if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
getWindow().setStatusBarColor(ContextCompat.getColor(this, android.R.color.transparent));
}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
emulator () { | |
EMULATORS=$(~/Library/Android/sdk/tools/emulator -list-avds) | |
LOCAL_PROXY_IP=`ipconfig getifaddr en0` | |
echo "Enter the number of the emulator you want to launch:" | |
PS3="Your choice: " | |
select EMULATOR in $EMULATORS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
recyclerView.addOnScrollListener(new RecyclerScrollListener()); | |
private static class RecyclerScrollListener extends RecyclerView.OnScrollListener { | |
private int overallYScroll; | |
@Override | |
public void onScrolled(RecyclerView recyclerView, int dx, int dy) { | |
overallYScroll += dy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.graphics.Bitmap; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.graphics.drawable.Drawable; | |
import android.net.Uri; | |
import com.squareup.picasso.Picasso; | |
import com.squareup.picasso.Request; | |
import com.squareup.picasso.RequestHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Proves that we can put a condition in the parameter of a synchronized block. | |
* | |
* <p>Ex. | |
* <br>{@code synchronized (first ? mLock1 : mLock2)} | |
*/ | |
public class ConditionSynchronizedBlock { | |
public static void main(String [ ] a) { | |
ConditionSynchronizedBlock tested = new ConditionSynchronizedBlock(); |