From c79b1204f43d8ae914bb4ef59305d4e9c388f060 Mon Sep 17 00:00:00 2001 From: Apostolof Date: Sat, 22 Jul 2017 15:19:20 +0300 Subject: [PATCH] Bookmarks refresh on activity resume, fixed quote, embedded video overlay image and recyclerView bugs. Made activities SingeInstance. --- app/src/main/AndroidManifest.xml | 57 +++++---- .../main/assets/YouTube_light_color_icon.png | Bin 0 -> 13195 bytes .../activities/board/BoardActivity.java | 8 ++ .../mthmmy/activities/topic/Posting.java | 121 +++++++++++++----- .../activities/topic/TopicActivity.java | 4 +- .../mthmmy/activities/topic/TopicAdapter.java | 1 + .../gr/thmmy/mthmmy/base/BaseActivity.java | 30 ++++- .../gr/thmmy/mthmmy/utils/ParseHelpers.java | 2 +- 8 files changed, 156 insertions(+), 67 deletions(-) create mode 100644 app/src/main/assets/YouTube_light_color_icon.png diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8a57fcbc..8e78f4e6 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,12 +1,12 @@ + package="gr.thmmy.mthmmy" + android:installLocation="auto"> - - - - + + + + - + - + - + - - + + + android:scheme="http" /> + android:scheme="http" /> + android:scheme="https" /> + android:scheme="https" /> - + + android:windowSoftInputMode="adjustPan" /> + android:value=".activities.main.MainActivity" /> + android:value=".activities.main.MainActivity" /> + android:theme="@style/AppTheme.NoActionBar" /> + android:value=".activities.main.MainActivity" /> + android:value=".activities.main.MainActivity" /> + android:value=".activities.main.MainActivity" /> + android:resource="@xml/provider_paths" /> + android:exported="false" /> - - + + diff --git a/app/src/main/assets/YouTube_light_color_icon.png b/app/src/main/assets/YouTube_light_color_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..bfd6db39af520e36914c67a9bb9d0b151f3178cd GIT binary patch literal 13195 zcmaKTc_7r?7x$fE2uTYm6i*9E;t`Q`S|lxKkwWMxDJpB(%{P)K6+&8U(}Fg%35A)c zY!xMG5o60z*<~>1`<^?g-}C%_@B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~rb=>GvEk(bK= literal 0 HcmV?d00001 diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java index 565b587a..633ab6ec 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java @@ -8,6 +8,7 @@ import android.support.v7.widget.DividerItemDecoration; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; +import android.util.Log; import android.view.View; import android.widget.ImageButton; import android.widget.ProgressBar; @@ -161,6 +162,13 @@ public class BoardActivity extends BaseActivity implements BoardAdapter.OnLoadMo } } + @Override + public void onResume() { + super.onResume(); + Log.d("Boardaa", "onResume called!"); + refreshBoardBookmark((ImageButton) findViewById(R.id.bookmark)); + } + @Override public void onDestroy() { super.onDestroy(); diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/Posting.java b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/Posting.java index f0220f82..3fe99911 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/Posting.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/Posting.java @@ -1,5 +1,7 @@ package gr.thmmy.mthmmy.activities.topic; +import android.util.Log; + import org.jsoup.Jsoup; import org.jsoup.nodes.Document; @@ -11,11 +13,52 @@ import java.util.regex.Matcher; import okhttp3.Response; import timber.log.Timber; +/** + * This is a utility class containing a collection of static methods to help with topic replying. + */ class Posting { + /** + * {@link REPLY_STATUS} enum defines the different possible outcomes of a topic reply request. + */ enum REPLY_STATUS { - SUCCESSFUL, NO_SUBJECT, EMPTY_BODY, NEW_REPLY_WHILE_POSTING, NOT_FOUND, SESSION_ENDED, OTHER_ERROR + /** + * The request was successful + */ + SUCCESSFUL, + /** + * Request was lacking a subject + */ + NO_SUBJECT, + /** + * Request had empty body + */ + EMPTY_BODY, + /** + * There were new topic replies while making the request + */ + NEW_REPLY_WHILE_POSTING, + /** + * Error 404, page was not found + */ + NOT_FOUND, + /** + * User session ended while posting the reply + */ + SESSION_ENDED, + /** + * Other undefined of unidentified error + */ + OTHER_ERROR } + /** + * This method can be used to check whether a topic post request was successful or not and if + * not maybe get the reason why. + * + * @param response {@link okhttp3.Response} of the request + * @return a {@link REPLY_STATUS} that describes the response status + * @throws IOException method relies to {@link org.jsoup.Jsoup#parse(String)} + */ static REPLY_STATUS replyStatus(Response response) throws IOException { if (response.code() == 404) return REPLY_STATUS.NOT_FOUND; if (response.code() < 200 || response.code() >= 400) return REPLY_STATUS.OTHER_ERROR; @@ -44,10 +87,19 @@ class Posting { return REPLY_STATUS.SUCCESSFUL; } + /** + * This is a fucked up method.. Just don't waste your time here unless you have suicidal + * tendencies. + * + * @param html the html string to be transformed to BBcode + * @return the BBcode string + */ static String htmlToBBcode(String html) { + Log.d("Cancer", html); Map bbMap = new HashMap<>(); Map smileysMap1 = new HashMap<>(); Map smileysMap2 = new HashMap<>(); + smileysMap1.put("Smiley", ":)"); smileysMap1.put("Wink", ";)"); smileysMap1.put("Cheesy", ":D"); @@ -170,64 +222,66 @@ class Posting { //html stuff on the beginning bbMap.put("\n ", ""); //quotes and code headers - bbMap.put("\n\\s+?

\n (.+?)\n
", ""); - bbMap.put("\n\\s+?
\n (.+?)\n
", ""); - bbMap.put("\n\\s+?
\n (.+?)\n
", ""); - bbMap.put("
", "\n"); + bbMap.put("\\s*?
(.*?(\\n))*?.*?<\\/div>", ""); + bbMap.put("\\s*?
(.*?(\\n))+?.*?<\\/div>", ""); + bbMap.put("\\s*?
(.*?(\\n))+?.*?<\\/div>", ""); + bbMap.put("
", "\\\n"); + //Non-breaking space + bbMap.put(" ", " "); //bold - bbMap.put("\n\\s+?(.+?)", "\\[b\\]$1\\[/b\\]"); + bbMap.put("\\s*?([\\S\\s]+?)<\\/b>", "\\[b\\]$1\\[/b\\]"); //italics - bbMap.put("\n\\s+?(.+?)", "\\[i\\]$1\\[/i\\]"); + bbMap.put("\\s*?([\\S\\s]+?)<\\/i>", "\\[i\\]$1\\[/i\\]"); //underline - bbMap.put("\n\\s+?(.+?)", "\\[u\\]$1\\[/u\\]"); + bbMap.put("\\s*?([\\S\\s]+?)<\\/span>", "\\[u\\]$1\\[/u\\]"); //deleted - bbMap.put("\n\\s+?(.+?)", "\\[s\\]$1\\[/s\\]"); + bbMap.put("\\s*?([\\S\\s]+?)<\\/del>", "\\[s\\]$1\\[/s\\]"); //text color - bbMap.put("\n\\s+?(.+?)", "\\[color=$1\\]$2\\[/color\\]"); + bbMap.put("\\s*?([\\S\\s]+?)<\\/span>", "\\[color=$1\\]$2\\[/color\\]"); //glow - bbMap.put("\n\\s+?(.+?)", "\\[glow=$1,2,300\\]$2\\[/glow\\]"); + bbMap.put("\\s*?([\\S\\s]+?)<\\/span>", "\\[glow=$1,2,300\\]$2\\[/glow\\]"); //shadow - bbMap.put("\n\\s+?(.+?)", "\\[shadow=$1,$2\\]$3\\[/shadow\\]"); + bbMap.put("\\s*?([\\S\\s]+?)<\\/span>", "\\[shadow=$1,$2\\]$3\\[/shadow\\]"); //running text - bbMap.put("\\s+?\n (.+?)\n ", "\\[move\\]$1\\[/move\\]"); + bbMap.put("\\s*?\n ([\\S\\s]+?)\n <\\/marquee>", "\\[move\\]$1\\[/move\\]"); //alignment - bbMap.put("\n\\s+?
\n (.+?)\n
", "\\[center\\]$1\\[/center\\]"); - bbMap.put("\n\\s+?
\n (.+?)\n
", "\\[$1\\]$2\\[/$1\\]"); + bbMap.put("\\s*?
\n ([\\S\\s]+?)\n <\\/div>", "\\[center\\]$1\\[/center\\]"); + bbMap.put("\\s*?
\n ([\\S\\s]+?)\n <\\/div>", "\\[$1\\]$2\\[/$1\\]"); //preformated - bbMap.put("\n\\s+?
(.+?)
", "\\[pre\\]$1\\[/pre\\]"); + bbMap.put("\\s*?
([\\S\\s]+?)<\\/pre>", "\\[pre\\]$1\\[/pre\\]");
         //horizontal rule
-        bbMap.put("\n\\s+?
", "\\[hr\\]"); + bbMap.put("\\s*?
", "\\[hr\\]"); //resize - bbMap.put("\n\\s+?(.+?)", "\\[size=$1\\]$3\\[/size\\]"); + bbMap.put("\\s*?([\\S\\s]+?)<\\/span>", "\\[size=$1\\]$3\\[/size\\]"); //font - bbMap.put("\n\\s+?(.+?)", "\\[font=$1\\]$2\\[/font\\]"); + bbMap.put("\\s*?([\\S\\s]+?)<\\/span>", "\\[font=$1\\]$2\\[/font\\]"); //lists - bbMap.put("\\s+
  • (.+?)
  • ", "\\[li\\]$1\\[/li\\]"); - bbMap.put("\n\\s+
      ([\\S\\s]+?)\n\\s+
    ", + bbMap.put("\\s+
  • (.+?)<\\/li>", "\\[li\\]$1\\[/li\\]"); + bbMap.put("\n\\s+
      ([\\S\\s]+?)\n\\s+<\\/ul>", "\\[list\\]\n$1\n\\[/list\\]"); //latex code - bbMap.put("\n\\s+?", "\\[tex\\]$1\\[/tex\\]"); + bbMap.put("\\s*?", "\\[tex\\]$1\\[/tex\\]"); //code - bbMap.put("\n\\s+?
      \n (.+?)\n
      ", "\\[code\\]$1\\[/code\\]"); + bbMap.put("\\s*?
      ((.*?(\\n))+?.*?)<\\/div>", "\\[code\\]$1\\[/code\\]"); //teletype - bbMap.put("\n\\s+?(.+?)", "\\[tt\\]$1\\[/tt\\]"); + bbMap.put("\\s*?([\\S\\s]+?)<\\/tt>", "\\[tt\\]$1\\[/tt\\]"); //superscript/subscript - bbMap.put("\n\\s+?(.+?)", "\\[sub\\]$1\\[/sub\\]"); - bbMap.put("\n\\s+?(.+?)", "\\[sup\\]$1\\[/sup\\]"); + bbMap.put("\\s*?([\\S\\s]+?)<\\/sub>", "\\[sub\\]$1\\[/sub\\]"); + bbMap.put("\\s*?([\\S\\s]+?)<\\/sup>", "\\[sup\\]$1\\[/sup\\]"); //tables - bbMap.put("\\s+?([\\S\\s]+?)", "\\[td\\]$1\\[/td\\]"); - bbMap.put("([\\S\\s]+?)\n ", "\\[tr\\]$1\\[/tr\\]"); - bbMap.put("\n\\s+?\n \n ([\\S\\s]+?)\n \n
      " + bbMap.put("\\s*?([\\S\\s]+?)<\\/td>", "\\[td\\]$1\\[/td\\]"); + bbMap.put("([\\S\\s]+?)\n <\\/tr>", "\\[tr\\]$1\\[/tr\\]"); + bbMap.put("\\s*?\n \n ([\\S\\s]+?)\n <\\/tbody>\n <\\/table>" , "\\[table\\]$2\\[/table\\]"); //videos - bbMap.put("\n\\s+?
      \n", + bbMap.put("\\s*?
      .+?watch\\?v=(.+?)\"((.|\\n)*?)/div>\n", "[youtube]https://www.youtube.com/watch?v=$1[/youtube]"); //ftp - bbMap.put("([\\S\\s]+?)", "\\[fpt=ftp:$1\\]$2\\[/ftp\\]"); + bbMap.put("([\\S\\s]+?)<\\/a>", "\\[fpt=ftp:$1\\]$2\\[/ftp\\]"); //mailto - bbMap.put("\n\\s+?([\\S\\s]+?)", "\\[email\\]$2\\[/email\\]"); + bbMap.put("\\s*?([\\S\\s]+?)<\\/a>", "\\[email\\]$2\\[/email\\]"); //links - bbMap.put("\n\\s+?([\\S\\s]+?)", "\\[url=$1\\]$2\\[/url\\]"); + bbMap.put("\\s*?([\\S\\s]+?)", "\\[url=$1\\]$2\\[/url\\]"); //smileys for (Map.Entry entry : smileysMap1.entrySet()) { bbMap.put("\n \""", "\\[img height=$2\\]$1\\[/img\\]"); html = html.replaceAll("\\s+", "\\[img\\]$1\\[/img\\]"); + Log.d("Cancer", html); return html; } } diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java index 8cb77d90..5c170204 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java @@ -226,6 +226,7 @@ public class TopicActivity extends BaseActivity { // Inflates the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.topic_menu, menu); setTopicBookmark(menu.getItem(0)); + super.onCreateOptionsMenu(menu); return true; } @@ -269,8 +270,9 @@ public class TopicActivity extends BaseActivity { @Override protected void onResume() { - drawer.setSelection(-1); super.onResume(); + refreshTopicBookmark(); + drawer.setSelection(-1); } @Override diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java index b37ec5e4..aa17b311 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java @@ -181,6 +181,7 @@ class TopicAdapter extends RecyclerView.Adapter { //Post's WebView parameters holder.post.setClickable(true); holder.post.setWebViewClient(new LinkLauncher()); + holder.post.setLayerType(View.LAYER_TYPE_SOFTWARE, null); //Avoids errors about layout having 0 width/height holder.thumbnail.setMinimumWidth(1); diff --git a/app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java b/app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java index f43d603f..f844573d 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java @@ -337,7 +337,7 @@ public abstract class BaseActivity extends AppCompatActivity { drawer = drawerBuilder.build(); - if(!(BaseActivity.this instanceof MainActivity)) + if (!(BaseActivity.this instanceof MainActivity)) drawer.getActionBarDrawerToggle().setDrawerIndicatorEnabled(false); drawer.setOnDrawerNavigationListener(new Drawer.OnDrawerNavigationListener() { @@ -396,7 +396,7 @@ public abstract class BaseActivity extends AppCompatActivity { protected void onPostExecute(Integer result) { Toast.makeText(getBaseContext(), "Logged out successfully!", Toast.LENGTH_LONG).show(); updateDrawer(); - if(mainActivity!=null) + if (mainActivity != null) mainActivity.updateTabs(); progressDialog.dismiss(); } @@ -422,6 +422,18 @@ public abstract class BaseActivity extends AppCompatActivity { } } + protected void refreshTopicBookmark() { + if (thisPageBookmarkMenuButton == null) { + return; + } + loadSavedBookmarks(); + if (thisPageBookmark.matchExists(topicsBookmarked)) { + thisPageBookmarkMenuButton.setIcon(bookmarked); + } else { + thisPageBookmarkMenuButton.setIcon(notBookmarked); + } + } + protected void topicMenuBookmarkClick() { if (thisPageBookmark.matchExists(topicsBookmarked)) { thisPageBookmarkMenuButton.setIcon(notBookmarked); @@ -455,6 +467,17 @@ public abstract class BaseActivity extends AppCompatActivity { }); } + protected void refreshBoardBookmark(final ImageButton thisPageBookmarkImageButton) { + if (thisPageBookmarkImageButton == null) + return; + loadSavedBookmarks(); + if (thisPageBookmark.matchExists(boardsBookmarked)) { + thisPageBookmarkImageButton.setImageDrawable(bookmarked); + } else { + thisPageBookmarkImageButton.setImageDrawable(notBookmarked); + } + } + private void loadSavedBookmarks() { String tmpString = bookmarksFile.getString(BOOKMARKED_TOPICS_KEY, null); if (tmpString != null) @@ -568,8 +591,7 @@ public abstract class BaseActivity extends AppCompatActivity { } //----------------------------------MISC---------------------- - protected void setMainActivity(MainActivity mainActivity) - { + protected void setMainActivity(MainActivity mainActivity) { this.mainActivity = mainActivity; } diff --git a/app/src/main/java/gr/thmmy/mthmmy/utils/ParseHelpers.java b/app/src/main/java/gr/thmmy/mthmmy/utils/ParseHelpers.java index 75a9fa72..a2e80cca 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/utils/ParseHelpers.java +++ b/app/src/main/java/gr/thmmy/mthmmy/utils/ParseHelpers.java @@ -156,7 +156,7 @@ public class ParseHelpers { + "" + "" + + "src=\"YouTube_light_color_icon.png\">" + "" + "