This file contains hidden or 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 DefaultInsertionPredicate<S, T> implements InsertionPredicate<S, T> { | |
| @Override | |
| public boolean canInsert(@Nonnull Section<S, T> section, @Nonnull T item) { | |
| return true; | |
| } | |
| } |
This file contains hidden or 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 HideFabScrollListener extends RecyclerView.OnScrollListener { | |
| private static final int TRANSLATE_HIDE_DURATION_MILLIS = 200; | |
| private static final int TRANSLATE_SHOW_DURATION_MILLIS = 170; | |
| private View fab; | |
| private Animator hideAnimator; | |
| private Animator showAnimator; |
This file contains hidden or 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 ScrollAwareFABBehavior extends FloatingActionButton.Behavior { | |
| private static final int TRANSLATE_HIDE_DURATION_MILLIS = 200; | |
| private static final int TRANSLATE_SHOW_DURATION_MILLIS = 170; | |
| private Animator hideAnimator; | |
| private Animator showAnimator; | |
| public ScrollAwareFABBehavior(Context context, AttributeSet attrs) { |
This file contains hidden or 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
| @SuppressWarnings("WeakerAccess") | |
| public class AndroidUtils { | |
| public static int getColorFromAttr(Context ctx, int attributeId) { | |
| int colorId = getResourceIdFromAttr(ctx, attributeId); | |
| return ContextCompat.getColor(ctx, colorId); | |
| } | |
| public static int dpToPx(int dp, Context ctx) { |
This file contains hidden or 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 enum Field { | |
| SOMETHING | |
| } |
This file contains hidden or 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 BoundServiceWrapper<T extends IBinder> { | |
| private Context context; | |
| private Class serviceClass; | |
| private int serviceFlags; | |
| private T binder; | |
| private Action<T> deferAction; | |
| public BoundServiceWrapper(Context context, Class serviceClass, int serviceFlags) { | |
| this.context = context; |
This file contains hidden or 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.support.annotation.NonNull; | |
| import android.support.annotation.Nullable; | |
| import android.support.design.widget.AppBarLayout; | |
| import android.support.design.widget.BottomSheetBehavior; | |
| import android.support.design.widget.CoordinatorLayout; | |
| import android.util.AttributeSet; | |
| import android.view.View; | |
| /** |
This file contains hidden or 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 EndlessPagerAdapter extends PagerAdapter { | |
| private PagerAdapter adapter; | |
| public EndlessPagerAdapter(PagerAdapter adapter, ViewPager viewPager) { | |
| this.adapter = adapter; | |
| viewPager.addOnPageChangeListener(new SwapPageListener(viewPager)); | |
| } | |
| @Override |
This file contains hidden or 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.app.Activity; | |
| import android.os.Build; | |
| import android.support.annotation.IdRes; | |
| import android.support.annotation.NonNull; | |
| import android.support.annotation.StringRes; | |
| import android.support.v4.app.ActivityOptionsCompat; | |
| import android.support.v4.util.Pair; | |
| import android.util.Log; | |
| import android.view.View; |
This file contains hidden or 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
| class BroadcastDisposable implements Disposable { | |
| private BroadcastReceiver receiver; | |
| private Context ctx; | |
| private boolean isDisposed = false; | |
| BroadcastDisposable(@NonNull BroadcastReceiver receiver, @NonNull Context ctx) { | |
| this.receiver = receiver; | |
| this.ctx = ctx; |