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 MultiTypeRecyclerAdapter extends RecyclerView.Adapter<MultiTypeRecyclerAdapter.ViewHolder> { | |
| private static final String TAG = MultiTypeRecyclerAdapter.class.getSimpleName(); | |
| @Retention(SOURCE) | |
| @IntDef({VIEW_TYPE_SUBTITLE, VIEW_TYPE_PROMOTION}) | |
| public @interface VIEW_TYPE {} | |
| private static final int VIEW_TYPE_SUBTITLE = 0; | |
| private static final int VIEW_TYPE_PROMOTION = 1; | |
| private List<Item> mList; |
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 RippleDrawableCompat { | |
| public static class Builder { | |
| int normalColor = Color.TRANSPARENT; | |
| int pressColor = Color.TRANSPARENT; | |
| int strokeColor = Color.TRANSPARENT; | |
| int strokeWidth = 0; | |
| float radius = 0.0f; | |
| public Builder() { |
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 ColorUtils { | |
| private static final float DEFAULT_LIGHTNESS_ADJUST_PERCENTAGE = 0.2f; | |
| public static boolean isFlagshipLight(@ColorInt int color) { | |
| return getBrightness(color) >= 204.0f; | |
| // return getLightness(color) > 0.5f; | |
| // return getContrast(color, Color.BLACK) > 4.5; | |
| } |
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 ECCollapsingToolbarLayout extends CollapsingToolbarLayout { | |
| private boolean mIsScrimShow; | |
| private OnScrimVisibilityChangedListener mOnScrimVisibilityChangedListener; | |
| private AppBarLayout.OnOffsetChangedListener mOnOffsetChangedListener; | |
| public ECCollapsingToolbarLayout(Context context) { | |
| super(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
| /** | |
| * A kind of FrameLayout which enable {@code fitsSystemWindows} and can only consume specific directions. | |
| */ | |
| public class FitsSystemWindowsFrameLayout extends FrameLayout { | |
| private static final String TAG = FitsSystemWindowsFrameLayout.class.getSimpleName(); | |
| private static final int FLAG_CONSUME_SYSTEM_WINDOWS_LEFT = 0x0001; | |
| private static final int FLAG_CONSUME_SYSTEM_WINDOWS_TOP = 0x0002; | |
| private static final int FLAG_CONSUME_SYSTEM_WINDOWS_RIGHT = 0x0004; | |
| private static final int FLAG_CONSUME_SYSTEM_WINDOWS_BOTTOM = 0x0008; |
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 abstract class TabViewPagerFragment extends ECFragment implements TabLayout.OnTabSelectedListener, ViewPager.OnPageChangeListener { | |
| private static final String TAG = ECTabViewPagerFragment.class.getSimpleName(); | |
| private TabLayout mTabLayout; | |
| @TabLayout.Mode | |
| private int mTabLayoutMode = TabLayout.MODE_FIXED; | |
| private ViewPager mViewPager; | |
| private TabPageAdapter mPagerAdapter; | |
| /* |
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
| /** | |
| * A kind of {@link android.support.v7.widget.RecyclerView.ItemDecoration} to draw gridlines with | |
| * specific color and size. It assumes every item at same column has the same width and don't draw border. | |
| */ | |
| public class GridlinesItemDecoration extends RecyclerView.ItemDecoration { | |
| private static final String TAG = GridlinesItemDecoration.class.getSimpleName(); | |
| private int mDividerSize; | |
| private Paint mPaint; |
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
| /** | |
| * A ViewPager support height is {@code WRAP_CONTENT}. | |
| */ | |
| public class WrapContentViewPager extends ViewPager { | |
| public WrapContentViewPager(Context context) { | |
| super(context, null); | |
| } | |
| public WrapContentViewPager(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
| /** | |
| * A target for display {@link GifDrawable} or {@link Drawable} objects in {@link ImageView}s. | |
| */ | |
| public class GifDrawableImageViewTarget extends ImageViewTarget<Drawable> { | |
| private int mLoopCount = GifDrawable.LOOP_FOREVER; | |
| public GifDrawableImageViewTarget(ImageView view, int loopCount) { | |
| super(view); | |
| mLoopCount = loopCount; |
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 abstract class OnItemVisibleChangeListener extends RecyclerView.OnScrollListener { | |
| private static final String TAG = OnItemVisibleChangeListener.class.getSimpleName(); | |
| private int mFirstVisibleItemPosition = RecyclerView.NO_POSITION; | |
| private int mFirstCompletelyVisibleItemPosition = RecyclerView.NO_POSITION; | |
| private int mLastVisibleItemPosition = RecyclerView.NO_POSITION; | |
| private int mLastCompletelyVisibleItemPosition = RecyclerView.NO_POSITION; | |
| @Override | |
| public void onScrolled(RecyclerView recyclerView, int dx, int dy) { |