aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-03-01 01:42:57 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-03-01 01:42:57 +0000
commit152a6a280ace51a09ed55fe1e57c2f9168a59c95 (patch)
tree2b9486cb4b1e1d41041285a2fd3323b21af10902 /app
parente528158f03f1fb26b75a99180cfd2dac8de96222 (diff)
downloadinfinity-for-reddit-152a6a280ace51a09ed55fe1e57c2f9168a59c95.tar
infinity-for-reddit-152a6a280ace51a09ed55fe1e57c2f9168a59c95.tar.gz
infinity-for-reddit-152a6a280ace51a09ed55fe1e57c2f9168a59c95.tar.bz2
infinity-for-reddit-152a6a280ace51a09ed55fe1e57c2f9168a59c95.tar.lz
infinity-for-reddit-152a6a280ace51a09ed55fe1e57c2f9168a59c95.tar.xz
infinity-for-reddit-152a6a280ace51a09ed55fe1e57c2f9168a59c95.tar.zst
infinity-for-reddit-152a6a280ace51a09ed55fe1e57c2f9168a59c95.zip
Still prepare to support multiple themes.
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountPostsActivity.java6
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountSavedThingActivity.java11
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java85
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java81
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java32
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java2
-rw-r--r--app/src/main/res/drawable/ic_add_menu_item_24dp.xml9
-rw-r--r--app/src/main/res/drawable/ic_add_toolbar_24dp.xml (renamed from app/src/main/res/drawable-night/ic_add_menu_item_24dp.xml)2
-rw-r--r--app/src/main/res/drawable/ic_bookmark_border_toolbar_24dp.xml (renamed from app/src/main/res/drawable/ic_bookmark_border_black_24dp.xml)2
-rw-r--r--app/src/main/res/drawable/ic_bookmark_toolbar_24dp.xml (renamed from app/src/main/res/drawable/ic_bookmark_black_24dp.xml)2
-rw-r--r--app/src/main/res/drawable/ic_check_circle_toolbar_24dp.xml (renamed from app/src/main/res/drawable/ic_check_circle_menu_item_24dp.xml)2
-rw-r--r--app/src/main/res/drawable/ic_comment_toolbar_24dp.xml (renamed from app/src/main/res/drawable/ic_comment_white_24dp.xml)2
-rw-r--r--app/src/main/res/drawable/ic_file_download_toolbar_white_24dp.xml (renamed from app/src/main/res/drawable/ic_file_download_white_24dp.xml)4
-rw-r--r--app/src/main/res/drawable/ic_refresh_toolbar_24dp.xml5
-rw-r--r--app/src/main/res/drawable/ic_refresh_white_24dp.xml5
-rw-r--r--app/src/main/res/drawable/ic_search_toolbar_24dp.xml5
-rw-r--r--app/src/main/res/drawable/ic_search_white_24dp.xml5
-rw-r--r--app/src/main/res/drawable/ic_send_toolbar_24dp.xml (renamed from app/src/main/res/drawable/ic_send_white_24dp.xml)4
-rw-r--r--app/src/main/res/drawable/ic_sort_toolbar_24dp.xml (renamed from app/src/main/res/drawable/ic_outline_sort_24px.xml)2
-rw-r--r--app/src/main/res/layout/app_bar_main.xml6
-rw-r--r--app/src/main/res/layout/item_post.xml8
-rw-r--r--app/src/main/res/menu/account_posts_activity.xml1
-rw-r--r--app/src/main/res/menu/account_saved_thing_activity.xml1
-rw-r--r--app/src/main/res/menu/comment_activity.xml2
-rw-r--r--app/src/main/res/menu/create_multi_reddit_activity.xml2
-rw-r--r--app/src/main/res/menu/edit_comment_activity.xml2
-rw-r--r--app/src/main/res/menu/edit_post_activity.xml2
-rw-r--r--app/src/main/res/menu/filtered_posts_activity.xml4
-rw-r--r--app/src/main/res/menu/main_activity.xml4
-rw-r--r--app/src/main/res/menu/menu_search.xml2
-rw-r--r--app/src/main/res/menu/post_image_activity.xml2
-rw-r--r--app/src/main/res/menu/post_link_activity.xml2
-rw-r--r--app/src/main/res/menu/post_text_activity.xml2
-rw-r--r--app/src/main/res/menu/post_video_activity.xml2
-rw-r--r--app/src/main/res/menu/search_activity.xml2
-rw-r--r--app/src/main/res/menu/search_result_activity.xml4
-rw-r--r--app/src/main/res/menu/subreddit_multiselection_activity.xml4
-rw-r--r--app/src/main/res/menu/subreddit_selection_activity.xml2
-rw-r--r--app/src/main/res/menu/view_gif_activity.xml2
-rw-r--r--app/src/main/res/menu/view_image.xml2
-rw-r--r--app/src/main/res/menu/view_multi_reddit_detail_activity.xml5
-rw-r--r--app/src/main/res/menu/view_post_detail_activity.xml2
-rw-r--r--app/src/main/res/menu/view_sidebar_activity.xml2
-rw-r--r--app/src/main/res/menu/view_subreddit_detail_activity.xml5
-rw-r--r--app/src/main/res/menu/view_user_detail_activity.xml5
-rw-r--r--app/src/main/res/menu/view_video.xml2
-rw-r--r--app/src/main/res/values/attr.xml1
-rw-r--r--app/src/main/res/values/styles.xml32
48 files changed, 209 insertions, 169 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 373a8655..39645f1d 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountPostsActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountPostsActivity.java
@@ -38,9 +38,9 @@ import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.Post.PostDataSource;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
-import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.SortType;
import ml.docilealligator.infinityforreddit.SortTypeSelectionCallback;
+import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
public class AccountPostsActivity extends BaseActivity implements SortTypeSelectionCallback, PostLayoutBottomSheetFragment.PostLayoutSelectionCallback {
@@ -86,9 +86,7 @@ public class AccountPostsActivity extends BaseActivity implements SortTypeSelect
Resources resources = getResources();
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1
- && (resources.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT
- || resources.getBoolean(R.bool.isTablet))
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
&& mSharedPreferences.getBoolean(SharedPreferencesUtils.IMMERSIVE_INTERFACE_KEY, true)) {
Window window = getWindow();
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
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 7f3f0341..c7a2c256 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountSavedThingActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/AccountSavedThingActivity.java
@@ -124,12 +124,19 @@ public class AccountSavedThingActivity extends BaseActivity {
}
});
- int statusBarResourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
+ /*int statusBarResourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (statusBarResourceId > 0) {
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams();
params.topMargin = getResources().getDimensionPixelSize(statusBarResourceId);
toolbar.setLayoutParams(params);
- }
+ }*/
+ }
+
+ int statusBarResourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
+ if (statusBarResourceId > 0) {
+ ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams();
+ params.topMargin = getResources().getDimensionPixelSize(statusBarResourceId);
+ toolbar.setLayoutParams(params);
}
setSupportActionBar(toolbar);
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 0902a493..0f75fb87 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java
@@ -2,21 +2,24 @@ package ml.docilealligator.infinityforreddit.Activity;
import android.content.SharedPreferences;
import android.content.res.Configuration;
+import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
-import android.util.TypedValue;
import android.view.View;
+import android.view.ViewGroup;
import android.view.Window;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
+import androidx.appcompat.widget.Toolbar;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.R;
-import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
+import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
+import ml.docilealligator.infinityforreddit.Utils.Utils;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM;
@@ -24,6 +27,12 @@ import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES;
public abstract class BaseActivity extends AppCompatActivity {
+ private boolean immersiveInterface;
+ private boolean lightStatusbar;
+ private boolean changeStatusBarIconColor = true;
+ private int systemVisibilityToolbarExpanded;
+ private int systemVisibilityToolbarCollapsed;
+
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -31,10 +40,14 @@ public abstract class BaseActivity extends AppCompatActivity {
SharedPreferences mSharedPreferences = getSharedPreferences();
boolean systemDefault = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q;
int themeType = Integer.parseInt(mSharedPreferences.getString(SharedPreferencesUtils.THEME_KEY, "2"));
+ immersiveInterface = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
+ mSharedPreferences.getBoolean(SharedPreferencesUtils.IMMERSIVE_INTERFACE_KEY, true);
switch (themeType) {
case 0:
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_NO);
getTheme().applyStyle(R.style.Theme_Purple, true);
+ lightStatusbar = true;
+ changeStatusBarIconColor = false;
break;
case 1:
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_YES);
@@ -43,6 +56,7 @@ public abstract class BaseActivity extends AppCompatActivity {
} else {
getTheme().applyStyle(R.style.Theme_Default_NormalDark, true);
}
+ changeStatusBarIconColor = false;
break;
case 2:
if (systemDefault) {
@@ -52,12 +66,15 @@ 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 = true;
+ changeStatusBarIconColor = false;
} else {
if(mSharedPreferences.getBoolean(SharedPreferencesUtils.AMOLED_DARK_KEY, false)) {
getTheme().applyStyle(R.style.Theme_Default_AmoledDark, true);
} else {
getTheme().applyStyle(R.style.Theme_Default_NormalDark, true);
}
+ changeStatusBarIconColor = false;
}
}
@@ -70,17 +87,69 @@ public abstract class BaseActivity extends AppCompatActivity {
getTheme().applyStyle(ContentFontStyle.valueOf(mSharedPreferences
.getString(SharedPreferencesUtils.CONTENT_FONT_SIZE_KEY, ContentFontStyle.Normal.name())).getResId(), true);
+ Window window = getWindow();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- Window window = getWindow();
- if ((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) {
+ if (lightStatusbar) {
+ window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ systemVisibilityToolbarExpanded = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
+ if (changeStatusBarIconColor) {
+ systemVisibilityToolbarCollapsed = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
+ }
+ } else {
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+ systemVisibilityToolbarExpanded = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
+ if (changeStatusBarIconColor) {
+ systemVisibilityToolbarCollapsed = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
+ }
+ }
+ window.setNavigationBarColor(Utils.getAttributeColor(this, R.attr.navBarColor));
+ } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ if (lightStatusbar) {
+ window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
+ systemVisibilityToolbarExpanded = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
+ }
+ if (changeStatusBarIconColor) {
+ systemVisibilityToolbarCollapsed = 0;
}
- TypedValue typedValue = new TypedValue();
- getTheme().resolveAttribute(R.attr.navBarColor, typedValue, true);
- int navBarColor = typedValue.data;
- window.setNavigationBarColor(navBarColor);
}
}
public abstract SharedPreferences getSharedPreferences();
+
+ protected boolean isLightStatusbar() {
+ return lightStatusbar;
+ }
+ protected boolean isChangeStatusBarIconColor() {
+ return changeStatusBarIconColor;
+ }
+
+ protected int getSystemVisibilityToolbarExpanded() {
+ return systemVisibilityToolbarExpanded;
+ }
+
+ protected int getSystemVisibilityToolbarCollapsed() {
+ return systemVisibilityToolbarCollapsed;
+ }
+
+ protected boolean isImmersiveInterface() {
+ return immersiveInterface;
+ }
+
+ protected void adjustToolbar(Toolbar toolbar) {
+ int statusBarResourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
+ if (statusBarResourceId > 0) {
+ ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams();
+ params.topMargin = getResources().getDimensionPixelSize(statusBarResourceId);
+ toolbar.setLayoutParams(params);
+ }
+ }
+
+ protected int getNavBarHeight() {
+ Resources resources = getResources();
+ int navBarResourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
+ if (navBarResourceId > 0) {
+ return resources.getDimensionPixelSize(navBarResourceId);
+ }
+ return 0;
+ }
}
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 2fd3c70c..1830e6cc 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java
@@ -3,11 +3,9 @@ package ml.docilealligator.infinityforreddit.Activity;
import android.app.Activity;
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;
-import android.util.TypedValue;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.Menu;
@@ -196,61 +194,34 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
EventBus.getDefault().register(this);
- getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
Window window = getWindow();
- if ((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) {
- window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
- }
- TypedValue typedValue = new TypedValue();
- getTheme().resolveAttribute(R.attr.navBarColor, typedValue, true);
- int navBarColor = typedValue.data;
- window.setNavigationBarColor(navBarColor);
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
- Resources resources = getResources();
-
- if ((resources.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT || resources.getBoolean(R.bool.isTablet))
- && mSharedPreferences.getBoolean(SharedPreferencesUtils.IMMERSIVE_INTERFACE_KEY, true)) {
- window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
+ Resources resources = getResources();
+ View decorView = window.getDecorView();
- boolean lightNavBar = false;
- if ((resources.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) {
- lightNavBar = true;
+ if (isChangeStatusBarIconColor()) {
+ appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
+ @Override
+ public void onStateChanged(AppBarLayout appBarLayout, AppBarStateChangeListener.State state) {
+ if (state == State.COLLAPSED) {
+ decorView.setSystemUiVisibility(getSystemVisibilityToolbarCollapsed());
+ } else if (state == State.EXPANDED) {
+ decorView.setSystemUiVisibility(getSystemVisibilityToolbarExpanded());
+ }
}
- boolean finalLightNavBar = lightNavBar;
+ });
+ }
- View decorView = window.getDecorView();
- appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
- @Override
- public void onStateChanged(AppBarLayout appBarLayout, State state) {
- if (state == State.COLLAPSED) {
- if (finalLightNavBar) {
- decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
- }
- } else if (state == State.EXPANDED) {
- if (finalLightNavBar) {
- decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
- }
- }
- }
- });
+ if (isImmersiveInterface()) {
+ window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
- int statusBarResourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
- if (statusBarResourceId > 0) {
- ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams();
- params.topMargin = resources.getDimensionPixelSize(statusBarResourceId);
- toolbar.setLayoutParams(params);
- }
+ adjustToolbar(toolbar);
- int navBarResourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
- if (navBarResourceId > 0) {
- int navBarHeight = resources.getDimensionPixelSize(navBarResourceId);
- linearLayoutBottomAppBar.setPadding(0,
- (int) (6 * resources.getDisplayMetrics().density), 0, navBarHeight);
- navDrawerRecyclerView.setPadding(0, 0, 0, navBarHeight);
- }
+ int navBarHeight = getNavBarHeight();
+ if (navBarHeight > 0) {
+ linearLayoutBottomAppBar.setPadding(0,
+ (int) (6 * resources.getDisplayMetrics().density), 0, navBarHeight);
+ navDrawerRecyclerView.setPadding(0, 0, 0, navBarHeight);
}
}
}
@@ -506,7 +477,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
case R.string.dark_theme:
mSharedPreferences.edit().putString(SharedPreferencesUtils.THEME_KEY, "1").apply();
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_YES);
- if(mSharedPreferences.getBoolean(SharedPreferencesUtils.AMOLED_DARK_KEY, false)) {
+ if (mSharedPreferences.getBoolean(SharedPreferencesUtils.AMOLED_DARK_KEY, false)) {
getTheme().applyStyle(R.style.Theme_Default_AmoledDark, true);
} else {
getTheme().applyStyle(R.style.Theme_Default_NormalDark, true);
@@ -1194,7 +1165,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
switch (viewPager.getCurrentItem()) {
case 0:
mSharedPreferences.edit().putString(SharedPreferencesUtils.SORT_TYPE_BEST_POST, sortType.getType().name()).apply();
- if(sortType.getTime() != null) {
+ if (sortType.getTime() != null) {
mSharedPreferences.edit().putString(SharedPreferencesUtils.SORT_TIME_BEST_POST, sortType.getTime().name()).apply();
}
@@ -1202,7 +1173,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
break;
case 1:
mSharedPreferences.edit().putString(SharedPreferencesUtils.SORT_TYPE_POPULAR_POST, sortType.getType().name()).apply();
- if(sortType.getTime() != null) {
+ if (sortType.getTime() != null) {
mSharedPreferences.edit().putString(SharedPreferencesUtils.SORT_TIME_POPULAR_POST, sortType.getTime().name()).apply();
}
@@ -1210,7 +1181,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
break;
case 2:
mSharedPreferences.edit().putString(SharedPreferencesUtils.SORT_TYPE_ALL_POST, sortType.getType().name()).apply();
- if(sortType.getTime() != null) {
+ if (sortType.getTime() != null) {
mSharedPreferences.edit().putString(SharedPreferencesUtils.SORT_TIME_ALL_POST, sortType.getTime().name()).apply();
}
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 1842a59d..f4ea7620 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java
@@ -460,10 +460,10 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
if (mAccessToken != null) {
if (mPost.isSaved()) {
saveItem.setVisible(true);
- saveItem.setIcon(R.drawable.ic_bookmark_black_24dp);
+ saveItem.setIcon(R.drawable.ic_bookmark_toolbar_24dp);
} else {
saveItem.setVisible(true);
- saveItem.setIcon(R.drawable.ic_bookmark_border_black_24dp);
+ saveItem.setIcon(R.drawable.ic_bookmark_border_toolbar_24dp);
}
if (mPost.isHidden()) {
@@ -601,10 +601,10 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
if (mAccessToken != null) {
if (post.isSaved()) {
saveItem.setVisible(true);
- saveItem.setIcon(R.drawable.ic_bookmark_black_24dp);
+ saveItem.setIcon(R.drawable.ic_bookmark_toolbar_24dp);
} else {
saveItem.setVisible(true);
- saveItem.setIcon(R.drawable.ic_bookmark_border_black_24dp);
+ saveItem.setIcon(R.drawable.ic_bookmark_border_toolbar_24dp);
}
if (post.isHidden()) {
@@ -911,10 +911,10 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
if (mAccessToken != null) {
if (post.isSaved()) {
saveItem.setVisible(true);
- saveItem.setIcon(R.drawable.ic_bookmark_black_24dp);
+ saveItem.setIcon(R.drawable.ic_bookmark_toolbar_24dp);
} else {
saveItem.setVisible(true);
- saveItem.setIcon(R.drawable.ic_bookmark_border_black_24dp);
+ saveItem.setIcon(R.drawable.ic_bookmark_border_toolbar_24dp);
}
if (post.isHidden()) {
@@ -1181,10 +1181,10 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
if (mMenu != null) {
if (event.post.isSaved()) {
mMenu.findItem(R.id.action_save_view_post_detail_activity).setIcon(getResources()
- .getDrawable(R.drawable.ic_bookmark_black_24dp));
+ .getDrawable(R.drawable.ic_bookmark_toolbar_24dp));
} else {
mMenu.findItem(R.id.action_save_view_post_detail_activity).setIcon(getResources()
- .getDrawable(R.drawable.ic_bookmark_border_black_24dp));
+ .getDrawable(R.drawable.ic_bookmark_border_toolbar_24dp));
}
}
mAdapter.updatePost(mPost);
@@ -1241,10 +1241,10 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
if (mAccessToken != null) {
if (mPost.isSaved()) {
saveItem.setVisible(true);
- saveItem.setIcon(R.drawable.ic_bookmark_black_24dp);
+ saveItem.setIcon(R.drawable.ic_bookmark_toolbar_24dp);
} else {
saveItem.setVisible(true);
- saveItem.setIcon(R.drawable.ic_bookmark_border_black_24dp);
+ saveItem.setIcon(R.drawable.ic_bookmark_border_toolbar_24dp);
}
if (mPost.isHidden()) {
@@ -1324,13 +1324,13 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
case R.id.action_save_view_post_detail_activity:
if (mPost != null && mAccessToken != null) {
if (mPost.isSaved()) {
- item.setIcon(R.drawable.ic_bookmark_border_black_24dp);
+ item.setIcon(R.drawable.ic_bookmark_border_toolbar_24dp);
SaveThing.unsaveThing(mOauthRetrofit, mAccessToken, mPost.getFullName(),
new SaveThing.SaveThingListener() {
@Override
public void success() {
mPost.setSaved(false);
- item.setIcon(R.drawable.ic_bookmark_border_black_24dp);
+ item.setIcon(R.drawable.ic_bookmark_border_toolbar_24dp);
showMessage(R.string.post_unsaved_success);
EventBus.getDefault().post(new PostUpdateEventToPostList(mPost, postListPosition));
}
@@ -1338,19 +1338,19 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
@Override
public void failed() {
mPost.setSaved(true);
- item.setIcon(R.drawable.ic_bookmark_black_24dp);
+ item.setIcon(R.drawable.ic_bookmark_toolbar_24dp);
showMessage(R.string.post_unsaved_failed);
EventBus.getDefault().post(new PostUpdateEventToPostList(mPost, postListPosition));
}
});
} else {
- item.setIcon(R.drawable.ic_bookmark_black_24dp);
+ item.setIcon(R.drawable.ic_bookmark_toolbar_24dp);
SaveThing.saveThing(mOauthRetrofit, mAccessToken, mPost.getFullName(),
new SaveThing.SaveThingListener() {
@Override
public void success() {
mPost.setSaved(true);
- item.setIcon(R.drawable.ic_bookmark_black_24dp);
+ item.setIcon(R.drawable.ic_bookmark_toolbar_24dp);
showMessage(R.string.post_saved_success);
EventBus.getDefault().post(new PostUpdateEventToPostList(mPost, postListPosition));
}
@@ -1358,7 +1358,7 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
@Override
public void failed() {
mPost.setSaved(false);
- item.setIcon(R.drawable.ic_bookmark_border_black_24dp);
+ item.setIcon(R.drawable.ic_bookmark_border_toolbar_24dp);
showMessage(R.string.post_saved_failed);
EventBus.getDefault().post(new PostUpdateEventToPostList(mPost, postListPosition));
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java
index 6c5a74d0..41dc90cf 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java
@@ -1502,7 +1502,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
MaterialCardView cardView;
@BindView(R.id.icon_gif_image_view_item_post)
AspectRatioGifImageView iconGifImageView;
- @BindView(R.id.name_text_view_item_post)
+ @BindView(R.id.subreddit_name_text_view_item_post)
TextView subredditTextView;
@BindView(R.id.user_text_view_item_post)
TextView userTextView;
diff --git a/app/src/main/res/drawable/ic_add_menu_item_24dp.xml b/app/src/main/res/drawable/ic_add_menu_item_24dp.xml
deleted file mode 100644
index b6814bc2..00000000
--- a/app/src/main/res/drawable/ic_add_menu_item_24dp.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:viewportWidth="24"
- android:viewportHeight="24">
- <path
- android:fillColor="#FFFFFFFF"
- android:pathData="M18,13h-5v5c0,0.55 -0.45,1 -1,1s-1,-0.45 -1,-1v-5H6c-0.55,0 -1,-0.45 -1,-1s0.45,-1 1,-1h5V6c0,-0.55 0.45,-1 1,-1s1,0.45 1,1v5h5c0.55,0 1,0.45 1,1s-0.45,1 -1,1z"/>
-</vector>
diff --git a/app/src/main/res/drawable-night/ic_add_menu_item_24dp.xml b/app/src/main/res/drawable/ic_add_toolbar_24dp.xml
index ed95d188..133eda34 100644
--- a/app/src/main/res/drawable-night/ic_add_menu_item_24dp.xml
+++ b/app/src/main/res/drawable/ic_add_toolbar_24dp.xml
@@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
- android:fillColor="#FF000000"
+ android:fillColor="?attr/toolbarPrimaryTextAndIconColor"
android:pathData="M18,13h-5v5c0,0.55 -0.45,1 -1,1s-1,-0.45 -1,-1v-5H6c-0.55,0 -1,-0.45 -1,-1s0.45,-1 1,-1h5V6c0,-0.55 0.45,-1 1,-1s1,0.45 1,1v5h5c0.55,0 1,0.45 1,1s-0.45,1 -1,1z"/>
</vector>
diff --git a/app/src/main/res/drawable/ic_bookmark_border_black_24dp.xml b/app/src/main/res/drawable/ic_bookmark_border_toolbar_24dp.xml
index 71382d27..3dfb41d7 100644
--- a/app/src/main/res/drawable/ic_bookmark_border_black_24dp.xml
+++ b/app/src/main/res/drawable/ic_bookmark_border_toolbar_24dp.xml
@@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
- android:fillColor="#FFFFFFFF"
+ android:fillColor="?attr/toolbarPrimaryTextAndIconColor"
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>
diff --git a/app/src/main/res/drawable/ic_bookmark_black_24dp.xml b/app/src/main/res/drawable/ic_bookmark_toolbar_24dp.xml
index a7ff3655..fededc94 100644
--- a/app/src/main/res/drawable/ic_bookmark_black_24dp.xml
+++ b/app/src/main/res/drawable/ic_bookmark_toolbar_24dp.xml
@@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
- android:fillColor="#FFFFFFFF"
+ android:fillColor="?attr/toolbarPrimaryTextAndIconColor"
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>
diff --git a/app/src/main/res/drawable/ic_check_circle_menu_item_24dp.xml b/app/src/main/res/drawable/ic_check_circle_toolbar_24dp.xml
index 191a8e4c..e5b5df1d 100644
--- a/app/src/main/res/drawable/ic_check_circle_menu_item_24dp.xml
+++ b/app/src/main/res/drawable/ic_check_circle_toolbar_24dp.xml
@@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
- android:fillColor="#FFFFFFFF"
+ android:fillColor="?attr/toolbarPrimaryTextAndIconColor"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM16.59,7.58L10,14.17l-2.59,-2.58L6,13l4,4 8,-8z"/>
</vector>
diff --git a/app/src/main/res/drawable/ic_comment_white_24dp.xml b/app/src/main/res/drawable/ic_comment_toolbar_24dp.xml
index c7250d4b..d4920fc6 100644
--- a/app/src/main/res/drawable/ic_comment_white_24dp.xml
+++ b/app/src/main/res/drawable/ic_comment_toolbar_24dp.xml
@@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
- android:fillColor="#FFFFFFFF"
+ android:fillColor="?attr/toolbarPrimaryTextAndIconColor"
android:pathData="M21.99,4c0,-1.1 -0.89,-2 -1.99,-2L4,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h14l4,4 -0.01,-18zM20,4v13.17L18.83,16L4,16L4,4h16zM6,12h12v2L6,14zM6,9h12v2L6,11zM6,6h12v2L6,8z"/>
</vector>
diff --git a/app/src/main/res/drawable/ic_file_download_white_24dp.xml b/app/src/main/res/drawable/ic_file_download_toolbar_white_24dp.xml
index b8e83614..8a9cfa3c 100644
--- a/app/src/main/res/drawable/ic_file_download_white_24dp.xml
+++ b/app/src/main/res/drawable/ic_file_download_toolbar_white_24dp.xml
@@ -1,5 +1,5 @@
-<vector android:height="24dp" android:tint="#FFFFFF"
+<vector android:height="24dp"
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="M19,9h-4V3H9v6H5l7,7 7,-7zM5,18v2h14v-2H5z"/>
+ <path android:fillColor="#FFFFFFFF" android:pathData="M19,9h-4V3H9v6H5l7,7 7,-7zM5,18v2h14v-2H5z"/>
</vector>
diff --git a/app/src/main/res/drawable/ic_refresh_toolbar_24dp.xml b/app/src/main/res/drawable/ic_refresh_toolbar_24dp.xml
new file mode 100644
index 00000000..0bddedb8
--- /dev/null
+++ b/app/src/main/res/drawable/ic_refresh_toolbar_24dp.xml
@@ -0,0 +1,5 @@
+<vector android:height="24dp"
+ android:viewportHeight="24.0" android:viewportWidth="24.0"
+ android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="?attr/toolbarPrimaryTextAndIconColor" android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -7.99,8s3.57,8 7.99,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z"/>
+</vector>
diff --git a/app/src/main/res/drawable/ic_refresh_white_24dp.xml b/app/src/main/res/drawable/ic_refresh_white_24dp.xml
deleted file mode 100644
index cc2d1e04..00000000
--- a/app/src/main/res/drawable/ic_refresh_white_24dp.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<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="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -7.99,8s3.57,8 7.99,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z"/>
-</vector>
diff --git a/app/src/main/res/drawable/ic_search_toolbar_24dp.xml b/app/src/main/res/drawable/ic_search_toolbar_24dp.xml
new file mode 100644
index 00000000..87dde9fb
--- /dev/null
+++ b/app/src/main/res/drawable/ic_search_toolbar_24dp.xml
@@ -0,0 +1,5 @@
+<vector android:height="24dp"
+ android:viewportHeight="24.0" android:viewportWidth="24.0"
+ android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="?attr/toolbarPrimaryTextAndIconColor" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
+</vector>
diff --git a/app/src/main/res/drawable/ic_search_white_24dp.xml b/app/src/main/res/drawable/ic_search_white_24dp.xml
deleted file mode 100644
index be5ad99c..00000000
--- a/app/src/main/res/drawable/ic_search_white_24dp.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<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="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
-</vector>
diff --git a/app/src/main/res/drawable/ic_send_white_24dp.xml b/app/src/main/res/drawable/ic_send_toolbar_24dp.xml
index 33efc5c9..fb547099 100644
--- a/app/src/main/res/drawable/ic_send_white_24dp.xml
+++ b/app/src/main/res/drawable/ic_send_toolbar_24dp.xml
@@ -1,5 +1,5 @@
-<vector android:height="24dp" android:tint="#FFFFFF"
+<vector android:height="24dp"
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="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/>
+ <path android:fillColor="?attr/toolbarPrimaryTextAndIconColor" android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/>
</vector>
diff --git a/app/src/main/res/drawable/ic_outline_sort_24px.xml b/app/src/main/res/drawable/ic_sort_toolbar_24dp.xml
index e795d2a2..8984e5aa 100644
--- a/app/src/main/res/drawable/ic_outline_sort_24px.xml
+++ b/app/src/main/res/drawable/ic_sort_toolbar_24dp.xml
@@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
- android:fillColor="#FFFFFF"
+ android:fillColor="?attr/toolbarPrimaryTextAndIconColor"
android:pathData="M3,18h6v-2L3,16v2zM3,6v2h18L21,6L3,6zM3,13h12v-2L3,11v2z"/>
</vector>
diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml
index 88de7dcf..cc63287c 100644
--- a/app/src/main/res/layout/app_bar_main.xml
+++ b/app/src/main/res/layout/app_bar_main.xml
@@ -40,12 +40,12 @@
android:background="?attr/toolbarAndTabBackgroundColor"
app:layout_scrollFlags="scroll|enterAlways"
app:tabGravity="fill"
- app:tabIndicatorColor="@android:color/white"
+ app:tabIndicatorColor="?attr/tabLayoutWithCollapsedCollapsingToolbarTabIndicator"
app:tabIndicatorHeight="3dp"
app:tabMode="fixed"
app:tabRippleColor="?attr/colorControlHighlight"
- app:tabSelectedTextColor="@android:color/white"
- app:tabTextColor="@android:color/white"
+ app:tabSelectedTextColor="?attr/tabLayoutWithCollapsedCollapsingToolbarTextColor"
+ app:tabTextColor="?attr/tabLayoutWithCollapsedCollapsingToolbarTextColor"
app:tabUnboundedRipple="false" />
</com.google.android.material.appbar.AppBarLayout>
diff --git a/app/src/main/res/layout/item_post.xml b/app/src/main/res/layout/item_post.xml
index 3acff256..335694e0 100644
--- a/app/src/main/res/layout/item_post.xml
+++ b/app/src/main/res/layout/item_post.xml
@@ -30,13 +30,13 @@
app:layout_constraintTop_toTopOf="parent"/>
<TextView
- android:id="@+id/name_text_view_item_post"
+ android:id="@+id/subreddit_name_text_view_item_post"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
- android:textColor="#E91E63"
+ android:textColor="?attr/subreddit"
android:textSize="?attr/font_default"
app:layout_constraintBottom_toTopOf="@id/user_text_view_item_post"
app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_item_post"
@@ -56,7 +56,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post"
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post"
- app:layout_constraintTop_toBottomOf="@+id/name_text_view_item_post"
+ app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_item_post"
app:layout_constraintHorizontal_bias="0" />
<ImageView
@@ -67,7 +67,7 @@
android:tint="?attr/stickiedPost"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toEndOf="@id/name_text_view_item_post"
+ app:layout_constraintStart_toEndOf="@id/subreddit_name_text_view_item_post"
app:layout_constraintEnd_toStartOf="@+id/guideline2"
app:layout_constraintTop_toTopOf="parent"/>
diff --git a/app/src/main/res/menu/account_posts_activity.xml b/app/src/main/res/menu/account_posts_activity.xml
index 72392f43..96174315 100644
--- a/app/src/main/res/menu/account_posts_activity.xml
+++ b/app/src/main/res/menu/account_posts_activity.xml
@@ -5,7 +5,6 @@
android:id="@+id/action_refresh_account_posts_activity"
android:orderInCategory="1"
android:title="@string/action_refresh"
- android:icon="@drawable/ic_refresh_white_24dp"
app:showAsAction="never" />
<item
diff --git a/app/src/main/res/menu/account_saved_thing_activity.xml b/app/src/main/res/menu/account_saved_thing_activity.xml
index 21628d7c..0ec48123 100644
--- a/app/src/main/res/menu/account_saved_thing_activity.xml
+++ b/app/src/main/res/menu/account_saved_thing_activity.xml
@@ -6,7 +6,6 @@
android:id="@+id/action_refresh_account_saved_thing_activity"
android:orderInCategory="1"
android:title="@string/action_refresh"
- android:icon="@drawable/ic_refresh_white_24dp"
app:showAsAction="never" />
<item
diff --git a/app/src/main/res/menu/comment_activity.xml b/app/src/main/res/menu/comment_activity.xml
index 640f6a43..bed5b858 100644
--- a/app/src/main/res/menu/comment_activity.xml
+++ b/app/src/main/res/menu/comment_activity.xml
@@ -5,6 +5,6 @@
android:id="@+id/action_send_comment_activity"
android:orderInCategory="1"
android:title="@string/action_send"
- android:icon="@drawable/ic_send_white_24dp"
+ android:icon="@drawable/ic_send_toolbar_24dp"
app:showAsAction="ifRoom" />
</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/create_multi_reddit_activity.xml b/app/src/main/res/menu/create_multi_reddit_activity.xml
index c2ae2455..44b154d9 100644
--- a/app/src/main/res/menu/create_multi_reddit_activity.xml
+++ b/app/src/main/res/menu/create_multi_reddit_activity.xml
@@ -5,6 +5,6 @@
android:id="@+id/action_create_create_multi_reddit_activity"
android:orderInCategory="1"
android:title="@string/action_send"
- android:icon="@drawable/ic_add_menu_item_24dp"
+ android:icon="@drawable/ic_add_toolbar_24dp"
app:showAsAction="ifRoom" />
</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/edit_comment_activity.xml b/app/src/main/res/menu/edit_comment_activity.xml
index e52e484b..97ef8af8 100644
--- a/app/src/main/res/menu/edit_comment_activity.xml
+++ b/app/src/main/res/menu/edit_comment_activity.xml
@@ -5,6 +5,6 @@
android:id="@+id/action_send_edit_comment_activity"
android:orderInCategory="1"
android:title="@string/action_send"
- android:icon="@drawable/ic_send_white_24dp"
+ android:icon="@drawable/ic_send_toolbar_24dp"
app:showAsAction="ifRoom" />
</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/edit_post_activity.xml b/app/src/main/res/menu/edit_post_activity.xml
index 270d7664..86ed3845 100644
--- a/app/src/main/res/menu/edit_post_activity.xml
+++ b/app/src/main/res/menu/edit_post_activity.xml
@@ -5,6 +5,6 @@
android:id="@+id/action_send_edit_post_activity"
android:orderInCategory="1"
android:title="@string/action_send"
- android:icon="@drawable/ic_send_white_24dp"
+ android:icon="@drawable/ic_send_toolbar_24dp"
app:showAsAction="ifRoom" />
</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/filtered_posts_activity.xml b/app/src/main/res/menu/filtered_posts_activity.xml
index 3cebab6c..6e826b5a 100644
--- a/app/src/main/res/menu/filtered_posts_activity.xml
+++ b/app/src/main/res/menu/filtered_posts_activity.xml
@@ -5,14 +5,14 @@
android:id="@+id/action_sort_filtered_thing_activity"
android:orderInCategory="1"
android:title="@string/action_sort"
- android:icon="@drawable/ic_outline_sort_24px"
+ android:icon="@drawable/ic_sort_toolbar_24dp"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_refresh_filtered_thing_activity"
android:orderInCategory="2"
android:title="@string/action_refresh"
- android:icon="@drawable/ic_search_white_24dp"
+ android:icon="@drawable/ic_search_toolbar_24dp"
app:showAsAction="never" />
<item
diff --git a/app/src/main/res/menu/main_activity.xml b/app/src/main/res/menu/main_activity.xml
index b500d3a7..2e3062b1 100644
--- a/app/src/main/res/menu/main_activity.xml
+++ b/app/src/main/res/menu/main_activity.xml
@@ -8,14 +8,14 @@
android:id="@+id/action_search_main_activity"
android:orderInCategory="1"
android:title="@string/action_search"
- android:icon="@drawable/ic_search_white_24dp"
+ android:icon="@drawable/ic_search_toolbar_24dp"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_sort_main_activity"
android:orderInCategory="2"
android:title="@string/action_sort"
- android:icon="@drawable/ic_outline_sort_24px"
+ android:icon="@drawable/ic_sort_toolbar_24dp"
app:showAsAction="ifRoom" />
<item
diff --git a/app/src/main/res/menu/menu_search.xml b/app/src/main/res/menu/menu_search.xml
index 7b3c998a..0e33b2dd 100644
--- a/app/src/main/res/menu/menu_search.xml
+++ b/app/src/main/res/menu/menu_search.xml
@@ -6,6 +6,6 @@
android:id="@+id/action_search_search_activity"
android:orderInCategory="1"
android:title="@string/action_search"
- android:icon="@drawable/ic_search_white_24dp"
+ android:icon="@drawable/ic_search_toolbar_24dp"
app:showAsAction="ifRoom" />
</menu>
diff --git a/app/src/main/res/menu/post_image_activity.xml b/app/src/main/res/menu/post_image_activity.xml
index 1525a802..19aed6e0 100644
--- a/app/src/main/res/menu/post_image_activity.xml
+++ b/app/src/main/res/menu/post_image_activity.xml
@@ -5,6 +5,6 @@
android:id="@+id/action_send_post_image_activity"
android:orderInCategory="1"
android:title="@string/action_send"
- android:icon="@drawable/ic_send_white_24dp"
+ android:icon="@drawable/ic_send_toolbar_24dp"
app:showAsAction="ifRoom" />
</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/post_link_activity.xml b/app/src/main/res/menu/post_link_activity.xml
index 8b9f2e69..f9425806 100644
--- a/app/src/main/res/menu/post_link_activity.xml
+++ b/app/src/main/res/menu/post_link_activity.xml
@@ -5,6 +5,6 @@
android:id="@+id/action_send_post_link_activity"
android:orderInCategory="1"
android:title="@string/action_send"
- android:icon="@drawable/ic_send_white_24dp"
+ android:icon="@drawable/ic_send_toolbar_24dp"
app:showAsAction="ifRoom" />
</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/post_text_activity.xml b/app/src/main/res/menu/post_text_activity.xml
index 94650918..23d9b6d6 100644
--- a/app/src/main/res/menu/post_text_activity.xml
+++ b/app/src/main/res/menu/post_text_activity.xml
@@ -5,6 +5,6 @@
android:id="@+id/action_send_post_text_activity"
android:orderInCategory="1"
android:title="@string/action_send"
- android:icon="@drawable/ic_send_white_24dp"
+ android:icon="@drawable/ic_send_toolbar_24dp"
app:showAsAction="ifRoom" />
</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/post_video_activity.xml b/app/src/main/res/menu/post_video_activity.xml
index c1573cb8..3897c461 100644
--- a/app/src/main/res/menu/post_video_activity.xml
+++ b/app/src/main/res/menu/post_video_activity.xml
@@ -5,6 +5,6 @@
android:id="@+id/action_send_post_video_activity"
android:orderInCategory="1"
android:title="@string/action_send"
- android:icon="@drawable/ic_send_white_24dp"
+ android:icon="@drawable/ic_send_toolbar_24dp"
app:showAsAction="ifRoom" />
</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/search_activity.xml b/app/src/main/res/menu/search_activity.xml
index 74cc4fb7..94119685 100644
--- a/app/src/main/res/menu/search_activity.xml
+++ b/app/src/main/res/menu/search_activity.xml
@@ -7,6 +7,6 @@
android:id="@+id/action_search_search_activity"
android:orderInCategory="1"
android:title="@string/action_search"
- android:icon="@drawable/ic_search_white_24dp"
+ android:icon="@drawable/ic_search_toolbar_24dp"
app:showAsAction="ifRoom" />
</menu>
diff --git a/app/src/main/res/menu/search_result_activity.xml b/app/src/main/res/menu/search_result_activity.xml
index b6c9dd3f..d503471f 100644
--- a/app/src/main/res/menu/search_result_activity.xml
+++ b/app/src/main/res/menu/search_result_activity.xml
@@ -5,14 +5,14 @@
android:id="@+id/action_sort_search_result_activity"
android:orderInCategory="1"
android:title="@string/action_sort"
- android:icon="@drawable/ic_outline_sort_24px"
+ android:icon="@drawable/ic_sort_toolbar_24dp"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_search_search_result_activity"
android:orderInCategory="2"
android:title="@string/action_search"
- android:icon="@drawable/ic_search_white_24dp"
+ android:icon="@drawable/ic_search_toolbar_24dp"
app:showAsAction="ifRoom" />
<item
diff --git a/app/src/main/res/menu/subreddit_multiselection_activity.xml b/app/src/main/res/menu/subreddit_multiselection_activity.xml
index 0a9d4ff3..ea842fd3 100644
--- a/app/src/main/res/menu/subreddit_multiselection_activity.xml
+++ b/app/src/main/res/menu/subreddit_multiselection_activity.xml
@@ -5,13 +5,13 @@
android:id="@+id/action_save_subreddit_multiselection_activity"
android:orderInCategory="1"
android:title="@string/action_save"
- android:icon="@drawable/ic_check_circle_menu_item_24dp"
+ android:icon="@drawable/ic_check_circle_toolbar_24dp"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_search_subreddit_multiselection_activity"
android:orderInCategory="2"
android:title="@string/action_search"
- android:icon="@drawable/ic_search_white_24dp"
+ android:icon="@drawable/ic_search_toolbar_24dp"
app:showAsAction="ifRoom" />
</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/subreddit_selection_activity.xml b/app/src/main/res/menu/subreddit_selection_activity.xml
index f3a40a77..a55e1b97 100644
--- a/app/src/main/res/menu/subreddit_selection_activity.xml
+++ b/app/src/main/res/menu/subreddit_selection_activity.xml
@@ -5,6 +5,6 @@
android:id="@+id/action_search_subreddit_selection_activity"
android:orderInCategory="1"
android:title="@string/action_search"
- android:icon="@drawable/ic_search_white_24dp"
+ android:icon="@drawable/ic_search_toolbar_24dp"
app:showAsAction="ifRoom" />
</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/view_gif_activity.xml b/app/src/main/res/menu/view_gif_activity.xml
index 493c9fdb..f97218ce 100644
--- a/app/src/main/res/menu/view_gif_activity.xml
+++ b/app/src/main/res/menu/view_gif_activity.xml
@@ -5,6 +5,6 @@
android:id="@+id/action_download_view_gif"
android:orderInCategory="1"
android:title="@string/action_download"
- android:icon="@drawable/ic_file_download_white_24dp"
+ android:icon="@drawable/ic_file_download_toolbar_white_24dp"
app:showAsAction="always" />
</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/view_image.xml b/app/src/main/res/menu/view_image.xml
index 238334e1..c09ff1f8 100644
--- a/app/src/main/res/menu/view_image.xml
+++ b/app/src/main/res/menu/view_image.xml
@@ -5,6 +5,6 @@
android:id="@+id/action_download_view_image"
android:orderInCategory="1"
android:title="@string/action_download"
- android:icon="@drawable/ic_file_download_white_24dp"
+ android:icon="@drawable/ic_file_download_toolbar_white_24dp"
app:showAsAction="always" />
</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/view_multi_reddit_detail_activity.xml b/app/src/main/res/menu/view_multi_reddit_detail_activity.xml
index c8005d25..abaf8a6a 100644
--- a/app/src/main/res/menu/view_multi_reddit_detail_activity.xml
+++ b/app/src/main/res/menu/view_multi_reddit_detail_activity.xml
@@ -7,20 +7,19 @@
android:id="@+id/action_sort_view_multi_reddit_detail_activity"
android:orderInCategory="1"
android:title="@string/action_sort"
- android:icon="@drawable/ic_outline_sort_24px"
+ android:icon="@drawable/ic_sort_toolbar_24dp"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_search_view_multi_reddit_detail_activity"
android:orderInCategory="2"
android:title="@string/action_search"
- android:icon="@drawable/ic_search_white_24dp"
+ android:icon="@drawable/ic_search_toolbar_24dp"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_refresh_view_multi_reddit_detail_activity"
android:orderInCategory="3"
android:title="@string/action_refresh"
- android:icon="@drawable/ic_refresh_white_24dp"
app:showAsAction="never" />
<item
diff --git a/app/src/main/res/menu/view_post_detail_activity.xml b/app/src/main/res/menu/view_post_detail_activity.xml
index 56f5d12c..a9871051 100644
--- a/app/src/main/res/menu/view_post_detail_activity.xml
+++ b/app/src/main/res/menu/view_post_detail_activity.xml
@@ -5,7 +5,7 @@
android:id="@+id/action_comment_view_post_detail_activity"
android:orderInCategory="1"
android:title="@string/action_add_comment"
- android:icon="@drawable/ic_comment_white_24dp"
+ android:icon="@drawable/ic_comment_toolbar_24dp"
app:showAsAction="ifRoom"
android:visible="false" />
diff --git a/app/src/main/res/menu/view_sidebar_activity.xml b/app/src/main/res/menu/view_sidebar_activity.xml
index 3bb65dee..fa5d9123 100644
--- a/app/src/main/res/menu/view_sidebar_activity.xml
+++ b/app/src/main/res/menu/view_sidebar_activity.xml
@@ -5,6 +5,6 @@
android:id="@+id/action_refresh_view_sidebar_activity"
android:orderInCategory="1"
android:title="@string/action_refresh"
- android:icon="@drawable/ic_refresh_white_24dp"
+ android:icon="@drawable/ic_refresh_toolbar_24dp"
app:showAsAction="ifRoom" />
</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/view_subreddit_detail_activity.xml b/app/src/main/res/menu/view_subreddit_detail_activity.xml
index d019e052..eeef2439 100644
--- a/app/src/main/res/menu/view_subreddit_detail_activity.xml
+++ b/app/src/main/res/menu/view_subreddit_detail_activity.xml
@@ -7,20 +7,19 @@
android:id="@+id/action_sort_view_subreddit_detail_activity"
android:orderInCategory="1"
android:title="@string/action_sort"
- android:icon="@drawable/ic_outline_sort_24px"
+ android:icon="@drawable/ic_sort_toolbar_24dp"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_search_view_subreddit_detail_activity"
android:orderInCategory="2"
android:title="@string/action_search"
- android:icon="@drawable/ic_search_white_24dp"
+ android:icon="@drawable/ic_search_toolbar_24dp"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_refresh_view_subreddit_detail_activity"
android:orderInCategory="3"
android:title="@string/action_refresh"
- android:icon="@drawable/ic_refresh_white_24dp"
app:showAsAction="never" />
<item
diff --git a/app/src/main/res/menu/view_user_detail_activity.xml b/app/src/main/res/menu/view_user_detail_activity.xml
index 51d2f61e..fe991f16 100644
--- a/app/src/main/res/menu/view_user_detail_activity.xml
+++ b/app/src/main/res/menu/view_user_detail_activity.xml
@@ -6,19 +6,18 @@
android:id="@+id/action_sort_view_user_detail_activity"
android:orderInCategory="1"
android:title="@string/action_search"
- android:icon="@drawable/ic_outline_sort_24px"
+ android:icon="@drawable/ic_sort_toolbar_24dp"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_search_view_user_detail_activity"
android:orderInCategory="2"
android:title="@string/action_search"
- android:icon="@drawable/ic_search_white_24dp"
+ android:icon="@drawable/ic_search_toolbar_24dp"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_refresh_view_user_detail_activity"
android:orderInCategory="3"
android:title="@string/action_refresh"
- android:icon="@drawable/ic_refresh_white_24dp"
app:showAsAction="never" />
<item
diff --git a/app/src/main/res/menu/view_video.xml b/app/src/main/res/menu/view_video.xml
index ef64a9dd..71a52c58 100644
--- a/app/src/main/res/menu/view_video.xml
+++ b/app/src/main/res/menu/view_video.xml
@@ -5,6 +5,6 @@
android:id="@+id/action_download_view_video"
android:orderInCategory="1"
android:title="@string/action_download"
- android:icon="@drawable/ic_file_download_white_24dp"
+ android:icon="@drawable/ic_file_download_toolbar_white_24dp"
app:showAsAction="always" />
</menu> \ No newline at end of file
diff --git a/app/src/main/res/values/attr.xml b/app/src/main/res/values/attr.xml
index 03dfb30f..5d6dc3c1 100644
--- a/app/src/main/res/values/attr.xml
+++ b/app/src/main/res/values/attr.xml
@@ -37,6 +37,7 @@
<attr name="backgroundColor" format="color"/>
<attr name="roundedBottomSheetPrimaryBackground" format="color"/>
<attr name="cardViewBackgroundColor" format="color"/>
+ <attr name="toolbarPrimaryTextAndIconColor" format="color" />
<attr name="toolbarAndTabBackgroundColor" format="color"/>
<attr name="circularProgressBarBackground" format="color"/>
<attr name="tabLayoutWithExpandedCollapsingToolbarTabBackground" format="color"/>
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index dc7024a9..2ae6c7cf 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -38,10 +38,14 @@
<item name="android:windowTranslucentNavigation">true</item>
</style>
- <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
+ <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.DayNight.ActionBar">
+ <item name="android:textColorPrimary">?attr/toolbarPrimaryTextAndIconColor</item>
+ </style>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.DayNight" />
+ <style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
+
<style name="CustomTabLayout" parent="Widget.Design.TabLayout">
<item name="tabIndicatorColor">@android:color/white</item>
<item name="tabIndicatorHeight">3dp</item>
@@ -228,6 +232,7 @@
<item name="backgroundColor">@color/backgroundColor</item>
<item name="roundedBottomSheetPrimaryBackground">@color/roundedBottomSheetPrimaryBackground</item>
<item name="cardViewBackgroundColor">#FFFFFF</item>
+ <item name="toolbarPrimaryTextAndIconColor">#3C4043</item>
<item name="toolbarAndTabBackgroundColor">@color/colorPrimary</item>
<item name="circularProgressBarBackground">#FFFFFF</item>
<item name="tabLayoutWithExpandedCollapsingToolbarTabBackground">#FFFFFF</item>
@@ -279,6 +284,7 @@
<item name="backgroundColor">@color/backgroundColor</item>
<item name="roundedBottomSheetPrimaryBackground">@color/roundedBottomSheetPrimaryBackground</item>
<item name="cardViewBackgroundColor">#242424</item>
+ <item name="toolbarPrimaryTextAndIconColor">#FFFFFF</item>
<item name="toolbarAndTabBackgroundColor">#282828</item>
<item name="circularProgressBarBackground">@color/colorPrimary</item>
<item name="tabLayoutWithExpandedCollapsingToolbarTabBackground">@color/backgroundColor</item>
@@ -330,6 +336,7 @@
<item name="backgroundColor">#000000</item>
<item name="roundedBottomSheetPrimaryBackground">#000000</item>
<item name="cardViewBackgroundColor">#000000</item>
+ <item name="toolbarPrimaryTextAndIconColor">#FFFFFF</item>
<item name="toolbarAndTabBackgroundColor">#000000</item>
<item name="circularProgressBarBackground">#000000</item>
<item name="tabLayoutWithExpandedCollapsingToolbarTabBackground">@color/backgroundColor</item>
@@ -372,23 +379,24 @@
</style>
<style name="Theme.Purple">
- <item name="colorPrimary">#9C27B0</item>
- <item name="colorPrimaryDark">#7B1FA2</item>
- <item name="colorAccent">#03A9F4</item>
- <item name="colorPrimaryLightTheme">#9C27B0</item>
+ <item name="colorPrimary">#00C3E9</item>
+ <item name="colorPrimaryDark">#009EBA</item>
+ <item name="colorAccent">#EE2502</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="toolbarAndTabBackgroundColor">#9C27B0</item>
+ <item name="toolbarPrimaryTextAndIconColor">#FF3C4043</item>
+ <item name="toolbarAndTabBackgroundColor">?attr/colorPrimary</item>
<item name="circularProgressBarBackground">#FFFFFF</item>
<item name="tabLayoutWithExpandedCollapsingToolbarTabBackground">#FFFFFF</item>
- <item name="tabLayoutWithExpandedCollapsingToolbarTextColor">#9C27B0</item>
- <item name="tabLayoutWithExpandedCollapsingToolbarTabIndicator">#9C27B0</item>
- <item name="tabLayoutWithCollapsedCollapsingToolbarTabBackground">#9C27B0</item>
- <item name="tabLayoutWithCollapsedCollapsingToolbarTextColor">#FFFFFF</item>
- <item name="tabLayoutWithCollapsedCollapsingToolbarTabIndicator">#FFFFFF</item>
+ <item name="tabLayoutWithExpandedCollapsingToolbarTextColor">?attr/colorPrimary</item>
+ <item name="tabLayoutWithExpandedCollapsingToolbarTabIndicator">?attr/colorPrimary</item>
+ <item name="tabLayoutWithCollapsedCollapsingToolbarTabBackground">?attr/colorPrimary</item>
+ <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>
@@ -407,7 +415,7 @@
<item name="authorFlairTextColor">#EE02C4</item>
<item name="submitter">#EE8A02</item>
<item name="moderator">#00BA81</item>
- <item name="notificationIconColor">#9C27B0</item>
+ <item name="notificationIconColor">?attr/colorPrimary</item>
<item name="singleCommentThreadBackgroundColor">#B3E5F9</item>
<item name="unreadMessageBackgroundColor">#B3E5F9</item>
<item name="dividerColor">#E0E0E0</item>