예제 #1
0
  @Override
  public void onCreate(final Bundle icicle) {
    Bundle bundle = this.getIntent().getExtras();
    String filterId = bundle.getString(AMENITY_FILTER);
    helper = ((OsmandApplication) getApplication()).getPoiFilters();
    filter = helper.getFilterById(filterId);
    super.onCreate(icicle);

    setContentView(R.layout.editing_poi_filter);
    getSupportActionBar().setTitle(R.string.filterpoi_activity);
    getSupportActionBar().setIcon(R.drawable.tab_search_poi_icon);

    getSupportActionBar().setSubtitle(filter.getName());
    setListAdapter(new AmenityAdapter(AmenityType.getCategories()));
  }
 @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);
 }