android.support.wearable.view.GridPagerAdapter Java Examples

The following examples show how to use android.support.wearable.view.GridPagerAdapter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SampleGridPagerAdapter.java    From android-GridViewPager with Apache License 2.0 6 votes vote down vote up
@Override
protected Drawable create(final Point page) {
    // place bugdroid as the background at row 2, column 1
    if (page.y == 2 && page.x == 1) {
        int resid = R.drawable.bugdroid_large;
        new DrawableLoadingTask(mContext) {
            @Override
            protected void onPostExecute(Drawable result) {
                TransitionDrawable background = new TransitionDrawable(new Drawable[] {
                        mClearBg,
                        result
                });
                mPageBackgrounds.put(page, background);
                notifyPageBackgroundChanged(page.y, page.x);
                background.startTransition(TRANSITION_DURATION_MILLIS);
            }
        }.execute(resid);
    }
    return GridPagerAdapter.BACKGROUND_NONE;
}
 
Example #2
Source File: CommentsGridPagerAdapter.java    From wear-notify-for-reddit with Apache License 2.0 4 votes vote down vote up
@Override public Drawable getBackgroundForPage(final int row, final int column) {
    if (column != 0) {
        return mPageBackgrounds.get(new Point(column, row));
    }
    return GridPagerAdapter.BACKGROUND_NONE;
}