use of android.app.ActionBar in project presentations by eburke.
the class LocationActivity method onCreate.
@Override
public void onCreate(Bundle state) {
super.onCreate(state);
setContentView(R.layout.location_activity);
ActionBar ab = getActionBar();
ab.setDisplayHomeAsUpEnabled(true);
ab.setTitle(R.string.locations);
}
use of android.app.ActionBar in project cardslib by gabrielemariotti.
the class AnimateStaggeredGridFragment method populateNavigationList.
/**
* Populate the downDownValues to select the different animations
*/
private void populateNavigationList() {
getActivity().getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
final String[] dropdownValues = { "Alpha", "Left", "Right", "Bottom", "Bottom right", "Scale" };
ActionBar actionBar = getActivity().getActionBar();
// Specify a SpinnerAdapter to populate the dropdown list.
ArrayAdapter<String> adapter = new ArrayAdapter<String>(actionBar.getThemedContext(), android.R.layout.simple_spinner_item, android.R.id.text1, dropdownValues);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// Set up the dropdown list navigation in the action bar.
actionBar.setListNavigationCallbacks(adapter, this);
}
use of android.app.ActionBar in project cardslib by gabrielemariotti.
the class ListViewAnimationsFragment method populateNavigationList.
/**
* Populate the downDownValues to select the different animations
*/
private void populateNavigationList() {
getActivity().getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
final String[] dropdownValues = { "Alpha", "Left", "Right", "Bottom", "Bottom right", "Scale" };
ActionBar actionBar = getActivity().getActionBar();
// Specify a SpinnerAdapter to populate the dropdown list.
ArrayAdapter<String> adapter = new ArrayAdapter<String>(actionBar.getThemedContext(), android.R.layout.simple_spinner_item, android.R.id.text1, dropdownValues);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// Set up the dropdown list navigation in the action bar.
actionBar.setListNavigationCallbacks(adapter, this);
}
use of android.app.ActionBar in project k-9 by k9mail.
the class MessageCompose method initializeActionBar.
private void initializeActionBar() {
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
}
use of android.app.ActionBar in project Talon-for-Twitter by klinker24.
the class ConfigurePagerActivity method setUpDoneDiscard.
public void setUpDoneDiscard() {
LayoutInflater inflater = (LayoutInflater) getActionBar().getThemedContext().getSystemService(LAYOUT_INFLATER_SERVICE);
final View customActionBarView = inflater.inflate(R.layout.actionbar_done_discard, null);
TextView doneButton = (TextView) customActionBarView.findViewById(R.id.done);
doneButton.setText(getResources().getString(R.string.done_label));
customActionBarView.findViewById(R.id.actionbar_done).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int currentAccount = sharedPrefs.getInt("current_account", 1);
SharedPreferences.Editor editor = sharedPrefs.edit();
for (int i = 0; i < chooserAdapter.getCount(); i++) {
if (chooserAdapter.getItem(i) instanceof ChooserFragment) {
ChooserFragment f = (ChooserFragment) chooserAdapter.getItem(i);
int num = i + 1;
editor.putInt("account_" + currentAccount + "_page_" + num, f.type);
editor.putLong("account_" + currentAccount + "_list_" + num + "_long", f.listId);
editor.putString("account_" + currentAccount + "_name_" + num, f.listName);
editor.putString("account_" + currentAccount + "_search_" + num, f.searchQuery);
if (f.check != null && f.check.isChecked()) {
editor.putInt("default_timeline_page_" + currentAccount, i);
}
}
}
editor.commit();
onBackPressed();
}
});
customActionBarView.findViewById(R.id.actionbar_discard).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
// Show the custom action bar view and hide the normal Home icon and title.
final ActionBar actionBar = getActionBar();
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE);
actionBar.setCustomView(customActionBarView, new ActionBar.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
}
Aggregations