Ejemplo n.º 1
0
  @Override
  public ContextMenuSubject getSubject(ContextMenu menu, View view, ContextMenuInfo menuInfo) {
    ContextMenuSubject subject = null;

    if (!(menuInfo instanceof AdapterView.AdapterContextMenuInfo)) {
      Log.e(LOGTAG, "menuInfo is not AdapterContextMenuInfo");
      return subject;
    }

    ListView list = (ListView) view;
    AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
    subject = ((AwesomeBarItem) list.getItemAtPosition(info.position)).getSubject();

    if (subject == null) return subject;

    MenuInflater inflater = new MenuInflater(mContext);
    inflater.inflate(R.menu.awesomebar_contextmenu, menu);
    menu.findItem(R.id.remove_bookmark).setVisible(false);
    menu.findItem(R.id.edit_bookmark).setVisible(false);
    menu.findItem(R.id.open_in_reader).setVisible(subject.display == Combined.DISPLAY_READER);

    // Hide "Remove" item if there isn't a valid history ID
    if (subject.id < 0) menu.findItem(R.id.remove_history).setVisible(false);

    menu.setHeaderTitle(subject.title);
    return subject;
  }
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater menuInflater = new MenuInflater(this);
    menuInflater.inflate(R.menu.main_menu, menu);

    return true;
  }
Ejemplo n.º 3
0
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    // getMenuInflater().inflate(R.menu.quick_pay, menu);
    // return true;
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.main, menu);

    if (numWalletInvites == null) {
      numWalletInvites = getData.getNumInvites();
    }

    View count = menu.findItem(R.id.badge).getActionView();
    Button notifWalletCount;
    notifWalletCount = (Button) count.findViewById(R.id.notif_count);
    notifWalletCount.setText(numWalletInvites.toString());
    notifWalletCount.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            showInvites();
          }
        });

    if (numWalletInvites == 0) {
      count.setVisibility(View.INVISIBLE);
    }

    return super.onCreateOptionsMenu(menu);
  }
Ejemplo n.º 4
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.layout.device_menu, menu);
   setMenuBackground();
   return true;
 }
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflator = getMenuInflater();
    if (currentMode.equals(mode.DRIVERS_LIST.name())) {
      inflator.inflate(R.menu.menu_search_home, menu);
    } else {
      inflator.inflate(R.menu.menu_vehicles_drivers_page, menu);
    }
    SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
    searchMenuItem = menu.findItem(R.id.action_search);
    searchView = (SearchView) searchMenuItem.getActionView();
    searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
    searchView.setSubmitButtonEnabled(false);
    searchView.setOnQueryTextListener(this);
    searchView.addOnAttachStateChangeListener(
        new View.OnAttachStateChangeListener() {
          @Override
          public void onViewAttachedToWindow(View v) {}

          @Override
          public void onViewDetachedFromWindow(View v) {
            Utilities.hideSoftKeyboard(DriversActivity.this);
            searchView.setQuery("", false);
          }
        });
    return true;
  }
Ejemplo n.º 6
0
 @Override
 public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
   menu.clear();
   MenuInflater inflater = mode.getMenuInflater();
   inflater.inflate(R.menu.newconversation_context, menu);
   SparseBooleanArray checkedItems = contactsView.getCheckedItemPositions();
   selectedContacts.clear();
   for (int i = 0; i < aggregatedContacts.size(); ++i) {
     if (checkedItems.get(i, false)) {
       selectedContacts.add(aggregatedContacts.get(i));
     }
   }
   if (selectedContacts.size() == 0) {
     menu.findItem(R.id.action_start_conversation).setVisible(false);
     menu.findItem(R.id.action_contact_details).setVisible(false);
     menu.findItem(R.id.action_invite).setVisible(false);
     menu.findItem(R.id.action_invite_to_existing).setVisible(false);
   } else if ((selectedContacts.size() == 1) && (!inviteIntent)) {
     menu.findItem(R.id.action_start_conversation).setVisible(true);
     menu.findItem(R.id.action_contact_details).setVisible(true);
     menu.findItem(R.id.action_invite).setVisible(false);
     menu.findItem(R.id.action_invite_to_existing).setVisible(true);
   } else if (!inviteIntent) {
     menu.findItem(R.id.action_start_conversation).setVisible(true);
     menu.findItem(R.id.action_contact_details).setVisible(false);
     menu.findItem(R.id.action_invite).setVisible(false);
     menu.findItem(R.id.action_invite_to_existing).setVisible(true);
   } else {
     menu.findItem(R.id.action_invite).setVisible(true);
     menu.findItem(R.id.action_start_conversation).setVisible(false);
     menu.findItem(R.id.action_contact_details).setVisible(false);
     menu.findItem(R.id.action_invite_to_existing).setVisible(false);
   }
   return true;
 }
 /** ********************************************** */
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   super.onCreateOptionsMenu(menu);
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.menu.initmenu, menu);
   return true;
 }
Ejemplo n.º 8
0
 @Override
 public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
   super.onCreateContextMenu(menu, v, menuInfo);
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.menu.cardeletemenu, menu);
   menu.setHeaderTitle("Delete Car?");
 }
Ejemplo n.º 9
0
  @Override
  public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);

    MenuInflater inflater = getActivity().getMenuInflater();
    inflater.inflate(R.menu.context_menu_favorito_desejo, menu);
  }
Ejemplo n.º 10
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.layout.ccmenu, menu);
   Log.e("n", " CC Menu Created");
   return true;
 }
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   // TODO Auto-generated method stub
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.menu.ficha_descargarparametros_menu, menu);
   return true;
 }
Ejemplo n.º 12
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   MenuInflater inflater = new MenuInflater(this);
   inflater.inflate(R.menu.stopwatch_activity, menu);
   View xyz = findViewById(R.id.action_new);
   return true;
 }
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.forum_index_options, menu);

    return true;
  }
Ejemplo n.º 14
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   // TODO Auto-generated method stub
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.menu.option_menu, menu);
   return super.onCreateOptionsMenu(menu);
 }
 // Create the Menu options
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   super.onCreateOptionsMenu(menu);
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.menu.container_object_list_menu, menu);
   return true;
 }
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   // Inflate the menu items from the menu layout.
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.menu.menu_map_controls, menu);
   return true;
 }
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.menu_formulario, menu);

    return super.onCreateOptionsMenu(menu);
  }
Ejemplo n.º 18
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   // Inflate the menu; this adds items to the action bar if it is present.
   MenuInflater menuInflater = getMenuInflater();
   menuInflater.inflate(R.menu.activity_main, menu);
   return true;
 }
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    if (PhoneConfiguration.getInstance().HandSide == 1) { // lefthand
      int flag = PhoneConfiguration.getInstance().getUiFlag();
      if (flag == 1 || flag == 3 || flag == 5 || flag == 7) { // 文章列表,UIFLAG为1或者1+2或者1+4或者1+2+4
        inflater.inflate(R.menu.articlelist_menu_left, menu);
      } else {
        inflater.inflate(R.menu.articlelist_menu, menu);
      }
    } else {
      inflater.inflate(R.menu.articlelist_menu, menu);
    }
    final int flags = ThemeManager.ACTION_BAR_FLAG;

    MenuItem lock = menu.findItem(R.id.article_menuitem_lock);
    int orentation = ThemeManager.getInstance().screenOrentation;
    if (orentation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
        || orentation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
      lock.setTitle(R.string.unlock_orientation);
      lock.setIcon(R.drawable.ic_menu_always_landscape_portrait);
    }

    ReflectionUtil.actionBar_setDisplayOption(this, flags);
    return super.onCreateOptionsMenu(menu);
  }
Ejemplo n.º 20
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   // getMenuInflater().inflate(R.menu.menu_main, menu);
   MenuInflater mif = getMenuInflater();
   mif.inflate(R.menu.main, menu);
   return super.onCreateOptionsMenu(menu);
 }
Ejemplo n.º 21
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   MenuInflater inflator = new MenuInflater(this);
   // 装填R.menu.my_menu对应的菜单,并添加到menu中
   inflator.inflate(R.menu.menu_main, menu);
   return super.onCreateOptionsMenu(menu);
 }
Ejemplo n.º 22
0
 @Override
 public boolean onCreateOptionsMenu(android.view.Menu menu) {
   // TODO Auto-generated method stub
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.menu.main_menu, menu);
   return true;
 }
Ejemplo n.º 23
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   // Inflate the menu; this adds items to the action bar if it is present.
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.menu.menu_my, menu);
   return super.onCreateOptionsMenu(menu);
 }
Ejemplo n.º 24
0
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.menu_makal, menu);

    SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
    SearchView searchView = (SearchView) menu.findItem(R.id.search).getActionView();
    if (null != searchView) {
      searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
    }
    SearchView.OnQueryTextListener queryTextListener =
        new SearchView.OnQueryTextListener() {
          @Override
          public boolean onQueryTextSubmit(String s) {
            //      Toast.makeText(getActivity(), "TEXT:" + s, Toast.LENGTH_SHORT).show();
            return false;
          }

          @Override
          public boolean onQueryTextChange(String s) {
            SearchAdapter(s);
            return false;
          }
        };
    searchView.setOnQueryTextListener(queryTextListener);
    return true;
  }
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {

    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.option_basic, menu);
    return super.onCreateOptionsMenu(menu);
  }
  @Override
  public boolean onCreateOptionsMenu(Menu aMenu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.osm_onestop_menu, aMenu);

    return true;
  }
Ejemplo n.º 27
0
 /* (non-Javadoc)
  * @see android.app.Activity#onCreateOptionsMenu(android.view.Menu)
  */
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   // Inflate the menu items for use in the action bar
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.menu.main, menu);
   return super.onCreateOptionsMenu(menu);
 }
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater menuInflater = getMenuInflater();
    menuInflater.inflate(R.menu.activity_recent_menu, menu);

    MenuItem searchItem = menu.findItem(R.id.activity_recent_search);
    searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
    // searchView.setOnQueryTextListener(this);
    searchView.setQueryHint(getString(R.string.hint_search_activity_recent));
    SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
    searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));

    // Handle the query that user types in action bar search field
    searchView.setOnQueryTextListener(
        new SearchView.OnQueryTextListener() {
          @Override
          public boolean onQueryTextSubmit(String query) {
            Intent intent = new Intent(RecentActivity.this, SearchResultsActivity.class);
            intent.putExtra("query", query);
            startActivity(intent);
            return false;
          }

          @Override
          public boolean onQueryTextChange(String query) {
            return false;
          }
        });

    return super.onCreateOptionsMenu(menu);
  }
Ejemplo n.º 29
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.menu.mainmenu, menu);
   this.menu = menu;
   return true;
 }
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.menu.details_menu, menu);
   this.menu = menu;
   return super.onCreateOptionsMenu(menu);
 }