Search in sources :

Example 1 with ActionBar

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

the class ListNavFragmentDemoActivity method onCreate.

@Override
public void onCreate(Bundle state) {
    super.onCreate(state);
    frag = (EditorFragment) getFragmentManager().findFragmentById(android.R.id.content);
    if (frag == null) {
        frag = new EditorFragment();
        getFragmentManager().beginTransaction().add(android.R.id.content, frag).commit();
    }
    if (state != null) {
        models = state.getCharSequenceArray(KEY_MODELS);
    }
    ArrayAdapter<String> nav = null;
    ActionBar bar = getActionBar();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        nav = new ArrayAdapter<String>(bar.getThemedContext(), android.R.layout.simple_spinner_item, labels);
    } else {
        nav = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, labels);
    }
    nav.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
    bar.setListNavigationCallbacks(nav, this);
    if (state != null) {
        bar.setSelectedNavigationItem(state.getInt(KEY_POSITION));
    }
}
Also used : ActionBar(android.app.ActionBar)

Example 2 with ActionBar

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

the class TabFragmentDemoActivity method onCreate.

@Override
public void onCreate(Bundle state) {
    super.onCreate(state);
    if (state != null) {
        models = state.getCharSequenceArray(KEY_MODELS);
    }
    ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    for (int i = 0; i < 10; i++) {
        bar.addTab(bar.newTab().setText("Tab #" + String.valueOf(i + 1)).setTabListener(this).setTag(i));
    }
    if (state != null) {
        bar.setSelectedNavigationItem(state.getInt(KEY_POSITION));
    }
}
Also used : ActionBar(android.app.ActionBar)

Example 3 with ActionBar

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

the class MainActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    widget = findViewById(R.id.widget);
    ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    for (int i = 0; i < TABS.length; i++) {
        bar.addTab(bar.newTab().setText(getString(TABS[i])).setTabListener(this));
    }
}
Also used : ActionBar(android.app.ActionBar)

Example 4 with ActionBar

use of android.app.ActionBar in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class IccLockSettings method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    Intent intent = getActivity().getIntent();
    ActionBar actionBar = getActivity().getActionBar();
    if (actionBar != null) {
        actionBar.setSubtitle(intent.getStringExtra(EXTRA_SUB_DISPLAY_NAME));
    }
    int subId = intent.getIntExtra(EXTRA_SUB_ID, SubscriptionManager.getDefaultSubscriptionId());
    int phoneId = SubscriptionManager.getPhoneId(subId);
    mPhone = PhoneFactory.getPhone(phoneId);
}
Also used : Intent(android.content.Intent) ActionBar(android.app.ActionBar)

Example 5 with ActionBar

use of android.app.ActionBar in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SubActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    String fragmentExtra = getIntent().getStringExtra(EXTRA_FRAGMENT_CLASS);
    if (fragmentExtra != null && !fragmentExtra.isEmpty()) {
        try {
            Class<?> fragmentClass = Class.forName(fragmentExtra);
            Fragment fragment = (Fragment) fragmentClass.newInstance();
            getFragmentManager().beginTransaction().replace(android.R.id.content, fragment).commit();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    String title = getIntent().getStringExtra(EXTRA_TITLE);
    if (title != null && !title.isEmpty()) {
        setTitle(title);
    }
}
Also used : Fragment(android.app.Fragment) ActionBar(android.app.ActionBar)

Aggregations

ActionBar (android.app.ActionBar)265 View (android.view.View)58 Intent (android.content.Intent)35 TextView (android.widget.TextView)21 ColorDrawable (android.graphics.drawable.ColorDrawable)20 OnClickListener (android.view.View.OnClickListener)14 AdapterView (android.widget.AdapterView)14 ListView (android.widget.ListView)12 Bundle (android.os.Bundle)10 Test (org.junit.Test)10 SharedPreferences (android.content.SharedPreferences)9 Uri (android.net.Uri)9 Button (android.widget.Button)9 AlertDialog (android.app.AlertDialog)8 DialogInterface (android.content.DialogInterface)8 ViewPager (android.support.v4.view.ViewPager)8 SpannableString (android.text.SpannableString)8 ComponentName (android.content.ComponentName)7 ArrayAdapter (android.widget.ArrayAdapter)7 FrameLayout (android.widget.FrameLayout)7