use of android.support.v7.widget.Toolbar in project CloudReader by youlookwhat.
the class MainActivity method initContentFragment.
private void initContentFragment() {
ArrayList<Fragment> mFragmentList = new ArrayList<>();
mFragmentList.add(new GankFragment());
mFragmentList.add(new OneFragment());
mFragmentList.add(new BookFragment());
// 注意使用的是:getSupportFragmentManager
MyFragmentPagerAdapter adapter = new MyFragmentPagerAdapter(getSupportFragmentManager(), mFragmentList);
vpContent.setAdapter(adapter);
// 设置ViewPager最大缓存的页面个数(cpu消耗少)
vpContent.setOffscreenPageLimit(2);
vpContent.addOnPageChangeListener(this);
mBinding.include.ivTitleGank.setSelected(true);
vpContent.setCurrentItem(0);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
//去除默认Title显示
actionBar.setDisplayShowTitleEnabled(false);
}
}
use of android.support.v7.widget.Toolbar in project Android-skin-support by ximsfei.
the class BaseActivity method initToolbar.
protected void initToolbar() {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setTitle("Title");
toolbar.setSubtitle("Subtitle");
toolbar.setNavigationIcon(R.drawable.ic_settings_36dp);
}
use of android.support.v7.widget.Toolbar in project LookLook by xinghongfei.
the class MainActivity method animateToolbar.
private void animateToolbar() {
// this is gross but toolbar doesn't expose it's children to animate them :(
View t = toolbar.getChildAt(0);
if (t != null && t instanceof TextView) {
TextView title = (TextView) t;
// fade in and space out the title. Animating the letterSpacing performs horribly so
// fake it by setting the desired letterSpacing then animating the scaleX ¯\_(ツ)_/¯
title.setAlpha(0f);
title.setScaleX(0.8f);
title.animate().alpha(1f).scaleX(1f).setStartDelay(500).setDuration(900).setInterpolator(AnimUtils.getFastOutSlowInInterpolator(this)).start();
}
View amv = toolbar.getChildAt(1);
if (amv != null & amv instanceof ActionMenuView) {
ActionMenuView actions = (ActionMenuView) amv;
// filter
popAnim(actions.getChildAt(0), 500, 200);
// overflow
popAnim(actions.getChildAt(1), 700, 200);
}
}
use of android.support.v7.widget.Toolbar in project PhotoNoter by yydcdut.
the class SettingActivity method initToolBarUI.
private void initToolBarUI() {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setTitle(getResources().getString(R.string.app_setting));
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
AppCompat.setElevation(toolbar, getResources().getDimension(R.dimen.ui_elevation));
}
use of android.support.v7.widget.Toolbar in project PhotoNoter by yydcdut.
the class UserCenterActivity method initToolBarUI.
private void initToolBarUI() {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle(getResources().getString(R.string.personal_page));
toolbar.setTitleTextColor(AppCompat.getColor(R.color.txt_gray, this));
toolbar.setBackgroundColor(AppCompat.getColor(android.R.color.white, this));
setSupportActionBar(toolbar);
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_gray_24dp);
toolbar.setOnMenuItemClickListener(onToolBarMenuItemClick);
}
Aggregations