Strip unecessary fields out of filter list items

pull/14/head
Sam Bosley 13 years ago
parent a6a1a9fcff
commit 6b9e23436a

@ -211,17 +211,17 @@ public class TagViewActivity extends TaskListActivity {
super.onNewIntent(intent);
if (intent.getBooleanExtra(TOKEN_START_ACTIVITY, false)) {
getView().findViewById(R.id.activity).postDelayed(new Runnable() {
@Override
public void run() {
Intent i = new Intent(getActivity(), TagUpdatesActivity.class);
i.putExtra(EXTRA_TAG_DATA, tagData);
startActivity(i);
AndroidUtilities.callOverridePendingTransition(getActivity(), R.anim.slide_left_in, R.anim.slide_left_out);
}
}, 500);
}
// if (intent.getBooleanExtra(TOKEN_START_ACTIVITY, false)) {
// getView().findViewById(R.id.activity).postDelayed(new Runnable() {
// @Override
// public void run() {
// Intent i = new Intent(getActivity(), TagUpdatesActivity.class);
// i.putExtra(EXTRA_TAG_DATA, tagData);
// startActivity(i);
// AndroidUtilities.callOverridePendingTransition(getActivity(), R.anim.slide_left_in, R.anim.slide_left_out);
// }
// }, 500);
// }
}
@Override

@ -10,19 +10,11 @@
android:paddingRight="6dip"
android:orientation="horizontal">
<!-- expander icon -->
<ImageView android:id="@+id/expander"
android:layout_width="22dip"
android:layout_height="wrap_content"
android:layout_marginLeft="11dip"
android:scaleType="fitCenter"
android:visibility="gone"/>
<!-- filter icon -->
<ImageView android:id="@+id/icon"
android:layout_width="25dip"
android:layout_height="48dip"
android:layout_toRightOf="@id/expander"
android:layout_alignParentLeft="true"
android:layout_marginTop="4dp"
android:layout_marginLeft="12dip"
android:scaleType="fitCenter"
@ -32,7 +24,7 @@
<greendroid.widget.AsyncImageView android:id="@+id/url_image"
android:layout_width="30dip"
android:layout_height="48dip"
android:layout_toRightOf="@id/expander"
android:layout_alignParentLeft="true"
android:layout_marginTop="4dp"
android:layout_marginLeft="10dip"
android:scaleType="fitCenter"
@ -72,16 +64,5 @@
android:src="@drawable/filter_selected_icon"
android:scaleType="fitCenter"
android:visibility="gone"/>
<!-- activity text -->
<TextView android:id="@+id/activity"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="55dp"
android:layout_marginTop="26dp"
style="@style/TextAppearance.TAd_ItemDetails"
android:paddingRight="30dp"
android:gravity="center_vertical"
android:visibility="gone"/>
</RelativeLayout>

@ -22,7 +22,6 @@ import android.content.pm.ResolveInfo;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
@ -170,11 +169,9 @@ public class FilterAdapter extends ArrayAdapter<Filter> {
convertView = inflater.inflate(layout, parent, false);
ViewHolder viewHolder = new ViewHolder();
viewHolder.view = convertView;
viewHolder.expander = (ImageView)convertView.findViewById(R.id.expander);
viewHolder.icon = (ImageView)convertView.findViewById(R.id.icon);
viewHolder.urlImage = (AsyncImageView)convertView.findViewById(R.id.url_image);
viewHolder.name = (TextView)convertView.findViewById(R.id.name);
viewHolder.activity = (TextView)convertView.findViewById(R.id.activity);
viewHolder.selected = (ImageView)convertView.findViewById(R.id.selected);
viewHolder.size = (TextView)convertView.findViewById(R.id.size);
viewHolder.decoration = null;
@ -185,11 +182,9 @@ public class FilterAdapter extends ArrayAdapter<Filter> {
public static class ViewHolder {
public FilterListItem item;
public ImageView expander;
public ImageView icon;
public AsyncImageView urlImage;
public TextView name;
public TextView activity;
public TextView size;
public ImageView selected;
public View view;
@ -414,17 +409,9 @@ public class FilterAdapter extends ArrayAdapter<Filter> {
viewHolder.view.getLayoutParams().height = (int) (58 * metrics.density);
}
if(viewHolder.item instanceof FilterCategory) {
viewHolder.expander.setVisibility(View.VISIBLE);
viewHolder.expander.setImageResource(isExpanded ?
R.drawable.expander_ic_maximized : R.drawable.expander_ic_minimized);
} else
viewHolder.expander.setVisibility(View.GONE);
// update with filter attributes (listing icon, url, update text, size)
viewHolder.urlImage.setVisibility(View.GONE);
viewHolder.activity.setVisibility(View.GONE);
viewHolder.icon.setVisibility(View.GONE);
if(filter.listingIcon != null) {
@ -448,11 +435,6 @@ public class FilterAdapter extends ArrayAdapter<Filter> {
viewHolder.urlImage.setVisibility(View.VISIBLE);
viewHolder.urlImage.setDefaultImageResource(R.drawable.gl_list);
viewHolder.urlImage.setUrl(((FilterWithUpdate)filter).imageUrl);
if(!TextUtils.isEmpty(((FilterWithUpdate)filter).updateText)) {
viewHolder.activity.setText(((FilterWithUpdate)filter).updateText);
viewHolder.name.getLayoutParams().height = (int) (25 * metrics.density);
viewHolder.activity.setVisibility(View.VISIBLE);
}
}
if(filter.color != 0)

Loading…
Cancel
Save