diff --git a/Chan/res/drawable-mdpi/closed_icon.png b/Chan/res/drawable-mdpi/closed_icon.png new file mode 100644 index 00000000..565fc938 Binary files /dev/null and b/Chan/res/drawable-mdpi/closed_icon.png differ diff --git a/Chan/src/org/floens/chan/ui/view/PostView.java b/Chan/src/org/floens/chan/ui/view/PostView.java index d37f4fb2..9b7fcef8 100644 --- a/Chan/src/org/floens/chan/ui/view/PostView.java +++ b/Chan/src/org/floens/chan/ui/view/PostView.java @@ -52,6 +52,7 @@ public class PostView extends LinearLayout implements View.OnClickListener, View private TextView repliesCountView; private LinearLayout iconView; private ImageView stickyView; + private ImageView closedView; private NetworkImageView countryView; /** @@ -189,10 +190,12 @@ public class PostView extends LinearLayout implements View.OnClickListener, View boolean showCountryFlag = !TextUtils.isEmpty(post.country); boolean showStickyIcon = post.sticky; + boolean showClosedIcon = post.closed; - iconView.setVisibility((showCountryFlag || showStickyIcon) ? View.VISIBLE : View.GONE); + iconView.setVisibility((showCountryFlag || showStickyIcon || showClosedIcon) ? View.VISIBLE : View.GONE); stickyView.setVisibility(showStickyIcon ? View.VISIBLE : View.GONE); + closedView.setVisibility(showClosedIcon ? View.VISIBLE : View.GONE); if (showCountryFlag) { countryView.setVisibility(View.VISIBLE); countryView.setImageUrl(ChanUrls.getCountryFlagUrl(post.country), ChanApplication.getImageLoader()); @@ -272,6 +275,10 @@ public class PostView extends LinearLayout implements View.OnClickListener, View stickyView.setImageBitmap(IconCache.stickyIcon); iconView.addView(stickyView, new LinearLayout.LayoutParams(iconWidth, iconHeight)); + closedView = new ImageView(context); + closedView.setImageBitmap(IconCache.closedIcon); + iconView.addView(closedView, new LinearLayout.LayoutParams(iconWidth, iconHeight)); + countryView = new NetworkImageView(context); countryView.setScaleType(ImageView.ScaleType.FIT_CENTER); iconView.addView(countryView, new LinearLayout.LayoutParams(iconWidth, iconHeight)); diff --git a/Chan/src/org/floens/chan/utils/IconCache.java b/Chan/src/org/floens/chan/utils/IconCache.java index 71d01538..3b19916a 100644 --- a/Chan/src/org/floens/chan/utils/IconCache.java +++ b/Chan/src/org/floens/chan/utils/IconCache.java @@ -8,7 +8,8 @@ import android.graphics.BitmapFactory; public class IconCache { public static Bitmap stickyIcon; - + public static Bitmap closedIcon; + /** * Load the icons in the cache. Lightweight icons only! Icons can be null! * @param context @@ -18,6 +19,7 @@ public class IconCache { @Override public void run() { stickyIcon = BitmapFactory.decodeResource(context.getResources(), R.drawable.sticky_icon); + closedIcon = BitmapFactory.decodeResource(context.getResources(), R.drawable.closed_icon); } }).start(); }