android.app.ActionBar.OnNavigationListener Java Examples

The following examples show how to use android.app.ActionBar.OnNavigationListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainActivity.java    From Contacts with MIT License 5 votes vote down vote up
@Override
public void displaySpinnerInActionBar(String[] array, int position, OnNavigationListener listener)
{
	ArrayAdapter<CharSequence> list = new ArrayAdapter<CharSequence>(getActionBar().getThemedContext(),
			android.R.layout.simple_dropdown_item_1line, array);
	list.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);

	getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
	getActionBar().setListNavigationCallbacks(list, listener);
	getActionBar().setSelectedNavigationItem(position);
}
 
Example #2
Source File: MainActivity.java    From Contacts with MIT License 5 votes vote down vote up
@Override
public void displaySpinnerInActionBar(int array, int position, OnNavigationListener listener)
{
	ArrayAdapter<CharSequence> list = ArrayAdapter.createFromResource(getActionBar().getThemedContext(), array,
			android.R.layout.simple_dropdown_item_1line);
	list.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);

	getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
	getActionBar().setListNavigationCallbacks(list, listener);
	getActionBar().setSelectedNavigationItem(position);
}
 
Example #3
Source File: MainActivity.java    From Contacts with MIT License 5 votes vote down vote up
@Override
public void displaySpinnerInActionBar(List<BaseType> data, int position, OnNavigationListener listener)
{
	MultiObjectAdapter adapter = new MultiObjectAdapter(null, LayoutType.DROP_DOWN_ITEM);
	adapter.addAll(data);

	getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
	getActionBar().setListNavigationCallbacks(adapter, listener);
	getActionBar().setSelectedNavigationItem(position);
}
 
Example #4
Source File: TitledFragmentActivity.java    From Klyph with MIT License 5 votes vote down vote up
@Override
public void displaySpinnerInActionBar(int array, int position, OnNavigationListener listener)
{
	ArrayAdapter<CharSequence> list = ArrayAdapter.createFromResource(this, array, android.R.layout.simple_dropdown_item_1line);
	list.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);

	getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
	getActionBar().setListNavigationCallbacks(list, listener);
	getActionBar().setSelectedNavigationItem(position);
}
 
Example #5
Source File: TitledFragmentActivity.java    From Klyph with MIT License 5 votes vote down vote up
@Override
public void displaySpinnerInActionBar(List<GraphObject> data, int position, OnNavigationListener listener)
{
	MultiObjectAdapter adapter = new MultiObjectAdapter(null, SpecialLayout.DROP_DOWN_ITEM);
	adapter.addAll(data);
	
	getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
	getActionBar().setListNavigationCallbacks(adapter, listener);
	getActionBar().setSelectedNavigationItem(position);
}
 
Example #6
Source File: TitledViewPagerActivity.java    From Klyph with MIT License 5 votes vote down vote up
public void displaySpinnerInActionBar(int array, int position, OnNavigationListener listener)
{
	ArrayAdapter<CharSequence> list = ArrayAdapter.createFromResource(this, array, android.R.layout.simple_dropdown_item_1line);
	list.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);

	getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
	getActionBar().setListNavigationCallbacks(list, listener);
	getActionBar().setSelectedNavigationItem(position);
}
 
Example #7
Source File: TitledViewPagerActivity.java    From Klyph with MIT License 5 votes vote down vote up
@Override
public void displaySpinnerInActionBar(List<GraphObject> data, int position, OnNavigationListener listener)
{
	MultiObjectAdapter adapter = new MultiObjectAdapter(null, SpecialLayout.DROP_DOWN_ITEM);
	adapter.addAll(data);
	
	getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
	getActionBar().setListNavigationCallbacks(adapter, listener);
	getActionBar().setSelectedNavigationItem(position);
}
 
Example #8
Source File: MainActivity.java    From ChipsLibrary with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(final Bundle savedInstanceState)
  {
  super.onCreate(savedInstanceState);
  getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
  final ArrayList<String> itemList=new ArrayList<String>();
  itemList.add("Contacts Recipients");
  itemList.add("Customized Recipients");
  final ArrayAdapter<String> navAdapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,android.R.id.text1,itemList);
  getActionBar().setListNavigationCallbacks(navAdapter,new OnNavigationListener()
    {
      @Override
      public boolean onNavigationItemSelected(final int itemPosition,final long itemId)
        {
        switch(itemPosition)
          {
          case 0:
            getFragmentManager().beginTransaction().replace(android.R.id.content,new ContactsRecipientsFragment()).commit();
            break;
          case 1:
            getFragmentManager().beginTransaction().replace(android.R.id.content,new CustomRecipientFragment()).commit();
            break;
          }
        return true;
        }
    });
  }
 
Example #9
Source File: TitledFragmentActivity.java    From KlyphMessenger with MIT License 5 votes vote down vote up
@Override
public void displaySpinnerInActionBar(int array, int position, OnNavigationListener listener)
{
	ArrayAdapter<CharSequence> list = ArrayAdapter.createFromResource(this, array, android.R.layout.simple_spinner_dropdown_item);
	list.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

	getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
	getActionBar().setListNavigationCallbacks(list, listener);
	getActionBar().setSelectedNavigationItem(position);
}
 
Example #10
Source File: IActionbarSpinner.java    From Contacts with MIT License votes vote down vote up
public void displaySpinnerInActionBar(String[] array, int position, OnNavigationListener listener); 
Example #11
Source File: IActionbarSpinner.java    From Contacts with MIT License votes vote down vote up
public void displaySpinnerInActionBar(int array, int position, OnNavigationListener listener); 
Example #12
Source File: IActionbarSpinner.java    From Contacts with MIT License votes vote down vote up
public void displaySpinnerInActionBar(List<BaseType> data, int position, OnNavigationListener listener); 
Example #13
Source File: IActionbarSpinner.java    From Klyph with MIT License votes vote down vote up
public void displaySpinnerInActionBar(int array, int position, OnNavigationListener listener); 
Example #14
Source File: IActionbarSpinner.java    From Klyph with MIT License votes vote down vote up
public void displaySpinnerInActionBar(List<GraphObject> data, int position, OnNavigationListener listener); 
Example #15
Source File: IActionbarSpinner.java    From KlyphMessenger with MIT License votes vote down vote up
public void displaySpinnerInActionBar(int array, int position, OnNavigationListener listener);