本文整理汇总了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;
}
示例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();
}
}
};
}
示例3: onAdapterChanged
import android.support.wearable.view.GridPagerAdapter; //导入依赖的package包/类
@Override
public void onAdapterChanged(GridPagerAdapter oldAdapter, GridPagerAdapter newAdapter) {
}
示例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;
}