Search in sources :

Example 81 with ActionBar

use of android.app.ActionBar in project coursera-android by aporter.

the class DialtactsActivity method exitSearchUi.

/**
     * Goes back to usual Phone UI with tags. Previously selected Tag and associated Fragment
     * should be automatically focused again.
     */
private void exitSearchUi() {
    final ActionBar actionBar = getActionBar();
    // Hide the search fragment, if exists.
    if (mSearchFragment != null) {
        mSearchFragment.setUserVisibleHint(false);
        final FragmentTransaction transaction = getFragmentManager().beginTransaction();
        transaction.hide(mSearchFragment);
        transaction.commitAllowingStateLoss();
    }
    // We want to hide SearchView and show Tabs. Also focus on previously selected one.
    actionBar.setDisplayShowCustomEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    for (int i = 0; i < TAB_INDEX_COUNT; i++) {
        sendFragmentVisibilityChange(i, i == mViewPager.getCurrentItem());
    }
    // Before exiting the search screen, reset swipe state.
    mDuringSwipe = false;
    mUserTabClick = false;
    mViewPager.setVisibility(View.VISIBLE);
    hideInputMethod(getCurrentFocus());
    // Request to update option menu.
    invalidateOptionsMenu();
    // See comments in onActionViewExpanded()
    mSearchView.onActionViewCollapsed();
    mInSearchUi = false;
}
Also used : FragmentTransaction(android.app.FragmentTransaction) ActionBar(android.app.ActionBar)

Example 82 with ActionBar

use of android.app.ActionBar in project coursera-android by aporter.

the class TabLayoutActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    // Put ActionBar in Tab Mode
    final ActionBar tabBar = getActionBar();
    tabBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    // Create a GridFragment for the Flower thumbnails
    GridFragment flowerFrag = new GridFragment();
    // Store the list of thumbnails as an argument to the GridFragment
    Bundle args = new Bundle();
    args.putIntegerArrayList(THUMBNAIL_IDS, mThumbIdsFlowers);
    flowerFrag.setArguments(args);
    // Configure a tab for the Flower thumbnail GridFragment
    tabBar.addTab(tabBar.newTab().setText(FLOWERS_TABSTRING).setTabListener(new TabListener(flowerFrag)));
    // Create a GridFragment for the Animal thumbnails
    GridFragment animalFrag = new GridFragment();
    // Store the list of thumbnails as an argument to the GridFragment
    args = new Bundle();
    args.putIntegerArrayList(THUMBNAIL_IDS, mThumbIdsAnimals);
    animalFrag.setArguments(args);
    // Configure a tab for the Animal thumbnail GridFragment
    tabBar.addTab(tabBar.newTab().setText(ANIMALS_TABSTRING).setTabListener(new TabListener(animalFrag)));
}
Also used : Bundle(android.os.Bundle) ActionBar(android.app.ActionBar)

Example 83 with ActionBar

use of android.app.ActionBar in project cw-advandroid by commonsguy.

the class FeedsTabActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_nav);
    for (final Feed feed : Feed.getFeeds()) {
        addNewFeed(feed);
    }
    ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE);
    bar.setDisplayHomeAsUpEnabled(true);
    int screenLayout = getResources().getConfiguration().screenLayout;
    if (((screenLayout & Configuration.SCREENLAYOUT_SIZE_NORMAL) == Configuration.SCREENLAYOUT_SIZE_NORMAL) || ((screenLayout & Configuration.SCREENLAYOUT_SIZE_SMALL) == Configuration.SCREENLAYOUT_SIZE_SMALL)) {
        bar.setDisplayShowHomeEnabled(false);
    }
    if (savedInstanceState != null) {
        cleanUpFragments();
    }
}
Also used : ActionBar(android.app.ActionBar)

Example 84 with ActionBar

use of android.app.ActionBar in project cw-advandroid by commonsguy.

the class FeedsTabActivity method addNewFeed.

public void addNewFeed(final Feed feed) {
    ActionBar bar = getActionBar();
    bar.addTab(bar.newTab().setText(feed.toString()).setTabListener(new TabListener(feed)));
}
Also used : ActionBar(android.app.ActionBar)

Example 85 with ActionBar

use of android.app.ActionBar in project presentations by eburke.

the class AccountActivity method onCreate.

@Override
protected void onCreate(Bundle state) {
    super.onCreate(state);
    setContentView(R.layout.account_activity);
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle(R.string.account);
    customerImage = (ImageView) findViewById(R.id.customer_image);
    customerName = (TextView) findViewById(R.id.customer_name);
}
Also used : ActionBar(android.app.ActionBar)

Aggregations

ActionBar (android.app.ActionBar)158 View (android.view.View)37 Intent (android.content.Intent)19 AdapterView (android.widget.AdapterView)11 TextView (android.widget.TextView)11 ListView (android.widget.ListView)9 SharedPreferences (android.content.SharedPreferences)8 Uri (android.net.Uri)7 ArrayAdapter (android.widget.ArrayAdapter)7 FrameLayout (android.widget.FrameLayout)7 SpannableString (android.text.SpannableString)6 BitmapRegionTileSource (com.android.photos.BitmapRegionTileSource)6 GridLayoutManager (android.support.v7.widget.GridLayoutManager)5 RecyclerView (android.support.v7.widget.RecyclerView)5 CircularProgressButton (com.dd.CircularProgressButton)5 CircularProgressButton (com.marshalchen.common.uimodule.circularProgressButton.CircularProgressButton)5 SuppressLint (android.annotation.SuppressLint)4 Bundle (android.os.Bundle)4 ViewPager (android.support.v4.view.ViewPager)4 MenuInflater (android.view.MenuInflater)4