aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-11-03 13:54:56 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-11-03 13:54:56 +0000
commit6df1b1f9543f904db26fa394734e454f917b7aa9 (patch)
tree0772e55e26a9ec936399f4f5e78151c613227e61 /app/src/main/java
parentef870f93fccc84e1d68dd6e0d4d4918422809b30 (diff)
downloadinfinity-for-reddit-6df1b1f9543f904db26fa394734e454f917b7aa9.tar
infinity-for-reddit-6df1b1f9543f904db26fa394734e454f917b7aa9.tar.gz
infinity-for-reddit-6df1b1f9543f904db26fa394734e454f917b7aa9.tar.bz2
infinity-for-reddit-6df1b1f9543f904db26fa394734e454f917b7aa9.tar.lz
infinity-for-reddit-6df1b1f9543f904db26fa394734e454f917b7aa9.tar.xz
infinity-for-reddit-6df1b1f9543f904db26fa394734e454f917b7aa9.tar.zst
infinity-for-reddit-6df1b1f9543f904db26fa394734e454f917b7aa9.zip
Tweak Material You light theme on Android 12.
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java3
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/utils/MaterialYouUtils.java49
4 files changed, 27 insertions, 29 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java
index 9ea9f5de..18f16d5d 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java
@@ -519,8 +519,8 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
appBarLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
- collapsingToolbarLayout.setScrimVisibleHeightTrigger(toolbar.getHeight() + tabLayout.getHeight() + getStatusBarHeight() * 2);
appBarLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
+ collapsingToolbarLayout.setScrimVisibleHeightTrigger(toolbar.getHeight() + tabLayout.getHeight() + getStatusBarHeight() * 2);
}
});
applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar, false);
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java
index dfc40140..7010c8e3 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java
@@ -566,8 +566,8 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
appBarLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
- collapsingToolbarLayout.setScrimVisibleHeightTrigger(toolbar.getHeight() + tabLayout.getHeight() + getStatusBarHeight() * 2);
appBarLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
+ collapsingToolbarLayout.setScrimVisibleHeightTrigger(toolbar.getHeight() + tabLayout.getHeight() + getStatusBarHeight() * 2);
}
});
applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar, false);
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
index 464a4ab1..493045f1 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
@@ -39,7 +39,6 @@ import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestBuilder;
import com.bumptech.glide.RequestManager;
import com.bumptech.glide.load.DataSource;
-import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.RequestOptions;
@@ -1495,7 +1494,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
.into(((PostWithPreviewTypeViewHolder) holder).imageView);
} else {
- imageRequestBuilder.diskCacheStrategy(DiskCacheStrategy.NONE).override(preview.getPreviewWidth(), preview.getPreviewHeight()).into(((PostWithPreviewTypeViewHolder) holder).imageView);
+ imageRequestBuilder.override(preview.getPreviewWidth(), preview.getPreviewHeight()).into(((PostWithPreviewTypeViewHolder) holder).imageView);
}
}
} else if (holder instanceof PostCompactBaseViewHolder) {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/MaterialYouUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/MaterialYouUtils.java
index 63c3d9f2..8c5dea51 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/MaterialYouUtils.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/MaterialYouUtils.java
@@ -53,32 +53,31 @@ public class MaterialYouUtils {
CustomTheme darkTheme = CustomThemeWrapper.getIndigoDark(context);
CustomTheme amoledTheme = CustomThemeWrapper.getIndigoAmoled(context);
-
- lightTheme.colorPrimary = context.getColor(android.R.color.system_accent1_300);
- lightTheme.colorPrimaryDark = context.getColor(android.R.color.system_accent1_500);
+ lightTheme.colorPrimary = context.getColor(android.R.color.system_accent1_100);
+ lightTheme.colorPrimaryDark = context.getColor(android.R.color.system_accent1_200);
lightTheme.colorAccent = context.getColor(android.R.color.system_accent3_300);
- lightTheme.colorPrimaryLightTheme = context.getColor(android.R.color.system_accent1_200);
- lightTheme.backgroundColor = context.getColor(android.R.color.system_neutral1_10);
+ lightTheme.colorPrimaryLightTheme = lightTheme.colorPrimary;
+ lightTheme.backgroundColor = context.getColor(android.R.color.system_neutral1_100);
lightTheme.cardViewBackgroundColor = context.getColor(android.R.color.system_neutral2_50);
lightTheme.commentBackgroundColor = context.getColor(android.R.color.system_neutral2_50);
- lightTheme.awardedCommentBackgroundColor = context.getColor(android.R.color.system_neutral2_100);
- lightTheme.bottomAppBarBackgroundColor = context.getColor(android.R.color.system_accent2_100);
- lightTheme.navBarColor = context.getColor(android.R.color.system_neutral2_100);
+ lightTheme.awardedCommentBackgroundColor = context.getColor(android.R.color.system_neutral2_50);
+ lightTheme.bottomAppBarBackgroundColor = lightTheme.colorPrimary;
+ lightTheme.navBarColor = lightTheme.colorPrimary;
lightTheme.primaryTextColor = context.getColor(android.R.color.system_neutral1_900);
- lightTheme.secondaryTextColor = context.getColor(android.R.color.system_neutral1_900);
- lightTheme.bottomAppBarIconColor = context.getColor(android.R.color.system_accent1_400);;
+ lightTheme.secondaryTextColor = context.getColor(android.R.color.system_neutral1_700);
+ lightTheme.bottomAppBarIconColor = context.getColor(android.R.color.system_accent1_800);
lightTheme.primaryIconColor = context.getColor(android.R.color.system_accent1_400);
- lightTheme.fabIconColor = context.getColor(android.R.color.system_neutral1_10);
- lightTheme.toolbarPrimaryTextAndIconColor = context.getColor(android.R.color.system_accent1_50);
- lightTheme.toolbarSecondaryTextColor = context.getColor(android.R.color.system_accent3_50);
- lightTheme.tabLayoutWithCollapsedCollapsingToolbarTabIndicator = context.getColor(android.R.color.system_accent1_50);
- lightTheme.tabLayoutWithCollapsedCollapsingToolbarTextColor = context.getColor(android.R.color.system_accent1_50);
- lightTheme.tabLayoutWithCollapsedCollapsingToolbarTabBackground = context.getColor(android.R.color.system_accent1_50);
- lightTheme.tabLayoutWithExpandedCollapsingToolbarTabBackground = context.getColor(android.R.color.system_accent1_50);
- lightTheme.tabLayoutWithExpandedCollapsingToolbarTabIndicator = context.getColor(android.R.color.system_accent1_50);
- lightTheme.tabLayoutWithExpandedCollapsingToolbarTextColor = context.getColor(android.R.color.system_accent1_50);
+ lightTheme.fabIconColor = lightTheme.bottomAppBarIconColor;
+ lightTheme.toolbarPrimaryTextAndIconColor = lightTheme.bottomAppBarIconColor;
+ lightTheme.toolbarSecondaryTextColor = lightTheme.bottomAppBarIconColor;
+ lightTheme.tabLayoutWithCollapsedCollapsingToolbarTabIndicator = lightTheme.bottomAppBarIconColor;
+ lightTheme.tabLayoutWithCollapsedCollapsingToolbarTextColor = lightTheme.bottomAppBarIconColor;
+ lightTheme.tabLayoutWithCollapsedCollapsingToolbarTabBackground = lightTheme.colorPrimary;
+ lightTheme.tabLayoutWithExpandedCollapsingToolbarTabBackground = lightTheme.backgroundColor;
+ lightTheme.tabLayoutWithExpandedCollapsingToolbarTabIndicator = lightTheme.bottomAppBarIconColor;
+ lightTheme.tabLayoutWithExpandedCollapsingToolbarTextColor = lightTheme.bottomAppBarIconColor;
lightTheme.circularProgressBarBackground = context.getColor(android.R.color.system_accent1_10);
- lightTheme.dividerColor = context.getColor(android.R.color.system_neutral1_100);
+ lightTheme.dividerColor = context.getColor(android.R.color.system_neutral1_400);
lightTheme.isLightStatusBar = false;
lightTheme.isChangeStatusBarIconColorAfterToolbarCollapsedInImmersiveInterface = true;
lightTheme.name = "Material You";
@@ -86,7 +85,7 @@ public class MaterialYouUtils {
darkTheme.colorPrimary = context.getColor(android.R.color.system_accent1_100);
darkTheme.colorPrimaryDark = context.getColor(android.R.color.system_accent1_300);
darkTheme.colorAccent = context.getColor(android.R.color.system_accent3_100);
- darkTheme.colorPrimaryLightTheme = context.getColor(android.R.color.system_accent1_100);
+ darkTheme.colorPrimaryLightTheme = context.getColor(android.R.color.system_accent1_300);
darkTheme.backgroundColor = context.getColor(android.R.color.system_neutral1_900);
darkTheme.cardViewBackgroundColor = context.getColor(android.R.color.system_neutral2_800);
darkTheme.commentBackgroundColor = context.getColor(android.R.color.system_neutral2_800);
@@ -99,11 +98,11 @@ public class MaterialYouUtils {
darkTheme.primaryIconColor = context.getColor(android.R.color.system_accent1_100);
darkTheme.fabIconColor = context.getColor(android.R.color.system_neutral1_900);
darkTheme.toolbarPrimaryTextAndIconColor = context.getColor(android.R.color.system_accent1_900);
- darkTheme.toolbarSecondaryTextColor = context.getColor(android.R.color.system_accent3_900);
+ darkTheme.toolbarSecondaryTextColor = context.getColor(android.R.color.system_accent1_900);
darkTheme.tabLayoutWithCollapsedCollapsingToolbarTabIndicator = context.getColor(android.R.color.system_accent1_800);
darkTheme.tabLayoutWithCollapsedCollapsingToolbarTextColor = context.getColor(android.R.color.system_accent1_800);
- darkTheme.tabLayoutWithCollapsedCollapsingToolbarTabBackground = context.getColor(android.R.color.system_accent1_800);
- darkTheme.tabLayoutWithExpandedCollapsingToolbarTabBackground = context.getColor(android.R.color.system_accent1_800);
+ darkTheme.tabLayoutWithCollapsedCollapsingToolbarTabBackground = context.getColor(android.R.color.system_accent1_100);
+ darkTheme.tabLayoutWithExpandedCollapsingToolbarTabBackground = context.getColor(android.R.color.system_accent1_100);
darkTheme.tabLayoutWithExpandedCollapsingToolbarTabIndicator = context.getColor(android.R.color.system_accent1_800);
darkTheme.tabLayoutWithExpandedCollapsingToolbarTextColor = context.getColor(android.R.color.system_accent1_800);
darkTheme.circularProgressBarBackground = context.getColor(android.R.color.system_accent1_900);
@@ -173,7 +172,7 @@ public class MaterialYouUtils {
lightTheme.tabLayoutWithCollapsedCollapsingToolbarTabIndicator = colorPrimaryAppropriateTextColor;
lightTheme.tabLayoutWithCollapsedCollapsingToolbarTextColor = colorPrimaryAppropriateTextColor;
lightTheme.tabLayoutWithCollapsedCollapsingToolbarTabBackground = colorPrimaryInt;
- lightTheme.tabLayoutWithExpandedCollapsingToolbarTabBackground = colorPrimaryInt;
+ lightTheme.tabLayoutWithExpandedCollapsingToolbarTabBackground = backgroundColor;
lightTheme.tabLayoutWithExpandedCollapsingToolbarTabIndicator = colorPrimaryAppropriateTextColor;
lightTheme.tabLayoutWithExpandedCollapsingToolbarTextColor = colorPrimaryAppropriateTextColor;
lightTheme.circularProgressBarBackground = colorPrimaryInt;