use of android.support.v7.app.ActionBar in project WordPress-Android by wordpress-mobile.
the class CommentsActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
((WordPress) getApplication()).component().inject(this);
setContentView(R.layout.comment_activity);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setElevation(0);
actionBar.setTitle(R.string.comments);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
}
if (savedInstanceState == null) {
mSite = (SiteModel) getIntent().getSerializableExtra(WordPress.SITE);
} else {
mSite = (SiteModel) savedInstanceState.getSerializable(WordPress.SITE);
}
if (mSite == null) {
ToastUtils.showToast(this, R.string.blog_not_found, ToastUtils.Duration.SHORT);
finish();
return;
}
if (getIntent() != null && getIntent().hasExtra(SAVED_COMMENTS_STATUS_TYPE)) {
mCurrentCommentStatusType = (CommentStatus) getIntent().getSerializableExtra(SAVED_COMMENTS_STATUS_TYPE);
} else {
// Read the value from app preferences here. Default to 0 - All
mCurrentCommentStatusType = AppPrefs.getCommentsStatusFilter().toCommentStatus();
}
if (savedInstanceState == null) {
CommentsListFragment commentsListFragment = new CommentsListFragment();
// initialize comment status filter first time
commentsListFragment.setCommentStatusFilter(mCurrentCommentStatusType);
getFragmentManager().beginTransaction().add(R.id.layout_fragment_container, commentsListFragment, getString(R.string.fragment_tag_comment_list)).commitAllowingStateLoss();
} else {
getIntent().putExtra(KEY_AUTO_REFRESHED, savedInstanceState.getBoolean(KEY_AUTO_REFRESHED));
getIntent().putExtra(KEY_EMPTY_VIEW_MESSAGE, savedInstanceState.getString(KEY_EMPTY_VIEW_MESSAGE));
mComment = (CommentModel) savedInstanceState.getSerializable(KEY_SELECTED_COMMENT);
}
}
use of android.support.v7.app.ActionBar in project WordPress-Android by wordpress-mobile.
the class AppLogViewerActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.logviewer_activity);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle(R.string.reader_title_applog);
}
final ListView listView = (ListView) findViewById(android.R.id.list);
listView.setAdapter(new LogAdapter(this));
}
use of android.support.v7.app.ActionBar in project WordPress-Android by wordpress-mobile.
the class WebViewActivity method configureView.
public void configureView() {
setContentView(R.layout.webview);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
}
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
use of android.support.v7.app.ActionBar in project WordPress-Android by wordpress-mobile.
the class PeopleManagementActivity method onSaveInstanceState.
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putSerializable(WordPress.SITE, mSite);
outState.putBoolean(KEY_USERS_END_OF_LIST_REACHED, mUsersEndOfListReached);
outState.putBoolean(KEY_FOLLOWERS_END_OF_LIST_REACHED, mFollowersEndOfListReached);
outState.putBoolean(KEY_EMAIL_FOLLOWERS_END_OF_LIST_REACHED, mEmailFollowersEndOfListReached);
outState.putBoolean(KEY_VIEWERS_END_OF_LIST_REACHED, mViewersEndOfListReached);
outState.putBoolean(KEY_HAS_REFRESHED_USERS, mHasRefreshedUsers);
outState.putBoolean(KEY_HAS_REFRESHED_FOLLOWERS, mHasRefreshedFollowers);
outState.putBoolean(KEY_HAS_REFRESHED_EMAIL_FOLLOWERS, mHasRefreshedEmailFollowers);
outState.putBoolean(KEY_HAS_REFRESHED_VIEWERS, mHasRefreshedViewers);
outState.putBoolean(KEY_USERS_FETCH_REQUEST_IN_PROGRESS, mUsersFetchRequestInProgress);
outState.putBoolean(KEY_FOLLOWERS_FETCH_REQUEST_IN_PROGRESS, mFollowersFetchRequestInProgress);
outState.putBoolean(KEY_EMAIL_FOLLOWERS_FETCH_REQUEST_IN_PROGRESS, mEmailFollowersFetchRequestInProgress);
outState.putBoolean(KEY_VIEWERS_FETCH_REQUEST_IN_PROGRESS, mViewersFetchRequestInProgress);
outState.putInt(KEY_FOLLOWERS_LAST_FETCHED_PAGE, mFollowersLastFetchedPage);
outState.putInt(KEY_EMAIL_FOLLOWERS_LAST_FETCHED_PAGE, mEmailFollowersLastFetchedPage);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
outState.putCharSequence(KEY_TITLE, actionBar.getTitle());
}
}
use of android.support.v7.app.ActionBar in project WordPress-Android by wordpress-mobile.
the class PeopleManagementActivity method navigateBackToPeopleListFragment.
private boolean navigateBackToPeopleListFragment() {
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager.getBackStackEntryCount() > 0) {
fragmentManager.popBackStack();
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setTitle(R.string.people);
}
return true;
}
return false;
}
Aggregations