From 034e14235e987b30d0ebc181b2d24c632035c453 Mon Sep 17 00:00:00 2001 From: Renard Date: Mon, 25 Apr 2016 20:48:52 -0300 Subject: v1.7 --- .../baiparser/structure/Board.java | 15 +++++++- .../baiparser/structure/BoardItem.java | 43 ++++++++++++++++++---- .../baiparser/structure/ReplyID.java | 10 ++++- 3 files changed, 58 insertions(+), 10 deletions(-) (limited to 'app/src/main/java/org/bienvenidoainternet/baiparser/structure') diff --git a/app/src/main/java/org/bienvenidoainternet/baiparser/structure/Board.java b/app/src/main/java/org/bienvenidoainternet/baiparser/structure/Board.java index cb95e63..536f476 100644 --- a/app/src/main/java/org/bienvenidoainternet/baiparser/structure/Board.java +++ b/app/src/main/java/org/bienvenidoainternet/baiparser/structure/Board.java @@ -24,16 +24,28 @@ import android.os.Parcelable; public class Board implements Parcelable{ private String boardName, boardDir; private int boardType; - public Board(String boardName,String boardDir,int boardType){ + + public boolean isCanAttachFiles() { + return canAttachFiles; + } + + public void setCanAttachFiles(boolean canAttachFiles) { + this.canAttachFiles = canAttachFiles; + } + + private boolean canAttachFiles; + public Board(String boardName, String boardDir, int boardType, boolean canAttachFiles){ this.boardName = boardName; this.boardDir = boardDir; this.boardType = boardType; + this.canAttachFiles = canAttachFiles; } public Board(Parcel in){ this.boardName = in.readString(); this.boardDir = in.readString(); this.boardType = in.readInt(); + this.canAttachFiles = in.readByte() != 0; } public String getBoardDir() { @@ -70,5 +82,6 @@ public class Board implements Parcelable{ dest.writeString(boardName); dest.writeString(boardDir); dest.writeInt(boardType); + dest.writeByte((byte)(canAttachFiles ? 1 : 0)); } } diff --git a/app/src/main/java/org/bienvenidoainternet/baiparser/structure/BoardItem.java b/app/src/main/java/org/bienvenidoainternet/baiparser/structure/BoardItem.java index b21d598..8eb55e5 100644 --- a/app/src/main/java/org/bienvenidoainternet/baiparser/structure/BoardItem.java +++ b/app/src/main/java/org/bienvenidoainternet/baiparser/structure/BoardItem.java @@ -3,6 +3,12 @@ package org.bienvenidoainternet.baiparser.structure; import android.graphics.Bitmap; import android.os.Parcel; import android.os.Parcelable; +import android.util.Log; + +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.parser.Tag; /** * BaiApp - Bienvenido a internet Android Application @@ -31,12 +37,13 @@ public class BoardItem implements Parcelable { private String message = ""; private String subject = ""; private String posterId = ""; - private int parentid, id, idcolor, totalreplies = 0, totalfiles, thumb_height, thumb_weight, filesize, deleted_code, bbs_id = 1, parentPostCount; + public String youtubeURL = "", youtubeID = ""; + private int parentid = 0, id = 0, idcolor, totalreplies = 0, totalfiles, thumb_height, thumb_weight, filesize, deleted_code, bbs_id = 1, parentPostCount; private long timestamp = 0; private Bitmap thumbBitmap = null; public boolean downloadingThumb = false; - public boolean isReply = false; + public boolean isReply = false, isLocked = false, youtubeLink = false; private Board parentBoard = null; protected BoardItem(Parcel in) { @@ -49,6 +56,8 @@ public class BoardItem implements Parcelable { message = in.readString(); subject = in.readString(); posterId = in.readString(); + youtubeURL = in.readString(); + youtubeID = in.readString(); parentid = in.readInt(); id = in.readInt(); idcolor = in.readInt(); @@ -64,6 +73,8 @@ public class BoardItem implements Parcelable { thumbBitmap = in.readParcelable(Bitmap.class.getClassLoader()); downloadingThumb = in.readByte() != 0; isReply = in.readByte() != 0; + isLocked = in.readByte() != 0; + youtubeLink = in.readByte() != 0; parentBoard = in.readParcelable(Board.class.getClassLoader()); } @@ -124,12 +135,22 @@ public class BoardItem implements Parcelable { } public void setMessage(String message) { - // TODO: Dar formato a los mensajes de otra forma - this.message = message.replace("", ""); - this.message = this.message.replace("", ""); - if (this.message.contains("