本文整理汇总了Java中com.flyco.tablayoutsamples.utils.ViewFindUtils.find方法的典型用法代码示例。如果您正苦于以下问题:Java ViewFindUtils.find方法的具体用法?Java ViewFindUtils.find怎么用?Java ViewFindUtils.find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.flyco.tablayoutsamples.utils.ViewFindUtils
的用法示例。
在下文中一共展示了ViewFindUtils.find方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.flyco.tablayoutsamples.utils.ViewFindUtils; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sliding_tab);
for (String title : mTitles) {
mFragments.add(SimpleCardFragment.getInstance(title));
}
View decorView = getWindow().getDecorView();
ViewPager vp = ViewFindUtils.find(decorView, R.id.vp);
mAdapter = new MyPagerAdapter(getSupportFragmentManager());
vp.setAdapter(mAdapter);
/** 默认 */
SlidingTabLayout tabLayout_1 = ViewFindUtils.find(decorView, R.id.tl_1);
/**自定义部分属性*/
SlidingTabLayout tabLayout_2 = ViewFindUtils.find(decorView, R.id.tl_2);
/** 字体加粗,大写 */
SlidingTabLayout tabLayout_3 = ViewFindUtils.find(decorView, R.id.tl_3);
/** tab固定宽度 */
SlidingTabLayout tabLayout_4 = ViewFindUtils.find(decorView, R.id.tl_4);
/** indicator固定宽度 */
SlidingTabLayout tabLayout_5 = ViewFindUtils.find(decorView, R.id.tl_5);
/** indicator圆 */
SlidingTabLayout tabLayout_6 = ViewFindUtils.find(decorView, R.id.tl_6);
/** indicator矩形圆角 */
final SlidingTabLayout tabLayout_7 = ViewFindUtils.find(decorView, R.id.tl_7);
/** indicator三角形 */
SlidingTabLayout tabLayout_8 = ViewFindUtils.find(decorView, R.id.tl_8);
/** indicator圆角色块 */
SlidingTabLayout tabLayout_9 = ViewFindUtils.find(decorView, R.id.tl_9);
/** indicator圆角色块 */
SlidingTabLayout tabLayout_10 = ViewFindUtils.find(decorView, R.id.tl_10);
tabLayout_1.setViewPager(vp);
tabLayout_2.setViewPager(vp);
tabLayout_2.setOnTabSelectListener(this);
tabLayout_3.setViewPager(vp);
tabLayout_4.setViewPager(vp);
tabLayout_5.setViewPager(vp);
tabLayout_6.setViewPager(vp);
tabLayout_7.setViewPager(vp, mTitles);
tabLayout_8.setViewPager(vp, mTitles, this, mFragments);
tabLayout_9.setViewPager(vp);
tabLayout_10.setViewPager(vp);
vp.setCurrentItem(4);
tabLayout_1.showDot(4);
tabLayout_3.showDot(4);
tabLayout_2.showDot(4);
tabLayout_2.showMsg(3, 5);
tabLayout_2.setMsgMargin(3, 0, 10);
MsgView rtv_2_3 = tabLayout_2.getMsgView(3);
if (rtv_2_3 != null) {
rtv_2_3.setBackgroundColor(Color.parseColor("#6D8FB0"));
}
tabLayout_2.showMsg(5, 5);
tabLayout_2.setMsgMargin(5, 0, 10);
// tabLayout_7.setOnTabSelectListener(new OnTabSelectListener() {
// @Override
// public void onTabSelect(int position) {
// Toast.makeText(mContext, "onTabSelect&position--->" + position, Toast.LENGTH_SHORT).show();
// }
//
// @Override
// public void onTabReselect(int position) {
// mFragments.add(SimpleCardFragment.getInstance("后端"));
// mAdapter.notifyDataSetChanged();
// tabLayout_7.addNewTab("后端");
// }
// });
}
示例2: onCreate
import com.flyco.tablayoutsamples.utils.ViewFindUtils; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sliding_tab);
for (String title : mTitles) {
mFragments.add(SimpleCardFragment.getInstance(title));
}
View decorView = getWindow().getDecorView();
ViewPager vp = ViewFindUtils.find(decorView, R.id.vp);
vp.setAdapter(new MyPagerAdapter(getSupportFragmentManager()));
/** 默认 */
SlidingTabLayout tabLayout_1 = ViewFindUtils.find(decorView, R.id.tl_1);
/**自定义部分属性*/
SlidingTabLayout tabLayout_2 = ViewFindUtils.find(decorView, R.id.tl_2);
/** 字体加粗,大写 */
SlidingTabLayout tabLayout_3 = ViewFindUtils.find(decorView, R.id.tl_3);
/** tab固定宽度 */
SlidingTabLayout tabLayout_4 = ViewFindUtils.find(decorView, R.id.tl_4);
/** indicator固定宽度 */
SlidingTabLayout tabLayout_5 = ViewFindUtils.find(decorView, R.id.tl_5);
/** indicator圆 */
SlidingTabLayout tabLayout_6 = ViewFindUtils.find(decorView, R.id.tl_6);
/** indicator矩形圆角 */
SlidingTabLayout tabLayout_7 = ViewFindUtils.find(decorView, R.id.tl_7);
/** indicator三角形 */
SlidingTabLayout tabLayout_8 = ViewFindUtils.find(decorView, R.id.tl_8);
/** indicator圆角色块 */
SlidingTabLayout tabLayout_9 = ViewFindUtils.find(decorView, R.id.tl_9);
/** indicator圆角色块 */
SlidingTabLayout tabLayout_10 = ViewFindUtils.find(decorView, R.id.tl_10);
tabLayout_1.setViewPager(vp);
tabLayout_2.setViewPager(vp);
tabLayout_2.setOnTabSelectListener(this);
tabLayout_3.setViewPager(vp);
tabLayout_4.setViewPager(vp);
tabLayout_5.setViewPager(vp);
tabLayout_6.setViewPager(vp);
tabLayout_7.setViewPager(vp, mTitles);
tabLayout_8.setViewPager(vp, mTitles, this, mFragments);
tabLayout_9.setViewPager(vp);
tabLayout_10.setViewPager(vp);
vp.setCurrentItem(4);
tabLayout_1.showDot(4);
tabLayout_3.showDot(4);
tabLayout_2.showDot(4);
tabLayout_2.showMsg(3, 5);
tabLayout_2.setMsgMargin(3, 0, 10);
MsgView rtv_2_3 = tabLayout_2.getMsgView(3);
if (rtv_2_3 != null) {
rtv_2_3.setBackgroundColor(Color.parseColor("#6D8FB0"));
}
tabLayout_2.showMsg(5, 5);
tabLayout_2.setMsgMargin(5, 0, 10);
}