当前位置: 首页>>代码示例>>Java>>正文


Java GridPagerAdapter类代码示例

本文整理汇总了Java中android.support.wearable.view.GridPagerAdapter的典型用法代码示例。如果您正苦于以下问题:Java GridPagerAdapter类的具体用法?Java GridPagerAdapter怎么用?Java GridPagerAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GridPagerAdapter类属于android.support.wearable.view包,在下文中一共展示了GridPagerAdapter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import android.support.wearable.view.GridPagerAdapter; //导入依赖的package包/类
@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;
}
 
开发者ID:glanceable,项目名称:GlanceTweet,代码行数:21,代码来源:TweetGridPagerAdapter.java

示例2: onCreate

import android.support.wearable.view.GridPagerAdapter; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ShapeWear.initShapeWear(this);
    setContentView(R.layout.activity_gridviewpager);
    new SendMessageToNode(Tools.WEAR_REFRESH_REQUEST,"", MainActivity.this).start();

    fragments = new ArrayList<>();
    fragmentStorySelector = new FragmentStorySelector();
    fragments.add(fragmentStorySelector);

    mGridPager = (GridViewPagerOnlyHorizontal) findViewById(R.id.gridPager);
    GridPagerAdapter adapter = new GridViewPagerAdapter(this, getFragmentManager(), fragments);
    mGridPager.setAdapter(adapter);


    receiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            if(fragmentStorySelector != null){
                WearSpritzerApplication.closeRealm();
                WearSpritzerApplication.getRealm();
                fragmentStorySelector.readStoriesRealm();
            }
        }
    };
}
 
开发者ID:tajchert,项目名称:SpritzerWear,代码行数:28,代码来源:MainActivity.java

示例3: onAdapterChanged

import android.support.wearable.view.GridPagerAdapter; //导入依赖的package包/类
@Override
public void onAdapterChanged(GridPagerAdapter oldAdapter, GridPagerAdapter newAdapter) {
}
 
开发者ID:DroidPlanner,项目名称:tower-wear,代码行数:4,代码来源:WearUIActivity.java

示例4: getBackgroundForPage

import android.support.wearable.view.GridPagerAdapter; //导入依赖的package包/类
@Override public Drawable getBackgroundForPage(final int row, final int column) {
    if (column != 0) {
        return mPageBackgrounds.get(new Point(column, row));
    }
    return GridPagerAdapter.BACKGROUND_NONE;
}
 
开发者ID:emmaguy,项目名称:wear-notify-for-reddit,代码行数:7,代码来源:CommentsGridPagerAdapter.java


注:本文中的android.support.wearable.view.GridPagerAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。