Search in sources :

Example 76 with ActionBar

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);
    }
}
Also used : ActionBar(android.support.v7.app.ActionBar) Toolbar(android.support.v7.widget.Toolbar)

Example 77 with ActionBar

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));
}
Also used : ListView(android.widget.ListView) ActionBar(android.support.v7.app.ActionBar)

Example 78 with ActionBar

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);
    }
}
Also used : ActionBar(android.support.v7.app.ActionBar) Toolbar(android.support.v7.widget.Toolbar)

Example 79 with ActionBar

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());
    }
}
Also used : ActionBar(android.support.v7.app.ActionBar)

Example 80 with ActionBar

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;
}
Also used : FragmentManager(android.app.FragmentManager) ActionBar(android.support.v7.app.ActionBar)

Aggregations

ActionBar (android.support.v7.app.ActionBar)784 View (android.view.View)248 Toolbar (android.support.v7.widget.Toolbar)214 TextView (android.widget.TextView)160 Intent (android.content.Intent)118 ImageView (android.widget.ImageView)76 AppCompatActivity (android.support.v7.app.AppCompatActivity)66 RecyclerView (android.support.v7.widget.RecyclerView)57 AdapterView (android.widget.AdapterView)52 Bundle (android.os.Bundle)49 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)49 ListView (android.widget.ListView)44 ColorDrawable (android.graphics.drawable.ColorDrawable)33 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)32 ViewPager (android.support.v4.view.ViewPager)29 ArrayList (java.util.ArrayList)29 SharedPreferences (android.content.SharedPreferences)28 Fragment (android.support.v4.app.Fragment)28 MenuItem (android.view.MenuItem)28 BindView (butterknife.BindView)28