Polish featured lists dropdown, started introducing hooks for showing/hiding comments in different filter modes

pull/14/head
Sam Bosley 12 years ago
parent b3f0ff27f1
commit 7583683235

@ -56,4 +56,9 @@ public class PeopleFilterMode implements FilterModeSpec {
TaskListFragment.MENU_ADDONS_ID,
MainMenuPopover.MAIN_MENU_ITEM_FRIENDS
};
@Override
public boolean showComments() {
return true;
}
}

@ -3,6 +3,8 @@ package com.todoroo.astrid.tags.reusable;
import android.app.Activity;
import android.content.Intent;
import android.content.IntentFilter;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import com.todoroo.astrid.adapter.FilterAdapter;
@ -34,4 +36,23 @@ public class FeaturedListFilterAdapter extends FilterAdapter {
public void unregisterRecevier() {
activity.unregisterReceiver(filterReceiver);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = super.getView(position, convertView, parent);
ViewHolder viewHolder = (ViewHolder) v.getTag();
viewHolder.size.setVisibility(View.GONE);
viewHolder.name.setSingleLine(false);
viewHolder.name.setLines(2);
viewHolder.name.setMaxLines(2);
int right = (int) (metrics.density * 10);
int top = (int) (metrics.density * 2);
viewHolder.name.setPadding(0, top, right, 0);
viewHolder.name.setTextSize(14);
viewHolder.name.setLineSpacing(0.0f, 1.2f);
return v;
}
}

@ -48,6 +48,9 @@ public class FeaturedListFilterMode implements FilterModeSpec {
//
}
@Override
public boolean showComments() {
return false;
}
}

@ -39,4 +39,9 @@ public class DefaultFilterMode implements FilterModeSpec {
//
}
@Override
public boolean showComments() {
return true;
}
}

@ -13,5 +13,6 @@ public interface FilterModeSpec {
public Filter getDefaultFilter(Context context);
public int getMainMenuIconAttr();
public void onFilterItemClickedCallback(FilterListItem item);
public boolean showComments();
}

@ -80,7 +80,7 @@ public class FilterAdapter extends ArrayAdapter<Filter> {
protected ListView listView;
/** display metrics for scaling icons */
private final DisplayMetrics metrics = new DisplayMetrics();
protected final DisplayMetrics metrics = new DisplayMetrics();
/** receiver for new filters */
protected final FilterReceiver filterReceiver = new FilterReceiver();

Loading…
Cancel
Save