Show how many images a thread has in board view.

captchafix
Florens Douwes 11 years ago
parent 61504f4d1e
commit 632791ad7e
  1. 3
      Clover/app/src/main/java/org/floens/chan/core/model/Post.java
  2. 3
      Clover/app/src/main/java/org/floens/chan/core/net/ChanReaderRequest.java
  3. 8
      Clover/app/src/main/java/org/floens/chan/ui/view/PostView.java
  4. 2
      Clover/app/src/main/res/values/strings.xml

@ -68,6 +68,7 @@ public class Post {
public boolean isSavedReply = false;
public String title = "";
public int fileSize;
public int images = -1;
/**
* This post replies to the these ids
@ -123,7 +124,7 @@ public class Post {
isOP = resto == 0;
if (isOP && replies < 0)
if (isOP && (replies < 0 || images < 0))
return false;
if (ext != null) {

@ -285,6 +285,9 @@ public class ChanReaderRequest extends JsonReaderRequest<List<Post>> {
case "capcode":
post.capcode = reader.nextString();
break;
case "images":
post.images = reader.nextInt();
break;
default:
// Unknown/ignored key
// log("Unknown/ignored key: " + key + ".");

@ -214,6 +214,14 @@ public class PostView extends LinearLayout implements View.OnClickListener, View
text = count + " " + context.getString(R.string.one_reply);
}
if (manager.getLoadable().isBoardMode() && post.images > 0) {
if (post.images > 1) {
text += ", " + post.images + " " + context.getString(R.string.multiple_images);
} else {
text += ", " + post.images + " " + context.getString(R.string.one_image);
}
}
if (manager.getLoadable().isThreadMode()) {
repliesCountView.setOnClickListener(new View.OnClickListener() {
@Override

@ -74,6 +74,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<string name="one_reply">reply</string>
<string name="multiple_replies">replies</string>
<string name="one_image">image</string>
<string name="multiple_images">images</string>
<string name="post_replies_back">Back</string>
<string name="post_replies_close">Close</string>
<string name="post_info">Info</string>

Loading…
Cancel
Save