Skip to content

Commit f1cb046

Browse files
committed
禁用图片
1 parent 4a17849 commit f1cb046

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/com/dreamteam/app/adapter/ItemListAdapter.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.util.ArrayList;
77

88
import android.content.Context;
9+
import android.content.SharedPreferences;
910
import android.content.res.Resources;
1011
import android.graphics.Bitmap;
1112
import android.graphics.BitmapFactory;
@@ -16,6 +17,7 @@
1617
import android.widget.ImageView;
1718
import android.widget.TextView;
1819

20+
import com.dreamteam.app.commons.AppContext;
1921
import com.dreamteam.app.entity.FeedItem;
2022
import com.dreamteam.app.utils.ImageLoader;
2123
import com.dreateam.app.ui.R;
@@ -36,7 +38,7 @@ public class ItemListAdapter extends BaseAdapter
3638
private ArrayList<String> imageUrls = new ArrayList<String>();
3739
private ImageLoader loader = new ImageLoader();
3840
private static int[] colors;//是否已阅读显示的颜色
39-
41+
private boolean loadImg = false;
4042

4143
public ItemListAdapter(Context context, ArrayList<FeedItem> items, boolean isNight)
4244
{
@@ -56,6 +58,9 @@ public ItemListAdapter(Context context, ArrayList<FeedItem> items, boolean isNig
5658
res.getColor(R.color.gray)
5759
};
5860
}
61+
//是否加载图片
62+
SharedPreferences prefs = AppContext.getPrefrences(context);
63+
loadImg = prefs.getBoolean("pref_imageLoad", false);
5964
}
6065

6166
@Override
@@ -107,7 +112,7 @@ public View getView(int position, View convertView, ViewGroup parent)
107112
viewHolder.titleTv.setText(title);
108113
viewHolder.pubdateTv.setText(item.getPubdate());
109114
imageUrls = item.getImageUrls();
110-
if(imageUrls.isEmpty())
115+
if(imageUrls.isEmpty() || !loadImg)
111116
{
112117
viewHolder.itemIv.setVisibility(View.GONE);
113118
}

0 commit comments

Comments
 (0)