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 intended to support multiple click areas for a {@link View}. | |
*/ | |
public abstract class ClickAreaHelper implements View.OnTouchListener, View.OnClickListener, View.OnLongClickListener { | |
private OnClickAreaListener mOnClickAreaListener; | |
private OnLongClickAreaListener mOnLongClickAreaListener; | |
private View mView; |
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
/** | |
* SpacingDividerItemDecoration is a {@link RecyclerView.ItemDecoration} that can add space divider | |
* between items of a {@link android.support.v7.widget.LinearLayoutManager}. It supports both {@link #HORIZONTAL} | |
* and {@link #VERTICAL} orientations. | |
*/ | |
public class SpacingDividerItemDecoration extends RecyclerView.ItemDecoration { | |
@IntDef({HORIZONTAL, VERTICAL}) | |
@Retention(RetentionPolicy.SOURCE) | |
public @interface OrientationMode {} |
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
/** | |
* Make the first {@link RecyclerView.ViewHolder} has parallax effect. | |
*/ | |
public class ParallaxRecyclerView extends ECRecyclerView { | |
private static final String TAG = ParallaxRecyclerView.class.getSimpleName(); | |
private static final float DEFAULT_PARALLAX_MULTIPLIER = 0.5f; | |
private float mParallaxMultiplier = DEFAULT_PARALLAX_MULTIPLIER; | |
private OnParallaxScrollListener mParallaxScrollListener; |
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) { |
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
/** | |
* 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 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
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 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 class ECCollapsingToolbarLayout extends CollapsingToolbarLayout { | |
private boolean mIsScrimShow; | |
private OnScrimVisibilityChangedListener mOnScrimVisibilityChangedListener; | |
private AppBarLayout.OnOffsetChangedListener mOnOffsetChangedListener; | |
public ECCollapsingToolbarLayout(Context context) { | |
super(context); | |
} |