<com.snad.loadingbutton.LoadingButton
android:id="@+id/first"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#BE6E46"
app:pbLoadingText="@string/loading"
app:pbProgressColor="#F9D8FB"
app:pbText="@string/click_me"
app:pbTextColor="#8A4FFF"
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
public class RecyclerViewScrollManager { | |
//region Variables | |
private int totalItemCount; | |
private int lastVisibleItem; | |
private final int visibleThreshold; | |
private final PublishRelay<Integer> relay; | |
private RecyclerView recyclerView; | |
@Nullable private RecyclerView.OnScrollListener scrollListener; | |
//endregion |
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
<resources> | |
<!--Hex Opacity Values: | |
100% — FF | |
99% — FC | |
98% — FA | |
97% — F7 | |
96% — F5 | |
95% — F2 | |
94% — F0 |
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
public class Triple<F, S, T> { | |
public final F first; | |
public final S second; | |
public final T third; | |
private static <F, S, T> Triple<F, S, T> create(F first, S second, T third) { | |
return new Triple<>(first, second, third); | |
} | |
public Triple(F first, S second, T third) { |
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 java.io.IOException; | |
import java.lang.annotation.Annotation; | |
import java.lang.reflect.Type; | |
import okhttp3.MediaType; | |
import okhttp3.RequestBody; | |
import okhttp3.ResponseBody; | |
import retrofit2.Converter; | |
import retrofit2.Retrofit; |
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
findViewById(R.id.first).setOnClickListener(this);
LoadingButton button = new LoadingButton(this);
LoadingButton.ViewSwitcherFactory factory = new LoadingButton.ViewSwitcherFactory(this,
getResources().getColor(android.R.color.white),
44F,
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
mView.getViewTreeObserver().addOnGlobalLayoutListener( | |
new ViewTreeObserver.OnGlobalLayoutListener() { | |
public void onGlobalLayout() { | |
int width = mView.getWidth(); | |
int height = mView.getHeight(); | |
if (mView.getViewTreeObserver().isAlive()) { | |
// remove this layout listener | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { |
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
public class Device { | |
public static final boolean GTE_HC = Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB; | |
private static String emailAddress = null; | |
private static Boolean isTablet = null; | |
private static DisplayMetrics displayMetrics = null; | |
public static void onConfigurationChanged(Configuration newConfig) { | |
displayMetrics = new DisplayMetrics(); |
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
@Override protected PatientPhoto doInBackground(PatientPhoto... intakePhotos) { | |
PatientPhoto photo = intakePhotos[0]; | |
File file = null; | |
if (photo != null) { | |
Matrix matrix = flip(new Matrix()); | |
Bitmap bitmap = BitmapFactory.decodeByteArray(photo.getPhotoBytes(), 0, photo.getPhotoBytes().length); | |
Bitmap flipped = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); | |
photo.setThumbnail(ThumbnailUtils.extractThumbnail(flipped, 250, 250)); |
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
public final class Api { | |
//region Variables | |
private static final String API_HOST = Application.string(R.string.api_server); | |
private static final Object sLockObject = new Object(); | |
private static Service sService = null; | |
static final int DISK_CACHE_SIZE = 50 * 1024 * 1024; // 50MB | |
//endregion |
NewerOlder