Skip to content

Commit

Permalink
Dynamic locale 2.3.0
Browse files Browse the repository at this point in the history
Dynamic utils 4.4.6.
  • Loading branch information
pranavpandey committed Sep 18, 2022
1 parent 023ee0d commit 7ecc1ee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ buildscript {
'targetSdk' : 33,
'buildTools' : '33.0.0',
'multidex' : '2.0.1',
'dynamic' : '4.4.5',
'dynamic' : '4.4.6',
'fragment' : '1.5.2',
'flexbox' : '3.0.0',
'kotlin' : '1.6.21',
'locale' : '2.2.0',
'locale' : '2.3.0',
'material' : '1.8.0-alpha01',
'preferences' : '2.2.2',
'swiperefresh': '1.1.0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ public void initialize() {
* @see #set(int, int)
*/
protected void onComputeColors(@ColorInt int color, @ColorInt int tint) {
set(DynamicColorUtils.getAccentColor(color),
DynamicColorUtils.getAccentColor(tint));
set(DynamicColorUtils.replaceColor(color, DynamicColorUtils.getRandomColor(color)),
DynamicColorUtils.replaceColor(tint, DynamicColorUtils.getRandomColor(tint)));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.appcompat.graphics.drawable.DrawableWrapper;
import androidx.appcompat.graphics.drawable.DrawableWrapperCompat;
import androidx.core.widget.EdgeEffectCompat;
import androidx.core.widget.NestedScrollView;
import androidx.recyclerview.widget.RecyclerView;
Expand Down Expand Up @@ -771,16 +771,15 @@ public static void setSelectorColor(@Nullable AbsListView view,
return;
}

if (view.getSelector() instanceof DrawableWrapper) {
DrawableWrapper drawable = (DrawableWrapper) view.getSelector();
if (view.getSelector() instanceof DrawableWrapperCompat) {
DrawableWrapperCompat drawable = (DrawableWrapperCompat) view.getSelector();
drawable.mutate();

if (DynamicSdkUtils.is21()
&& drawable.getWrappedDrawable() instanceof RippleDrawable) {
if (DynamicSdkUtils.is21() && drawable.getDrawable() instanceof RippleDrawable) {
color = DynamicColorUtils.getLighterColor(DynamicColorUtils.adjustAlpha(color,
Defaults.ADS_ALPHA_PRESSED_SELECTOR), Defaults.ADS_STATE_LIGHT);

DynamicTintUtils.colorizeRippleDrawable(view, drawable.getWrappedDrawable(),
DynamicTintUtils.colorizeRippleDrawable(view, drawable.getDrawable(),
background, color, false, false);
} else {
DynamicDrawableUtils.colorizeDrawable(drawable, color);
Expand Down

0 comments on commit 7ecc1ee

Please sign in to comment.