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));
}
}
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));
}
}
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));
}
}
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);
}
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);
}
}
Aggregations