Browse Source

Reformat code/ apply styling

pull/71/merge
Ezerous 4 years ago
parent
commit
f7969dd600
  1. 15
      app/build.gradle
  2. 38
      app/src/main/assets/apache_libraries.html
  3. 3
      app/src/main/assets/epl_libraries.html
  4. 9
      app/src/main/assets/mit_libraries.html
  5. 3
      app/src/main/java/gr/thmmy/mthmmy/activities/AboutActivity.java
  6. 9
      app/src/main/java/gr/thmmy/mthmmy/activities/LoginActivity.java
  7. 9
      app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java
  8. 39
      app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java
  9. 4
      app/src/main/java/gr/thmmy/mthmmy/activities/bookmarks/BookmarksFragment.java
  10. 7
      app/src/main/java/gr/thmmy/mthmmy/activities/create_content/CreateContentActivity.java
  11. 1
      app/src/main/java/gr/thmmy/mthmmy/activities/create_content/NewTopicTask.java
  12. 18
      app/src/main/java/gr/thmmy/mthmmy/activities/downloads/DownloadsActivity.java
  13. 21
      app/src/main/java/gr/thmmy/mthmmy/activities/downloads/DownloadsAdapter.java
  14. 18
      app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java
  15. 15
      app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java
  16. 3
      app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java
  17. 12
      app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java
  18. 3
      app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadAdapter.java
  19. 14
      app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java
  20. 18
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java
  21. 6
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsAdapter.java
  22. 3
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsFragment.java
  23. 12
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/stats/StatsFragment.java
  24. 21
      app/src/main/java/gr/thmmy/mthmmy/activities/settings/SettingsFragment.java
  25. 1
      app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/SendShoutTask.java
  26. 9
      app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/ShoutAdapter.java
  27. 3
      app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/ShoutboxActivity.java
  28. 12
      app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/ShoutboxFragment.java
  29. 72
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java
  30. 112
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java
  31. 39
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicParser.java
  32. 1
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/tasks/EditTask.java
  33. 1
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/tasks/PrepareForEditTask.java
  34. 1
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/tasks/PrepareForReplyTask.java
  35. 1
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/tasks/ReplyTask.java
  36. 4
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/tasks/TopicTask.java
  37. 93
      app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java
  38. 18
      app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadFieldsBuilderActivity.java
  39. 10
      app/src/main/java/gr/thmmy/mthmmy/activities/upload/multipart/MultipartUploadRequest.java
  40. 4
      app/src/main/java/gr/thmmy/mthmmy/activities/upload/multipart/MultipartUploadTask.java
  41. 64
      app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java
  42. 3
      app/src/main/java/gr/thmmy/mthmmy/base/BaseFragment.java
  43. 3
      app/src/main/java/gr/thmmy/mthmmy/model/Poll.java
  44. 2
      app/src/main/java/gr/thmmy/mthmmy/model/Post.java
  45. 7
      app/src/main/java/gr/thmmy/mthmmy/model/ThmmyPage.java
  46. 3
      app/src/main/java/gr/thmmy/mthmmy/services/DownloadHelper.java
  47. 9
      app/src/main/java/gr/thmmy/mthmmy/services/NotificationService.java
  48. 3
      app/src/main/java/gr/thmmy/mthmmy/services/UploadsReceiver.java
  49. 3
      app/src/main/java/gr/thmmy/mthmmy/session/InvalidSessionException.java
  50. 6
      app/src/main/java/gr/thmmy/mthmmy/session/SessionManager.java
  51. 12
      app/src/main/java/gr/thmmy/mthmmy/utils/DateTimeUtils.java
  52. 3
      app/src/main/java/gr/thmmy/mthmmy/utils/ExternalAsyncTask.java
  53. 3
      app/src/main/java/gr/thmmy/mthmmy/utils/FileUtils.java
  54. 12
      app/src/main/java/gr/thmmy/mthmmy/utils/HTMLUtils.java
  55. 6
      app/src/main/java/gr/thmmy/mthmmy/utils/LaunchType.java
  56. 3
      app/src/main/java/gr/thmmy/mthmmy/utils/crashreporting/CrashReporter.java
  57. 1
      app/src/main/java/gr/thmmy/mthmmy/utils/crashreporting/CrashReportingTree.java
  58. 3
      app/src/main/java/gr/thmmy/mthmmy/utils/networking/NetworkTask.java
  59. 3
      app/src/main/java/gr/thmmy/mthmmy/utils/parsing/NewParseTask.java
  60. 3
      app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ParseException.java
  61. 3
      app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ParseHelpers.java
  62. 5
      app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ParseTask.java
  63. 9
      app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ThmmyDateTimeParser.java
  64. 6
      app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ThmmyParser.java
  65. 3
      app/src/main/java/gr/thmmy/mthmmy/utils/ui/ScrollAwareFABBehavior.java
  66. 3
      app/src/main/java/gr/thmmy/mthmmy/utils/ui/ScrollAwareLinearBehavior.java
  67. 3
      app/src/main/java/gr/thmmy/mthmmy/viewmodel/ShoutboxViewModel.java
  68. 24
      app/src/main/java/gr/thmmy/mthmmy/viewmodel/TopicViewModel.java
  69. 10
      app/src/main/java/gr/thmmy/mthmmy/views/RelativeTimeTextView.java
  70. 1
      app/src/main/java/gr/thmmy/mthmmy/views/ToggledBackgroundButton.java
  71. 23
      app/src/main/java/gr/thmmy/mthmmy/views/editorview/EditorView.java
  72. 1
      app/src/main/java/gr/thmmy/mthmmy/views/editorview/EmojiInputField.java
  73. 1
      app/src/main/java/gr/thmmy/mthmmy/views/editorview/FormatButtonsAdapter.java
  74. 4
      app/src/main/java/gr/thmmy/mthmmy/views/editorview/IEmojiKeyboard.java
  75. 13
      app/src/main/res/drawable/ic_access_time_white_24dp.xml
  76. 13
      app/src/main/res/drawable/ic_announcement.xml
  77. 13
      app/src/main/res/drawable/ic_arrow_drop_down_accent_24dp.xml
  78. 13
      app/src/main/res/drawable/ic_arrow_drop_up_accent_24dp.xml
  79. 13
      app/src/main/res/drawable/ic_backspace_black_24dp.xml
  80. 13
      app/src/main/res/drawable/ic_bookmark_false_accent_24dp.xml
  81. 13
      app/src/main/res/drawable/ic_bookmark_true_accent_24dp.xml
  82. 10
      app/src/main/res/drawable/ic_cached_accent_24dp.xml
  83. 10
      app/src/main/res/drawable/ic_cancel_accent_24dp.xml
  84. 13
      app/src/main/res/drawable/ic_code.xml
  85. 15
      app/src/main/res/drawable/ic_default_user_avatar.xml
  86. 15
      app/src/main/res/drawable/ic_default_user_avatar_darker.xml
  87. 13
      app/src/main/res/drawable/ic_delete_accent_24dp.xml
  88. 13
      app/src/main/res/drawable/ic_delete_white_24dp.xml
  89. 13
      app/src/main/res/drawable/ic_edit_white_24dp.xml
  90. 13
      app/src/main/res/drawable/ic_fiber_new_white_24dp.xml
  91. 13
      app/src/main/res/drawable/ic_file_not_found.xml
  92. 13
      app/src/main/res/drawable/ic_file_upload_white_24dp.xml
  93. 13
      app/src/main/res/drawable/ic_format_align_center.xml
  94. 13
      app/src/main/res/drawable/ic_format_align_left.xml
  95. 13
      app/src/main/res/drawable/ic_format_align_right.xml
  96. 15
      app/src/main/res/drawable/ic_format_color_text.xml
  97. 11
      app/src/main/res/drawable/ic_format_italic.xml
  98. 13
      app/src/main/res/drawable/ic_format_list_bulleted.xml
  99. 13
      app/src/main/res/drawable/ic_format_quote.xml
  100. 13
      app/src/main/res/drawable/ic_format_quote_checked_accent_24dp.xml

15
app/build.gradle

@ -57,8 +57,7 @@ tasks.whenTaskAdded { task ->
def json = new JsonSlurper().parseText(googleServicesFile.text)
if (json.project_info.project_id != firebaseReleaseProjectId)
throw new GradleException('Please supply the correct google-services.json for release in app/src/release/ directory!')
}
else
} else
throw new GradleException('Please add the release google-services.json in app/src/release/ directory!')
})
} else if (task.name.contains("assembleDebug")) {
@ -68,8 +67,7 @@ tasks.whenTaskAdded { task ->
def json = new JsonSlurper().parseText(googleServicesFile.text)
if (json.project_info.project_id == firebaseReleaseProjectId)
throw new GradleException('Please replace google-services.json in app/src/debug/ with a debug one!')
}
else
} else
throw new GradleException('Please add a debug google-services.json in app/src/debug/ directory!')
})
}
@ -93,7 +91,8 @@ dependencies {
implementation 'com.google.firebase:firebase-crashlytics:17.1.1'
implementation 'com.google.firebase:firebase-messaging:20.2.4'
implementation 'com.snatik:storage:2.1.0'
implementation ('com.squareup.okhttp3:okhttp:3.12.12') { //TODO: Warning: OkHttp has dropped support for Android 19 since OkHttp 3.13!
implementation('com.squareup.okhttp3:okhttp:3.12.12') {
//TODO: Warning: OkHttp has dropped support for Android 19 since OkHttp 3.13!
force = true //TODO: Remove when minSdkVersion >= 21
}
implementation 'org.jsoup:jsoup:1.13.1'
@ -109,8 +108,10 @@ dependencies {
implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'ru.noties:markwon:2.0.2'
implementation 'net.gotev:uploadservice:3.5.2'
implementation 'net.gotev:uploadservice-okhttp:3.4.2' //TODO: Warning: v.3.5 depends on okhttp 3.13!
implementation 'com.itkacher.okhttpprofiler:okhttpprofiler:1.0.7' //Plugin: https://plugins.jetbrains.com/plugin/11249-okhttp-profiler
implementation 'net.gotev:uploadservice-okhttp:3.4.2'
//TODO: Warning: v.3.5 depends on okhttp 3.13!
implementation 'com.itkacher.okhttpprofiler:okhttpprofiler:1.0.7'
//Plugin: https://plugins.jetbrains.com/plugin/11249-okhttp-profiler
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
testImplementation 'junit:junit:4.12'

38
app/src/main/assets/apache_libraries.html

@ -6,40 +6,53 @@
<body>
<ul>
<li>
<h5><a href="https://square.github.io/okhttp/">OkHttp</a>&nbsp;v3.12.12 (Copyright ©2019 Square, Inc.)</h5>
<h5><a href="https://square.github.io/okhttp/">OkHttp</a>&nbsp;v3.12.12 (Copyright ©2019
Square, Inc.)</h5>
</li>
<li>
<h5><a href="https://github.com/franmontiel/PersistentCookieJar">PersistentCookieJar</a>&nbsp;v1.0.1 (Copyright ©2016 Francisco José Montiel Navarro)</h5>
<h5><a href="https://github.com/franmontiel/PersistentCookieJar">PersistentCookieJar</a>&nbsp;v1.0.1
(Copyright ©2016 Francisco José Montiel Navarro)</h5>
</li>
<li>
<h5><a href="https://github.com/PhilJay/MPAndroidChart">MPAndroidChart</a>&nbsp;v3.0.3 (Copyright ©2018 Philipp Jahoda)</h5>
<h5><a href="https://github.com/PhilJay/MPAndroidChart">MPAndroidChart</a>&nbsp;v3.0.3
(Copyright ©2018 Philipp Jahoda)</h5>
</li>
<li>
<h5><a href="https://github.com/mikepenz/MaterialDrawer">MaterialDrawer</a>&nbsp;v6.1.1 (Copyright ©2018 Mike Penz)</h5>
<h5><a href="https://github.com/mikepenz/MaterialDrawer">MaterialDrawer</a>&nbsp;v6.1.1
(Copyright ©2018 Mike Penz)</h5>
</li>
<li>
<h5><a href="https://github.com/chrisbanes/PhotoView">PhotoView</a>&nbsp;v2.3.0 (Copyright ©2018 Chris Banes)</h5>
<h5><a href="https://github.com/chrisbanes/PhotoView">PhotoView</a>&nbsp;v2.3.0 (Copyright
©2018 Chris Banes)</h5>
</li>
<li>
<h5><a href="https://github.com/mikepenz/Android-Iconics">Android-Iconics</a>&nbsp;v2.9.5 (Copyright ©2016 Mike Penz)</h5>
<h5><a href="https://github.com/mikepenz/Android-Iconics">Android-Iconics</a>&nbsp;v2.9.5
(Copyright ©2016 Mike Penz)</h5>
</li>
<li>
<h5><a href="https://github.com/DreaminginCodeZH/MaterialProgressBar">MaterialProgressBar</a>&nbsp;v1.4.2 (Copyright ©2015 Zhang Hai)</h5>
<h5>
<a href="https://github.com/DreaminginCodeZH/MaterialProgressBar">MaterialProgressBar</a>&nbsp;v1.4.2
(Copyright ©2015 Zhang Hai)</h5>
</li>
<li>
<h5><a href="https://github.com/JakeWharton/timber">Timber</a>&nbsp;v4.7.1 (Copyright ©2013 Jake Wharton)</h5>
<h5><a href="https://github.com/JakeWharton/timber">Timber</a>&nbsp;v4.7.1 (Copyright ©2013
Jake Wharton)</h5>
</li>
<li>
<h5><a href="https://github.com/gotev/android-upload-service">Android Upload Service</a>&nbsp;v3.5.2 (Copyright ©2013-2019 Aleksandar Gotev)</h5>
<h5><a href="https://github.com/gotev/android-upload-service">Android Upload Service</a>&nbsp;v3.5.2
(Copyright ©2013-2019 Aleksandar Gotev)</h5>
</li>
<li>
<h5><a href="https://github.com/noties/Markwon">Markwon</a>&nbsp;v2.0.2 (Copyright ©2017 Dimitry Ivanov)</h5>
<h5><a href="https://github.com/noties/Markwon">Markwon</a>&nbsp;v2.0.2 (Copyright ©2017
Dimitry Ivanov)</h5>
</li>
<li>
<h5><a href="https://github.com/ajoberstar/grgit">Grgit</a>&nbsp;v3.0.0 (Copyright ©2018 Andrew Oberstar)</h5>
<h5><a href="https://github.com/ajoberstar/grgit">Grgit</a>&nbsp;v3.0.0 (Copyright ©2018
Andrew Oberstar)</h5>
</li>
<li>
<h5><a href="https://github.com/JodaOrg/joda-time">Joda-Time</a>&nbsp;v2.10.4 (Copyright ©2002-2019 Joda.org)</h5>
<h5><a href="https://github.com/JodaOrg/joda-time">Joda-Time</a>&nbsp;v2.10.4 (Copyright
©2002-2019 Joda.org)</h5>
</li>
<li>
<h5><a href="https://github.com/powermock/powermock">PowerMock</a>&nbsp;v2.0.2</h5>
@ -53,7 +66,6 @@
</ul>
<pre>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

3
app/src/main/assets/epl_libraries.html

@ -6,7 +6,8 @@
<body>
<ul>
<li>
<h5><a href="https://github.com/junit-team/junit4">JUnit</a>&nbsp;v4.12 (Copyright © 2002-2019, JUnit)</h5>
<h5><a href="https://github.com/junit-team/junit4">JUnit</a>&nbsp;v4.12 (Copyright ©
2002-2019, JUnit)</h5>
</li>
</ul>

9
app/src/main/assets/mit_libraries.html

@ -6,13 +6,16 @@
<body>
<ul>
<li>
<h5><a href="https://jsoup.org">jsoup</a>&nbsp;v1.13.1 (Copyright ©2009-2020, Jonathan Hedley &lt;jonathan@hedley.net&gt;)</h5>
<h5><a href="https://jsoup.org">jsoup</a>&nbsp;v1.13.1 (Copyright ©2009-2020, Jonathan
Hedley &lt;jonathan@hedley.net&gt;)</h5>
</li>
<li>
<h5><a href="https://github.com/bignerdranch/expandable-recycler-view">Expandable RecyclerView</a>&nbsp;v3.0.0-RC1 (Copyright ©2015, Big Nerd Ranch)</h5>
<h5><a href="https://github.com/bignerdranch/expandable-recycler-view">Expandable
RecyclerView</a>&nbsp;v3.0.0-RC1 (Copyright ©2015, Big Nerd Ranch)</h5>
</li>
<li>
<h5><a href="https://github.com/LachlanMcKee/timber-junit-rule">Timber JUnit-Rule</a>&nbsp;v1.0.1 (Copyright ©2017, Lachlan McKee)</h5>
<h5><a href="https://github.com/LachlanMcKee/timber-junit-rule">Timber JUnit-Rule</a>&nbsp;v1.0.1
(Copyright ©2017, Lachlan McKee)</h5>
</li>
</ul>

3
app/src/main/java/gr/thmmy/mthmmy/activities/AboutActivity.java

@ -89,7 +89,8 @@ public class AboutActivity extends BaseActivity {
showEasterEgg();
mVersionLastPressedTime = System.currentTimeMillis();
++mVersionPressedCounter;
} else {
}
else {
mVersionLastPressedTime = System.currentTimeMillis();
mVersionPressedCounter = 0;
}

9
app/src/main/java/gr/thmmy/mthmmy/activities/LoginActivity.java

@ -117,7 +117,8 @@ public class LoginActivity extends BaseActivity {
inputUsername.setError("Enter a valid username");
inputUsername.requestFocus();
valid = false;
} else {
}
else {
inputUsername.setError(null);
}
@ -126,7 +127,8 @@ public class LoginActivity extends BaseActivity {
if (valid)
inputPassword.requestFocus();
valid = false;
} else {
}
else {
inputPassword.setError(null);
}
@ -173,7 +175,8 @@ public class LoginActivity extends BaseActivity {
if (initialRedirect) {
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
startActivity(intent);
} else
}
else
onBackPressed();
finish();

9
app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java

@ -116,7 +116,8 @@ public class BoardActivity extends BaseActivity implements BoardAdapter.OnLoadMo
intent.putExtra(CreateContentActivity.EXTRA_NEW_TOPIC_URL, newTopicUrl);
startActivity(intent);
}
} else {
}
else {
new AlertDialog.Builder(BoardActivity.this)
.setMessage("You need to be logged in to create a new topic!")
.setPositiveButton("Login", (dialogInterface, i) -> {
@ -281,11 +282,13 @@ public class BoardActivity extends BaseActivity implements BoardAdapter.OnLoadMo
break;
}
} else if (pLastPost.contains("redirected clicks")||pLastPost.contains("N/A"))
}
else if (pLastPost.contains("redirected clicks") || pLastPost.contains("N/A"))
pLastPost = "";
else
pLastPost = "No posts yet";
} else {
}
else {
pUrl = subBoardCol.select("a").first().attr("href");
pTitle = subBoardCol.select("a").first().text();
if (subBoardCol.select("div.smalltext").first() != null)

39
app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java

@ -59,7 +59,8 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
if (position <= parsedSubBoards.size()) {
if (position == 0) return VIEW_TYPE_SUB_BOARD_TITLE;
return VIEW_TYPE_SUB_BOARD;
} else if (position <= parsedSubBoards.size() + parsedTopics.size() + 1) {
}
else if (position <= parsedSubBoards.size() + parsedTopics.size() + 1) {
if (position == parsedSubBoards.size() + 1) return VIEW_TYPE_TOPIC_TITLE;
if (parsedTopics.get(position - parsedSubBoards.size() - 1 - 1) != null)
return VIEW_TYPE_TOPIC;
@ -79,7 +80,8 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
subBoardTitle.setBackgroundColor(context.getColor(R.color.background_light));
subBoardTitle.setTextColor(context.getColor(R.color.accent));
} else {
}
else {
//noinspection deprecation
subBoardTitle.setBackgroundColor(context.getResources().getColor(R.color.background_light));
//noinspection deprecation
@ -89,11 +91,13 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
subBoardTitle.setTextSize(20f);
return new TitlesViewHolder(subBoardTitle);
} else if (viewType == VIEW_TYPE_SUB_BOARD) {
}
else if (viewType == VIEW_TYPE_SUB_BOARD) {
View subBoard = LayoutInflater.from(parent.getContext()).
inflate(R.layout.activity_board_sub_board_row, parent, false);
return new SubBoardViewHolder(subBoard);
} else if (viewType == VIEW_TYPE_TOPIC_TITLE) {
}
else if (viewType == VIEW_TYPE_TOPIC_TITLE) {
TextView topicTitle = new TextView(context);
topicTitle.setLayoutParams(new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT
@ -102,7 +106,8 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
topicTitle.setTypeface(topicTitle.getTypeface(), Typeface.BOLD);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
topicTitle.setTextColor(context.getColor(R.color.primary_text));
} else {
}
else {
//noinspection deprecation
topicTitle.setTextColor(context.getResources().getColor(R.color.primary_text));
}
@ -110,11 +115,13 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
topicTitle.setTextSize(20f);
return new TitlesViewHolder(topicTitle);
} else if (viewType == VIEW_TYPE_TOPIC) {
}
else if (viewType == VIEW_TYPE_TOPIC) {
View topic = LayoutInflater.from(parent.getContext()).
inflate(R.layout.activity_board_topic_row, parent, false);
return new TopicViewHolder(topic);
} else if (viewType == VIEW_TYPE_LOADING) {
}
else if (viewType == VIEW_TYPE_LOADING) {
View loading = LayoutInflater.from(parent.getContext()).
inflate(R.layout.recycler_loading_item, parent, false);
return new LoadingViewHolder(loading);
@ -145,7 +152,8 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
if (boardExpandableVisibility.get(subBoardViewHolder.getAdapterPosition() - 1)) {
subBoardViewHolder.boardExpandable.setVisibility(View.VISIBLE);
subBoardViewHolder.showHideExpandable.setImageResource(R.drawable.ic_arrow_drop_up_accent_24dp);
} else {
}
else {
subBoardViewHolder.boardExpandable.setVisibility(View.GONE);
subBoardViewHolder.showHideExpandable.setImageResource(R.drawable.ic_arrow_drop_down_accent_24dp);
}
@ -154,7 +162,8 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
if (visible) {
subBoardViewHolder.boardExpandable.setVisibility(View.GONE);
subBoardViewHolder.showHideExpandable.setImageResource(R.drawable.ic_arrow_drop_down_accent_24dp);
} else {
}
else {
subBoardViewHolder.boardExpandable.setVisibility(View.VISIBLE);
subBoardViewHolder.showHideExpandable.setImageResource(R.drawable.ic_arrow_drop_up_accent_24dp);
}
@ -191,7 +200,8 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
context.startActivity(intent);
});
}
} else if (holder instanceof TopicViewHolder) {
}
else if (holder instanceof TopicViewHolder) {
final Topic topic = parsedTopics.get(position - parsedSubBoards.size() - 1 - 1);
final TopicViewHolder topicViewHolder = (TopicViewHolder) holder;
@ -213,7 +223,8 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
.size() - 2)) {
topicViewHolder.topicExpandable.setVisibility(View.VISIBLE);
topicViewHolder.showHideExpandable.setImageResource(R.drawable.ic_arrow_drop_up_accent_24dp);
} else {
}
else {
topicViewHolder.topicExpandable.setVisibility(View.GONE);
topicViewHolder.showHideExpandable.setImageResource(R.drawable.ic_arrow_drop_down_accent_24dp);
}
@ -223,7 +234,8 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
if (visible) {
topicViewHolder.topicExpandable.setVisibility(View.GONE);
topicViewHolder.showHideExpandable.setImageResource(R.drawable.ic_arrow_drop_down_accent_24dp);
} else {
}
else {
topicViewHolder.topicExpandable.setVisibility(View.VISIBLE);
topicViewHolder.showHideExpandable.setImageResource(R.drawable.ic_arrow_drop_up_accent_24dp);
}
@ -258,7 +270,8 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
context.startActivity(intent);
});
} else if (holder instanceof LoadingViewHolder) {
}
else if (holder instanceof LoadingViewHolder) {
LoadingViewHolder loadingViewHolder = (LoadingViewHolder) holder;
loadingViewHolder.progressBar.setIndeterminate(true);
}

4
app/src/main/java/gr/thmmy/mthmmy/activities/bookmarks/BookmarksFragment.java

@ -23,6 +23,7 @@ import gr.thmmy.mthmmy.model.Bookmark;
//TODO refactor using RecyclerView
public class BookmarksFragment extends Fragment {
enum Type {TOPIC, BOARD}
private static final String ARG_SECTION_NUMBER = "SECTION_NUMBER";
private static final String ARG_BOOKMARKS = "BOOKMARKS";
@ -147,7 +148,8 @@ public class BookmarksFragment extends Fragment {
bookmarksLinearView.addView(row);
}
}
} else
}
else
showNothingBookmarked();
return rootView;

7
app/src/main/java/gr/thmmy/mthmmy/activities/create_content/CreateContentActivity.java

@ -82,11 +82,13 @@ public class CreateContentActivity extends BaseActivity implements NewTopicTask.
}
});
}
@Override
public void onBackPressed() {
if (emojiKeyboard.getVisibility() == View.VISIBLE) {
emojiKeyboard.setVisibility(View.GONE);
} else {
}
else {
super.onBackPressed();
}
}
@ -103,7 +105,8 @@ public class CreateContentActivity extends BaseActivity implements NewTopicTask.
if (success) {
Timber.i("New topic created successfully");
finish();
} else {
}
else {
Timber.w("New topic creation failed");
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Failed to create new topic!", Toast.LENGTH_LONG).show();
finish();

1
app/src/main/java/gr/thmmy/mthmmy/activities/create_content/NewTopicTask.java

@ -96,6 +96,7 @@ public class NewTopicTask extends AsyncTask<String, Void, Boolean> {
public interface NewTopicTaskCallbacks {
void onNewTopicTaskStarted();
void onNewTopicTaskFinished(boolean success);
}
}

18
app/src/main/java/gr/thmmy/mthmmy/activities/downloads/DownloadsActivity.java

@ -81,7 +81,8 @@ public class DownloadsActivity extends BaseActivity implements DownloadsAdapter.
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "An error has occurred\nAborting.", Toast.LENGTH_SHORT).show();
finish();
}
} else downloadsUrl = downloadsIndexUrl;
}
else downloadsUrl = downloadsIndexUrl;
//Initialize toolbar
toolbar = findViewById(R.id.toolbar);
@ -166,7 +167,8 @@ public class DownloadsActivity extends BaseActivity implements DownloadsAdapter.
if (downloadsUrl.contains("tpstart"))
parseDownloadPageTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, downloadsUrl.substring(0
, downloadsUrl.lastIndexOf(";tpstart=")) + ";tpstart=" + pagesLoaded * 10);
else parseDownloadPageTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, downloadsUrl + ";tpstart=" + pagesLoaded * 10);
else
parseDownloadPageTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, downloadsUrl + ";tpstart=" + pagesLoaded * 10);
}
}
@ -237,7 +239,8 @@ public class DownloadsActivity extends BaseActivity implements DownloadsAdapter.
int pageNumber = Integer.parseInt(page.text());
if (pageNumber > numberOfPages) numberOfPages = pageNumber;
}
} else numberOfPages = 1;
}
else numberOfPages = 1;
Elements rows = downloadPage.select("table.tborder>tbody>tr");
if (type == Download.DownloadItemType.DOWNLOADS_CATEGORY) {
@ -253,20 +256,23 @@ public class DownloadsActivity extends BaseActivity implements DownloadsAdapter.
parsedDownloads.add(new Download(type, url, title, subtitle, null,
true, null));
} else {
}
else {
String stats = row.text();
stats = stats.replace(title, "").replace(subtitle, "").trim();
parsedDownloads.add(new Download(type, url, title, subtitle, stats,
false, null));
}
} else {
}
else {
String stats = row.text();
stats = stats.replace(title, "").replace(subtitle, "").trim();
parsedDownloads.add(new Download(type, url, title, subtitle, stats,
false, null));
}
}
} else {
}
else {
download = new Download(type,
rows.select("b>a").first().attr("href"),
rows.select("b>a").first().text(),

21
app/src/main/java/gr/thmmy/mthmmy/activities/downloads/DownloadsAdapter.java

@ -57,7 +57,8 @@ class DownloadsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
View download = LayoutInflater.from(parent.getContext()).
inflate(R.layout.activity_downloads_row, parent, false);
return new DownloadViewHolder(download);
} else if (viewType == VIEW_TYPE_LOADING) {
}
else if (viewType == VIEW_TYPE_LOADING) {
View loading = LayoutInflater.from(parent.getContext()).
inflate(R.layout.recycler_loading_item, parent, false);
return new LoadingViewHolder(loading);
@ -90,7 +91,8 @@ class DownloadsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
if (downloadExpandableVisibility.get(downloadViewHolder.getAdapterPosition())) {
downloadViewHolder.informationExpandable.setVisibility(View.VISIBLE);
downloadViewHolder.informationExpandableBtn.setImageResource(R.drawable.ic_arrow_drop_up_accent_24dp);
} else {
}
else {
downloadViewHolder.informationExpandable.setVisibility(View.GONE);
downloadViewHolder.informationExpandableBtn.setImageResource(R.drawable.ic_arrow_drop_down_accent_24dp);
}
@ -100,7 +102,8 @@ class DownloadsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
if (visible) {
downloadViewHolder.informationExpandable.setVisibility(View.GONE);
downloadViewHolder.informationExpandableBtn.setImageResource(R.drawable.ic_arrow_drop_down_accent_24dp);
} else {
}
else {
downloadViewHolder.informationExpandable.setVisibility(View.VISIBLE);
downloadViewHolder.informationExpandableBtn.setImageResource(R.drawable.ic_arrow_drop_up_accent_24dp);
}
@ -112,12 +115,14 @@ class DownloadsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
String tmp = context.getResources().getString(R.string.fa_folder) + " "
+ download.getTitle();
downloadViewHolder.title.setText(tmp);
} else {
}
else {
String tmp = context.getResources().getString(R.string.fa_file) + " "
+ download.getTitle();
downloadViewHolder.title.setText(tmp);
}
} else {
}
else {
downloadViewHolder.downloadRow.setOnClickListener(view -> {
try {
((BaseActivity) context).downloadFile(new ThmmyFile(
@ -129,7 +134,8 @@ class DownloadsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
downloadViewHolder.upperLinear.setBackgroundColor(context.getResources().getColor(R.color.background, null));
} else {
}
else {
//noinspection deprecation
downloadViewHolder.upperLinear.setBackgroundColor(context.getResources().getColor(R.color.background));
}
@ -148,7 +154,8 @@ class DownloadsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
if (tmp != null && !Objects.equals(tmp, ""))
downloadViewHolder.uploaderDate.setText(tmp);
else downloadViewHolder.uploaderDate.setVisibility(View.GONE);
} else if (holder instanceof LoadingViewHolder) {
}
else if (holder instanceof LoadingViewHolder) {
LoadingViewHolder loadingViewHolder = (LoadingViewHolder) holder;
loadingViewHolder.progressBar.setIndeterminate(true);
}

18
app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java

@ -164,7 +164,8 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF
i.putExtra(BUNDLE_TOPIC_TITLE, topicSummary.getSubject());
i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(i);
} else
}
else
Timber.e("onUnreadFragmentInteraction TopicSummary came without a link");
}
@ -256,26 +257,31 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF
redirectIntent.putExtra(BUNDLE_BOARD_URL, uri.toString());
redirectIntent.putExtra(BUNDLE_BOARD_TITLE, "");
startActivity(redirectIntent);
} else if (page.is(ThmmyPage.PageCategory.TOPIC)) {
}
else if (page.is(ThmmyPage.PageCategory.TOPIC)) {
Intent redirectIntent = new Intent(MainActivity.this, TopicActivity.class);
redirectIntent.putExtra(BUNDLE_TOPIC_URL, uri.toString());
redirectIntent.putExtra(BUNDLE_TOPIC_TITLE, "");
startActivity(redirectIntent);
} else if (page.is(ThmmyPage.PageCategory.PROFILE)) {
}
else if (page.is(ThmmyPage.PageCategory.PROFILE)) {
Intent redirectIntent = new Intent(MainActivity.this, ProfileActivity.class);
redirectIntent.putExtra(BUNDLE_PROFILE_URL, uri.toString());
redirectIntent.putExtra(BUNDLE_PROFILE_THUMBNAIL_URL, "");
redirectIntent.putExtra(BUNDLE_PROFILE_USERNAME, "");
startActivity(redirectIntent);
} else if (page.is(ThmmyPage.PageCategory.DOWNLOADS)) {
}
else if (page.is(ThmmyPage.PageCategory.DOWNLOADS)) {
Intent redirectIntent = new Intent(MainActivity.this, DownloadsActivity.class);
redirectIntent.putExtra(BUNDLE_DOWNLOADS_URL, uri.toString());
redirectIntent.putExtra(BUNDLE_DOWNLOADS_TITLE, "");
startActivity(redirectIntent);
} else if (!page.is(ThmmyPage.PageCategory.INDEX)) {
}
else if (!page.is(ThmmyPage.PageCategory.INDEX)) {
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "This thmmy sector is not yet supported.", Toast.LENGTH_LONG).show();
}
} else {
}
else {
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "This is not thmmy.", Toast.LENGTH_LONG).show();
}
}

15
app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java

@ -163,7 +163,8 @@ public class ForumFragment extends BaseFragment {
if (forumTask.isRunning())
forumTask.cancel(true);
} // Yes, it happens even though we checked
catch (NullPointerException ignored){ }
catch (NullPointerException ignored) {
}
}
}
@ -180,9 +181,11 @@ public class ForumFragment extends BaseFragment {
categories.clear();
categories.addAll(fetchedCategories);
forumAdapter.notifyParentDataSetChanged(false);
} else if (resultCode == NetworkResultCodes.NETWORK_ERROR) {
}
else if (resultCode == NetworkResultCodes.NETWORK_ERROR) {
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Network error", Toast.LENGTH_SHORT).show();
} else {
}
else {
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Unexpected error," +
" please contact the developers with the details", Toast.LENGTH_LONG).show();
}
@ -218,13 +221,15 @@ public class ForumFragment extends BaseFragment {
Board board = new Board(boardElement.attr("href"), boardElement.text(), null, null, null, null);
category.getBoards().add(board);
}
} else
}
else
category.setExpanded(false);
fetchedCategories.add(category);
}
return fetchedCategories;
} else
}
else
throw new ParseException("Parsing failed");
}

3
app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java

@ -48,8 +48,7 @@ class RecentAdapter extends RecyclerView.Adapter<RecentAdapter.ViewHolder> {
String timestamp = topicSummary.getLastPostTimestamp();
try {
holder.mDateTimeView.setReferenceTime(Long.valueOf(timestamp));
}
catch(NumberFormatException e){
} catch (NumberFormatException e) {
Timber.e(e, "Invalid number format: %s", timestamp);
holder.mDateTimeView.setText(topicSummary.getLastPostSimplifiedDateTime());
}

12
app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java

@ -54,7 +54,8 @@ public class RecentFragment extends BaseFragment {
private RecentTask recentTask;
// Required empty public constructor
public RecentFragment() {}
public RecentFragment() {
}
/**
* Use ONLY this factory method to create a new instance of
@ -128,7 +129,8 @@ public class RecentFragment extends BaseFragment {
if (recentTask.isRunning())
recentTask.cancel(true);
} // Yes, it happens even though we checked
catch (NullPointerException ignored){ }
catch (NullPointerException ignored) {
}
}
}
@ -146,9 +148,11 @@ public class RecentFragment extends BaseFragment {
topicSummaries.clear();
topicSummaries.addAll(fetchedRecent);
recentAdapter.notifyDataSetChanged();
} else if (resultCode == NetworkResultCodes.NETWORK_ERROR) {
}
else if (resultCode == NetworkResultCodes.NETWORK_ERROR) {
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Network error", Toast.LENGTH_SHORT).show();
} else {
}
else {
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Unexpected error," +
" please contact the developers with the details", Toast.LENGTH_LONG).show();
}

3
app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadAdapter.java

@ -45,8 +45,7 @@ class UnreadAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
String timestamp = topicSummary.getLastPostTimestamp();
try {
viewHolder.mDateTimeView.setReferenceTime(Long.valueOf(timestamp));
}
catch(NumberFormatException e){
} catch (NumberFormatException e) {
Timber.e(e, "Invalid number format: %s", timestamp);
viewHolder.mDateTimeView.setText(topicSummary.getLastPostSimplifiedDateTime());
}

14
app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java

@ -66,7 +66,8 @@ public class UnreadFragment extends BaseFragment {
private MarkAsReadTask markAsReadTask;
// Required empty public constructor
public UnreadFragment() {}
public UnreadFragment() {
}
/**
* Use ONLY this factory method to create a new instance of
@ -145,7 +146,8 @@ public class UnreadFragment extends BaseFragment {
if (markAsReadTask.isRunning())
markAsReadTask.cancel(true);
} // Yes, it happens even though we checked
catch (NullPointerException ignored){ }
catch (NullPointerException ignored) {
}
}
if (topicSummaries != null)
topicSummaries.clear();
@ -161,8 +163,8 @@ public class UnreadFragment extends BaseFragment {
assert SessionManager.unreadUrl != null;
unreadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, SessionManager.unreadUrl.toString());
}
} catch (NullPointerException ignored) {
}
catch (NullPointerException ignored){ }
}
}
@ -172,7 +174,8 @@ public class UnreadFragment extends BaseFragment {
if (unreadTask.isRunning())
unreadTask.cancel(true);
} // Yes, it happens even though we checked
catch (NullPointerException ignored){ }
catch (NullPointerException ignored) {
}
}
}
@ -202,7 +205,8 @@ public class UnreadFragment extends BaseFragment {
markAsReadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
builder.setNegativeButton("Nope", (dialogInterface, i) -> {});
builder.setNegativeButton("Nope", (dialogInterface, i) -> {
});
builder.create().show();
}

18
app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java

@ -185,7 +185,8 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment
if (target.is(ThmmyPage.PageCategory.PROFILE_STATS)) {
profileUrl = profileUrl.substring(0, profileUrl.indexOf(";sa=statPanel"));
tabSelect = 2;
} else if (target.is(ThmmyPage.PageCategory.PROFILE_LATEST_POSTS)) {
}
else if (target.is(ThmmyPage.PageCategory.PROFILE_LATEST_POSTS)) {
profileUrl = profileUrl.substring(0, profileUrl.indexOf(";sa=showPosts"));
tabSelect = 1;
}
@ -292,7 +293,8 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment
Element tmpEl = profilePage.select("td.windowbg:nth-child(2)").first();
if (tmpEl != null) {
personalText = emojiTagToHtml(tmpEl.text().trim());
} else {
}
else {
//Should never get here!
//Something is wrong.
Timber.e("An error occurred while trying to find profile's personal text.");
@ -328,11 +330,13 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment
if (usernameSpan != null) {
if (isOnline) {
usernameView.setTextColor(Color.parseColor("#4CAF50"));
} else {
}
else {
usernameView.setTextColor(Color.GRAY);
}
usernameView.setText(usernameSpan);
} else if (usernameView.getText() != username) usernameView.setText(username);
}
else if (usernameView.getText() != username) usernameView.setText(username);
if (avatarUrl != null && !Objects.equals(avatarUrl, ""))
loadAvatar(false);
else
@ -349,12 +353,14 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment
TabLayout.Tab tab = tabLayout.getTabAt(tabSelect);
if (tab != null) tab.select();
}
} else if (result == NetworkResultCodes.NETWORK_ERROR) {
}
else if (result == NetworkResultCodes.NETWORK_ERROR) {
Timber.w("Network error while excecuting profile activity");
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Network error"
, Toast.LENGTH_LONG).show();
finish();
} else {
}
else {
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Fatal error!\n Aborting..."
, Toast.LENGTH_LONG).show();
finish();

6
app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsAdapter.java

@ -51,10 +51,12 @@ class LatestPostsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
View view = LayoutInflater.from(parent.getContext()).
inflate(R.layout.fragment_profile_latest_posts_row, parent, false);
return new LatestPostViewHolder(view);
} else { // viewType == VIEW_TYPE_EMPTY
}
else { // viewType == VIEW_TYPE_EMPTY
View view = LayoutInflater.from(parent.getContext()).
inflate(R.layout.fragment_profile_latest_posts_empty_message, parent, false);
return new RecyclerView.ViewHolder(view){};
return new RecyclerView.ViewHolder(view) {
};
}
}

3
app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsFragment.java

@ -216,7 +216,8 @@ public class LatestPostsFragment extends BaseFragment {
numberOfPages = Integer.parseInt(page.text());
}
}
} else {
}
else {
Elements rowHeader = row.select("td.middletext");
if (rowHeader.size() != 2)
return false;

12
app/src/main/java/gr/thmmy/mthmmy/activities/profile/stats/StatsFragment.java

@ -227,7 +227,8 @@ public class StatsFragment extends Fragment {
}
private void populateLayout() {
onLoadingListener.onLoadingStats(true);;
onLoadingListener.onLoadingStats(true);
;
((TextView) mainContent.findViewById(R.id.general_statistics_title))
.setText(generalStatisticsTitle);
((TextView) mainContent.findViewById(R.id.general_statistics))
@ -261,7 +262,8 @@ public class StatsFragment extends Fragment {
if (isAdded()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
postingActivityByTimeDataSet.setFillDrawable(getResources().getDrawable(R.drawable.line_chart_gradient, null));
} else
}
else
//noinspection deprecation
postingActivityByTimeDataSet.setFillDrawable(getResources().getDrawable(R.drawable.line_chart_gradient));
}
@ -300,7 +302,8 @@ public class StatsFragment extends Fragment {
if (isAdded()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mostPopularBoardsByPostsDataSet.setColors(getResources().getColor(R.color.accent, null));
} else
}
else
//noinspection deprecation
mostPopularBoardsByPostsDataSet.setColors(getResources().getColor(R.color.accent));
}
@ -341,7 +344,8 @@ public class StatsFragment extends Fragment {
if (isAdded()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mostPopularBoardsByActivityDataSet.setColors(getResources().getColor(R.color.accent, null));
} else
}
else
//noinspection deprecation
mostPopularBoardsByActivityDataSet.setColors(getResources().getColor(R.color.accent));
}

21
app/src/main/java/gr/thmmy/mthmmy/activities/settings/SettingsFragment.java

@ -133,17 +133,20 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Shared
if (existingValue.equals(SILENT_SELECTED)) {
//Selects "Silent"
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, (Uri) null);
} else {
}
else {
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, Uri.parse(existingValue));
}
} else {
}
else {
//No ringtone has been selected, set to the default
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, Settings.System.DEFAULT_NOTIFICATION_URI);
}
startActivityForResult(intent, REQUEST_CODE_ALERT_RINGTONE);
return true;
} else {
}
else {
return super.onPreferenceTreeClick(preference);
}
}
@ -155,11 +158,13 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Shared
SharedPreferences.Editor editor = settingsFile.edit();
if (ringtone != null) {
editor.putString(SELECTED_RINGTONE, ringtone.toString()).apply();
} else {
}
else {
//"Silent" was selected
editor.putString(SELECTED_RINGTONE, SILENT_SELECTED).apply();
}
} else {
}
else {
super.onActivityResult(requestCode, resultCode, data);
}
}
@ -206,14 +211,16 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Shared
BaseApplication.getInstance().setFirebaseCrashlyticsEnabled(false);
displayRestartAppToTakeEffectToast();
}
} else if (key.equals(getString(R.string.pref_privacy_analytics_enable_key))) {
}
else if (key.equals(getString(R.string.pref_privacy_analytics_enable_key))) {
enabled = sharedPreferences.getBoolean(key, false);
BaseApplication.getInstance().setFirebaseAnalyticsEnabled(enabled);
if (enabled)
Timber.i("Analytics collection enabled.");
else
Timber.i("Analytics collection disabled.");
} else if (key.equals(getString(R.string.pref_app_display_relative_time_key))
}
else if (key.equals(getString(R.string.pref_app_display_relative_time_key))
&& BaseApplication.getInstance().isDisplayRelativeTimeEnabled() != sharedPreferences.getBoolean(key, false)) {
displayRestartAppToTakeEffectToast();
}

1
app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/SendShoutTask.java

@ -37,7 +37,6 @@ public class SendShoutTask extends NetworkTask<Void> {
}
@Override
protected Void performTask(Document document, Response response) {
return null;

9
app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/ShoutAdapter.java

@ -59,7 +59,8 @@ public class ShoutAdapter extends CustomRecyclerView.Adapter<ShoutAdapter.ShoutV
public void onBindViewHolder(@NonNull ShoutViewHolder holder, int position) {
Shout currentShout = shouts[position];
holder.author.setText(currentShout.getShouter());
if (currentShout.isMemberOfTheMonth()) holder.author.setTextColor(context.getResources().getColor(R.color.member_of_the_month));
if (currentShout.isMemberOfTheMonth())
holder.author.setTextColor(context.getResources().getColor(R.color.member_of_the_month));
else holder.author.setTextColor(context.getResources().getColor(R.color.accent));
holder.author.setOnClickListener(view -> {
Intent intent = new Intent(context, ProfileActivity.class);
@ -125,7 +126,8 @@ public class ShoutAdapter extends CustomRecyclerView.Adapter<ShoutAdapter.ShoutV
intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
return true;
} else if (target.is(ThmmyPage.PageCategory.BOARD)) {
}
else if (target.is(ThmmyPage.PageCategory.BOARD)) {
Intent intent = new Intent(context, BoardActivity.class);
Bundle extras = new Bundle();
extras.putString(BUNDLE_BOARD_URL, uriString);
@ -134,7 +136,8 @@ public class ShoutAdapter extends CustomRecyclerView.Adapter<ShoutAdapter.ShoutV
intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
return true;
} else if (target.is(ThmmyPage.PageCategory.PROFILE)) {
}
else if (target.is(ThmmyPage.PageCategory.PROFILE)) {
Intent intent = new Intent(context, ProfileActivity.class);
Bundle extras = new Bundle();
extras.putString(BUNDLE_PROFILE_URL, uriString);

3
app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/ShoutboxActivity.java

@ -45,7 +45,8 @@ public class ShoutboxActivity extends BaseActivity {
if (count == 0) {
if (!shoutboxFragment.onBackPressed())
super.onBackPressed();
} else {
}
else {
getSupportFragmentManager().popBackStack();
}
}

12
app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/ShoutboxFragment.java

@ -93,7 +93,8 @@ public class ShoutboxFragment extends Fragment {
if (item.getItemId() == R.id.menu_refresh) {
shoutboxViewModel.loadShoutbox(true);
return true;
} else {
}
else {
return false;
}
}
@ -142,7 +143,8 @@ public class ShoutboxFragment extends Fragment {
BaseApplication.getInstance().logFirebaseAnalyticsEvent("shout", null);
editorView.getEditText().getText().clear();
shoutboxViewModel.loadShoutbox(true);
} else if (resultCode == NetworkResultCodes.NETWORK_ERROR) {
}
else if (resultCode == NetworkResultCodes.NETWORK_ERROR) {
Timber.w("Failed to send shout");
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "NetworkError", Toast.LENGTH_SHORT).show();
}
@ -154,10 +156,12 @@ public class ShoutboxFragment extends Fragment {
shoutboxViewModel.setShoutbox(shoutbox);
if (shoutbox.getShoutSend() != null)
editorView.setVisibility(View.VISIBLE);
} else if (resultCode == NetworkResultCodes.NETWORK_ERROR) {
}
else if (resultCode == NetworkResultCodes.NETWORK_ERROR) {
Timber.w("Failed to retreive shoutbox due to network error");
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "NetworkError", Toast.LENGTH_SHORT).show();
} else {
}
else {
Timber.wtf("Failed to retreive shoutbox due to unknown error");
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Failed to retrieve shoutbox, please contact mthmmy developer team", Toast.LENGTH_LONG).show();
}

72
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java

@ -198,7 +198,8 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
if (!sessionManager.isLoggedIn()) {
replyFAB.hide();
replyFAB.setTag(false);
} else {
}
else {
replyFAB.setOnClickListener(view -> {
if (sessionManager.isLoggedIn())
viewModel.prepareForReply();
@ -279,10 +280,12 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
if (drawer.isDrawerOpen()) {
drawer.closeDrawer();
return;
} else if (emojiKeyboard.getVisibility() == View.VISIBLE) {
}
else if (emojiKeyboard.getVisibility() == View.VISIBLE) {
emojiKeyboard.setVisibility(View.GONE);
return;
} else if (viewModel.isWritingReply()) {
}
else if (viewModel.isWritingReply()) {
// persist reply
SharedPreferences drafts = getSharedPreferences(getString(R.string.pref_topic_drafts_key), MODE_PRIVATE);
Post reply = (Post) topicItems.get(topicItems.size() - 1);
@ -296,7 +299,8 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
replyFAB.setTag(true);
bottomNavBar.setVisibility(View.VISIBLE);
return;
} else if (viewModel.isEditingPost()) {
}
else if (viewModel.isEditingPost()) {
((Post) topicItems.get(viewModel.getPostBeingEditedPosition())).setPostType(Post.TYPE_POST);
topicAdapter.notifyItemChanged(viewModel.getPostBeingEditedPosition());
topicAdapter.setBackButtonHidden();
@ -364,7 +368,8 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
if (autoIncrement) {
viewModel.incrementPageRequestValue(step, false);
repeatUpdateHandler.postDelayed(new RepetitiveUpdater(step), REPEAT_DELAY);
} else if (autoDecrement) {
}
else if (autoDecrement) {
viewModel.decrementPageRequestValue(step, false);
repeatUpdateHandler.postDelayed(new RepetitiveUpdater(step), REPEAT_DELAY);
}
@ -383,19 +388,23 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
previousPage.setEnabled(false);
nextPage.setEnabled(false);
lastPage.setEnabled(false);
} else if (exception == previousPage) {
}
else if (exception == previousPage) {
firstPage.setEnabled(false);
nextPage.setEnabled(false);
lastPage.setEnabled(false);
} else if (exception == nextPage) {
}
else if (exception == nextPage) {
firstPage.setEnabled(false);
previousPage.setEnabled(false);
lastPage.setEnabled(false);
} else if (exception == lastPage) {
}
else if (exception == lastPage) {
firstPage.setEnabled(false);
previousPage.setEnabled(false);
nextPage.setEnabled(false);
} else {
}
else {
paginationEnabled(false);
}
}
@ -406,7 +415,8 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
increment.setOnClickListener(v -> {
if (!autoIncrement && step == LARGE_STEP) {
viewModel.setPageIndicatorIndex(viewModel.getPageCount(), true);
} else if (!autoIncrement) {
}
else if (!autoIncrement) {
viewModel.incrementPageRequestValue(step, true);
}
});
@ -428,11 +438,13 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
rect = new Rect(v.getLeft(), v.getTop(), v.getRight(), v.getBottom());
} else if (rect != null && event.getAction() == MotionEvent.ACTION_UP && autoIncrement) {
}
else if (rect != null && event.getAction() == MotionEvent.ACTION_UP && autoIncrement) {
autoIncrement = false;
paginationEnabled(true);
viewModel.loadPageIndicated();
} else if (rect != null && event.getAction() == MotionEvent.ACTION_MOVE) {
}
else if (rect != null && event.getAction() == MotionEvent.ACTION_MOVE) {
if (!rect.contains(v.getLeft() + (int) event.getX(), v.getTop() + (int) event.getY())) {
autoIncrement = false;
viewModel.setPageIndicatorIndex(viewModel.getCurrentPageIndex(), false);
@ -450,7 +462,8 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
decrement.setOnClickListener(v -> {
if (!autoDecrement && step == LARGE_STEP) {
viewModel.setPageIndicatorIndex(1, true);
} else if (!autoDecrement) {
}
else if (!autoDecrement) {
viewModel.decrementPageRequestValue(step, true);
}
});
@ -472,11 +485,13 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
rect = new Rect(v.getLeft(), v.getTop(), v.getRight(), v.getBottom());
} else if (event.getAction() == MotionEvent.ACTION_UP && autoDecrement) {
}
else if (event.getAction() == MotionEvent.ACTION_UP && autoDecrement) {
autoDecrement = false;
paginationEnabled(true);
viewModel.loadPageIndicated();
} else if (event.getAction() == MotionEvent.ACTION_MOVE) {
}
else if (event.getAction() == MotionEvent.ACTION_MOVE) {
if (rect != null &&
!rect.contains(v.getLeft() + (int) event.getX(), v.getTop() + (int) event.getY())) {
autoIncrement = false;
@ -514,7 +529,8 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
if (resultCode == NetworkResultCodes.SUCCESSFUL) {
Timber.i("Post deleted successfully");
viewModel.reloadPage();
} else {
}
else {
Timber.w("Failed to delete post");
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Delete failed!", Toast.LENGTH_SHORT).show();
}
@ -551,7 +567,8 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
if ((((Post) topicItems.get(topicItems.size() - 1)).getPostNumber() + 1) % 15 == 0) {
Timber.i("Reply was posted in new page. Switching to last page.");
viewModel.loadUrl(ParseHelpers.getBaseURL(viewModel.getTopicUrl()) + "." + 2147483647);
} else {
}
else {
viewModel.reloadPage();
}
break;
@ -621,7 +638,8 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
bottomNavBar.setVisibility(View.VISIBLE);
viewModel.setEditingPost(false);
viewModel.reloadPage();
} else {
}
else {
Timber.i("Post edit unsuccessful");
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Edit failed!", Toast.LENGTH_SHORT).show();
recyclerView.getChildAt(viewModel.getPostBeingEditedPosition()).setAlpha(1);
@ -689,7 +707,8 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
if (replyPageUrl == null) {
replyFAB.hide();
replyFAB.setTag(false);
} else {
}
else {
replyFAB.show();
replyFAB.setTag(true);
}
@ -742,7 +761,8 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
errorTextview.setVisibility(View.GONE);
recyclerView.setVisibility(View.VISIBLE);
});
} else {
}
else {
// a page has already been loaded
viewModel.setPageIndicatorIndex(viewModel.getCurrentPageIndex(), false);
snackbar = Snackbar.make(findViewById(R.id.main_content),
@ -787,7 +807,8 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
replyFAB.hide();
replyFAB.setTag(false);
bottomNavBar.setVisibility(View.GONE);
} else {
}
else {
Timber.i("Prepare for reply unsuccessful");
Snackbar.make(findViewById(R.id.main_content), getString(R.string.generic_network_error), Snackbar.LENGTH_SHORT).show();
}
@ -803,16 +824,19 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
replyFAB.hide();
replyFAB.setTag(false);
bottomNavBar.setVisibility(View.GONE);
} else {
}
else {
Timber.i("Prepare for edit unsuccessful");
Snackbar.make(findViewById(R.id.main_content), getString(R.string.generic_network_error), Snackbar.LENGTH_SHORT).show();
}
});
}
/**This method sets a long click listener on the title of the topic. Once the
/**
* This method sets a long click listener on the title of the topic. Once the
* listener gets triggered, it copies the link url of the topic in the clipboard.
* This method is getting called on the onCreate() of the TopicActivity*/
* This method is getting called on the onCreate() of the TopicActivity
*/
void setToolbarOnLongClickListener(String url) {
toolbar.setOnLongClickListener(view -> {
//Try to set the clipboard text

112
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java

@ -129,7 +129,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.activity_topic_post_row, parent, false);
return new PostViewHolder(itemView);
} else if (viewType == Post.TYPE_QUICK_REPLY) {
}
else if (viewType == Post.TYPE_QUICK_REPLY) {
View view = LayoutInflater.from(parent.getContext()).
inflate(R.layout.activity_topic_quick_reply_row, parent, false);
@ -143,7 +144,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
quickReplyText.requestFocus();
return new QuickReplyViewHolder(view);
} else if (viewType == Post.TYPE_EDIT) {
}
else if (viewType == Post.TYPE_EDIT) {
View view = LayoutInflater.from(parent.getContext()).
inflate(R.layout.activity_topic_edit_row, parent, false);
@ -157,11 +159,13 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
editPostEdittext.requestFocus();
return new EditMessageViewHolder(view);
} else if (viewType == Poll.TYPE_POLL) {
}
else if (viewType == Poll.TYPE_POLL) {
View view = LayoutInflater.from(parent.getContext()).
inflate(R.layout.activity_topic_poll, parent, false);
return new PollViewHolder(view);
} else {
}
else {
throw new IllegalArgumentException("Unknown view type");
}
}
@ -227,7 +231,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
holder.voteChart.setVisibility(View.GONE);
holder.selectedEntry.setVisibility(View.GONE);
holder.optionsLayout.setVisibility(View.VISIBLE);
} else if (poll.getAvailableVoteCount() == 1) {
}
else if (poll.getAvailableVoteCount() == 1) {
// vote single option
RadioGroup radioGroup = new RadioGroup(context);
for (int i = 0; i < entries.length; i++) {
@ -236,7 +241,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
radioButton.setMovementMethod(LinkMovementMethod.getInstance());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
radioButton.setText(Html.fromHtml(entries[i].getEntryName(), Html.FROM_HTML_MODE_LEGACY));
} else
}
else
radioButton.setText(Html.fromHtml(entries[i].getEntryName()));
radioButton.setText(ThmmyParser.html2span(context, entries[i].getEntryName()));
@ -247,7 +253,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
holder.voteChart.setVisibility(View.GONE);
holder.selectedEntry.setVisibility(View.GONE);
holder.optionsLayout.setVisibility(View.VISIBLE);
} else if (poll.isPollResultsHidden()) {
}
else if (poll.isPollResultsHidden()) {
// vote already submitted but results are hidden
Poll.Entry[] entries1 = poll.getEntries();
for (int i = 0; i < entries1.length; i++) {
@ -272,7 +279,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
holder.voteChart.setVisibility(View.GONE);
holder.selectedEntry.setVisibility(View.GONE);
holder.optionsLayout.setVisibility(View.VISIBLE);
} else {
}
else {
// Showing results
holder.optionsLayout.setVisibility(View.GONE);
@ -331,16 +339,19 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
if (poll.getRemoveVoteUrl() != null) {
holder.removeVotesButton.setOnClickListener(v -> viewModel.removeVote());
holder.removeVotesButton.setVisibility(View.VISIBLE);
} else holder.removeVotesButton.setVisibility(View.GONE);
}
else holder.removeVotesButton.setVisibility(View.GONE);
if (poll.getShowVoteResultsUrl() != null) {
holder.showPollResultsButton.setOnClickListener(v -> viewModel.loadUrl(poll.getShowVoteResultsUrl()));
holder.showPollResultsButton.setVisibility(View.VISIBLE);
} else holder.showPollResultsButton.setVisibility(View.GONE);
}
else holder.showPollResultsButton.setVisibility(View.GONE);
if (poll.getShowOptionsUrl() != null) {
holder.hidePollResultsButton.setOnClickListener(v -> viewModel.loadUrl(poll.getShowOptionsUrl()));
holder.hidePollResultsButton.setVisibility(View.VISIBLE);
} else holder.hidePollResultsButton.setVisibility(View.GONE);
}
else holder.hidePollResultsButton.setVisibility(View.GONE);
if (poll.getPollFormUrl() != null) {
holder.submitButton.setOnClickListener(v -> {
if (!viewModel.submitVote(holder.optionsLayout)) {
@ -351,8 +362,10 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
}
});
holder.submitButton.setVisibility(View.VISIBLE);
} else holder.submitButton.setVisibility(View.GONE);
} else {
}
else holder.submitButton.setVisibility(View.GONE);
}
else {
Post currentPost = (Post) topicItems.get(position);
if (currentHolder instanceof PostViewHolder) {
final PostViewHolder holder = (PostViewHolder) currentHolder;
@ -382,7 +395,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
int filesTextColor;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
filesTextColor = context.getResources().getColor(R.color.accent, null);
} else
}
else
filesTextColor = context.getResources().getColor(R.color.accent);
for (final ThmmyFile attachedFile : currentPost.getAttachedFiles()) {
@ -405,7 +419,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
int lastEditTextColor;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
lastEditTextColor = context.getResources().getColor(R.color.white, null);
} else
}
else
lastEditTextColor = context.getResources().getColor(R.color.white);
final TextView lastEdit = new TextView(context);
@ -415,7 +430,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
lastEdit.setPadding(0, 3, 0, 3);
holder.postFooter.addView(lastEdit);
}
} else {
}
else {
holder.bodyFooterDivider.setVisibility(View.GONE);
holder.postFooter.removeAllViews();
}
@ -430,7 +446,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
mNumberOfPosts = currentPost.getNumberOfPosts();
mPersonalText = currentPost.getPersonalText();
mNumberOfStars = currentPost.getNumberOfStars();
} else {
}
else {
mSpecialRank = null;
mRank = null;
mGender = null;
@ -443,27 +460,32 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
if (!Objects.equals(mSpecialRank, "") && mSpecialRank != null) {
holder.specialRank.setText(mSpecialRank);
holder.specialRank.setVisibility(View.VISIBLE);
} else
}
else
holder.specialRank.setVisibility(View.GONE);
if (!Objects.equals(mRank, "") && mRank != null) {
holder.rank.setText(mRank);
holder.rank.setVisibility(View.VISIBLE);
} else
}
else
holder.rank.setVisibility(View.GONE);
if (!Objects.equals(mGender, "") && mGender != null) {
holder.gender.setText(mGender);
holder.gender.setVisibility(View.VISIBLE);
} else
}
else
holder.gender.setVisibility(View.GONE);
if (!Objects.equals(mNumberOfPosts, "") && mNumberOfPosts != null) {
holder.numberOfPosts.setText(mNumberOfPosts);
holder.numberOfPosts.setVisibility(View.VISIBLE);
} else
}
else
holder.numberOfPosts.setVisibility(View.GONE);
if (!Objects.equals(mPersonalText, "") && mPersonalText != null) {
holder.personalText.setText("\"" + mPersonalText + "\"");
holder.personalText.setVisibility(View.VISIBLE);
} else
}
else
holder.personalText.setVisibility(View.GONE);
if (mUserColor != USER_COLOR_YELLOW)
holder.username.setTextColor(mUserColor);
@ -482,25 +504,30 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
holder.stars.setText(usersStars.toString());
holder.stars.setTextColor(mUserColor);
holder.stars.setVisibility(View.VISIBLE);
} else
}
else
holder.stars.setVisibility(View.GONE);
if (currentPost.isUserMentionedInPost()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
holder.cardChildLinear.setBackground(context.getResources().
getDrawable(R.drawable.mention_card, null));
} else
}
else
holder.cardChildLinear.setBackground(context.getResources().
getDrawable(R.drawable.mention_card));
} else if (mUserColor == TopicParser.USER_COLOR_PINK) {
}
else if (mUserColor == TopicParser.USER_COLOR_PINK) {
//Special card for special member of the month!
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
holder.cardChildLinear.setBackground(context.getResources().
getDrawable(R.drawable.member_of_the_month_card, null));
} else
}
else
holder.cardChildLinear.setBackground(context.getResources().
getDrawable(R.drawable.member_of_the_month_card));
} else holder.cardChildLinear.setBackground(null);
}
else holder.cardChildLinear.setBackground(null);
//Avoid's view's visibility recycling
if (!currentPost.isDeleted() && viewModel.isUserExtraInfoVisible(holder.getAdapterPosition())) {
@ -513,7 +540,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
holder.subject.setTextColor(Color.parseColor("#FFFFFF"));
holder.subject.setMaxLines(Integer.MAX_VALUE);
holder.subject.setEllipsize(null);
} else {
}
else {
holder.userExtraInfo.setVisibility(View.GONE);
holder.userExtraInfo.setAlpha(0.0f);
@ -554,7 +582,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
holder.subject, Color.parseColor("#FFFFFF"),
Color.parseColor("#757575"), (LinearLayout) v);
});
} else {
}
else {
holder.header.setOnClickListener(null);
holder.userExtraInfo.setOnClickListener(null);
}
@ -636,7 +665,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
holder.quoteToggle.setImageResource(R.drawable.ic_format_quote_unchecked_24dp);
});
}
} else if (currentHolder instanceof QuickReplyViewHolder) {
}
else if (currentHolder instanceof QuickReplyViewHolder) {
final QuickReplyViewHolder holder = (QuickReplyViewHolder) currentHolder;
Post reply = (Post) topicItems.get(position);
@ -647,7 +677,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
holder.itemView.setEnabled(true);
if (reply.getSubject() != null) {
holder.quickReplySubject.setText(reply.getSubject());
} else {
}
else {
holder.quickReplySubject.setText("Re: " + viewModel.getTopicTitle().getValue());
}
holder.quickReplySubject.setRawInputType(InputType.TYPE_CLASS_TEXT);
@ -700,7 +731,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
backPressHidden = false;
}
holder.quickReplySubject.addTextChangedListener(createTextWatcher(holder, TextWatcherType.SUBJECT));
} else if (currentHolder instanceof EditMessageViewHolder) {
}
else if (currentHolder instanceof EditMessageViewHolder) {
final EditMessageViewHolder holder = (EditMessageViewHolder) currentHolder;
loadAvatar(getSessionManager().getAvatarLink(), holder.thumbnail, holder.itemView.getContext());
@ -749,10 +781,12 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private enum TextWatcherType {
CONTENT, SUBJECT
}
private TextWatcher createTextWatcher(@NonNull final RecyclerView.ViewHolder holder, TextWatcherType type) {
return new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { }
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
@ -767,7 +801,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
}
@Override
public void afterTextChanged(Editable editable) { }
public void afterTextChanged(Editable editable) {
}
};
}
@ -948,7 +983,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
return true;
}
}
} else if ((Objects.equals(uriString, ParseHelpers.getBaseURL(viewModel.getTopicUrl())) &&
}
else if ((Objects.equals(uriString, ParseHelpers.getBaseURL(viewModel.getTopicUrl())) &&
viewModel.getCurrentPageIndex() == 1) ||
Integer.parseInt(uriString.substring(ParseHelpers.getBaseURL(viewModel.getTopicUrl()).length() + 1)) / 15 + 1 ==
viewModel.getCurrentPageIndex()) {
@ -964,7 +1000,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
return true;
} else if (target.is(ThmmyPage.PageCategory.BOARD)) {
}
else if (target.is(ThmmyPage.PageCategory.BOARD)) {
Intent intent = new Intent(context, BoardActivity.class);
Bundle extras = new Bundle();
extras.putString(BUNDLE_BOARD_URL, uriString);
@ -973,7 +1010,8 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
return true;
} else if (target.is(ThmmyPage.PageCategory.PROFILE)) {
}
else if (target.is(ThmmyPage.PageCategory.PROFILE)) {
Intent intent = new Intent(context, ProfileActivity.class);
Bundle extras = new Bundle();
extras.putString(BUNDLE_PROFILE_URL, uriString);

39
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicParser.java

@ -87,7 +87,8 @@ public class TopicParser {
break;
}
}
} else {
}
else {
Elements findCurrentPage = topic.select("td:contains(Pages:)>b");
for (Element item : findCurrentPage) {
@ -125,7 +126,8 @@ public class TopicParser {
returnPages = Integer.parseInt(item.text());
}
}
} else {
}
else {
Elements pages = topic.select("td:contains(Pages:)>a.navPages");
if (pages.size() != 0) {
@ -220,7 +222,8 @@ public class TopicParser {
if (postIndex != null) {
String tmp = postIndex.attr("name");
p_postIndex = Integer.parseInt(tmp.substring(tmp.indexOf("msg") + 3));
} else {
}
else {
postIndex = thisRow.select("div[id^=subject]").first();
if (postIndex == null)
p_postIndex = NO_INDEX;
@ -246,7 +249,8 @@ public class TopicParser {
.first().text();
p_userName = p_userName.substring(0, p_userName.indexOf(" Επισκέπτης"));
p_userColor = USER_COLOR_YELLOW;
} else {
}
else {
p_userName = userName.html();
p_profileURL = userName.attr("href");
}
@ -271,7 +275,8 @@ public class TopicParser {
Element postNum = thisRow.select("div.smalltext:matches(Απάντηση #)").first();
if (postNum == null) { //Topic starter
p_postNum = 0;
} else {
}
else {
String tmp_str = postNum.text().substring(12);
p_postNum = Integer.parseInt(tmp_str.substring(0, tmp_str.indexOf(" στις")));
}
@ -306,7 +311,8 @@ public class TopicParser {
p_attachedFiles.add(new ThmmyFile(attachedUrl, attachedFileName, attachedFileInfo));
}
}
} else {
}
else {
//Finds username
userName = thisRow.select("a[title^=View the profile of]").first();
if (userName == null) { //Deleted profile
@ -316,7 +322,8 @@ public class TopicParser {
.first().text();
p_userName = p_userName.substring(0, p_userName.indexOf(" Guest"));
p_userColor = USER_COLOR_YELLOW;
} else {
}
else {
p_userName = userName.html();
p_profileURL = userName.attr("href");
}
@ -343,7 +350,8 @@ public class TopicParser {
Element postNum = thisRow.select("div.smalltext:matches(Reply #)").first();
if (postNum == null) { //Topic starter
p_postNum = 0;
} else {
}
else {
String tmp_str = postNum.text().substring(9);
p_postNum = Integer.parseInt(tmp_str.substring(0, tmp_str.indexOf(" on")));
}
@ -409,7 +417,8 @@ public class TopicParser {
.attr("abs:src"));
}
}
} else {
}
else {
for (String line : infoList) {
if (line.contains("Posts:")) {
postsLineIndex = infoList.indexOf(line);
@ -437,7 +446,8 @@ public class TopicParser {
if (starsLineIndex == -1 || starsLineIndex == 1) {
p_rank = infoList.get(0).trim(); //First line has the rank
p_specialRank = null; //They don't have a special rank
} else if (starsLineIndex == 2) { //This member has a special rank
}
else if (starsLineIndex == 2) { //This member has a special rank
p_specialRank = infoList.get(0).trim(); //First line has the special rank
p_rank = infoList.get(1).trim(); //Second line has the rank
}
@ -467,7 +477,8 @@ public class TopicParser {
, p_attachedFiles, p_postLastEditDate, p_postURL, p_deletePostURL, p_editPostURL
, p_isUserMentionedInPost, Post.TYPE_POST));
} else { //Deleted user
}
else { //Deleted user
//Add new post in postsList, only standard information needed
parsedPostsList.add(new Post(p_thumbnailURL, p_userName, p_subject, p_post
, null, p_postIndex, p_postNum, p_postDate, p_userColor, p_attachedFiles
@ -516,7 +527,8 @@ public class TopicParser {
availableVoteCount = Integer.parseInt(prompt.substring(integerMatcher.start(), integerMatcher.end()));
}
links = formTableRows.get(1).child(1).select("a");
} else {
}
else {
availableVoteCount = 1;
links = formTableRows.first().child(1).select("a");
}
@ -524,7 +536,8 @@ public class TopicParser {
if (links != null && links.size() > 0) {
showVoteResultsUrl = links.first().attr("href");
}
} else {
}
else {
// poll in results mode
Elements entryRows = pollColumn.select("table[cellspacing] tr");
for (int i = 0; i < entryRows.size(); i++) {

1
app/src/main/java/gr/thmmy/mthmmy/activities/topic/tasks/EditTask.java

@ -74,6 +74,7 @@ public class EditTask extends AsyncTask<String, Void, Boolean> {
public interface EditTaskCallbacks {
void onEditTaskStarted();
void onEditTaskFinished(boolean result, int position);
}
}

1
app/src/main/java/gr/thmmy/mthmmy/activities/topic/tasks/PrepareForEditTask.java

@ -74,6 +74,7 @@ public class PrepareForEditTask extends AsyncTask<String, Void, PrepareForEditRe
public interface PrepareForEditCallbacks {
void onPrepareEditStarted();
void onPrepareEditCancelled();
}

1
app/src/main/java/gr/thmmy/mthmmy/activities/topic/tasks/PrepareForReplyTask.java

@ -85,6 +85,7 @@ public class PrepareForReplyTask extends AsyncTask<Integer, Void, PrepareForRepl
public interface PrepareForReplyCallbacks {
void onPrepareForReplyStarted();
void onPrepareForReplyCancelled();
}

1
app/src/main/java/gr/thmmy/mthmmy/activities/topic/tasks/ReplyTask.java

@ -68,6 +68,7 @@ public class ReplyTask extends AsyncTask<String, Void, Posting.REPLY_STATUS> {
public interface ReplyTaskCallbacks {
void onReplyTaskStarted();
void onReplyTaskFinished(Posting.REPLY_STATUS result);
}
}

4
app/src/main/java/gr/thmmy/mthmmy/activities/topic/tasks/TopicTask.java

@ -123,7 +123,8 @@ public class TopicTask extends AsyncTask<String, Void, TopicTaskResult> {
if (isUnauthorized(topic)) {
return new TopicTaskResult(ResultCode.UNAUTHORIZED, null, null, null,
0, 0, 0, 0, null, null);
} else {
}
else {
Timber.e(e, "Topic parse failed");
return new TopicTaskResult(ResultCode.PARSING_ERROR, null, null, null,
0, 0, 0, 0, null, null);
@ -149,6 +150,7 @@ public class TopicTask extends AsyncTask<String, Void, TopicTaskResult> {
public interface TopicTaskObserver {
void onTopicTaskStarted();
void onTopicTaskCancelled();
}

93
app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java

@ -329,7 +329,8 @@ public class UploadActivity extends BaseActivity {
tempFileUri = UploadsHelper.createTempFile(this, storage,
uploadFile.getFileUri(),
FileUtils.getFilenameWithoutExtension(editTextFilename));
} else {
}
else {
//Renames the photo taken
String photoPath = uploadFile.getPhotoFile().getPath();
photoPath = photoPath.substring(0, photoPath.lastIndexOf(File.separator));
@ -348,14 +349,16 @@ public class UploadActivity extends BaseActivity {
uploadFile.setFileUri(FileProvider.getUriForFile(this, getPackageName() +
".provider", uploadFile.getPhotoFile()));
}
} else {
}
else {
requestPerms(UPLOAD_REQUEST_STORAGE_CODE);
zipTask = null;
dialog.cancel();
return;
}
}
} else {
}
else {
Uri[] filesListArray = new Uri[filesList.size()];
for (int i = 0; i < filesList.size(); ++i) {
filesListArray[i] = filesList.get(i).getFileUri();
@ -368,7 +371,8 @@ public class UploadActivity extends BaseActivity {
if (checkPerms()) {
zipTask.execute(filesListArray);
finish();
} else {
}
else {
requestPerms(UPLOAD_REQUEST_STORAGE_CODE);
dialog.cancel();
}
@ -384,7 +388,8 @@ public class UploadActivity extends BaseActivity {
? filesList.get(0).getFileUri()
: tempFileUri)) {
finish();
} else {
}
else {
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Couldn't initiate upload.", Toast.LENGTH_SHORT).show();
}
});
@ -406,7 +411,8 @@ public class UploadActivity extends BaseActivity {
//Parses the uploads page
parseUploadPageTask = new ParseUploadPageTask();
parseUploadPageTask.execute(uploadIndexUrl);
} else {
}
else {
//Renders the already parsed data
updateUIElements();
generateFieldsButton.setEnabled(true);
@ -465,7 +471,8 @@ public class UploadActivity extends BaseActivity {
addFileViewToList(filename);
filesList.add(new UploadFile(false, newFileUri, null));
}
} else {
}
else {
Uri newFileUri = data.getData();
if (newFileUri != null) {
String filename = FileUtils.filenameFromUri(this, newFileUri);
@ -481,23 +488,30 @@ public class UploadActivity extends BaseActivity {
filename = filename.toLowerCase();
if (filename.endsWith(".jpg")) {
fileIcon = "jpg_image.gif";
} else if (filename.endsWith(".gif")) {
}
else if (filename.endsWith(".gif")) {
fileIcon = "gif_image.gif";
} else if (filename.endsWith(".png")) {
}
else if (filename.endsWith(".png")) {
fileIcon = "png_image.gif";
} else if (filename.endsWith(".html") || filename.endsWith(".htm")) {
}
else if (filename.endsWith(".html") || filename.endsWith(".htm")) {
fileIcon = "html_file.gif";
} else if (filename.endsWith(".pdf") || filename.endsWith(".doc") ||
}
else if (filename.endsWith(".pdf") || filename.endsWith(".doc") ||
filename.endsWith("djvu")) {
fileIcon = "text_file.gif";
} else if (filename.endsWith(".zip") || filename.endsWith(".rar") ||
}
else if (filename.endsWith(".zip") || filename.endsWith(".rar") ||
filename.endsWith(".tar") || filename.endsWith(".tar.gz") ||
filename.endsWith(".gz")) {
fileIcon = "archive.gif";
} else {
}
else {
fileIcon = "blank.gif";
}
} else {
}
else {
fileIcon = "archive.gif";
textWatcher.setFileExtension(".zip");
@ -509,7 +523,8 @@ public class UploadActivity extends BaseActivity {
filesList.add(new UploadFile(false, newFileUri, null));
}
}
} else if (requestCode == AFR_REQUEST_CODE_CAMERA) {
}
else if (requestCode == AFR_REQUEST_CODE_CAMERA) {
if (resultCode == Activity.RESULT_CANCELED) {
//Deletes image file
storage.deleteFile(photoFileCreated.getAbsolutePath());
@ -525,7 +540,8 @@ public class UploadActivity extends BaseActivity {
}
fileIcon = "jpg_image.gif";
} else {
}
else {
fileIcon = "archive.gif";
textWatcher.setFileExtension(".zip");
@ -538,7 +554,8 @@ public class UploadActivity extends BaseActivity {
addFileViewToList(FileUtils.getFilenameWithoutExtension(FileUtils.
filenameFromUri(this, newFile.getFileUri())));
filesList.add(newFile);
} else if (requestCode == AFR_REQUEST_CODE_FIELDS_BUILDER) {
}
else if (requestCode == AFR_REQUEST_CODE_FIELDS_BUILDER) {
if (resultCode == Activity.RESULT_CANCELED) {
return;
}
@ -546,7 +563,8 @@ public class UploadActivity extends BaseActivity {
String previousName = uploadFilename.getText().toString();
if (previousName.isEmpty()) {
uploadFilename.setText(data.getStringExtra(RESULT_FILENAME));
} else {
}
else {
String extractedExtension = FileUtils.getFileExtension(previousName);
String filenameWithExtension = data.getStringExtra(RESULT_FILENAME) +
(extractedExtension != null ? extractedExtension : "");
@ -556,7 +574,8 @@ public class UploadActivity extends BaseActivity {
uploadTitle.setText(data.getStringExtra(RESULT_TITLE));
uploadDescription.setText(data.getStringExtra(RESULT_DESCRIPTION));
} else {
}
else {
super.onActivityResult(requestCode, resultCode, data);
}
}
@ -579,7 +598,8 @@ public class UploadActivity extends BaseActivity {
zipTask.execute(filesListArray);
finish();
} else {
}
else {
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Please retry uploading.", Toast.LENGTH_SHORT).show();
}
break;
@ -656,7 +676,8 @@ public class UploadActivity extends BaseActivity {
filesList.remove(fileIndex);
if (filesList.isEmpty()) {
filesListView.setVisibility(View.GONE);
} else if (filesList.size() == 1) {
}
else if (filesList.size() == 1) {
textWatcher.setFileExtension(FileUtils.getFileExtension(FileUtils.
filenameFromUri(this, filesList.get(0).getFileUri())));
}
@ -764,7 +785,8 @@ public class UploadActivity extends BaseActivity {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) { }
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
@ -773,7 +795,8 @@ public class UploadActivity extends BaseActivity {
if (filenameWithoutExtension != null && !filenameWithoutExtension.isEmpty() &&
!filenameWithoutExtension.matches("[0-9a-zA-Z~!@#$%^&()_+=\\-`\\[\\]{};',.]+")) {
uploadFilenameInfo.setImageResource(R.drawable.ic_info_outline_warning_24dp);
} else {
}
else {
uploadFilenameInfo.setImageResource(R.drawable.ic_info_outline_white_24dp);
}
@ -811,7 +834,8 @@ public class UploadActivity extends BaseActivity {
if (!oldFilename.isEmpty()) {
newFilename = FileUtils.getFilenameWithoutExtension(oldFilename) + extension;
} else {
}
else {
newFilename = extension;
}
@ -888,7 +912,8 @@ public class UploadActivity extends BaseActivity {
}
@Override
public void onNothingSelected(AdapterView<?> parent) { }
public void onNothingSelected(AdapterView<?> parent) {
}
private void setCourseAndSemester() {
uploadsCourse = null;
@ -910,12 +935,14 @@ public class UploadActivity extends BaseActivity {
categoriesSpinners.getChildAt(numberOfSpinners - 2)).getSelectedItem();
}
else return;
} else if (numberOfSpinners == 4) {
}
else if (numberOfSpinners == 4) {
maybeSemester = (String) ((AppCompatSpinnerWithoutDefault)
categoriesSpinners.getChildAt(numberOfSpinners - 3)).getSelectedItem();
maybeCourse = (String) ((AppCompatSpinnerWithoutDefault)
categoriesSpinners.getChildAt(numberOfSpinners - 1)).getSelectedItem();
} else {
}
else {
maybeSemester = (String) ((AppCompatSpinnerWithoutDefault)
categoriesSpinners.getChildAt(numberOfSpinners - 2)).getSelectedItem();
maybeCourse = (String) ((AppCompatSpinnerWithoutDefault)
@ -974,25 +1001,29 @@ public class UploadActivity extends BaseActivity {
if (categoryText.startsWith("- ")) {
//This is a level one subcategory
uploadRootCategories.get(uploadRootCategories.size() - 1).addSubCategory(categoryValue, categoryText);
} else if (categoryText.startsWith("-- ")) {
}
else if (categoryText.startsWith("-- ")) {
//This is a level two subcategory
UploadCategory rootLevelCategory = uploadRootCategories.get(uploadRootCategories.size() - 1);
UploadCategory firstLevelCategory = rootLevelCategory.getSubCategories().get(rootLevelCategory.getSubCategories().size() - 1);
firstLevelCategory.addSubCategory(categoryValue, categoryText);
} else if (categoryText.startsWith("--- ")) {
}
else if (categoryText.startsWith("--- ")) {
//This is a level three subcategory
UploadCategory rootLevelCategory = uploadRootCategories.get(uploadRootCategories.size() - 1);
UploadCategory firstLevelCategory = rootLevelCategory.getSubCategories().get(rootLevelCategory.getSubCategories().size() - 1);
UploadCategory secondLevelCategory = firstLevelCategory.getSubCategories().get(firstLevelCategory.getSubCategories().size() - 1);
secondLevelCategory.addSubCategory(categoryValue, categoryText);
} else if (categoryText.startsWith("---- ")) {
}
else if (categoryText.startsWith("---- ")) {
//This is a level four subcategory
UploadCategory rootLevelCategory = uploadRootCategories.get(uploadRootCategories.size() - 1);
UploadCategory firstLevelCategory = rootLevelCategory.getSubCategories().get(rootLevelCategory.getSubCategories().size() - 1);
UploadCategory secondLevelCategory = firstLevelCategory.getSubCategories().get(firstLevelCategory.getSubCategories().size() - 1);
UploadCategory thirdLevelCategory = secondLevelCategory.getSubCategories().get(secondLevelCategory.getSubCategories().size() - 1);
thirdLevelCategory.addSubCategory(categoryValue, categoryText);
} else {
}
else {
//This is a root category
uploadRootCategories.add(new UploadCategory(categoryValue, categoryText));
}

18
app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadFieldsBuilderActivity.java

@ -49,7 +49,8 @@ public class UploadFieldsBuilderActivity extends BaseActivity {
int inputYear = Integer.parseInt(working);
isValidYear = inputYear <= currentYear && inputYear > 1980;
} else
}
else
isValidYear = false;
if (!isValidYear)
@ -59,10 +60,12 @@ public class UploadFieldsBuilderActivity extends BaseActivity {
}
@Override
public void afterTextChanged(Editable s) { }
public void afterTextChanged(Editable s) {
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
};
@Override
@ -111,7 +114,8 @@ public class UploadFieldsBuilderActivity extends BaseActivity {
typeRadio.setOnCheckedChangeListener((group, checkedId) -> {
if (checkedId == R.id.upload_fields_builder_radio_button_notes) {
semesterChooserLinear.setVisibility(View.GONE);
} else {
}
else {
semesterChooserLinear.setVisibility(View.VISIBLE);
}
});
@ -122,10 +126,12 @@ public class UploadFieldsBuilderActivity extends BaseActivity {
if (typeId == -1) {
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Please choose a type for the upload", Toast.LENGTH_SHORT).show();
return;
} else if (semesterChooserLinear.getVisibility() == View.VISIBLE && semesterId == -1) {
}
else if (semesterChooserLinear.getVisibility() == View.VISIBLE && semesterId == -1) {
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Please choose a semester for the upload", Toast.LENGTH_SHORT).show();
return;
} else if (year.getText().toString().isEmpty() || !isValidYear) {
}
else if (year.getText().toString().isEmpty() || !isValidYear) {
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Please choose a valid year for the upload", Toast.LENGTH_SHORT).show();
return;
}

10
app/src/main/java/gr/thmmy/mthmmy/activities/upload/multipart/MultipartUploadRequest.java

@ -12,8 +12,8 @@ import java.io.FileNotFoundException;
import java.net.MalformedURLException;
/**
From MultipartUploadRequest gotev/android-upload-service in order to use the local custom
MultipartUploadTask.
* From MultipartUploadRequest gotev/android-upload-service in order to use the local custom
* MultipartUploadTask.
*/
public class MultipartUploadRequest extends HttpUploadRequest<MultipartUploadRequest> {
@ -61,7 +61,8 @@ public class MultipartUploadRequest extends HttpUploadRequest<MultipartUploadReq
contentType = file.getContentType(context);
Logger.debug(LOG_TAG, "Auto-detected MIME type for " + filePath
+ " is: " + contentType);
} else {
}
else {
Logger.debug(LOG_TAG, "Content Type set for " + filePath
+ " is: " + contentType);
}
@ -71,7 +72,8 @@ public class MultipartUploadRequest extends HttpUploadRequest<MultipartUploadReq
if (fileName == null || "".equals(fileName)) {
fileName = file.getName(context);
Logger.debug(LOG_TAG, "Using original file name: " + fileName);
} else {
}
else {
Logger.debug(LOG_TAG, "Using custom file name: " + fileName);
}

4
app/src/main/java/gr/thmmy/mthmmy/activities/upload/multipart/MultipartUploadTask.java

@ -13,8 +13,8 @@ import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
/**
Extended MultipartUploadTask from gotev/android-upload-service to include a fix for the parameter
tp_dluploadpic. Also changed Connection to keep-alive.
* Extended MultipartUploadTask from gotev/android-upload-service to include a fix for the parameter
* tp_dluploadpic. Also changed Connection to keep-alive.
*/
public class MultipartUploadTask extends HttpUploadTask {

64
app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java

@ -318,7 +318,8 @@ public abstract class BaseActivity extends AppCompatActivity {
.withName(R.string.logout)
.withIcon(logoutIcon)
.withSelectable(false);
} else
}
else
loginLogoutItem = new PrimaryDrawerItem()
.withTextColor(primaryColor)
.withSelectedColor(selectedSecondaryColor)
@ -378,7 +379,8 @@ public abstract class BaseActivity extends AppCompatActivity {
intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
return false;
} else
}
else
startLoginActivity();
return true;
@ -398,12 +400,14 @@ public abstract class BaseActivity extends AppCompatActivity {
Intent intent = new Intent(BaseActivity.this, MainActivity.class);
startActivity(intent);
}
} else if (drawerItem.equals(SHOUTBOX_ID)) {
}
else if (drawerItem.equals(SHOUTBOX_ID)) {
if (!(BaseActivity.this instanceof ShoutboxActivity)) {
Intent intent = new Intent(BaseActivity.this, ShoutboxActivity.class);
startActivity(intent);
}
} else if (drawerItem.equals(DOWNLOADS_ID)) {
}
else if (drawerItem.equals(DOWNLOADS_ID)) {
if (!(BaseActivity.this instanceof DownloadsActivity)) {
Intent intent = new Intent(BaseActivity.this, DownloadsActivity.class);
Bundle extras = new Bundle();
@ -412,29 +416,34 @@ public abstract class BaseActivity extends AppCompatActivity {
intent.putExtras(extras);
startActivity(intent);
}
} else if (drawerItem.equals(UPLOAD_ID)) {
}
else if (drawerItem.equals(UPLOAD_ID)) {
if (!(BaseActivity.this instanceof UploadActivity)) {
Intent intent = new Intent(BaseActivity.this, UploadActivity.class);
startActivity(intent);
}
} else if (drawerItem.equals(BOOKMARKS_ID)) {
}
else if (drawerItem.equals(BOOKMARKS_ID)) {
if (!(BaseActivity.this instanceof BookmarksActivity)) {
Intent intent = new Intent(BaseActivity.this, BookmarksActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);
}
} else if (drawerItem.equals(LOG_ID)) {
}
else if (drawerItem.equals(LOG_ID)) {
if (!sessionManager.isLoggedIn()) //When logged out or if user is guest
startLoginActivity();
else
showLogoutDialog();
} else if (drawerItem.equals(ABOUT_ID)) {
}
else if (drawerItem.equals(ABOUT_ID)) {
if (!(BaseActivity.this instanceof AboutActivity)) {
Intent intent = new Intent(BaseActivity.this, AboutActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);
}
} else if (drawerItem.equals(SETTINGS_ID)) {
}
else if (drawerItem.equals(SETTINGS_ID)) {
if (!(BaseActivity.this instanceof SettingsActivity)) {
Intent intent = new Intent(BaseActivity.this, SettingsActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
@ -470,7 +479,8 @@ public abstract class BaseActivity extends AppCompatActivity {
loginLogoutItem.withName(R.string.login).withIcon(loginIcon); //Swap logout with login
profileDrawerItem.withName(sessionManager.getUsername());
setDefaultAvatar();
} else {
}
else {
if (!drawer.getDrawerItems().contains(downloadsItem)) {
drawer.addItemAtPosition(downloadsItem, 4);
}
@ -495,6 +505,7 @@ public abstract class BaseActivity extends AppCompatActivity {
//-------------------------------------------LOGOUT-------------------------------------------------
private ProgressDialog progressDialog;
private void onLogoutTaskStarted() {
progressDialog = new ProgressDialog(BaseActivity.this,
R.style.AppTheme_Dark_Dialog);
@ -532,7 +543,8 @@ public abstract class BaseActivity extends AppCompatActivity {
builder.setPositiveButton("Yep", (dialogInterface, i) -> {
new LogoutTask(this::onLogoutTaskStarted, this::onLogoutTaskFinished).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); //Avoid delays between onPreExecute() and doInBackground()
});
builder.setNegativeButton("Nope", (dialogInterface, i) -> {});
builder.setNegativeButton("Nope", (dialogInterface, i) -> {
});
builder.create().show();
}
//-----------------------------------------LOGOUT END-----------------------------------------------
@ -570,7 +582,8 @@ public abstract class BaseActivity extends AppCompatActivity {
thisPageBookmarkMenuButton.setIcon(R.drawable.ic_bookmark_false_accent_24dp);
toggleTopicToBookmarks(thisPageBookmark);
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Bookmark removed", Toast.LENGTH_SHORT).show();
} else {
}
else {
thisPageBookmarkMenuButton.setIcon(R.drawable.ic_bookmark_true_accent_24dp);
toggleTopicToBookmarks(thisPageBookmark);
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Bookmark added", Toast.LENGTH_SHORT).show();
@ -580,14 +593,16 @@ public abstract class BaseActivity extends AppCompatActivity {
protected void setBoardBookmark(final ImageButton thisPageBookmarkImageButton) {
if (thisPageBookmark.matchExists(boardsBookmarked)) {
thisPageBookmarkImageButton.setImageResource(R.drawable.ic_bookmark_true_accent_24dp);
} else {
}
else {
thisPageBookmarkImageButton.setImageResource(R.drawable.ic_bookmark_false_accent_24dp);
}
thisPageBookmarkImageButton.setOnClickListener(view -> {
if (thisPageBookmark.matchExists(boardsBookmarked)) {
thisPageBookmarkImageButton.setImageResource(R.drawable.ic_bookmark_false_accent_24dp);
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Bookmark removed", Toast.LENGTH_SHORT).show();
} else {
}
else {
thisPageBookmarkImageButton.setImageResource(R.drawable.ic_bookmark_true_accent_24dp);
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Bookmark added", Toast.LENGTH_SHORT).show();
}
@ -601,7 +616,8 @@ public abstract class BaseActivity extends AppCompatActivity {
loadSavedBookmarks();
if (thisPageBookmark.matchExists(boardsBookmarked)) {
thisPageBookmarkImageButton.setImageResource(R.drawable.ic_bookmark_true_accent_24dp);
} else {
}
else {
thisPageBookmarkImageButton.setImageResource(R.drawable.ic_bookmark_false_accent_24dp);
}
}
@ -626,7 +642,8 @@ public abstract class BaseActivity extends AppCompatActivity {
if (bookmark.matchExists(boardsBookmarked)) {
boardsBookmarked.remove(bookmark.findIndex(boardsBookmarked));
FirebaseMessaging.getInstance().unsubscribeFromTopic("b" + bookmark.getId());
} else {
}
else {
boardsBookmarked.add(new Bookmark(bookmark.getTitle(), bookmark.getId(), true));
FirebaseMessaging.getInstance().subscribeToTopic("b" + bookmark.getId());
}
@ -638,7 +655,8 @@ public abstract class BaseActivity extends AppCompatActivity {
if (bookmark.matchExists(topicsBookmarked)) {
topicsBookmarked.remove(bookmark.findIndex(topicsBookmarked));
FirebaseMessaging.getInstance().unsubscribeFromTopic(bookmark.getId());
} else {
}
else {
topicsBookmarked.add(new Bookmark(bookmark.getTitle(), bookmark.getId(), true));
FirebaseMessaging.getInstance().subscribeToTopic(bookmark.getId());
}
@ -675,7 +693,8 @@ public abstract class BaseActivity extends AppCompatActivity {
FirebaseMessaging.getInstance().unsubscribeFromTopic(bookmark.getId());
return topicsBookmarked.get(bookmark.findIndex(topicsBookmarked)).isNotificationsEnabled();
} else if (bookmark.matchExists(boardsBookmarked)) {
}
else if (bookmark.matchExists(boardsBookmarked)) {
boardsBookmarked.get(bookmark.findIndex(boardsBookmarked)).toggleNotificationsEnabled();
updateBoardBookmarks();
@ -685,7 +704,8 @@ public abstract class BaseActivity extends AppCompatActivity {
FirebaseMessaging.getInstance().unsubscribeFromTopic("b" + bookmark.getId());
return boardsBookmarked.get(bookmark.findIndex(boardsBookmarked)).isNotificationsEnabled();
} else
}
else
Timber.w("No bookmark match exists!");
return false;
}
@ -902,7 +922,8 @@ public abstract class BaseActivity extends AppCompatActivity {
dialogProgressText.setText(getString(R.string.upload_failed));
uploadsProgressDialog.show();
} else {
}
else {
//Empty buttons are needed, they are updated with correct values in the receiver
uploadsProgressDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "placeholder", (progressDialog, progressWhich) -> {
});
@ -913,7 +934,8 @@ public abstract class BaseActivity extends AppCompatActivity {
//UploadsReceiver.setDialogDisplay(uploadsProgressDialog, dialogUploadID, retryIntent);
uploadsProgressDialog.show();
}
} else {
}
else {
UploadsReceiver.setDialogDisplay(uploadsProgressDialog, dialogUploadID, null);
//UploadsReceiver.setDialogDisplay(uploadsProgressDialog, dialogUploadID, retryIntent);
uploadsProgressDialog.show();

3
app/src/main/java/gr/thmmy/mthmmy/base/BaseFragment.java

@ -46,5 +46,6 @@ public abstract class BaseFragment extends Fragment {
* the activity that contains it, to allow communication upon interaction,
* between the fragment and the activity/ other fragments
*/
public interface FragmentInteractionListener {}
public interface FragmentInteractionListener {
}
}

3
app/src/main/java/gr/thmmy/mthmmy/model/Poll.java

@ -91,8 +91,7 @@ public class Poll extends TopicItem {
/**
* Constructor for entry with unknown number of votes
*
* @param entryName
* The name of the entry
* @param entryName The name of the entry
*/
public Entry(String entryName) {
this.entryName = entryName;

2
app/src/main/java/gr/thmmy/mthmmy/model/Post.java

@ -81,6 +81,7 @@ public class Post extends TopicItem {
* Constructor for active user's posts. All variables are declared final, once assigned they
* can not change. Parameters notated as {@link Nullable} can either pass null or empty
* (strings/ArrayList).
*
* @param thumbnailUrl author's thumbnail url
* @param author author's username
* @param subject post's subject
@ -139,6 +140,7 @@ public class Post extends TopicItem {
* Constructor for deleted user's posts. All variables are declared final, once assigned they
* can not change. Parameters notated as {@link Nullable} can either pass null or empty
* (strings/ArrayList).
*
* @param thumbnailUrl author's thumbnail url
* @param author author's username
* @param subject post's subject

7
app/src/main/java/gr/thmmy/mthmmy/model/ThmmyPage.java

@ -153,7 +153,8 @@ public class ThmmyPage {
else if (uriString.contains(";sa=statPanel"))
return PageCategory.PROFILE_STATS;
else return PageCategory.PROFILE_SUMMARY;
} else if (uriString.contains("action=unread"))
}
else if (uriString.contains("action=unread"))
return PageCategory.UNREAD_POSTS;
else if (uriString.contains("action=tpmod;dl=item"))
return PageCategory.DOWNLOADS_FILE;
@ -185,13 +186,15 @@ public class ThmmyPage {
Matcher topicIdMatcher = Pattern.compile("topic=[0-9]+").matcher(topicUrl);
if (topicIdMatcher.find()) {
return topicUrl.substring(topicIdMatcher.start() + 6, topicIdMatcher.end());
} else return null;
}
else return null;
}
return null;
}
/**
* This method gets a VALID topic url and strips it off any unnecessary stuff (e.g. wap2).
*
* @param topicUrl a valid topic url
* @return sanitized topic url
*/

3
app/src/main/java/gr/thmmy/mthmmy/services/DownloadHelper.java

@ -63,7 +63,8 @@ public class DownloadHelper {
if (tokens.length != 2) {
Timber.w("Couldn't get file extension...");
nameFormat = originalFileName + "(%d)";
} else
}
else
nameFormat = tokens[0] + "-%d." + tokens[1];
for (int i = 1; ; i++) {

9
app/src/main/java/gr/thmmy/mthmmy/services/NotificationService.java

@ -98,7 +98,8 @@ public class NotificationService extends FirebaseMessagingService {
String poster = json.getString("poster");
sendNotification(new PostNotification(postId, topicId, topicTitle, poster, boardId, boardTitle));
} else
}
else
Timber.i("Notification suppressed (own userID).");
} catch (JSONException e) {
Timber.e(e, "JSON Exception");
@ -154,7 +155,8 @@ public class NotificationService extends FirebaseMessagingService {
if (notificationsVibrateEnabled) {
if (notificationDefaultValues != -1) {
notificationDefaultValues |= Notification.DEFAULT_VIBRATE;
} else {
}
else {
notificationDefaultValues = Notification.DEFAULT_VIBRATE;
}
@ -162,7 +164,8 @@ public class NotificationService extends FirebaseMessagingService {
if (notificationSoundUri == null) {
if (notificationDefaultValues != -1) {
notificationDefaultValues = Notification.DEFAULT_SOUND;
} else {
}
else {
notificationDefaultValues |= Notification.DEFAULT_SOUND;
}
}

3
app/src/main/java/gr/thmmy/mthmmy/services/UploadsReceiver.java

@ -162,7 +162,8 @@ public class UploadsReceiver extends UploadServiceBroadcastReceiver {
uploadProgressDialog.dismiss();
}
}
} else {
}
else {
cancelNotification(context, uploadInfo.getNotificationID());
Intent combinedActionsIntent = new Intent(UploadsReceiver.ACTION_COMBINED_UPLOAD);
combinedActionsIntent.putExtra(UploadsReceiver.UPLOAD_ID_KEY, uploadInfo.getUploadId());

3
app/src/main/java/gr/thmmy/mthmmy/session/InvalidSessionException.java

@ -1,7 +1,8 @@
package gr.thmmy.mthmmy.session;
public class InvalidSessionException extends RuntimeException {
public InvalidSessionException() {}
public InvalidSessionException() {
}
public InvalidSessionException(String message) {
super(message);

6
app/src/main/java/gr/thmmy/mthmmy/session/SessionManager.java

@ -125,7 +125,8 @@ public class SessionManager {
editor.apply();
return SUCCESS;
} else {
}
else {
Timber.i("Login failed.");
//Investigate login failure
@ -263,7 +264,8 @@ public class SessionManager {
Matcher matcher = pattern.matcher(txt);
if (matcher.find())
userName = matcher.group(1);
} else {
}
else {
//Helios_Multi and SMF_oneBlue
user = doc.select("td.smalltext[width=100%] b");
if (user.size() == 1)

12
app/src/main/java/gr/thmmy/mthmmy/utils/DateTimeUtils.java

@ -29,7 +29,8 @@ public class DateTimeUtils {
if (mod >= 30 * SECOND_IN_MILLIS)
count += 1;
format = "%dm";
} else if (duration < 22*HOUR_IN_MILLIS) {
}
else if (duration < 22 * HOUR_IN_MILLIS) {
count = duration / HOUR_IN_MILLIS;
format = "%dh";
mod = (duration % HOUR_IN_MILLIS) / MINUTE_IN_MILLIS;
@ -41,13 +42,15 @@ public class DateTimeUtils {
}
else if (mod >= 30)
count += 1;
} else if (duration < 26*DAY_IN_MILLIS) {
}
else if (duration < 26 * DAY_IN_MILLIS) {
count = duration / DAY_IN_MILLIS;
format = "%dd";
mod = duration % DAY_IN_MILLIS;
if (mod >= 12 * HOUR_IN_MILLIS)
count += 1;
} else if (duration < 320*DAY_IN_MILLIS) {
}
else if (duration < 320 * DAY_IN_MILLIS) {
count = duration / MONTH_IN_MILLIS;
format = "%d month";
mod = duration % MONTH_IN_MILLIS;
@ -55,7 +58,8 @@ public class DateTimeUtils {
count += 1;
if (count > 1)
format = format + 's';
} else if (duration < DECADE_IN_MILLIS) {
}
else if (duration < DECADE_IN_MILLIS) {
count = duration / YEAR_IN_MILLIS;
format = "%d year";
mod = duration % YEAR_IN_MILLIS;

3
app/src/main/java/gr/thmmy/mthmmy/utils/ExternalAsyncTask.java

@ -52,7 +52,8 @@ public abstract class ExternalAsyncTask<U, V> extends AsyncTask<U, Void, V> {
this.onTaskFinishedListener = onTaskFinishedListener;
}
public ExternalAsyncTask() { }
public ExternalAsyncTask() {
}
public void setOnTaskStartedListener(OnTaskStartedListener onTaskStartedListener) {
this.onTaskStartedListener = onTaskStartedListener;

3
app/src/main/java/gr/thmmy/mthmmy/utils/FileUtils.java

@ -41,7 +41,8 @@ public class FileUtils {
}
if (filename.toLowerCase().endsWith(".tar.gz")) {
fileExtension = filename.substring(filename.length() - 7);
} else {
}
else {
fileExtension = filename.substring(filename.lastIndexOf("."));
}

12
app/src/main/java/gr/thmmy/mthmmy/utils/HTMLUtils.java

@ -25,13 +25,15 @@ import static gr.thmmy.mthmmy.activities.profile.ProfileActivity.BUNDLE_PROFILE_
import static gr.thmmy.mthmmy.activities.profile.ProfileActivity.BUNDLE_PROFILE_USERNAME;
public class HTMLUtils {
private HTMLUtils() {}
private HTMLUtils() {
}
public static SpannableStringBuilder getSpannableFromHtml(Activity activity, String html) {
CharSequence sequence;
if (Build.VERSION.SDK_INT >= 24) {
sequence = Html.fromHtml(html, Html.FROM_HTML_MODE_LEGACY);
} else {
}
else {
//noinspection deprecation
sequence = Html.fromHtml(html);
}
@ -59,7 +61,8 @@ public class HTMLUtils {
intent.putExtras(extras);
intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
} else if (target.is(ThmmyPage.PageCategory.PROFILE)) {
}
else if (target.is(ThmmyPage.PageCategory.PROFILE)) {
Intent intent = new Intent(context, ProfileActivity.class);
Bundle extras = new Bundle();
extras.putString(BUNDLE_PROFILE_URL, span.getURL());
@ -68,7 +71,8 @@ public class HTMLUtils {
intent.putExtras(extras);
intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
} else if (target.is(ThmmyPage.PageCategory.INDEX)) {
}
else if (target.is(ThmmyPage.PageCategory.INDEX)) {
Intent intent = new Intent(context, MainActivity.class);
intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);

6
app/src/main/java/gr/thmmy/mthmmy/utils/LaunchType.java

@ -24,11 +24,13 @@ public class LaunchType {
if (currentVersionCode == savedVersionCode) {
//This is just a normal run
return LAUNCH_TYPE.NORMAL_LAUNCH;
} else if (savedVersionCode == notThere) {
}
else if (savedVersionCode == notThere) {
//Updates the shared preferences with the current version code
prefs.edit().putInt(PREF_VERSION_CODE_KEY, currentVersionCode).apply();
return LAUNCH_TYPE.FIRST_LAUNCH_EVER;
} else if (currentVersionCode > savedVersionCode) {
}
else if (currentVersionCode > savedVersionCode) {
//Updates the shared preferences with the current version code
prefs.edit().putInt(PREF_VERSION_CODE_KEY, currentVersionCode).apply();
return LAUNCH_TYPE.FIRST_LAUNCH_AFTER_UPDATE;

3
app/src/main/java/gr/thmmy/mthmmy/utils/crashreporting/CrashReporter.java

@ -13,7 +13,8 @@ import gr.thmmy.mthmmy.utils.parsing.ParseHelpers;
public class CrashReporter {
private static final int STRING_BATCH_LENGTH = 250;
private CrashReporter() {}
private CrashReporter() {
}
public static void reportForumInfo(Document document) {
ParseHelpers.Theme theme = ParseHelpers.parseTheme(document);

1
app/src/main/java/gr/thmmy/mthmmy/utils/crashreporting/CrashReportingTree.java

@ -10,6 +10,7 @@ import timber.log.Timber.DebugTree;
public class CrashReportingTree extends DebugTree {
private FirebaseCrashlytics firebaseCrashlytics;
public CrashReportingTree() {
super();
firebaseCrashlytics = FirebaseCrashlytics.getInstance();

3
app/src/main/java/gr/thmmy/mthmmy/utils/networking/NetworkTask.java

@ -36,7 +36,8 @@ public abstract class NetworkTask<T> extends ExternalAsyncTask<String, Parcel<T>
this.onNetworkTaskFinishedListener = onNetworkTaskFinishedListener;
}
public NetworkTask() {}
public NetworkTask() {
}
@Override
protected Parcel<T> doInBackground(String... input) {

3
app/src/main/java/gr/thmmy/mthmmy/utils/parsing/NewParseTask.java

@ -17,7 +17,8 @@ public abstract class NewParseTask<T> extends NetworkTask<T> {
super(onTaskStartedListener, onParseTaskFinishedListener);
}
public NewParseTask() {}
public NewParseTask() {
}
@Override
protected final T performTask(Document document, Response response) {

3
app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ParseException.java

@ -4,7 +4,8 @@ package gr.thmmy.mthmmy.utils.parsing;
* Use ParseException for errors while parsing.
*/
public class ParseException extends RuntimeException {
public ParseException() {}
public ParseException() {
}
public ParseException(String message) {
super(message);

3
app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ParseHelpers.java

@ -56,7 +56,8 @@ public class ParseHelpers {
if (welcomingGuest != null && welcomingGuest.text().contains("Welcome"))
return ENGLISH;
return PAGE_INCOMPLETE;
} else if (welcoming.text().contains("Καλώς ορίσατε")) return GREEK;
}
else if (welcoming.text().contains("Καλώς ορίσατε")) return GREEK;
else if (welcoming.text().contains("Hey")) return ENGLISH;
else return UNKNOWN_LANGUAGE;
}

5
app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ParseTask.java

@ -21,14 +21,17 @@ import timber.log.Timber;
*/
public abstract class ParseTask extends AsyncTask<String, Void, ParseTask.ResultCode> {
protected String url;
public enum ResultCode {
SUCCESS, PARSING_ERROR, NETWORK_ERROR, OTHER_ERROR
}
protected abstract void parse(Document document) throws ParseException;
protected abstract void postExecution(ParseTask.ResultCode result); //ResultCode.NETWORK_ERROR is handled automatically
protected void postParsing (){}
protected void postParsing() {
}
protected Request prepareRequest(String... params) {
url = params[0];

9
app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ThmmyDateTimeParser.java

@ -39,7 +39,8 @@ public class ThmmyDateTimeParser {
private static final Pattern pattern = Pattern.compile("\\s((1[3-9]|2[0-3]):)");
private ThmmyDateTimeParser(){}
private ThmmyDateTimeParser() {
}
public static String convertToTimestamp(String thmmyDateTime) {
Timber.v("Will attempt to convert %s to timestamp.", thmmyDateTime);
@ -65,8 +66,7 @@ public class ThmmyDateTimeParser {
DateTime dateTime;
try {
dateTime = formatter.withZone(dtz).withLocale(englishLocale).parseDateTime(thmmyDateTime);
}
catch (IllegalArgumentException e1){
} catch (IllegalArgumentException e1) {
Timber.v("Parsing DateTime %s using English Locale failed.", thmmyDateTime);
try {
DateFormatSymbols dfs = DateTimeUtils.getDateFormatSymbols(greekLocale);
@ -74,8 +74,7 @@ public class ThmmyDateTimeParser {
thmmyDateTime = thmmyDateTime.replace("pm", dfs.getAmPmStrings()[1]);
Timber.v("Attempting to parse DateTime %s using Greek Locale...", thmmyDateTime);
dateTime = formatter.withZone(dtz).withLocale(greekLocale).parseDateTime(thmmyDateTime);
}
catch (IllegalArgumentException e2){
} catch (IllegalArgumentException e2) {
Timber.d("Parsing DateTime %s using Greek Locale failed too.", thmmyDateTime);
Timber.e("Couldn't convert DateTime %s to timestamp!", originalDateTime);
return null;

6
app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ThmmyParser.java

@ -138,7 +138,8 @@ public class ThmmyParser {
if (separatorIndex > 0) {
attribute = startTag.substring(separatorIndex);
name = startTag.substring(0, separatorIndex);
} else
}
else
name = startTag;
if (name.startsWith("/")) {
@ -177,7 +178,8 @@ public class ThmmyParser {
attribute = fullAttribute.substring(1, equalsIndex);
attributeValue = fullAttribute.substring(equalsIndex + 2, fullAttribute.length() - 1);
name = startTag.substring(0, separatorIndex);
} else
}
else
name = startTag;
if (name.startsWith("/")) {

3
app/src/main/java/gr/thmmy/mthmmy/utils/ui/ScrollAwareFABBehavior.java

@ -45,7 +45,8 @@ public class ScrollAwareFABBehavior extends CoordinatorLayout.Behavior<FloatingA
fab.setVisibility(View.INVISIBLE);
}
});
} else if (child.getTag() != null && (boolean) child.getTag() && (dyConsumed < 0 ||
}
else if (child.getTag() != null && (boolean) child.getTag() && (dyConsumed < 0 ||
!target.canScrollVertically(-1) && dyUnconsumed < -50)) {
child.show(new FloatingActionButton.OnVisibilityChangedListener() {
@Override

3
app/src/main/java/gr/thmmy/mthmmy/utils/ui/ScrollAwareLinearBehavior.java

@ -45,7 +45,8 @@ public class ScrollAwareLinearBehavior extends CoordinatorLayout.Behavior<View>
if (bottomNavBar.getVisibility() == View.VISIBLE && (dyConsumed > 0
|| (!target.canScrollVertically(-1) && dyConsumed == 0 && dyUnconsumed > 50))) {
hide(bottomNavBar);
} else if (bottomNavBar.getVisibility() == View.INVISIBLE && (dyConsumed < 0
}
else if (bottomNavBar.getVisibility() == View.INVISIBLE && (dyConsumed < 0
|| (!target.canScrollVertically(-1) && dyConsumed == 0 && dyUnconsumed < -50))) {
show(bottomNavBar);
}

3
app/src/main/java/gr/thmmy/mthmmy/viewmodel/ShoutboxViewModel.java

@ -28,7 +28,8 @@ public class ShoutboxViewModel extends ViewModel {
}
public void sendShout(String shout) {
if (shoutboxMutableLiveData.getValue() == null) throw new IllegalStateException("Shoutbox task has not finished yet!");
if (shoutboxMutableLiveData.getValue() == null)
throw new IllegalStateException("Shoutbox task has not finished yet!");
Shoutbox shoutbox = shoutboxMutableLiveData.getValue();
new SendShoutTask(onSendShoutTaskStarted, onSendShoutTaskFinished)
.execute(shoutbox.getSendShoutUrl(), shout, shoutbox.getSc(),

24
app/src/main/java/gr/thmmy/mthmmy/viewmodel/TopicViewModel.java

@ -100,7 +100,8 @@ public class TopicViewModel extends BaseViewModel implements TopicTask.OnTopicTa
}
public void reloadPage() {
if (topicUrl == null) throw new NullPointerException("No topic task has been requested yet!");
if (topicUrl == null)
throw new NullPointerException("No topic task has been requested yet!");
Timber.i("Reloading page");
loadUrl(topicUrl);
}
@ -110,13 +111,15 @@ public class TopicViewModel extends BaseViewModel implements TopicTask.OnTopicTa
* in the url before refreshing
*/
public void resetPage() {
if (topicUrl == null) throw new NullPointerException("No topic task has been requested yet!");
if (topicUrl == null)
throw new NullPointerException("No topic task has been requested yet!");
Timber.i("Resetting page");
loadUrl(ParseHelpers.getBaseURL(topicUrl) + "." + String.valueOf(currentPageIndex * 15));
}
public void resetPageThen(Runnable runnable) {
if (topicUrl == null) throw new NullPointerException("No topic task has been requested yet!");
if (topicUrl == null)
throw new NullPointerException("No topic task has been requested yet!");
Timber.i("Resetting page");
stopLoading();
currentTopicTask = new TopicTask(topicTaskObserver, result -> {
@ -134,18 +137,21 @@ public class TopicViewModel extends BaseViewModel implements TopicTask.OnTopicTa
Timber.i("Changing to page " + pageRequested + 1);
loadUrl(ParseHelpers.getBaseURL(topicUrl) + "." + pageRequested * 15);
pageIndicatorIndex.setValue(pageRequested + 1);
} else {
}
else {
stopLoading();
}
}
public boolean submitVote(LinearLayout optionsLayout) {
if (topicItems.getValue() == null) throw new NullPointerException("Topic task has not finished yet!");
if (topicItems.getValue() == null)
throw new NullPointerException("Topic task has not finished yet!");
ArrayList<Integer> votes = new ArrayList<>();
if (optionsLayout.getChildAt(0) instanceof RadioGroup) {
RadioGroup optionsRadioGroup = (RadioGroup) optionsLayout.getChildAt(0);
votes.add(optionsRadioGroup.getCheckedRadioButtonId());
} else if (optionsLayout.getChildAt(0) instanceof CheckBox) {
}
else if (optionsLayout.getChildAt(0) instanceof CheckBox) {
for (int i = 0; i < optionsLayout.getChildCount(); i++) {
CheckBox checkBox = (CheckBox) optionsLayout.getChildAt(i);
if (checkBox.isChecked())
@ -164,7 +170,8 @@ public class TopicViewModel extends BaseViewModel implements TopicTask.OnTopicTa
}
public void removeVote() {
if (topicItems.getValue() == null) throw new NullPointerException("Topic task has not finished yet!");
if (topicItems.getValue() == null)
throw new NullPointerException("Topic task has not finished yet!");
RemoveVoteTask removeVoteTask = new RemoveVoteTask();
removeVoteTask.setOnTaskStartedListener(removeVoteTaskStartedListener);
removeVoteTask.setOnNetworkTaskFinishedListener(removeVoteTaskFinishedListener);
@ -308,7 +315,8 @@ public class TopicViewModel extends BaseViewModel implements TopicTask.OnTopicTa
throw new NullPointerException("No page has been loaded yet!");
int oldIndicatorIndex = this.pageIndicatorIndex.getValue();
this.pageIndicatorIndex.setValue(pageIndicatorIndex);
if (changePage && oldIndicatorIndex != this.pageIndicatorIndex.getValue()) loadPageIndicated();
if (changePage && oldIndicatorIndex != this.pageIndicatorIndex.getValue())
loadPageIndicated();
}
// <-------------Just getters, setters and helper methods below here---------------->

10
app/src/main/java/gr/thmmy/mthmmy/views/RelativeTimeTextView.java

@ -67,6 +67,7 @@ public class RelativeTimeTextView extends TextView {
* Sets the reference time for this view. At any moment, the view will render a relative time period relative to the time set here.
* <p/>
* This value can also be set with the XML attribute {@code reference_time}
*
* @param referenceTime The timestamp (in milliseconds since epoch) that will be the reference point for this view.
*/
public void setReferenceTime(long referenceTime) {
@ -120,7 +121,8 @@ public class RelativeTimeTextView extends TextView {
super.onVisibilityChanged(changedView, visibility);
if (visibility == GONE || visibility == INVISIBLE) {
stopTaskForPeriodicallyUpdatingRelativeTime();
} else {
}
else {
startTaskForPeriodicallyUpdatingRelativeTime();
}
}
@ -219,9 +221,11 @@ public class RelativeTimeTextView extends TextView {
long interval = INITIAL_UPDATE_INTERVAL;
if (difference > DateUtils.WEEK_IN_MILLIS) {
interval = DateUtils.WEEK_IN_MILLIS;
} else if (difference > DateUtils.DAY_IN_MILLIS) {
}
else if (difference > DateUtils.DAY_IN_MILLIS) {
interval = DateUtils.DAY_IN_MILLIS;
} else if (difference > DateUtils.HOUR_IN_MILLIS) {
}
else if (difference > DateUtils.HOUR_IN_MILLIS) {
interval = DateUtils.HOUR_IN_MILLIS;
}
rttv.updateTextDisplay();

1
app/src/main/java/gr/thmmy/mthmmy/views/ToggledBackgroundButton.java

@ -1,4 +1,5 @@
package gr.thmmy.mthmmy.views;
import android.content.Context;
import android.util.AttributeSet;

23
app/src/main/java/gr/thmmy/mthmmy/views/editorview/EditorView.java

@ -85,7 +85,8 @@ public class EditorView extends LinearLayout implements EmojiInputField {
if (!emojiKeyboard.isVisible()) {
InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
} else {
}
else {
InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(getWindowToken(), 0);
requestEditTextFocus();
@ -313,7 +314,8 @@ public class EditorView extends LinearLayout implements EmojiInputField {
return;
}
if (hadTextSelection) editText.getText().delete(start, end);
if (hadTextSelection)
editText.getText().delete(start, end);
if (!TextUtils.isEmpty(linkText.getEditText().getText())) {
getText()
.insert(
@ -323,7 +325,8 @@ public class EditorView extends LinearLayout implements EmojiInputField {
+ "]"
+ linkText.getEditText().getText().toString()
+ "[/url]");
} else
}
else
getText()
.insert(
editText.getSelectionStart(),
@ -402,7 +405,8 @@ public class EditorView extends LinearLayout implements EmojiInputField {
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Activity.INPUT_METHOD_SERVICE);
if (imm != null)
imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
} else {
}
else {
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Activity.INPUT_METHOD_SERVICE);
if (imm != null)
imm.hideSoftInputFromWindow(getWindowToken(), 0);
@ -414,19 +418,20 @@ public class EditorView extends LinearLayout implements EmojiInputField {
if (b) {
emojiKeyboard.onEmojiInputFieldFocused(EditorView.this);
showMarkdown();
} else hideMarkdown();
}
else hideMarkdown();
});
editText.setOnFocusChangeListener((view, b) -> {
if (b) {
emojiKeyboard.onEmojiInputFieldFocused(EditorView.this);
showMarkdown();
} else hideMarkdown();
}
else hideMarkdown();
});
}
/**
* Animates the hiding of the markdown options.
*
*/
public void hideMarkdown() {
if (formatButtonsRecyclerview.getVisibility() == GONE) return;
@ -459,7 +464,6 @@ public class EditorView extends LinearLayout implements EmojiInputField {
/**
* Animates the showing of the markdown options.
*
*/
public void showMarkdown() {
if (formatButtonsRecyclerview.getVisibility() == VISIBLE) return;
@ -523,7 +527,8 @@ public class EditorView extends LinearLayout implements EmojiInputField {
public void onKeyboardVisibilityChange(boolean visible) {
if (visible) {
emojiButton.setImageResource(R.drawable.ic_keyboard_24dp);
} else {
}
else {
emojiButton.setImageResource(R.drawable.ic_tag_faces_24dp);
}
}

1
app/src/main/java/gr/thmmy/mthmmy/views/editorview/EmojiInputField.java

@ -4,5 +4,6 @@ import android.view.inputmethod.InputConnection;
public interface EmojiInputField {
void onKeyboardVisibilityChange(boolean visible);
InputConnection getInputConnection();
}

1
app/src/main/java/gr/thmmy/mthmmy/views/editorview/FormatButtonsAdapter.java

@ -45,6 +45,7 @@ public class FormatButtonsAdapter extends RecyclerView.Adapter<FormatButtonsAdap
static class FormatButtonViewHolder extends RecyclerView.ViewHolder {
AppCompatImageButton formatButton;
FormatButtonViewHolder(AppCompatImageButton formatButton) {
super(formatButton);
this.formatButton = formatButton;

4
app/src/main/java/gr/thmmy/mthmmy/views/editorview/IEmojiKeyboard.java

@ -8,24 +8,28 @@ public interface IEmojiKeyboard {
/**
* Check if keyboard is visible
*
* @return true, if {@link EmojiKeyboard#getVisibility()} returns View.VISIBLE, otherwise false
*/
boolean isVisible();
/**
* Callback to the keyboard when {@link EditorView#emojiButton} is clicked
*
* @return whether the keyboard became visible or not
*/
boolean onEmojiButtonToggle();
/**
* Callback to create input connection with {@link EmojiInputField}
*
* @param emojiInputField the connected input field
*/
void onEmojiInputFieldFocused(EmojiInputField emojiInputField);
/**
* Persist a set of all input fields to update all of them when visibility changes
*
* @param emojiInputField the input field to be added
*/
void registerEmojiInputField(EmojiInputField emojiInputField);

13
app/src/main/res/drawable/ic_access_time_white_24dp.xml

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z"/>
<vector android:height="24dp"
android:tint="#FFFFFF"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z" />
</vector>

13
app/src/main/res/drawable/ic_announcement.xml

@ -1,7 +1,12 @@
<vector android:height="24dp" android:viewportHeight="297"
android:viewportWidth="297" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"
<vector android:height="24dp"
android:viewportHeight="297"
android:viewportWidth="297"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android"
android:tint="#FFFFFF">
<path android:fillColor="#FF000000"
<path
android:fillColor="#FF000000"
android:pathData="M282.82,107.559h-25.792V10.025c0,-4.056 -2.443,-7.711 -6.19,-9.261c-3.745,-1.555 -8.059,-0.693 -10.925,2.177C195.46,47.434 157.039,68.643 132.635,78.6C106.33,89.333 90.261,89.635 90.159,89.637H14.18c-5.536,0 -10.023,4.488 -10.023,10.024v89.631c0,5.536 4.487,10.023 10.023,10.023h10.2l37.887,91.497c1.551,3.746 5.206,6.189 9.261,6.189h55.538c0.006,-0.001 0.012,-0.001 0.02,0c5.536,0 10.023,-4.488 10.023,-10.023c0,-1.588 -0.37,-3.09 -1.025,-4.424l-33.809,-81.646c22.4,4.443 73.884,21.285 137.641,85.1c1.917,1.921 4.483,2.939 7.094,2.939c0.055,0 0.109,0 0.164,0c5.468,-0.079 9.877,-4.536 9.877,-10.023c0,-0.214 -0.006,-0.428 -0.02,-0.639l-0.002,-96.896h25.792c5.536,0 10.023,-4.488 10.023,-10.024v-53.779C292.844,112.048 288.356,107.559 282.82,107.559zM24.204,109.683h55.932v69.584H24.204V109.683zM78.226,276.952l-31.139,-75.196h33.839l31.138,75.196H78.226zM100.183,180.201v-71.452c20.889,-3.123 72.28,-16.674 136.797,-75.301v84.121v0.015v53.779c0,0.008 0,0.017 0,0.025l0.002,84.111C172.466,196.876 121.072,183.326 100.183,180.201zM272.796,161.34h-15.768v-33.732h15.768V161.34z"
android:strokeColor="#000000" android:strokeWidth="1"/>
android:strokeColor="#000000"
android:strokeWidth="1" />
</vector>

13
app/src/main/res/drawable/ic_arrow_drop_down_accent_24dp.xml

@ -1,5 +1,10 @@
<vector android:height="48dp" android:tint="@color/accent"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="30dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M7,10l5,5 5,-5z"/>
<vector android:height="48dp"
android:tint="@color/accent"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="30dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M7,10l5,5 5,-5z" />
</vector>

13
app/src/main/res/drawable/ic_arrow_drop_up_accent_24dp.xml

@ -1,5 +1,10 @@
<vector android:height="48dp" android:tint="@color/accent"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="30dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M7,14l5,-5 5,5z"/>
<vector android:height="48dp"
android:tint="@color/accent"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="30dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M7,14l5,-5 5,5z" />
</vector>

13
app/src/main/res/drawable/ic_backspace_black_24dp.xml

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="#4B4B4B"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M22,3L7,3c-0.69,0 -1.23,0.35 -1.59,0.88L0,12l5.41,8.11c0.36,0.53 0.9,0.89 1.59,0.89h15c1.1,0 2,-0.9 2,-2L24,5c0,-1.1 -0.9,-2 -2,-2zM19,15.59L17.59,17 14,13.41 10.41,17 9,15.59 12.59,12 9,8.41 10.41,7 14,10.59 17.59,7 19,8.41 15.41,12 19,15.59z"/>
<vector android:height="24dp"
android:tint="#4B4B4B"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M22,3L7,3c-0.69,0 -1.23,0.35 -1.59,0.88L0,12l5.41,8.11c0.36,0.53 0.9,0.89 1.59,0.89h15c1.1,0 2,-0.9 2,-2L24,5c0,-1.1 -0.9,-2 -2,-2zM19,15.59L17.59,17 14,13.41 10.41,17 9,15.59 12.59,12 9,8.41 10.41,7 14,10.59 17.59,7 19,8.41 15.41,12 19,15.59z" />
</vector>

13
app/src/main/res/drawable/ic_bookmark_false_accent_24dp.xml

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="@color/accent"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M17,3L7,3c-1.1,0 -1.99,0.9 -1.99,2L5,21l7,-3 7,3L19,5c0,-1.1 -0.9,-2 -2,-2zM17,18l-5,-2.18L7,18L7,5h10v13z"/>
<vector android:height="24dp"
android:tint="@color/accent"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M17,3L7,3c-1.1,0 -1.99,0.9 -1.99,2L5,21l7,-3 7,3L19,5c0,-1.1 -0.9,-2 -2,-2zM17,18l-5,-2.18L7,18L7,5h10v13z" />
</vector>

13
app/src/main/res/drawable/ic_bookmark_true_accent_24dp.xml

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="@color/accent"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M17,3H7c-1.1,0 -1.99,0.9 -1.99,2L5,21l7,-3 7,3V5c0,-1.1 -0.9,-2 -2,-2z"/>
<vector android:height="24dp"
android:tint="@color/accent"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M17,3H7c-1.1,0 -1.99,0.9 -1.99,2L5,21l7,-3 7,3V5c0,-1.1 -0.9,-2 -2,-2z" />
</vector>

10
app/src/main/res/drawable/ic_cached_accent_24dp.xml

@ -1,4 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp">
<path android:fillColor="#26A69A" android:pathData="M19,8l-4,4h3c0,3.31 -2.69,6 -6,6 -1.01,0 -1.97,-0.25 -2.8,-0.7l-1.46,1.46C8.97,19.54 10.43,20 12,20c4.42,0 8,-3.58 8,-8h3l-4,-4zM6,12c0,-3.31 2.69,-6 6,-6 1.01,0 1.97,0.25 2.8,0.7l1.46,-1.46C15.03,4.46 13.57,4 12,4c-4.42,0 -8,3.58 -8,8H1l4,4 4,-4H6z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="24dp">
<path
android:fillColor="#26A69A"
android:pathData="M19,8l-4,4h3c0,3.31 -2.69,6 -6,6 -1.01,0 -1.97,-0.25 -2.8,-0.7l-1.46,1.46C8.97,19.54 10.43,20 12,20c4.42,0 8,-3.58 8,-8h3l-4,-4zM6,12c0,-3.31 2.69,-6 6,-6 1.01,0 1.97,0.25 2.8,0.7l1.46,-1.46C15.03,4.46 13.57,4 12,4c-4.42,0 -8,3.58 -8,8H1l4,4 4,-4H6z" />
</vector>

10
app/src/main/res/drawable/ic_cancel_accent_24dp.xml

@ -1,4 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp">
<path android:fillColor="#26A69A" android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM17,15.59L15.59,17 12,13.41 8.41,17 7,15.59 10.59,12 7,8.41 8.41,7 12,10.59 15.59,7 17,8.41 13.41,12 17,15.59z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="24dp">
<path
android:fillColor="#26A69A"
android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM17,15.59L15.59,17 12,13.41 8.41,17 7,15.59 10.59,12 7,8.41 8.41,7 12,10.59 15.59,7 17,8.41 13.41,12 17,15.59z" />
</vector>

13
app/src/main/res/drawable/ic_code.xml

@ -1,5 +1,10 @@
<vector android:height="@dimen/editor_format_button_size" android:tint="@color/topic_post_icon"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="@dimen/editor_format_button_size" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M9.4,16.6L4.8,12l4.6,-4.6L8,6l-6,6 6,6 1.4,-1.4zM14.6,16.6l4.6,-4.6 -4.6,-4.6L16,6l6,6 -6,6 -1.4,-1.4z"/>
<vector android:height="@dimen/editor_format_button_size"
android:tint="@color/topic_post_icon"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="@dimen/editor_format_button_size"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M9.4,16.6L4.8,12l4.6,-4.6L8,6l-6,6 6,6 1.4,-1.4zM14.6,16.6l4.6,-4.6 -4.6,-4.6L16,6l6,6 -6,6 -1.4,-1.4z" />
</vector>

15
app/src/main/res/drawable/ic_default_user_avatar.xml

@ -1,5 +1,12 @@
<vector android:height="24dp" android:viewportHeight="512"
android:viewportWidth="512" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#ffffff" android:pathData="M256,60c-108.27,0 -196,87.73 -196,196c0,108.27 87.73,196 196,196c108.27,0 196,-87.73 196,-196c0,-108.27 -87.73,-196 -196,-196z"/>
<path android:fillColor="#494949" android:pathData="M504,256c0,137 -111,248 -248,248c-137,0 -248,-111 -248,-248c0,-137 111,-248 248,-248c137,0 248,111 248,248zM168,192c0,48.6 39.4,88 88,88c48.6,0 88,-39.4 88,-88c0,-48.6 -39.4,-88 -88,-88c-48.6,0 -88,39.4 -88,88zM402.5,379.8c-18.8,-35.4 -55.6,-59.8 -98.5,-59.8c-2.4,0 -4.8,0.4 -7.1,1.1c-12.9,4.2 -26.6,6.9 -40.9,6.9c-14.3,0 -27.9,-2.7 -40.9,-6.9c-2.3,-0.7 -4.7,-1.1 -7.1,-1.1c-42.9,0 -79.7,24.4 -98.5,59.8c35.2,41.6 87.8,68.2 146.5,68.2c58.7,0 111.3,-26.6 146.5,-68.2z"/>
<vector android:height="24dp"
android:viewportHeight="512"
android:viewportWidth="512"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#ffffff"
android:pathData="M256,60c-108.27,0 -196,87.73 -196,196c0,108.27 87.73,196 196,196c108.27,0 196,-87.73 196,-196c0,-108.27 -87.73,-196 -196,-196z" />
<path
android:fillColor="#494949"
android:pathData="M504,256c0,137 -111,248 -248,248c-137,0 -248,-111 -248,-248c0,-137 111,-248 248,-248c137,0 248,111 248,248zM168,192c0,48.6 39.4,88 88,88c48.6,0 88,-39.4 88,-88c0,-48.6 -39.4,-88 -88,-88c-48.6,0 -88,39.4 -88,88zM402.5,379.8c-18.8,-35.4 -55.6,-59.8 -98.5,-59.8c-2.4,0 -4.8,0.4 -7.1,1.1c-12.9,4.2 -26.6,6.9 -40.9,6.9c-14.3,0 -27.9,-2.7 -40.9,-6.9c-2.3,-0.7 -4.7,-1.1 -7.1,-1.1c-42.9,0 -79.7,24.4 -98.5,59.8c35.2,41.6 87.8,68.2 146.5,68.2c58.7,0 111.3,-26.6 146.5,-68.2z" />
</vector>

15
app/src/main/res/drawable/ic_default_user_avatar_darker.xml

@ -1,5 +1,12 @@
<vector android:height="24dp" android:viewportHeight="512"
android:viewportWidth="512" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#ffffff" android:pathData="M256,60c-108.27,0 -196,87.73 -196,196c0,108.27 87.73,196 196,196c108.27,0 196,-87.73 196,-196c0,-108.27 -87.73,-196 -196,-196z"/>
<path android:fillColor="#323232" android:pathData="M504,256c0,137 -111,248 -248,248c-137,0 -248,-111 -248,-248c0,-137 111,-248 248,-248c137,0 248,111 248,248zM168,192c0,48.6 39.4,88 88,88c48.6,0 88,-39.4 88,-88c0,-48.6 -39.4,-88 -88,-88c-48.6,0 -88,39.4 -88,88zM402.5,379.8c-18.8,-35.4 -55.6,-59.8 -98.5,-59.8c-2.4,0 -4.8,0.4 -7.1,1.1c-12.9,4.2 -26.6,6.9 -40.9,6.9c-14.3,0 -27.9,-2.7 -40.9,-6.9c-2.3,-0.7 -4.7,-1.1 -7.1,-1.1c-42.9,0 -79.7,24.4 -98.5,59.8c35.2,41.6 87.8,68.2 146.5,68.2c58.7,0 111.3,-26.6 146.5,-68.2z"/>
<vector android:height="24dp"
android:viewportHeight="512"
android:viewportWidth="512"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#ffffff"
android:pathData="M256,60c-108.27,0 -196,87.73 -196,196c0,108.27 87.73,196 196,196c108.27,0 196,-87.73 196,-196c0,-108.27 -87.73,-196 -196,-196z" />
<path
android:fillColor="#323232"
android:pathData="M504,256c0,137 -111,248 -248,248c-137,0 -248,-111 -248,-248c0,-137 111,-248 248,-248c137,0 248,111 248,248zM168,192c0,48.6 39.4,88 88,88c48.6,0 88,-39.4 88,-88c0,-48.6 -39.4,-88 -88,-88c-48.6,0 -88,39.4 -88,88zM402.5,379.8c-18.8,-35.4 -55.6,-59.8 -98.5,-59.8c-2.4,0 -4.8,0.4 -7.1,1.1c-12.9,4.2 -26.6,6.9 -40.9,6.9c-14.3,0 -27.9,-2.7 -40.9,-6.9c-2.3,-0.7 -4.7,-1.1 -7.1,-1.1c-42.9,0 -79.7,24.4 -98.5,59.8c35.2,41.6 87.8,68.2 146.5,68.2c58.7,0 111.3,-26.6 146.5,-68.2z" />
</vector>

13
app/src/main/res/drawable/ic_delete_accent_24dp.xml

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="@color/accent"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
<vector android:height="24dp"
android:tint="@color/accent"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z" />
</vector>

13
app/src/main/res/drawable/ic_delete_white_24dp.xml

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
<vector android:height="24dp"
android:tint="#FFFFFF"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z" />
</vector>

13
app/src/main/res/drawable/ic_edit_white_24dp.xml

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"/>
<vector android:height="24dp"
android:tint="#FFFFFF"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z" />
</vector>

13
app/src/main/res/drawable/ic_fiber_new_white_24dp.xml

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M20,4L4,4c-1.11,0 -1.99,0.89 -1.99,2L2,18c0,1.11 0.89,2 2,2h16c1.11,0 2,-0.89 2,-2L22,6c0,-1.11 -0.89,-2 -2,-2zM8.5,15L7.3,15l-2.55,-3.5L4.75,15L3.5,15L3.5,9h1.25l2.5,3.5L7.25,9L8.5,9v6zM13.5,10.26L11,10.26v1.12h2.5v1.26L11,12.64v1.11h2.5L13.5,15h-4L9.5,9h4v1.26zM20.5,14c0,0.55 -0.45,1 -1,1h-4c-0.55,0 -1,-0.45 -1,-1L14.5,9h1.25v4.51h1.13L16.88,9.99h1.25v3.51h1.12L19.25,9h1.25v5z"/>
<vector android:height="24dp"
android:tint="#FFFFFF"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M20,4L4,4c-1.11,0 -1.99,0.89 -1.99,2L2,18c0,1.11 0.89,2 2,2h16c1.11,0 2,-0.89 2,-2L22,6c0,-1.11 -0.89,-2 -2,-2zM8.5,15L7.3,15l-2.55,-3.5L4.75,15L3.5,15L3.5,9h1.25l2.5,3.5L7.25,9L8.5,9v6zM13.5,10.26L11,10.26v1.12h2.5v1.26L11,12.64v1.11h2.5L13.5,15h-4L9.5,9h4v1.26zM20.5,14c0,0.55 -0.45,1 -1,1h-4c-0.55,0 -1,-0.45 -1,-1L14.5,9h1.25v4.51h1.13L16.88,9.99h1.25v3.51h1.12L19.25,9h1.25v5z" />
</vector>

13
app/src/main/res/drawable/ic_file_not_found.xml

@ -1,5 +1,10 @@
<vector android:height="96dp" android:tint="#D926A69A"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="96dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M19.35,10.04C18.67,6.59 15.64,4 12,4c-1.48,0 -2.85,0.43 -4.01,1.17l1.46,1.46C10.21,6.23 11.08,6 12,6c3.04,0 5.5,2.46 5.5,5.5v0.5H19c1.66,0 3,1.34 3,3 0,1.13 -0.64,2.11 -1.56,2.62l1.45,1.45C23.16,18.16 24,16.68 24,15c0,-2.64 -2.05,-4.78 -4.65,-4.96zM3,5.27l2.75,2.74C2.56,8.15 0,10.77 0,14c0,3.31 2.69,6 6,6h11.73l2,2L21,20.73 4.27,4 3,5.27zM7.73,10l8,8H6c-2.21,0 -4,-1.79 -4,-4s1.79,-4 4,-4h1.73z"/>
<vector android:height="96dp"
android:tint="#D926A69A"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="96dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M19.35,10.04C18.67,6.59 15.64,4 12,4c-1.48,0 -2.85,0.43 -4.01,1.17l1.46,1.46C10.21,6.23 11.08,6 12,6c3.04,0 5.5,2.46 5.5,5.5v0.5H19c1.66,0 3,1.34 3,3 0,1.13 -0.64,2.11 -1.56,2.62l1.45,1.45C23.16,18.16 24,16.68 24,15c0,-2.64 -2.05,-4.78 -4.65,-4.96zM3,5.27l2.75,2.74C2.56,8.15 0,10.77 0,14c0,3.31 2.69,6 6,6h11.73l2,2L21,20.73 4.27,4 3,5.27zM7.73,10l8,8H6c-2.21,0 -4,-1.79 -4,-4s1.79,-4 4,-4h1.73z" />
</vector>

13
app/src/main/res/drawable/ic_file_upload_white_24dp.xml

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M9,16h6v-6h4l-7,-7 -7,7h4zM5,18h14v2L5,20z"/>
<vector android:height="24dp"
android:tint="#FFFFFF"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M9,16h6v-6h4l-7,-7 -7,7h4zM5,18h14v2L5,20z" />
</vector>

13
app/src/main/res/drawable/ic_format_align_center.xml

@ -1,5 +1,10 @@
<vector android:height="@dimen/editor_format_button_size" android:tint="@color/topic_post_icon"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="@dimen/editor_format_button_size" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M7,15v2h10v-2L7,15zM3,21h18v-2L3,19v2zM3,13h18v-2L3,11v2zM7,7v2h10L17,7L7,7zM3,3v2h18L21,3L3,3z"/>
<vector android:height="@dimen/editor_format_button_size"
android:tint="@color/topic_post_icon"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="@dimen/editor_format_button_size"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M7,15v2h10v-2L7,15zM3,21h18v-2L3,19v2zM3,13h18v-2L3,11v2zM7,7v2h10L17,7L7,7zM3,3v2h18L21,3L3,3z" />
</vector>

13
app/src/main/res/drawable/ic_format_align_left.xml

@ -1,5 +1,10 @@
<vector android:height="@dimen/editor_format_button_size" android:tint="@color/topic_post_icon"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="@dimen/editor_format_button_size" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M15,15L3,15v2h12v-2zM15,7L3,7v2h12L15,7zM3,13h18v-2L3,11v2zM3,21h18v-2L3,19v2zM3,3v2h18L21,3L3,3z"/>
<vector android:height="@dimen/editor_format_button_size"
android:tint="@color/topic_post_icon"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="@dimen/editor_format_button_size"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M15,15L3,15v2h12v-2zM15,7L3,7v2h12L15,7zM3,13h18v-2L3,11v2zM3,21h18v-2L3,19v2zM3,3v2h18L21,3L3,3z" />
</vector>

13
app/src/main/res/drawable/ic_format_align_right.xml

@ -1,5 +1,10 @@
<vector android:height="@dimen/editor_format_button_size" android:tint="@color/topic_post_icon"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="@dimen/editor_format_button_size" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M3,21h18v-2L3,19v2zM9,17h12v-2L9,15v2zM3,13h18v-2L3,11v2zM9,9h12L21,7L9,7v2zM3,3v2h18L21,3L3,3z"/>
<vector android:height="@dimen/editor_format_button_size"
android:tint="@color/topic_post_icon"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="@dimen/editor_format_button_size"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M3,21h18v-2L3,19v2zM9,17h12v-2L9,15v2zM3,13h18v-2L3,11v2zM9,9h12L21,7L9,7v2zM3,3v2h18L21,3L3,3z" />
</vector>

15
app/src/main/res/drawable/ic_format_color_text.xml

@ -1,6 +1,13 @@
<vector android:height="@dimen/editor_format_button_size"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="@dimen/editor_format_button_size" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillAlpha="1" android:fillColor="@color/accent" android:pathData="M0,20h24v4H0z"/>
<path android:fillColor="@color/topic_post_icon" android:pathData="M11,3L5.5,17h2.25l1.12,-3h6.25l1.12,3h2.25L13,3h-2zM9.62,12L12,5.67 14.38,12L9.62,12z"/>
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="@dimen/editor_format_button_size"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillAlpha="1"
android:fillColor="@color/accent"
android:pathData="M0,20h24v4H0z" />
<path
android:fillColor="@color/topic_post_icon"
android:pathData="M11,3L5.5,17h2.25l1.12,-3h6.25l1.12,3h2.25L13,3h-2zM9.62,12L12,5.67 14.38,12L9.62,12z" />
</vector>

11
app/src/main/res/drawable/ic_format_italic.xml

@ -1,4 +1,9 @@
<vector android:height="@dimen/editor_format_button_size" android:viewportHeight="24.0"
android:viewportWidth="24.0" android:width="@dimen/editor_format_button_size" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@color/topic_post_icon" android:pathData="M10,4v3h2.21l-3.42,8H6v3h8v-3h-2.21l3.42,-8H18V4z"/>
<vector android:height="@dimen/editor_format_button_size"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="@dimen/editor_format_button_size"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="@color/topic_post_icon"
android:pathData="M10,4v3h2.21l-3.42,8H6v3h8v-3h-2.21l3.42,-8H18V4z" />
</vector>

13
app/src/main/res/drawable/ic_format_list_bulleted.xml

@ -1,5 +1,10 @@
<vector android:height="@dimen/editor_format_button_size" android:tint="@color/topic_post_icon"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="@dimen/editor_format_button_size" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M4,10.5c-0.83,0 -1.5,0.67 -1.5,1.5s0.67,1.5 1.5,1.5 1.5,-0.67 1.5,-1.5 -0.67,-1.5 -1.5,-1.5zM4,4.5c-0.83,0 -1.5,0.67 -1.5,1.5S3.17,7.5 4,7.5 5.5,6.83 5.5,6 4.83,4.5 4,4.5zM4,16.5c-0.83,0 -1.5,0.68 -1.5,1.5s0.68,1.5 1.5,1.5 1.5,-0.68 1.5,-1.5 -0.67,-1.5 -1.5,-1.5zM7,19h14v-2L7,17v2zM7,13h14v-2L7,11v2zM7,5v2h14L21,5L7,5z"/>
<vector android:height="@dimen/editor_format_button_size"
android:tint="@color/topic_post_icon"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="@dimen/editor_format_button_size"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M4,10.5c-0.83,0 -1.5,0.67 -1.5,1.5s0.67,1.5 1.5,1.5 1.5,-0.67 1.5,-1.5 -0.67,-1.5 -1.5,-1.5zM4,4.5c-0.83,0 -1.5,0.67 -1.5,1.5S3.17,7.5 4,7.5 5.5,6.83 5.5,6 4.83,4.5 4,4.5zM4,16.5c-0.83,0 -1.5,0.68 -1.5,1.5s0.68,1.5 1.5,1.5 1.5,-0.68 1.5,-1.5 -0.67,-1.5 -1.5,-1.5zM7,19h14v-2L7,17v2zM7,13h14v-2L7,11v2zM7,5v2h14L21,5L7,5z" />
</vector>

13
app/src/main/res/drawable/ic_format_quote.xml

@ -1,5 +1,10 @@
<vector android:height="@dimen/editor_format_button_size" android:tint="@color/topic_post_icon"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="@dimen/editor_format_button_size" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M6,17h3l2,-4L11,7L5,7v6h3zM14,17h3l2,-4L19,7h-6v6h3z"/>
<vector android:height="@dimen/editor_format_button_size"
android:tint="@color/topic_post_icon"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="@dimen/editor_format_button_size"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M6,17h3l2,-4L11,7L5,7v6h3zM14,17h3l2,-4L19,7h-6v6h3z" />
</vector>

13
app/src/main/res/drawable/ic_format_quote_checked_accent_24dp.xml

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="@color/accent"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M6,17h3l2,-4L11,7L5,7v6h3zM14,17h3l2,-4L19,7h-6v6h3z"/>
<vector android:height="24dp"
android:tint="@color/accent"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M6,17h3l2,-4L11,7L5,7v6h3zM14,17h3l2,-4L19,7h-6v6h3z" />
</vector>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save