aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-03-05 09:43:27 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-03-05 09:43:27 +0000
commitf3f9642a0e200b62f3010b013e6107d039ae8e90 (patch)
tree16d5b48be71e90b2a063314e0dfb00f65ed75d33 /app/src
parentb101e4c87d78c880fca6971319daddd05470f0db (diff)
downloadinfinity-for-reddit-f3f9642a0e200b62f3010b013e6107d039ae8e90.tar
infinity-for-reddit-f3f9642a0e200b62f3010b013e6107d039ae8e90.tar.gz
infinity-for-reddit-f3f9642a0e200b62f3010b013e6107d039ae8e90.tar.bz2
infinity-for-reddit-f3f9642a0e200b62f3010b013e6107d039ae8e90.tar.lz
infinity-for-reddit-f3f9642a0e200b62f3010b013e6107d039ae8e90.tar.xz
infinity-for-reddit-f3f9642a0e200b62f3010b013e6107d039ae8e90.tar.zst
infinity-for-reddit-f3f9642a0e200b62f3010b013e6107d039ae8e90.zip
Add a custom theme table in database.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountPostsActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountSavedThingActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java16
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CommentActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CreateMultiRedditActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/EditCommentActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/EditPostActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/FilteredThingActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MultiRedditListingActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostImageActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostLinkActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostTextActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostVideoActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/RulesActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchResultActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchSubredditsResultActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SettingsActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SubredditMultiselectionActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SubredditSelectionActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SubscribedThingListingActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewGIFActivity.java5
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewMessageActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewMultiRedditDetailActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSidebarActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSubredditDetailActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewUserDetailActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewVideoActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java10
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomTheme.java116
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeDao.java24
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeRepository.java19
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeViewModel.java36
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/CommentsListingFragment.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/FollowedUsersListingFragment.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SubredditListingFragment.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SubscribedSubredditsListingFragment.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/UserListingFragment.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/MultiRedditRepository.java28
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/MultiRedditViewModel.java4
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/PullNotificationWorker.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java44
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Settings/GesturesAndButtonsPreferenceFragment.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Settings/MainPreferenceFragment.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Settings/NotificationPreferenceFragment.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java52
-rw-r--r--app/src/main/res/layout/activity_view_gif.xml2
-rw-r--r--app/src/main/res/layout/activity_view_image.xml2
-rw-r--r--app/src/main/res/layout/item_post.xml6
-rw-r--r--app/src/main/res/layout/item_post_compact.xml4
-rw-r--r--app/src/main/res/layout/item_post_detail.xml6
-rw-r--r--app/src/main/res/values/attr.xml4
-rw-r--r--app/src/main/res/values/strings.xml3
-rw-r--r--app/src/main/res/values/styles.xml33
60 files changed, 402 insertions, 69 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountPostsActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountPostsActivity.java
index 2c7416a0..822a47ec 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountPostsActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountPostsActivity.java
@@ -20,6 +20,7 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import javax.inject.Inject;
+import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
@@ -56,6 +57,7 @@ public class AccountPostsActivity extends BaseActivity implements SortTypeSelect
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean isInLazyMode = false;
private boolean mNullAccessToken = false;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountSavedThingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountSavedThingActivity.java
index 238ed3ce..0b10698a 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountSavedThingActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountSavedThingActivity.java
@@ -65,6 +65,7 @@ public class AccountSavedThingActivity extends BaseActivity {
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private SectionsPagerAdapter sectionsPagerAdapter;
private Menu mMenu;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java
index 863322ce..9200e80a 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java
@@ -50,8 +50,7 @@ public abstract class BaseActivity extends AppCompatActivity {
case 0:
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_NO);
getTheme().applyStyle(R.style.Theme_Purple, true);
- lightStatusbar = !transparentStatusBarAfterToolbarCollapsed;
- changeStatusBarIconColor = false;
+ changeStatusBarIconColor = immersiveInterface;
break;
case 1:
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_YES);
@@ -70,8 +69,7 @@ public abstract class BaseActivity extends AppCompatActivity {
}
if((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_NO) {
getTheme().applyStyle(R.style.Theme_Purple, true);
- lightStatusbar = !transparentStatusBarAfterToolbarCollapsed;
- changeStatusBarIconColor = false;
+ changeStatusBarIconColor = immersiveInterface;
} else {
if(mSharedPreferences.getBoolean(SharedPreferencesUtils.AMOLED_DARK_KEY, false)) {
getTheme().applyStyle(R.style.Theme_Default_AmoledDark, true);
@@ -172,4 +170,14 @@ public abstract class BaseActivity extends AppCompatActivity {
public void setTransparentStatusBarAfterToolbarCollapsed(boolean transparentStatusBarAfterToolbarCollapsed) {
this.transparentStatusBarAfterToolbarCollapsed = transparentStatusBarAfterToolbarCollapsed;
}
+
+ @Override
+ protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
+ super.onApplyThemeResource(theme, resid, first);
+ }
+
+ @Override
+ public Resources.Theme getTheme() {
+ return super.getTheme();
+ }
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CommentActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CommentActivity.java
index 73cde34e..fd422e9e 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CommentActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CommentActivity.java
@@ -89,6 +89,7 @@ public class CommentActivity extends BaseActivity {
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean mNullAccessToken = false;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CreateMultiRedditActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CreateMultiRedditActivity.java
index dcd3a734..61593cd9 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CreateMultiRedditActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CreateMultiRedditActivity.java
@@ -66,6 +66,7 @@ public class CreateMultiRedditActivity extends BaseActivity {
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean mNullAccessToken = false;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/EditCommentActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/EditCommentActivity.java
index 657a0fc4..b71dd151 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/EditCommentActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/EditCommentActivity.java
@@ -63,6 +63,7 @@ public class EditCommentActivity extends BaseActivity {
@Named("oauth")
Retrofit mOauthRetrofit;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private String mFullName;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/EditPostActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/EditPostActivity.java
index a93a8b48..fa0a3d74 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/EditPostActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/EditPostActivity.java
@@ -62,6 +62,7 @@ public class EditPostActivity extends BaseActivity {
@Named("oauth")
Retrofit mOauthRetrofit;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private String mFullName;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/FilteredThingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/FilteredThingActivity.java
index f2747ff8..66a9b154 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/FilteredThingActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/FilteredThingActivity.java
@@ -20,6 +20,7 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import javax.inject.Inject;
+import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
@@ -64,6 +65,7 @@ public class FilteredThingActivity extends BaseActivity implements SortTypeSelec
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean isInLazyMode = false;
private boolean mNullAccessToken = false;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java
index 0a2553de..b112ee47 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java
@@ -18,6 +18,7 @@ import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
+import javax.inject.Named;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
@@ -44,6 +45,7 @@ public class LinkResolverActivity extends AppCompatActivity {
private static final String MULTIREDDIT_PATTERN = "/user/\\w+/m/\\w+/{0,1}";
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
public static Uri getRedditUriByPath(String path) {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java
index 89e19a2b..212dbd0f 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java
@@ -59,6 +59,7 @@ public class LoginActivity extends BaseActivity {
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private String authCode;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java
index af05d808..b9c74256 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java
@@ -152,6 +152,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private SectionsPagerAdapter sectionsPagerAdapter;
private AppBarLayout.LayoutParams params;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MultiRedditListingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MultiRedditListingActivity.java
index 4667ce9d..8080794e 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MultiRedditListingActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MultiRedditListingActivity.java
@@ -70,6 +70,7 @@ public class MultiRedditListingActivity extends BaseActivity {
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
@Inject
@Named("oauth")
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostImageActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostImageActivity.java
index 69150291..949b5428 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostImageActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostImageActivity.java
@@ -122,6 +122,7 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean mNullAccessToken = false;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostLinkActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostLinkActivity.java
index 0f9b54fc..dd9fee91 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostLinkActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostLinkActivity.java
@@ -99,6 +99,7 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean mNullAccessToken = false;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostTextActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostTextActivity.java
index 988454e2..c310b3c3 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostTextActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostTextActivity.java
@@ -99,6 +99,7 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean mNullAccessToken = false;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostVideoActivity.java
index 33ce3006..d73f9704 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostVideoActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/PostVideoActivity.java
@@ -127,6 +127,7 @@ public class PostVideoActivity extends BaseActivity implements FlairBottomSheetF
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean mNullAccessToken = false;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/RulesActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/RulesActivity.java
index 57b15c4c..826debd6 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/RulesActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/RulesActivity.java
@@ -62,6 +62,7 @@ public class RulesActivity extends BaseActivity {
@Named("no_oauth")
Retrofit mRetrofit;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private String mSubredditName;
private RulesRecyclerViewAdapter mAdapter;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchActivity.java
index 580b7d49..58716b61 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchActivity.java
@@ -22,6 +22,7 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import javax.inject.Inject;
+import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
@@ -53,6 +54,7 @@ public class SearchActivity extends BaseActivity {
@BindView(R.id.subreddit_name_text_view_search_activity)
TextView subredditNameTextView;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private String query;
private String subredditName;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchResultActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchResultActivity.java
index ab2fad08..f21c6515 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchResultActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchResultActivity.java
@@ -25,6 +25,7 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import javax.inject.Inject;
+import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
@@ -66,6 +67,7 @@ public class SearchResultActivity extends BaseActivity implements SortTypeSelect
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean mNullAccessToken = false;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchSubredditsResultActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchSubredditsResultActivity.java
index 0b8a6b1e..ba1ba5c9 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchSubredditsResultActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchSubredditsResultActivity.java
@@ -19,6 +19,7 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import javax.inject.Inject;
+import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
@@ -48,6 +49,7 @@ public class SearchSubredditsResultActivity extends BaseActivity {
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean mNullAccessToken = false;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SettingsActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SettingsActivity.java
index adaef84d..81b16bef 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SettingsActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SettingsActivity.java
@@ -14,6 +14,7 @@ import androidx.preference.PreferenceFragmentCompat;
import com.google.android.material.appbar.AppBarLayout;
import javax.inject.Inject;
+import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
@@ -34,6 +35,7 @@ public class SettingsActivity extends BaseActivity implements
Toolbar toolbar;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
@Override
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SubredditMultiselectionActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SubredditMultiselectionActivity.java
index 2bf4e5dd..3be8274c 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SubredditMultiselectionActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SubredditMultiselectionActivity.java
@@ -74,6 +74,7 @@ public class SubredditMultiselectionActivity extends BaseActivity {
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean mNullAccessToken = false;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SubredditSelectionActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SubredditSelectionActivity.java
index 4abb5a42..ee9efb95 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SubredditSelectionActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SubredditSelectionActivity.java
@@ -65,6 +65,7 @@ public class SubredditSelectionActivity extends BaseActivity {
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean mNullAccessToken = false;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SubscribedThingListingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SubscribedThingListingActivity.java
index 506d47bf..d7da38ef 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SubscribedThingListingActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SubscribedThingListingActivity.java
@@ -65,6 +65,7 @@ public class SubscribedThingListingActivity extends BaseActivity {
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean mNullAccessToken = false;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewGIFActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewGIFActivity.java
index 5c641cff..72cef5a5 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewGIFActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewGIFActivity.java
@@ -47,6 +47,7 @@ import com.github.pwittchen.swipe.library.rx2.Swipe;
import java.io.File;
import javax.inject.Inject;
+import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
@@ -74,6 +75,7 @@ public class ViewGIFActivity extends AppCompatActivity {
@BindView(R.id.load_image_error_linear_layout_view_gif_activity)
LinearLayout mLoadErrorLinearLayout;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean isActionBarHidden = false;
private boolean isDownloading = false;
@@ -406,7 +408,8 @@ public class ViewGIFActivity extends AppCompatActivity {
@Override
public void saveFailed() {
-
+ Toast.makeText(ViewGIFActivity.this,
+ R.string.cannot_save_gif, Toast.LENGTH_SHORT).show();
}
}).execute();
} else {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageActivity.java
index c58d0736..0697c5e1 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageActivity.java
@@ -52,6 +52,7 @@ import com.github.pwittchen.swipe.library.rx2.Swipe;
import java.io.File;
import javax.inject.Inject;
+import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
@@ -78,6 +79,7 @@ public class ViewImageActivity extends AppCompatActivity {
@BindView(R.id.load_image_error_linear_layout_view_image_activity)
LinearLayout mLoadErrorLinearLayout;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean isActionBarHidden = false;
private boolean isDownloading = false;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewMessageActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewMessageActivity.java
index 0468038a..c765f863 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewMessageActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewMessageActivity.java
@@ -79,6 +79,7 @@ public class ViewMessageActivity extends BaseActivity {
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean mNullAccessToken = false;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewMultiRedditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewMultiRedditDetailActivity.java
index cfe2af6f..2cd68c10 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewMultiRedditDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewMultiRedditDetailActivity.java
@@ -68,6 +68,7 @@ public class ViewMultiRedditDetailActivity extends BaseActivity implements SortT
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean mNullAccessToken = false;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java
index 9d77c73b..230e6a2a 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java
@@ -154,6 +154,7 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private RequestManager mGlide;
private Locale mLocale;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSidebarActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSidebarActivity.java
index 35076de2..4955689b 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSidebarActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSidebarActivity.java
@@ -70,6 +70,7 @@ public class ViewSidebarActivity extends BaseActivity {
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private String subredditName;
private SubredditViewModel mSubredditViewModel;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSubredditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSubredditDetailActivity.java
index b9640612..6d3b3cbe 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSubredditDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSubredditDetailActivity.java
@@ -132,6 +132,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean mNullAccessToken = false;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewUserDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewUserDetailActivity.java
index a71b2c71..e15d805b 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewUserDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewUserDetailActivity.java
@@ -122,6 +122,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private SectionsPagerAdapter sectionsPagerAdapter;
private SubscribedUserDao subscribedUserDao;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewVideoActivity.java
index 935538e7..7e873010 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewVideoActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewVideoActivity.java
@@ -54,6 +54,7 @@ import com.google.android.exoplayer2.util.Util;
import java.io.File;
import javax.inject.Inject;
+import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
@@ -91,6 +92,7 @@ public class ViewVideoActivity extends AppCompatActivity {
private float touchY = -1.0f;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
@Override
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java b/app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java
index a8619df8..c64fac50 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java
@@ -1,6 +1,7 @@
package ml.docilealligator.infinityforreddit;
import android.app.Application;
+import android.content.Context;
import android.content.SharedPreferences;
import androidx.preference.PreferenceManager;
@@ -13,6 +14,7 @@ import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import ml.docilealligator.infinityforreddit.Utils.RedditUtils;
+import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
import okhttp3.ConnectionPool;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
@@ -97,8 +99,16 @@ class AppModule {
}
@Provides
+ @Named("default")
@Singleton
SharedPreferences provideSharedPreferences() {
return PreferenceManager.getDefaultSharedPreferences(mApplication);
}
+
+ @Provides
+ @Named("theme")
+ @Singleton
+ SharedPreferences provideThemeSharedPreferences() {
+ return mApplication.getSharedPreferences(SharedPreferencesUtils.THEME_SHARED_PREFERENCES_FILE, Context.MODE_PRIVATE);
+ }
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomTheme.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomTheme.java
new file mode 100644
index 00000000..799e530d
--- /dev/null
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomTheme.java
@@ -0,0 +1,116 @@
+package ml.docilealligator.infinityforreddit.CustomTheme;
+
+import androidx.annotation.NonNull;
+import androidx.room.ColumnInfo;
+import androidx.room.Entity;
+import androidx.room.PrimaryKey;
+
+@Entity(tableName = "custom_themes")
+public class CustomTheme {
+ @PrimaryKey
+ @NonNull
+ @ColumnInfo(name = "name")
+ public String name;
+ @ColumnInfo(name = "color_primary")
+ public int colorPrimary;
+ @ColumnInfo(name = "color_primary_dark")
+ public int colorPrimaryDark;
+ @ColumnInfo(name = "color_accent")
+ public int colorAccent;
+ @ColumnInfo(name = "color_primary_light_theme")
+ public int colorPrimaryLightTheme;
+ @ColumnInfo(name = "primary_text_color")
+ public int primaryTextColor;
+ @ColumnInfo(name = "secondary_text_color")
+ public int secondaryTextColor;
+ @ColumnInfo(name = "background_color")
+ public int backgroundColor;
+ @ColumnInfo(name = "rounded_bottom_sheet_primary_background")
+ public int roundedBottomSheetPrimaryBackground;
+ @ColumnInfo(name = "card_view_background_color")
+ public int cardViewBackgroundColor;
+ @ColumnInfo(name = "toolbar_primary_text_and_icon_color")
+ public int toolbarPrimaryTextAndIconColor;
+ @ColumnInfo(name = "toolbar_and_tab_background_color")
+ public int toolbarAndTabBackgroundColor;
+ @ColumnInfo(name = "circular_progress_bar_background")
+ public int circularProgressBarBackground;
+ @ColumnInfo(name = "tab_layout_with_expanded_collapsing_toolbar_tab_background")
+ public int tabLayoutWithExpandedCollapsingToolbarTabBackground;
+ @ColumnInfo(name = "tab_layout_with_expanded_collapsing_toolbar_text_color")
+ public int tabLayoutWithExpandedCollapsingToolbarTextColor;
+ @ColumnInfo(name = "tab_layout_with_expanded_collapsing_toolbar_tab_indicator")
+ public int tabLayoutWithExpandedCollapsingToolbarTabIndicator;
+ @ColumnInfo(name = "tab_layout_with_collapsed_collapsing_toolbar_tab_background")
+ public int tabLayoutWithCollapsedCollapsingToolbarTabBackground;
+ @ColumnInfo(name = "tab_layout_with_collapsed_collapsing_toolbar_text_color")
+ public int tabLayoutWithCollapsedCollapsingToolbarTextColor;
+ @ColumnInfo(name = "tab_layout_with_collapsed_collapsing_toolbar_tab_indicator")
+ public int tabLayoutWithCollapsedCollapsingToolbarTabIndicator;
+ @ColumnInfo(name = "nav_bar_color")
+ public int navBarColor;
+ @ColumnInfo(name = "upvoted")
+ public int upvoted;
+ @ColumnInfo(name = "downvoted")
+ public int downvoted;
+ @ColumnInfo(name = "post_type")
+ public int postType;
+ @ColumnInfo(name = "spoiler_color")
+ public int spoilerColor;
+ @ColumnInfo(name = "nsfw_color")
+ public int nsfwColor;
+ @ColumnInfo(name = "flair_color")
+ public int flairColor;
+ @ColumnInfo(name = "archived_tint")
+ public int archivedTint;
+ @ColumnInfo(name = "locked_icon_tint")
+ public int lockedIconTint;
+ @ColumnInfo(name = "crosspost")
+ public int crosspost;
+ @ColumnInfo(name = "stickied_post")
+ public int stickiedPost;
+ @ColumnInfo(name = "subscribed")
+ public int subscribed;
+ @ColumnInfo(name = "unsubscribed")
+ public int unsubscribed;
+ @ColumnInfo(name = "username")
+ public int username;
+ @ColumnInfo(name = "subreddit")
+ public int subreddit;
+ @ColumnInfo(name = "author_flair_text_color")
+ public int authorFlairTextColor;
+ @ColumnInfo(name = "submitter")
+ public int submitter;
+ @ColumnInfo(name = "moderator")
+ public int moderator;
+ @ColumnInfo(name = "notification_icon_color")
+ public int notificationIconColor;
+ @ColumnInfo(name = "single_comment_thread_background_color")
+ public int singleCommentThreadBackgroundColor;
+ @ColumnInfo(name = "unread_message_background_color")
+ public int unreadMessageBackgroundColor;
+ @ColumnInfo(name = "divider_color")
+ public int dividerColor;
+ @ColumnInfo(name = "no_preview_link_background_color")
+ public int noPreviewLinkBackgroundColor;
+ @ColumnInfo(name = "vote_and_reply_unavailable_vote_button_color")
+ public int voteAndReplyUnavailableVoteButtonColor;
+ @ColumnInfo(name = "comment_vertical_bar_color_1")
+ public int commentVerticalBarColor1;
+ @ColumnInfo(name = "comment_vertical_bar_color_2")
+ public int commentVerticalBarColor2;
+ @ColumnInfo(name = "comment_vertical_bar_color_3")
+ public int commentVerticalBarColor3;
+ @ColumnInfo(name = "comment_vertical_bar_color_4")
+ public int commentVerticalBarColor4;
+ @ColumnInfo(name = "comment_vertical_bar_color_5")
+ public int commentVerticalBarColor5;
+ @ColumnInfo(name = "comment_vertical_bar_color_6")
+ public int commentVerticalBarColor6;
+ @ColumnInfo(name = "comment_vertical_bar_color_7")
+ public int commentVerticalBarColor7;
+
+ public CustomTheme(@NonNull String name) {
+ this.name = name;
+ }
+}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeDao.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeDao.java
new file mode 100644
index 00000000..f1afb3c4
--- /dev/null
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeDao.java
@@ -0,0 +1,24 @@
+package ml.docilealligator.infinityforreddit.CustomTheme;
+
+import androidx.lifecycle.LiveData;
+import androidx.room.Dao;
+import androidx.room.Insert;
+import androidx.room.OnConflictStrategy;
+import androidx.room.Query;
+
+import java.util.List;
+
+@Dao
+public interface CustomThemeDao {
+ @Insert(onConflict = OnConflictStrategy.REPLACE)
+ void insert(CustomTheme customTheme);
+
+ @Query("SELECT * FROM custom_themes")
+ LiveData<List<CustomTheme>> getAllCustomThemes();
+
+ @Query("SELECT * FROM custom_themes WHERE name = :name AND username = :username COLLATE NOCASE LIMIT 1")
+ CustomTheme getCustomTheme(String name, String username);
+
+ @Query("DELETE FROM custom_themes WHERE name = :name AND username = :username")
+ void deleteCustomTheme(String name, String username);
+}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeRepository.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeRepository.java
new file mode 100644
index 00000000..e2c0b692
--- /dev/null
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeRepository.java
@@ -0,0 +1,19 @@
+package ml.docilealligator.infinityforreddit.CustomTheme;
+
+import androidx.lifecycle.LiveData;
+
+import java.util.List;
+
+import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
+
+public class CustomThemeRepository {
+ private LiveData<List<CustomTheme>> mAllCustomThemes;
+
+ CustomThemeRepository(RedditDataRoomDatabase redditDataRoomDatabase) {
+ mAllCustomThemes = redditDataRoomDatabase.customThemeDao().getAllCustomThemes();
+ }
+
+ LiveData<List<CustomTheme>> getAllCustomThemes() {
+ return mAllCustomThemes;
+ }
+}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeViewModel.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeViewModel.java
new file mode 100644
index 00000000..44a43f23
--- /dev/null
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeViewModel.java
@@ -0,0 +1,36 @@
+package ml.docilealligator.infinityforreddit.CustomTheme;
+
+import androidx.annotation.NonNull;
+import androidx.lifecycle.LiveData;
+import androidx.lifecycle.ViewModel;
+import androidx.lifecycle.ViewModelProvider;
+
+import java.util.List;
+
+import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
+
+public class CustomThemeViewModel extends ViewModel {
+ private LiveData<List<CustomTheme>> mAllCustomThemes;
+
+ public CustomThemeViewModel(RedditDataRoomDatabase redditDataRoomDatabase) {
+ mAllCustomThemes = new CustomThemeRepository(redditDataRoomDatabase).getAllCustomThemes();
+ }
+
+ public LiveData<List<CustomTheme>> getAllCustomThemes() {
+ return mAllCustomThemes;
+ }
+
+ public static class Factory extends ViewModelProvider.NewInstanceFactory {
+ private RedditDataRoomDatabase mRedditDataRoomDatabase;
+
+ public Factory(RedditDataRoomDatabase redditDataRoomDatabase) {
+ mRedditDataRoomDatabase = redditDataRoomDatabase;
+ }
+
+ @NonNull
+ @Override
+ public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
+ return (T) new CustomThemeViewModel(mRedditDataRoomDatabase);
+ }
+ }
+}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/CommentsListingFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/CommentsListingFragment.java
index ee3cc947..8cb75d6a 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/CommentsListingFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/CommentsListingFragment.java
@@ -4,7 +4,6 @@ package ml.docilealligator.infinityforreddit.Fragment;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
-import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
@@ -81,6 +80,7 @@ public class CommentsListingFragment extends Fragment implements FragmentCommuni
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private boolean mNullAccessToken = false;
private String mAccessToken;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/FollowedUsersListingFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/FollowedUsersListingFragment.java
index 2bd84344..9dad2c5e 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/FollowedUsersListingFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/FollowedUsersListingFragment.java
@@ -60,6 +60,7 @@ public class FollowedUsersListingFragment extends Fragment implements FragmentCo
@Named("oauth")
Retrofit mOauthRetrofit;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java
index 2605ffa0..7b07c9dc 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java
@@ -112,6 +112,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private RequestManager mGlide;
private AppCompatActivity activity;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SubredditListingFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SubredditListingFragment.java
index 9e16db19..c6a413dc 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SubredditListingFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SubredditListingFragment.java
@@ -5,7 +5,6 @@ import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
-import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
@@ -79,6 +78,7 @@ public class SubredditListingFragment extends Fragment implements FragmentCommun
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private LinearLayoutManager mLinearLayoutManager;
private SubredditListingRecyclerViewAdapter mAdapter;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SubscribedSubredditsListingFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SubscribedSubredditsListingFragment.java
index a0d2af6c..852590b7 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SubscribedSubredditsListingFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SubscribedSubredditsListingFragment.java
@@ -4,7 +4,6 @@ package ml.docilealligator.infinityforreddit.Fragment;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
-import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
@@ -66,6 +65,7 @@ public class SubscribedSubredditsListingFragment extends Fragment implements Fra
@Named("oauth")
Retrofit mOauthRetrofit;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/UserListingFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/UserListingFragment.java
index 726e8c14..4167c483 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/UserListingFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/UserListingFragment.java
@@ -4,7 +4,6 @@ package ml.docilealligator.infinityforreddit.Fragment;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
-import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
@@ -75,6 +74,7 @@ public class UserListingFragment extends Fragment implements FragmentCommunicato
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private LinearLayoutManager mLinearLayoutManager;
private String mQuery;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/MultiRedditRepository.java b/app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/MultiRedditRepository.java
index b725caa2..860cdd43 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/MultiRedditRepository.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/MultiRedditRepository.java
@@ -1,7 +1,5 @@
package ml.docilealligator.infinityforreddit.MultiReddit;
-import android.os.AsyncTask;
-
import androidx.lifecycle.LiveData;
import java.util.List;
@@ -9,14 +7,13 @@ import java.util.List;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
public class MultiRedditRepository {
- private MultiRedditDao mMultiRedditDao;
private LiveData<List<MultiReddit>> mAllMultiReddits;
private LiveData<List<MultiReddit>> mAllFavoriteMultiReddits;
MultiRedditRepository(RedditDataRoomDatabase redditDataRoomDatabase, String accountName) {
- mMultiRedditDao = redditDataRoomDatabase.multiRedditDao();
- mAllMultiReddits = mMultiRedditDao.getAllMultiReddits(accountName);
- mAllFavoriteMultiReddits = mMultiRedditDao.getAllFavoriteMultiReddits(accountName);
+ MultiRedditDao multiRedditDao = redditDataRoomDatabase.multiRedditDao();
+ mAllMultiReddits = multiRedditDao.getAllMultiReddits(accountName);
+ mAllFavoriteMultiReddits = multiRedditDao.getAllFavoriteMultiReddits(accountName);
}
LiveData<List<MultiReddit>> getAllMultiReddits() {
@@ -26,23 +23,4 @@ public class MultiRedditRepository {
LiveData<List<MultiReddit>> getAllFavoriteMultiReddits() {
return mAllFavoriteMultiReddits;
}
-
- public void insert(MultiReddit MultiReddit) {
- new MultiRedditRepository.insertAsyncTask(mMultiRedditDao).execute();
- }
-
- private static class insertAsyncTask extends AsyncTask<MultiReddit, Void, Void> {
-
- private MultiRedditDao mAsyncTaskDao;
-
- insertAsyncTask(MultiRedditDao dao) {
- mAsyncTaskDao = dao;
- }
-
- @Override
- protected Void doInBackground(final MultiReddit... params) {
- mAsyncTaskDao.insert(params[0]);
- return null;
- }
- }
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/MultiRedditViewModel.java b/app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/MultiRedditViewModel.java
index bb9dcf76..14f42bee 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/MultiRedditViewModel.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/MultiReddit/MultiRedditViewModel.java
@@ -32,10 +32,6 @@ public class MultiRedditViewModel extends AndroidViewModel {
return mAllFavoriteMultiReddits;
}
- public void insert(MultiReddit MultiReddit) {
- mMultiRedditRepository.insert(MultiReddit);
- }
-
public static class Factory extends ViewModelProvider.NewInstanceFactory {
private Application mApplication;
private RedditDataRoomDatabase mRedditDataRoomDatabase;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PullNotificationWorker.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PullNotificationWorker.java
index 716c4f0b..31da44dc 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/PullNotificationWorker.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PullNotificationWorker.java
@@ -45,6 +45,7 @@ public class PullNotificationWorker extends Worker {
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
+ @Named("default")
SharedPreferences mSharedPreferences;
private Context context;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java b/app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java
index 4a55da1f..a0d6edb0 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java
@@ -11,6 +11,8 @@ import androidx.sqlite.db.SupportSQLiteDatabase;
import ml.docilealligator.infinityforreddit.Account.Account;
import ml.docilealligator.infinityforreddit.Account.AccountDao;
+import ml.docilealligator.infinityforreddit.CustomTheme.CustomTheme;
+import ml.docilealligator.infinityforreddit.CustomTheme.CustomThemeDao;
import ml.docilealligator.infinityforreddit.MultiReddit.MultiReddit;
import ml.docilealligator.infinityforreddit.MultiReddit.MultiRedditDao;
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditDao;
@@ -23,7 +25,7 @@ import ml.docilealligator.infinityforreddit.User.UserDao;
import ml.docilealligator.infinityforreddit.User.UserData;
@Database(entities = {Account.class, SubredditData.class, SubscribedSubredditData.class, UserData.class,
- SubscribedUserData.class, MultiReddit.class}, version = 5)
+ SubscribedUserData.class, MultiReddit.class, CustomTheme.class}, version = 6)
public abstract class RedditDataRoomDatabase extends RoomDatabase {
private static RedditDataRoomDatabase INSTANCE;
@@ -33,7 +35,8 @@ public abstract class RedditDataRoomDatabase extends RoomDatabase {
if (INSTANCE == null) {
INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
RedditDataRoomDatabase.class, "reddit_data")
- .addMigrations(MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4, MIGRATION_4_5)
+ .addMigrations(MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4, MIGRATION_4_5,
+ MIGRATION_5_6)
.build();
}
}
@@ -53,6 +56,8 @@ public abstract class RedditDataRoomDatabase extends RoomDatabase {
public abstract MultiRedditDao multiRedditDao();
+ public abstract CustomThemeDao customThemeDao();
+
private static final Migration MIGRATION_1_2 = new Migration(1, 2) {
@Override
public void migrate(SupportSQLiteDatabase database) {
@@ -106,4 +111,39 @@ public abstract class RedditDataRoomDatabase extends RoomDatabase {
+ " ADD COLUMN sidebar_description TEXT");
}
};
+
+ private static final Migration MIGRATION_5_6 = new Migration(5, 6) {
+ @Override
+ public void migrate(@NonNull SupportSQLiteDatabase database) {
+ database.execSQL("CREATE TABLE custom_themes" +
+ "(name TEXT NOT NULL PRIMARY KEY, color_primary INTEGER NOT NULL," +
+ "color_primary_dark INTEGER NOT NULL, color_accent INTEGER NOT NULL," +
+ "color_primary_light_theme INTEGER NOT NULL, primary_text_color INTEGER NOT NULL," +
+ "secondary_text_color INTEGER NOT NULL, background_color INTEGER NOT NULL," +
+ "rounded_bottom_sheet_primary_background INTEGER NOT NULL," +
+ "card_view_background_color INTEGER NOT NULL, toolbar_primary_text_and_icon_color INTEGER NOT NULL," +
+ "toolbar_and_tab_background_color INTEGER NOT NULL, circular_progress_bar_background INTEGER NOT NULL," +
+ "tab_layout_with_expanded_collapsing_toolbar_tab_background INTEGER NOT NULL," +
+ "tab_layout_with_expanded_collapsing_toolbar_text_color INTEGER NOT NULL," +
+ "tab_layout_with_expanded_collapsing_toolbar_tab_indicator INTEGER NOT NULL," +
+ "tab_layout_with_collapsed_collapsing_toolbar_tab_background INTEGER NOT NULL," +
+ "tab_layout_with_collapsed_collapsing_toolbar_text_color INTEGER NOT NULL," +
+ "tab_layout_with_collapsed_collapsing_toolbar_tab_indicator INTEGER NOT NULL," +
+ "nav_bar_color INTEGER NOT NULL, upvoted INTEGER NOT NULL, downvoted INTEGER NOT NULL," +
+ "post_type INTEGER NOT NULL, spoiler_color INTEGER NOT NULL, nsfw_color INTEGER NOT NULL," +
+ "flair_color INTEGER NOT NULL, archived_tint INTEGER NOT NULL, locked_icon_tint INTEGER NOT NULL," +
+ "crosspost INTEGER NOT NULL, stickied_post INTEGER NOT NULL, subscribed INTEGER NOT NULL," +
+ "unsubscribed INTEGER NOT NULL, username INTEGER NOT NULL, subreddit INTEGER NOT NULL," +
+ "author_flair_text_color INTEGER NOT NULL, submitter INTEGER NOT NULL," +
+ "moderator INTEGER NOT NULL, notification_icon_color INTEGER NOT NULL," +
+ "single_comment_thread_background_color INTEGER NOT NULL," +
+ "unread_message_background_color INTEGER NOT NULL, divider_color INTEGER NOT NULL," +
+ "no_preview_link_background_color INTEGER NOT NULL," +
+ "vote_and_reply_unavailable_vote_button_color INTEGER NOT NULL," +
+ "comment_vertical_bar_color_1 INTEGER NOT NULL, comment_vertical_bar_color_2 INTEGER NOT NULL," +
+ "comment_vertical_bar_color_3 INTEGER NOT NULL, comment_vertical_bar_color_4 INTEGER NOT NULL," +
+ "comment_vertical_bar_color_5 INTEGER NOT NULL, comment_vertical_bar_color_6 INTEGER NOT NULL," +
+ "comment_vertical_bar_color_7 INTEGER NOT NULL)");
+ }
+ };
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/GesturesAndButtonsPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/GesturesAndButtonsPreferenceFragment.java
index 255e8d23..ec170cc8 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/GesturesAndButtonsPreferenceFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/GesturesAndButtonsPreferenceFragment.java
@@ -14,6 +14,7 @@ import androidx.preference.SwitchPreference;
import org.greenrobot.eventbus.EventBus;
import javax.inject.Inject;
+import javax.inject.Named;
import ml.docilealligator.infinityforreddit.Event.ChangeLockBottomAppBarEvent;
import ml.docilealligator.infinityforreddit.Infinity;
@@ -26,6 +27,7 @@ import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
public class GesturesAndButtonsPreferenceFragment extends PreferenceFragmentCompat {
@Inject
+ @Named("default")
SharedPreferences sharedPreferences;
private Activity activity;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/MainPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/MainPreferenceFragment.java
index 5733c32e..1aea7212 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/MainPreferenceFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/MainPreferenceFragment.java
@@ -14,6 +14,7 @@ import androidx.preference.SwitchPreference;
import org.greenrobot.eventbus.EventBus;
import javax.inject.Inject;
+import javax.inject.Named;
import ml.docilealligator.infinityforreddit.Event.ChangeNSFWBlurEvent;
import ml.docilealligator.infinityforreddit.Event.ChangeNSFWEvent;
@@ -29,6 +30,7 @@ import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
public class MainPreferenceFragment extends PreferenceFragmentCompat {
@Inject
+ @Named("default")
SharedPreferences sharedPreferences;
private Activity activity;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/NotificationPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/NotificationPreferenceFragment.java
index 36b0326e..f6644468 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/NotificationPreferenceFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/NotificationPreferenceFragment.java
@@ -20,6 +20,7 @@ import androidx.work.WorkManager;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
+import javax.inject.Named;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.PullNotificationWorker;
@@ -32,6 +33,7 @@ import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
public class NotificationPreferenceFragment extends PreferenceFragmentCompat {
@Inject
+ @Named("default")
SharedPreferences sharedPreferences;
private boolean enableNotification;
private long notificationInterval;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java
index 0ff474bd..6d0ba6c6 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java
@@ -77,4 +77,56 @@ public class SharedPreferencesUtils {
public static final String LOCK_BOTTOM_APP_BAR = "lock_bottom_app_bar";
public static final String SHOW_COMMENT_DIVIDER = "show_comment_divider";
public static final String SHOW_ABSOLUTE_NUMBER_OF_VOTES = "show_absolute_number_of_votes";
+
+ //Theme
+ public static final String THEME_SHARED_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit.theme";
+ public static final String COLOR_PRIMARY = "colorPrimary";
+ public static final String COLOR_PRIMARY_DARK = "colorPrimaryDark";
+ public static final String COLOR_ACCENT = "colorAccent";
+ public static final String COLOR_PRIMARY_LIGHT_THEME = "colorPrimaryLightTheme";
+ public static final String PRIMARY_TEXT_COLOR = "primaryTextColor";
+ public static final String SECONDARY_TEXT_COLOR = "secondaryTextColor";
+ public static final String BACKGROUND_COLOR = "backgroundColor";
+ public static final String ROUNDED_BOTTOM_SHEET_PRIMARY_BACKGROUND = "roundedBottomSheetPrimaryBackground";
+ public static final String CARD_VIEW_BACKGROUND_COLOR = "cardViewBackgroundColor";
+ public static final String TOOLBAR_PRIMARY_TEXT_AND_ICON_COLOR = "toolbarPrimaryTextAndIconColor";
+ public static final String TOOLBAR_AND_TAB_BACKGROUND_COLOR = "toolbarAndTabBackgroundColor";
+ public static final String CIRCULAR_PROGRESS_BAR_BACKGROUND = "circularProgressBarBackground";
+ public static final String TAB_LAYOUT_WITH_EXPANDED_COLLAPSING_TOOLBAR_TAB_BACKGROUND = "tabLayoutWithExpandedCollapsingToolbarTabBackground";
+ public static final String TAB_LAYOUT_WITH_EXPANDED_COLLAPSING_TOOLBAR_TEXT_COLOR = "tabLayoutWithExpandedCollapsingToolbarTextColor";
+ public static final String TAB_LAYOUT_WITH_EXPANDED_COLLAPSING_TOOLBAR_TAB_INDICATOR = "tabLayoutWithExpandedCollapsingToolbarTabIndicator";
+ public static final String TAB_LAYOUT_WITH_COLLAPSED_COLLAPSING_TOOLBAR_TAB_BACKGROUND = "tabLayoutWithCollapsedCollapsingToolbarTabBackground";
+ public static final String TAB_LAYOUT_WITH_COLLAPSED_COLLAPSING_TOOLBAR_TEXT_COLOR = "tabLayoutWithCollapsedCollapsingToolbarTextColor";
+ public static final String TAB_LAYOUT_WITH_COLLAPSED_COLLAPSING_TOOLBAR_TAB_INDICATOR = "tabLayoutWithCollapsedCollapsingToolbarTabIndicator";
+ public static final String NAV_BAR_COLOR = "navBarColor";
+ public static final String UPVOTED = "upvoted";
+ public static final String DOWNVOTED = "downvoted";
+ public static final String POST_TYPE = "postType";
+ public static final String SPOILER_COLOR = "spoilerColor";
+ public static final String NSFW_COLOR = "nsfwColor";
+ public static final String FLAIR_COLOR = "flairColor";
+ public static final String ARCHIVED_TINT = "archivedTint";
+ public static final String LOCKED_ICON_TINT = "lockedIconTint";
+ public static final String CROSSPOST = "crosspost";
+ public static final String STICKIED_POST = "stickiedPost";
+ public static final String SUBSCRIBED = "subscribed";
+ public static final String UNSUBSCRIBED = "unsubscribed";
+ public static final String USERNAME = "username";
+ public static final String SUBREDDIT = "subreddit";
+ public static final String AUTHOR_FLAIR_TEXT_COLOR = "authorFlairTextColor";
+ public static final String SUBMITTER = "submitter";
+ public static final String MODERATOR = "moderator";
+ public static final String NOTIFICATION_ICON_COLOR = "notificationIconColor";
+ public static final String SINGLE_COMMENT_THREAD_BACKGROUND = "singleCommentThreadBackgroundColor";
+ public static final String UNREAD_MESSAGE_BACKGROUND_COLOR = "unreadMessageBackgroundColor";
+ public static final String DIVIDER_COLOR = "dividerColor";
+ public static final String NO_PREVIEW_LINK_BACKGROUND_COLOR = "noPreviewLinkBackgroundColor";
+ public static final String VOTE_AND_REPLY_UNAVAILABLE_VOTE_BUTTON_COLOR = "voteAndReplyUnavailableVoteButtonColor";
+ public static final String COMMENT_VERTICAL_BAR_COLOR_1 = "commentVerticalBarColor1";
+ public static final String COMMENT_VERTICAL_BAR_COLOR_2 = "commentVerticalBarColor2";
+ public static final String COMMENT_VERTICAL_BAR_COLOR_3 = "commentVerticalBarColor3";
+ public static final String COMMENT_VERTICAL_BAR_COLOR_4 = "commentVerticalBarColor4";
+ public static final String COMMENT_VERTICAL_BAR_COLOR_5 = "commentVerticalBarColor5";
+ public static final String COMMENT_VERTICAL_BAR_COLOR_6 = "commentVerticalBarColor6";
+ public static final String COMMENT_VERTICAL_BAR_COLOR_7 = "commentVerticalBarColor7";
}
diff --git a/app/src/main/res/layout/activity_view_gif.xml b/app/src/main/res/layout/activity_view_gif.xml
index b1821e41..8740679c 100644
--- a/app/src/main/res/layout/activity_view_gif.xml
+++ b/app/src/main/res/layout/activity_view_gif.xml
@@ -33,7 +33,7 @@
android:layout_gravity="center"
android:gravity="center"
android:textColor="@android:color/white"
- android:text="@string/tap_to_retry"
+ android:text="@string/error_loading_gif_tap_to_retry"
android:textSize="?attr/font_default" />
</LinearLayout>
diff --git a/app/src/main/res/layout/activity_view_image.xml b/app/src/main/res/layout/activity_view_image.xml
index 7bad15e1..8486d543 100644
--- a/app/src/main/res/layout/activity_view_image.xml
+++ b/app/src/main/res/layout/activity_view_image.xml
@@ -33,7 +33,7 @@
android:layout_gravity="center"
android:gravity="center"
android:textColor="@android:color/white"
- android:text="@string/tap_to_retry"
+ android:text="@string/error_loading_image_tap_to_retry"
android:textSize="?attr/font_default" />
</LinearLayout>
diff --git a/app/src/main/res/layout/item_post.xml b/app/src/main/res/layout/item_post.xml
index 335694e0..ad3d1aca 100644
--- a/app/src/main/res/layout/item_post.xml
+++ b/app/src/main/res/layout/item_post.xml
@@ -127,8 +127,8 @@
android:padding="4dp"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
- app:lib_setRoundedBGColor="?attr/post_type"
- app:lib_setRoundedBorderColor="?attr/post_type"
+ app:lib_setRoundedBGColor="?attr/postType"
+ app:lib_setRoundedBorderColor="?attr/postType"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
@@ -273,7 +273,7 @@
android:drawableTop="@drawable/ic_error_outline_black_24dp"
android:layout_gravity="center"
android:gravity="center"
- android:text="@string/tap_to_retry"
+ android:text="@string/error_loading_image_tap_to_retry"
android:textSize="?attr/font_default" />
</RelativeLayout>
diff --git a/app/src/main/res/layout/item_post_compact.xml b/app/src/main/res/layout/item_post_compact.xml
index 5488508f..486b0dc8 100644
--- a/app/src/main/res/layout/item_post_compact.xml
+++ b/app/src/main/res/layout/item_post_compact.xml
@@ -115,8 +115,8 @@
android:textColor="@android:color/white"
android:textSize="?attr/font_10"
app:lib_setRadius="3dp"
- app:lib_setRoundedBGColor="?attr/post_type"
- app:lib_setRoundedBorderColor="?attr/post_type"
+ app:lib_setRoundedBGColor="?attr/postType"
+ app:lib_setRoundedBorderColor="?attr/postType"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
diff --git a/app/src/main/res/layout/item_post_detail.xml b/app/src/main/res/layout/item_post_detail.xml
index 983ac476..3c08ca6a 100644
--- a/app/src/main/res/layout/item_post_detail.xml
+++ b/app/src/main/res/layout/item_post_detail.xml
@@ -109,8 +109,8 @@
android:padding="4dp"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
- app:lib_setRoundedBGColor="?attr/post_type"
- app:lib_setRoundedBorderColor="?attr/post_type"
+ app:lib_setRoundedBGColor="?attr/postType"
+ app:lib_setRoundedBorderColor="?attr/postType"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
@@ -255,7 +255,7 @@
android:drawableTop="@drawable/ic_error_outline_black_24dp"
android:layout_centerInParent="true"
android:gravity="center"
- android:text="@string/tap_to_retry"
+ android:text="@string/error_loading_image_tap_to_retry"
android:textSize="?attr/font_default"
android:visibility="gone" />
diff --git a/app/src/main/res/values/attr.xml b/app/src/main/res/values/attr.xml
index 5d6dc3c1..9906b99f 100644
--- a/app/src/main/res/values/attr.xml
+++ b/app/src/main/res/values/attr.xml
@@ -37,7 +37,7 @@
<attr name="backgroundColor" format="color"/>
<attr name="roundedBottomSheetPrimaryBackground" format="color"/>
<attr name="cardViewBackgroundColor" format="color"/>
- <attr name="toolbarPrimaryTextAndIconColor" format="color" />
+ <attr name="toolbarPrimaryTextAndIconColor" format="color"/>
<attr name="toolbarAndTabBackgroundColor" format="color"/>
<attr name="circularProgressBarBackground" format="color"/>
<attr name="tabLayoutWithExpandedCollapsingToolbarTabBackground" format="color"/>
@@ -49,7 +49,7 @@
<attr name="navBarColor" format="color"/>
<attr name="upvoted" format="color"/>
<attr name="downvoted" format="color"/>
- <attr name="post_type" format="color"/>
+ <attr name="postType" format="color"/>
<attr name="spoilerColor" format="color"/>
<attr name="nsfwColor" format="color"/>
<attr name="flairColor" format="color"/>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 41b3dde0..eb88ae16 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -56,7 +56,8 @@
<string name="access_denied">Access denied</string>
<string name="parse_user_info_error">Error occurred when parsing the user info</string>
- <string name="tap_to_retry">Error loading image. Tap to retry.</string>
+ <string name="error_loading_image_tap_to_retry">Error loading the image. Tap to retry.</string>
+ <string name="error_loading_gif_tap_to_retry">Error loading the gif. Tap to retry.</string>
<string name="load_posts_error">Error loading posts.\nTap to retry.</string>
<string name="load_more_posts_error">Error loading posts.</string>
<string name="load_post_error">Error loading this post.\nTap to retry.</string>
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 2ae6c7cf..8f7256a5 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -244,7 +244,7 @@
<item name="navBarColor">@color/backgroundColor</item>
<item name="upvoted">#E91E63</item>
<item name="downvoted">#007DDE</item>
- <item name="post_type">@color/colorPrimaryDark</item>
+ <item name="postType">@color/colorPrimaryDark</item>
<item name="spoilerColor">#EE02EB</item>
<item name="nsfwColor">@color/colorAccent</item>
<item name="flairColor">#00AA8C</item>
@@ -296,7 +296,7 @@
<item name="navBarColor">@color/backgroundColor</item>
<item name="upvoted">#E91E63</item>
<item name="downvoted">#007DDE</item>
- <item name="post_type">#0D47A1</item>
+ <item name="postType">#0D47A1</item>
<item name="spoilerColor">#EE02EB</item>
<item name="nsfwColor">@color/colorAccent</item>
<item name="flairColor">#00AA8C</item>
@@ -348,7 +348,7 @@
<item name="navBarColor">#000000</item>
<item name="upvoted">#E91E63</item>
<item name="downvoted">#007DDE</item>
- <item name="post_type">#0D47A1</item>
+ <item name="postType">#0D47A1</item>
<item name="spoilerColor">#EE02EB</item>
<item name="nsfwColor">@color/colorAccent</item>
<item name="flairColor">#00AA8C</item>
@@ -379,16 +379,17 @@
</style>
<style name="Theme.Purple">
- <item name="colorPrimary">#00C3E9</item>
- <item name="colorPrimaryDark">#009EBA</item>
- <item name="colorAccent">#EE2502</item>
+ <item name="colorPrimary">#6002EE</item>
+ <item name="colorPrimaryDark">#3D00E0</item>
+ <item name="colorAccent">#0098DD</item>
<item name="colorPrimaryLightTheme">?attr/colorPrimary</item>
<item name="primaryTextColor">#000000</item>
<item name="secondaryTextColor">#8A000000</item>
<item name="backgroundColor">@color/backgroundColor</item>
<item name="roundedBottomSheetPrimaryBackground">@color/roundedBottomSheetPrimaryBackground</item>
<item name="cardViewBackgroundColor">#FFFFFF</item>
- <item name="toolbarPrimaryTextAndIconColor">#FF3C4043</item>
+ <!--<item name="toolbarPrimaryTextAndIconColor">#FF3C4043</item>-->
+ <item name="toolbarPrimaryTextAndIconColor">#FFFFFF</item>
<item name="toolbarAndTabBackgroundColor">?attr/colorPrimary</item>
<item name="circularProgressBarBackground">#FFFFFF</item>
<item name="tabLayoutWithExpandedCollapsingToolbarTabBackground">#FFFFFF</item>
@@ -398,23 +399,23 @@
<item name="tabLayoutWithCollapsedCollapsingToolbarTextColor">?attr/toolbarPrimaryTextAndIconColor</item>
<item name="tabLayoutWithCollapsedCollapsingToolbarTabIndicator">?attr/toolbarPrimaryTextAndIconColor</item>
<item name="navBarColor">@color/backgroundColor</item>
- <item name="upvoted">#E91E63</item>
- <item name="downvoted">#007DDE</item>
- <item name="post_type">#7B1FA2</item>
+ <item name="upvoted">#FC2727</item>
+ <item name="downvoted">#276BFC</item>
+ <item name="postType">#6002EE</item>
<item name="spoilerColor">#EE02EB</item>
- <item name="nsfwColor">#03A9F4</item>
- <item name="flairColor">#00AA8C</item>
+ <item name="nsfwColor">#FC27A1</item>
+ <item name="flairColor">#00D039</item>
<item name="archivedTint">#B4009F</item>
<item name="lockedIconTint">#EE7302</item>
<item name="crosspost">#03A9F4</item>
<item name="stickiedPost">#7B1FA2</item>
<item name="subscribed">#03A9F4</item>
<item name="unsubscribed">#7B1FA2</item>
- <item name="username">#7B1FA2</item>
- <item name="subreddit">#03A9F4</item>
+ <item name="username">#FB9E25</item>
+ <item name="subreddit">#4D27FC</item>
<item name="authorFlairTextColor">#EE02C4</item>
- <item name="submitter">#EE8A02</item>
- <item name="moderator">#00BA81</item>
+ <item name="submitter">#EE8002</item>
+ <item name="moderator">#02EEDD</item>
<item name="notificationIconColor">?attr/colorPrimary</item>
<item name="singleCommentThreadBackgroundColor">#B3E5F9</item>
<item name="unreadMessageBackgroundColor">#B3E5F9</item>