Convert to dynamic color

* Drop color hardcode
This commit is contained in:
tarsin committed 2022-05-18 11:17:47 +08:00
1 parent bc38c8c135
commit fcce3a04a6
20 files changed
+13 -194

No files matched your search

@@ -92,14 +92,8 @@ public final class UrlOpener {
}
}
boolean isNight = (context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_YES) > 0;
CustomTabsIntent.Builder customTabsIntent = new CustomTabsIntent.Builder();
customTabsIntent.setShowTitle(true);
CustomTabColorSchemeParams params = new CustomTabColorSchemeParams.Builder()
.setToolbarColor(ResourcesKt.resolveColor(context.getTheme(), R.attr.toolbarColor))
.build();
customTabsIntent.setDefaultColorSchemeParams(params);
customTabsIntent.setColorScheme(isNight ? CustomTabsIntent.COLOR_SCHEME_DARK : CustomTabsIntent.COLOR_SCHEME_LIGHT);
try {
customTabsIntent.build().launchUrl(context, uri);
} catch (ActivityNotFoundException e) {
@@ -383,7 +383,7 @@ public class DownloadsScene extends ToolbarScene
mFastScroller.attachToRecyclerView(mRecyclerView);
HandlerDrawable handlerDrawable = new HandlerDrawable();
handlerDrawable.setColor(ResourcesKt.resolveColor(getTheme(), R.attr.widgetColorThemeAccent));
handlerDrawable.setColor(com.google.android.material.R.color.material_dynamic_neutral100);
mFastScroller.setHandlerDrawable(handlerDrawable);
mFastScroller.setOnDragHandlerListener(this);
@@ -238,7 +238,7 @@ public class HistoryScene extends ToolbarScene {
mFastScroller.attachToRecyclerView(mRecyclerView);
HandlerDrawable handlerDrawable = new HandlerDrawable();
handlerDrawable.setColor(ResourcesKt.resolveColor(getTheme(), R.attr.widgetColorThemeAccent));
handlerDrawable.setColor(com.google.android.material.R.color.material_dynamic_neutral100);
mFastScroller.setHandlerDrawable(handlerDrawable);
updateLazyList();
@@ -106,7 +106,7 @@ public class ContentLayout extends FrameLayout {
mFastScroller.attachToRecyclerView(mRecyclerView);
HandlerDrawable drawable = new HandlerDrawable();
drawable.setColor(ResourcesKt.resolveColor(context.getTheme(), R.attr.widgetColorThemeAccent));
drawable.setColor(com.google.android.material.R.color.material_dynamic_neutral100);
mFastScroller.setHandlerDrawable(drawable);
mRefreshLayout.setColorSchemeResources(
@@ -45,6 +45,8 @@ import com.hippo.yorozuya.LayoutUtils;
import com.hippo.yorozuya.MathUtils;
import com.hippo.yorozuya.SimpleHandler;
import rikka.core.res.ResourcesKt;
public class Slider extends View {
private static final char[] CHARACTERS = {
@@ -134,10 +136,8 @@ public class Slider extends View {
setProgress(a.getInteger(R.styleable.Slider_slider_progress, 0));
mThickness = a.getDimension(R.styleable.Slider_thickness, 2);
mRadius = a.getDimension(R.styleable.Slider_radius, 6);
setColor(a.getColor(R.styleable.Slider_color, Color.BLACK));
mBgPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBgPaint.setColor(a.getBoolean(R.styleable.Slider_dark, false) ? 0x4dffffff : 0x42000000);
a.recycle();