Ejemplo n.º 1
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   createMenuItem(
       menu,
       SAVE_FILTER,
       R.string.edit_filter_save_as_menu_item,
       R.drawable.ic_action_gsave_dark,
       R.drawable.ic_action_gsave_light,
       MenuItem.SHOW_AS_ACTION_IF_ROOM);
   createMenuItem(
       menu,
       FILTER,
       R.string.filter_current_poiButton,
       0,
       0,
       // R.drawable.a_1_navigation_accept_light, R.drawable.a_1_navigation_accept_dark,
       MenuItem.SHOW_AS_ACTION_WITH_TEXT | MenuItem.SHOW_AS_ACTION_ALWAYS);
   if (!filter.isStandardFilter()) {
     createMenuItem(
         menu,
         DELETE_FILTER,
         R.string.edit_filter_delete_menu_item,
         R.drawable.ic_action_gdiscard_dark,
         R.drawable.ic_action_gdiscard_light,
         MenuItem.SHOW_AS_ACTION_IF_ROOM);
   }
   return super.onCreateOptionsMenu(menu);
 }
 private void showEditActivity(PoiFilter poi) {
   if (!poi.isStandardFilter()) {
     Intent newIntent = new Intent(SearchPoiFilterActivity.this, EditPOIFilterActivity.class);
     // folder selected
     newIntent.putExtra(EditPOIFilterActivity.AMENITY_FILTER, poi.getFilterId());
     updateIntentToLaunch(newIntent);
     startActivityForResult(newIntent, 0);
   }
 }
 @Override
 public View getView(int position, View convertView, ViewGroup parent) {
   LayoutInflater inflater = getLayoutInflater();
   View row = inflater.inflate(R.layout.searchpoifolder_list, parent, false);
   TextView label = (TextView) row.findViewById(R.id.folder_label);
   ImageView icon = (ImageView) row.findViewById(R.id.folder_icon);
   PoiFilter model = getItem(position);
   label.setText(model.getName());
   if (model.getFilterId().equals(PoiFilter.CUSTOM_FILTER_ID)) {
     icon.setImageResource(android.R.drawable.ic_input_get);
   } else if (model.getFilterId().equals(PoiFilter.BY_NAME_FILTER_ID)) {
     // label.setTypeface(Typeface.DEFAULT, Typeface.ITALIC);
     icon.setImageResource(android.R.drawable.ic_search_category_default);
   } else {
     //				label.setTypeface(Typeface.DEFAULT);
     icon.setImageResource(
         model.isStandardFilter() ? R.drawable.folder : R.drawable.tab_icon_favourite_menu);
   }
   return (row);
 }