use of android.support.v7.app.ActionBar in project SeriesGuide by UweTrottmann.
the class TraktCommentsActivity method setupActionBar.
@Override
protected void setupActionBar() {
super.setupActionBar();
String commentsTitle = getIntent().getStringExtra(InitBundle.TITLE);
setTitle(getString(R.string.comments) + " " + commentsTitle);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle(R.string.comments);
actionBar.setSubtitle(commentsTitle);
}
}
use of android.support.v7.app.ActionBar in project SeriesGuide by UweTrottmann.
the class SeriesGuidePreferences method setupActionBar.
private void setupActionBar() {
Toolbar toolbar = (Toolbar) findViewById(R.id.sgToolbar);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
use of android.support.v7.app.ActionBar in project SeriesGuide by UweTrottmann.
the class SearchActivity method setupActionBar.
@Override
protected void setupActionBar() {
super.setupActionBar();
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowTitleEnabled(false);
}
}
use of android.support.v7.app.ActionBar in project BoomMenu by Nightonke.
the class ActionBarActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_action_bar);
ActionBar mActionBar = getSupportActionBar();
assert mActionBar != null;
mActionBar.setDisplayShowHomeEnabled(false);
mActionBar.setDisplayShowTitleEnabled(false);
LayoutInflater mInflater = LayoutInflater.from(this);
View actionBar = mInflater.inflate(R.layout.custom_actionbar, null);
TextView mTitleTextView = (TextView) actionBar.findViewById(R.id.title_text);
mTitleTextView.setText(R.string.app_name);
mActionBar.setCustomView(actionBar);
mActionBar.setDisplayShowCustomEnabled(true);
((Toolbar) actionBar.getParent()).setContentInsetsAbsolute(0, 0);
BoomMenuButton leftBmb = (BoomMenuButton) actionBar.findViewById(R.id.action_bar_left_bmb);
BoomMenuButton rightBmb = (BoomMenuButton) actionBar.findViewById(R.id.action_bar_right_bmb);
leftBmb.setButtonEnum(ButtonEnum.TextOutsideCircle);
leftBmb.setPiecePlaceEnum(PiecePlaceEnum.DOT_9_1);
leftBmb.setButtonPlaceEnum(ButtonPlaceEnum.SC_9_1);
for (int i = 0; i < leftBmb.getPiecePlaceEnum().pieceNumber(); i++) leftBmb.addBuilder(BuilderManager.getTextOutsideCircleButtonBuilderWithDifferentPieceColor());
rightBmb.setButtonEnum(ButtonEnum.Ham);
rightBmb.setPiecePlaceEnum(PiecePlaceEnum.HAM_4);
rightBmb.setButtonPlaceEnum(ButtonPlaceEnum.HAM_4);
for (int i = 0; i < rightBmb.getPiecePlaceEnum().pieceNumber(); i++) rightBmb.addBuilder(BuilderManager.getHamButtonBuilderWithDifferentPieceColor());
}
use of android.support.v7.app.ActionBar in project CoCoin by Nightonke.
the class AccountBookTodayViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_account_book_today_view);
SuperToast.cancelAllSuperToasts();
mContext = this;
mViewPager = (MaterialViewPager) findViewById(R.id.materialViewPager);
userName = (TextView) findViewById(R.id.user_name);
userEmail = (TextView) findViewById(R.id.user_email);
userName.setTypeface(CoCoinUtil.typefaceLatoRegular);
userEmail.setTypeface(CoCoinUtil.typefaceLatoLight);
User user = BmobUser.getCurrentUser(CoCoinApplication.getAppContext(), User.class);
if (user != null) {
userName.setText(user.getUsername());
userEmail.setText(user.getEmail());
}
setFonts();
View view = mViewPager.getRootView();
title = (TextView) view.findViewById(R.id.logo_white);
title.setTypeface(CoCoinUtil.typefaceLatoLight);
title.setText(SettingManager.getInstance().getAccountBookName());
mViewPager.getPagerTitleStrip().setTypeface(CoCoinUtil.GetTypeface(), Typeface.NORMAL);
setTitle("");
toolbar = mViewPager.getToolbar();
mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout);
custom = (MaterialRippleLayout) mDrawer.findViewById(R.id.custom_layout);
tags = (MaterialRippleLayout) mDrawer.findViewById(R.id.tag_layout);
months = (MaterialRippleLayout) mDrawer.findViewById(R.id.month_layout);
list = (MaterialRippleLayout) mDrawer.findViewById(R.id.list_layout);
report = (MaterialRippleLayout) mDrawer.findViewById(R.id.report_layout);
sync = (MaterialRippleLayout) mDrawer.findViewById(R.id.sync_layout);
settings = (MaterialRippleLayout) mDrawer.findViewById(R.id.settings_layout);
help = (MaterialRippleLayout) mDrawer.findViewById(R.id.help_layout);
feedback = (MaterialRippleLayout) mDrawer.findViewById(R.id.feedback_layout);
about = (MaterialRippleLayout) mDrawer.findViewById(R.id.about_layout);
syncIcon = (MaterialIconView) mDrawer.findViewById(R.id.sync_icon);
setIconEnable(syncIcon, SettingManager.getInstance().getLoggenOn());
monthExpenseTip = (TextView) mDrawer.findViewById(R.id.month_expense_tip);
monthExpenseTip.setTypeface(CoCoinUtil.GetTypeface());
monthExpense = (RiseNumberTextView) mDrawer.findViewById(R.id.month_expense);
monthExpense.setTypeface(CoCoinUtil.typefaceLatoLight);
if (SettingManager.getInstance().getIsMonthLimit()) {
monthExpenseTip.setVisibility(View.VISIBLE);
monthExpense.setText("0");
} else {
monthExpenseTip.setVisibility(View.INVISIBLE);
monthExpense.setVisibility(View.INVISIBLE);
}
if (toolbar != null) {
setSupportActionBar(toolbar);
final ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setHomeButtonEnabled(true);
}
}
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawer, 0, 0) {
public void onDrawerClosed(View view) {
super.onDrawerClosed(view);
monthExpense.setText("0");
}
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
monthExpense.withNumber(RecordManager.getCurrentMonthExpense()).setDuration(500).start();
}
};
mDrawer.setDrawerListener(mDrawerToggle);
View logo = findViewById(R.id.logo_white);
if (logo != null) {
logo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mViewPager.notifyHeaderChanged();
}
});
}
todayModeAdapter = new TodayViewFragmentAdapter(getSupportFragmentManager());
mViewPager.getViewPager().setOffscreenPageLimit(todayModeAdapter.getCount());
mViewPager.getViewPager().setAdapter(todayModeAdapter);
mViewPager.getPagerTitleStrip().setViewPager(mViewPager.getViewPager());
mViewPager.setMaterialViewPagerListener(new MaterialViewPager.Listener() {
@Override
public HeaderDesign getHeaderDesign(int page) {
return HeaderDesign.fromColorAndDrawable(CoCoinUtil.GetTagColor(page - 2), CoCoinUtil.GetTagDrawable(-3));
}
});
setListeners();
profileImage = (CircleImageView) mDrawer.findViewById(R.id.profile_image);
profileImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (SettingManager.getInstance().getLoggenOn()) {
CoCoinUtil.showToast(mContext, R.string.change_logo_tip);
} else {
CoCoinUtil.showToast(mContext, R.string.login_tip);
}
}
});
mDemoSlider = (SliderLayout) findViewById(R.id.slider);
HashMap<String, Integer> urls = CoCoinUtil.GetDrawerTopUrl();
for (String name : urls.keySet()) {
CustomSliderView customSliderView = new CustomSliderView(this);
// initialize a SliderLayout
customSliderView.image(urls.get(name)).setScaleType(BaseSliderView.ScaleType.Fit);
mDemoSlider.addSlider(customSliderView);
}
mDemoSlider.setPresetTransformer(SliderLayout.Transformer.ZoomOut);
mDemoSlider.setCustomAnimation(new DescriptionAnimation());
mDemoSlider.setDuration(4000);
mDemoSlider.setCustomIndicator((PagerIndicator) findViewById(R.id.custom_indicator));
loadLogo();
}
Aggregations