use of android.support.v7.app.ActionBar in project UltimateAndroid by cymcsg.
the class HomeasUpActionbarActivity method beforeOnCreate.
private void beforeOnCreate() {
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
}
use of android.support.v7.app.ActionBar in project UltimateAndroid by cymcsg.
the class MaterialMenuIconCompat method setActionBarSettings.
@Override
protected void setActionBarSettings(Activity activity) {
ActionBar actionBar = ((ActionBarActivity) activity).getSupportActionBar();
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(false);
actionBar.setIcon(getDrawable());
}
use of android.support.v7.app.ActionBar in project android_frameworks_base by DirtyUnicorns.
the class NekoLand method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.neko_activity);
final ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.setLogo(Cat.create(this));
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setDisplayShowHomeEnabled(true);
}
mPrefs = new PrefState(this);
mPrefs.setListener(this);
final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.holder);
mAdapter = new CatAdapter();
recyclerView.setAdapter(mAdapter);
recyclerView.setLayoutManager(new GridLayoutManager(this, 3));
int numCats = updateCats();
MetricsLogger.histogram(this, "egg_neko_visit_gallery", numCats);
}
use of android.support.v7.app.ActionBar in project WordPress-Android by wordpress-mobile.
the class ReaderSubsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.reader_activity_subs);
restoreState(savedInstanceState);
mViewPager = (WPViewPager) findViewById(R.id.viewpager);
mViewPager.setOffscreenPageLimit(NUM_TABS - 1);
mViewPager.setAdapter(getPageAdapter());
TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout);
tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
int normalColor = ContextCompat.getColor(this, R.color.blue_light);
int selectedColor = ContextCompat.getColor(this, R.color.white);
tabLayout.setTabTextColors(normalColor, selectedColor);
tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
tabLayout.setupWithViewPager(mViewPager);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
}
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
// Shadow removed on Activities with a tab toolbar
actionBar.setElevation(0.0f);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
}
mEditAdd = (EditText) findViewById(R.id.edit_add);
mEditAdd.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
addCurrentEntry();
}
return false;
}
});
mBtnAdd = (ImageButton) findViewById(R.id.btn_add);
mBtnAdd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addCurrentEntry();
}
});
if (savedInstanceState == null) {
// return to the page the user was on the last time they viewed this activity
restorePreviousPage();
}
// note this listener must be assigned after we've already called restorePreviousPage()
mViewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageSelected(int position) {
// remember which page the user last viewed
String pageTitle = (String) getPageAdapter().getPageTitle(position);
AppPrefs.setReaderSubsPageTitle(pageTitle);
}
});
}
use of android.support.v7.app.ActionBar in project WordPress-Android by wordpress-mobile.
the class ReaderUserListActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.reader_activity_userlist);
setTitle(null);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
}
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
getSupportActionBar().setDisplayShowTitleEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
if (savedInstanceState != null) {
mRestorePosition = savedInstanceState.getInt(ReaderConstants.KEY_RESTORE_POSITION);
}
int spacingHorizontal = 0;
int spacingVertical = DisplayUtils.dpToPx(this, 1);
mRecyclerView = (ReaderRecyclerView) findViewById(R.id.recycler_view);
mRecyclerView.addItemDecoration(new RecyclerItemDecoration(spacingHorizontal, spacingVertical));
long blogId = getIntent().getLongExtra(ReaderConstants.ARG_BLOG_ID, 0);
long postId = getIntent().getLongExtra(ReaderConstants.ARG_POST_ID, 0);
long commentId = getIntent().getLongExtra(ReaderConstants.ARG_COMMENT_ID, 0);
loadUsers(blogId, postId, commentId);
}
Aggregations