use of com.flyco.tablayout.SlidingTabLayout in project Android-skin-support by ximsfei.
the class SlidingTabActivity method onCreate.
@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);
MsgView rtv_1_4 = tabLayout_1.getMsgView(4);
if (rtv_1_4 != null) {
if (rtv_1_4 instanceof SkinMsgView) {
((SkinMsgView) rtv_1_4).setBackgroundColorResource(R.color.msg_background_color);
((SkinMsgView) rtv_1_4).setStrokeColorResource(R.color.msg_stroke_color);
} else {
rtv_1_4.setBackgroundColor(Color.parseColor("#6D8FB0"));
}
}
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) {
if (rtv_2_3 instanceof SkinMsgView) {
((SkinMsgView) rtv_2_3).setBackgroundColorResource(R.color.msg_background_color);
((SkinMsgView) rtv_2_3).setStrokeColorResource(R.color.msg_stroke_color);
} else {
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("后端");
// }
// });
}
use of com.flyco.tablayout.SlidingTabLayout in project FlycoTabLayout by H07000223.
the class SlidingTabActivity method onCreate.
@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("后端");
// }
// });
}
use of com.flyco.tablayout.SlidingTabLayout in project AndriodDesignPattern by Shimingli.
the class BehaviorModelActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.behavioral_model_activity_layout);
ViewPager pager = (ViewPager) findViewById(R.id.viewpager);
SlidingTabLayout tab = (SlidingTabLayout) findViewById(R.id.tap);
mTitles = new String[] { this.getResources().getString(R.string.all_order_tab16), this.getResources().getString(R.string.all_order_tab17), this.getResources().getString(R.string.all_order_tab18), this.getResources().getString(R.string.all_order_tab19), this.getResources().getString(R.string.all_order_tab20), this.getResources().getString(R.string.all_order_tab21), this.getResources().getString(R.string.all_order_tab22), this.getResources().getString(R.string.all_order_tab23), this.getResources().getString(R.string.all_order_tab24), this.getResources().getString(R.string.all_order_tab25) };
mFragments.add(new StrategyModelFragment());
mFragments.add(new TemplateModelFragment());
mFragments.add(new ObserverModelFragment());
mFragments.add(new IteratorModelFragment());
mFragments.add(new ChainOfResponsibilityFragment());
mFragments.add(new CommandPatternModelFragment());
mFragments.add(new MementoModelFragment());
mFragments.add(new StateModelFragment());
mFragments.add(new VisitorPatternModelFragment());
mFragments.add(new MediatorPatternModelFragment());
mAdapter = new MyPagerAdapter(getSupportFragmentManager());
pager.setAdapter(mAdapter);
tab.setViewPager(pager);
}
use of com.flyco.tablayout.SlidingTabLayout in project AndriodDesignPattern by Shimingli.
the class CreatorModelActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.creator_model_activity_layout);
ViewPager pager = (ViewPager) findViewById(R.id.viewpager);
SlidingTabLayout tab = (SlidingTabLayout) findViewById(R.id.tap);
mTitles = new String[] { this.getResources().getString(R.string.all_order_tab1), this.getResources().getString(R.string.all_order_tab2), this.getResources().getString(R.string.all_order_tab3), this.getResources().getString(R.string.all_order_tab4) };
mFragments.add(new FactoryMethodModelFragment());
mFragments.add(new SingletonModelFragment());
mFragments.add(new BuilderModelFragment());
mFragments.add(new ProtoTypeModelFragment());
mAdapter = new MyPagerAdapter(getSupportFragmentManager());
pager.setAdapter(mAdapter);
tab.setViewPager(pager);
}
use of com.flyco.tablayout.SlidingTabLayout in project AndriodDesignPattern by Shimingli.
the class StructuralModelActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.structural_model_activity_layout);
ViewPager pager = (ViewPager) findViewById(R.id.viewpager);
SlidingTabLayout tab = (SlidingTabLayout) findViewById(R.id.tap);
mTitles = new String[] { this.getResources().getString(R.string.all_order_tab5), this.getResources().getString(R.string.all_order_tab10), this.getResources().getString(R.string.all_order_tab11), this.getResources().getString(R.string.all_order_tab12), this.getResources().getString(R.string.all_order_tab13), this.getResources().getString(R.string.all_order_tab14), this.getResources().getString(R.string.all_order_tab15) };
mFragments.add(new AdapterModelFragment());
mFragments.add(new DecoratorModelFragment());
mFragments.add(new ProxyModelFragment());
mFragments.add(new FacadeModelFragment());
mFragments.add(new BridgeModelFragment());
mFragments.add(new CompositeModelFragment());
mFragments.add(new FlyWeightModelFragment());
mAdapter = new MyPagerAdapter(getSupportFragmentManager());
pager.setAdapter(mAdapter);
tab.setViewPager(pager);
}
Aggregations