Search in sources :

Example 66 with ActionBar

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

Example 67 with ActionBar

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

Example 68 with ActionBar

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

Example 69 with ActionBar

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);
        }
    });
}
Also used : View(android.view.View) TextView(android.widget.TextView) ViewPager(android.support.v4.view.ViewPager) WPViewPager(org.wordpress.android.widgets.WPViewPager) KeyEvent(android.view.KeyEvent) TabLayout(android.support.design.widget.TabLayout) TextView(android.widget.TextView) ActionBar(android.support.v7.app.ActionBar) Toolbar(android.support.v7.widget.Toolbar)

Example 70 with ActionBar

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);
}
Also used : RecyclerItemDecoration(org.wordpress.android.widgets.RecyclerItemDecoration) ReaderRecyclerView(org.wordpress.android.ui.reader.views.ReaderRecyclerView) View(android.view.View) ActionBar(android.support.v7.app.ActionBar) Toolbar(android.support.v7.widget.Toolbar)

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