mirror of
https://github.com/meowarex/rl-mobile.git
synced 2026-08-26 22:17:44 +10:00
Merge pull request #49 from Se7en-dev/feat/mini-player-dynamic-color-patch
[PATCH] mini player dynamic bg color
This commit is contained in:
@@ -177,6 +177,13 @@ enum class KnownPatch(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
MiniPlayerDynamicBackground(
|
||||||
|
order = 51,
|
||||||
|
fileNames = listOf("mini-player-dynamic-bg.patch"),
|
||||||
|
titleRes = R.string.patch_mini_player_dynamic_bg_title,
|
||||||
|
descRes = R.string.patch_mini_player_dynamic_bg_desc,
|
||||||
|
default = Disabled,
|
||||||
|
),
|
||||||
EnableLegacyUi(
|
EnableLegacyUi(
|
||||||
order = 10,
|
order = 10,
|
||||||
fileNames = listOf("enable-legacy-ui.patch"),
|
fileNames = listOf("enable-legacy-ui.patch"),
|
||||||
@@ -193,6 +200,7 @@ enum class KnownPatch(
|
|||||||
PlayerBackdrop,
|
PlayerBackdrop,
|
||||||
QualityBadgeColors,
|
QualityBadgeColors,
|
||||||
LyricsProgressPill,
|
LyricsProgressPill,
|
||||||
|
MiniPlayerDynamicBackground,
|
||||||
CoverEverywhere,
|
CoverEverywhere,
|
||||||
MiniPlayerGestures,
|
MiniPlayerGestures,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -293,6 +293,8 @@
|
|||||||
<string name="patch_mini_player_gestures_desc">Swipe up on the mini-player to open the full player.</string>
|
<string name="patch_mini_player_gestures_desc">Swipe up on the mini-player to open the full player.</string>
|
||||||
<string name="patch_mini_player_left_right_gestures_title">Next/Previous Gestures</string>
|
<string name="patch_mini_player_left_right_gestures_title">Next/Previous Gestures</string>
|
||||||
<string name="patch_mini_player_left_right_gestures_desc">Swipe left or right on the mini-player to skip tracks.</string>
|
<string name="patch_mini_player_left_right_gestures_desc">Swipe left or right on the mini-player to skip tracks.</string>
|
||||||
|
<string name="patch_mini_player_dynamic_bg_title">Mini-Player Dynamic Background</string>
|
||||||
|
<string name="patch_mini_player_dynamic_bg_desc">Colorizes the Mini-Player depending on the currently playing track.</string>
|
||||||
<string name="patch_mini_player_variant_floating_title">Floating</string>
|
<string name="patch_mini_player_variant_floating_title">Floating</string>
|
||||||
<string name="patch_mini_player_variant_square_grey_title">Grey</string>
|
<string name="patch_mini_player_variant_square_grey_title">Grey</string>
|
||||||
<string name="patch_mini_player_variant_square_black_title">Black</string>
|
<string name="patch_mini_player_variant_square_black_title">Black</string>
|
||||||
|
|||||||
@@ -0,0 +1,139 @@
|
|||||||
|
.class public final Lradiant/MiniPlayerBackground;
|
||||||
|
.super Ljava/lang/Object;
|
||||||
|
|
||||||
|
|
||||||
|
# static fields
|
||||||
|
.field public static final colorState:Landroidx/compose/runtime/MutableState; # player bg color
|
||||||
|
|
||||||
|
|
||||||
|
# direct methods
|
||||||
|
.method static constructor <clinit>()V
|
||||||
|
.locals 2
|
||||||
|
|
||||||
|
const/4 v0, 0x0
|
||||||
|
|
||||||
|
const/4 v1, 0x2
|
||||||
|
|
||||||
|
invoke-static {v0, v0, v1, v0}, Landroidx/compose/runtime/SnapshotStateKt;->mutableStateOf$default(Ljava/lang/Object;Landroidx/compose/runtime/SnapshotMutationPolicy;ILjava/lang/Object;)Landroidx/compose/runtime/MutableState;
|
||||||
|
|
||||||
|
move-result-object v0
|
||||||
|
|
||||||
|
sput-object v0, Lradiant/MiniPlayerBackground;->colorState:Landroidx/compose/runtime/MutableState;
|
||||||
|
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
|
||||||
|
.method private constructor <init>()V
|
||||||
|
.locals 0
|
||||||
|
|
||||||
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||||||
|
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
|
||||||
|
.method public static color(JLandroidx/compose/runtime/Composer;I)J
|
||||||
|
.locals 8
|
||||||
|
.annotation build Landroidx/compose/runtime/Composable;
|
||||||
|
.end annotation
|
||||||
|
|
||||||
|
const v0, 0x4d504442 # compose group key
|
||||||
|
|
||||||
|
invoke-interface {p2, v0}, Landroidx/compose/runtime/Composer;->startReplaceGroup(I)V
|
||||||
|
|
||||||
|
sget-object v0, Lradiant/MiniPlayerBackground;->colorState:Landroidx/compose/runtime/MutableState;
|
||||||
|
|
||||||
|
invoke-interface {v0}, Landroidx/compose/runtime/MutableState;->getValue()Ljava/lang/Object; # read player color
|
||||||
|
|
||||||
|
move-result-object v0
|
||||||
|
|
||||||
|
check-cast v0, Landroidx/compose/ui/graphics/Color;
|
||||||
|
|
||||||
|
if-eqz v0, :fallback
|
||||||
|
|
||||||
|
invoke-virtual {v0}, Landroidx/compose/ui/graphics/Color;->unbox-impl()J
|
||||||
|
|
||||||
|
move-result-wide p0
|
||||||
|
|
||||||
|
:fallback
|
||||||
|
const/16 v0, 0x2ee # 750ms
|
||||||
|
|
||||||
|
const/4 v1, 0x0
|
||||||
|
|
||||||
|
const/4 v2, 0x0
|
||||||
|
|
||||||
|
const/4 v3, 0x6
|
||||||
|
|
||||||
|
const/4 v4, 0x0
|
||||||
|
|
||||||
|
invoke-static {v0, v1, v2, v3, v4}, Landroidx/compose/animation/core/AnimationSpecKt;->tween$default(IILandroidx/compose/animation/core/Easing;ILjava/lang/Object;)Landroidx/compose/animation/core/TweenSpec;
|
||||||
|
|
||||||
|
move-result-object v2
|
||||||
|
|
||||||
|
move-wide v0, p0
|
||||||
|
|
||||||
|
const-string v3, "miniPlayerBackgroundColorAnimation"
|
||||||
|
|
||||||
|
const/4 v4, 0x0
|
||||||
|
|
||||||
|
move-object v5, p2
|
||||||
|
|
||||||
|
const/16 v6, 0x1b0
|
||||||
|
|
||||||
|
const/16 v7, 0x8
|
||||||
|
|
||||||
|
invoke-static/range {v0 .. v7}, Landroidx/compose/animation/SingleValueAnimationKt;->animateColorAsState-euL9pac(JLandroidx/compose/animation/core/AnimationSpec;Ljava/lang/String;Lyl0/l;Landroidx/compose/runtime/Composer;II)Landroidx/compose/runtime/State;
|
||||||
|
|
||||||
|
move-result-object v0
|
||||||
|
|
||||||
|
invoke-interface {v0}, Landroidx/compose/runtime/State;->getValue()Ljava/lang/Object;
|
||||||
|
|
||||||
|
move-result-object v0
|
||||||
|
|
||||||
|
check-cast v0, Landroidx/compose/ui/graphics/Color;
|
||||||
|
|
||||||
|
invoke-virtual {v0}, Landroidx/compose/ui/graphics/Color;->unbox-impl()J
|
||||||
|
|
||||||
|
move-result-wide p0
|
||||||
|
|
||||||
|
invoke-interface {p2}, Landroidx/compose/runtime/Composer;->endReplaceGroup()V
|
||||||
|
|
||||||
|
return-wide p0
|
||||||
|
.end method
|
||||||
|
|
||||||
|
|
||||||
|
.method public static setHex(Ljava/lang/String;)V
|
||||||
|
.locals 3
|
||||||
|
|
||||||
|
const/4 v0, 0x0
|
||||||
|
|
||||||
|
if-eqz p0, :set_color
|
||||||
|
|
||||||
|
:try_start
|
||||||
|
invoke-static {p0}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I
|
||||||
|
|
||||||
|
move-result p0
|
||||||
|
|
||||||
|
invoke-static {p0}, Landroidx/compose/ui/graphics/ColorKt;->Color(I)J # pack ARGB color
|
||||||
|
|
||||||
|
move-result-wide v1
|
||||||
|
|
||||||
|
invoke-static {v1, v2}, Landroidx/compose/ui/graphics/Color;->box-impl(J)Landroidx/compose/ui/graphics/Color;
|
||||||
|
|
||||||
|
move-result-object v0
|
||||||
|
:try_end
|
||||||
|
.catch Ljava/lang/Throwable; {:try_start .. :try_end} :catch_parse
|
||||||
|
|
||||||
|
goto :set_color
|
||||||
|
|
||||||
|
:catch_parse
|
||||||
|
move-exception p0
|
||||||
|
|
||||||
|
:set_color
|
||||||
|
sget-object p0, Lradiant/MiniPlayerBackground;->colorState:Landroidx/compose/runtime/MutableState;
|
||||||
|
|
||||||
|
invoke-interface {p0, v0}, Landroidx/compose/runtime/MutableState;->setValue(Ljava/lang/Object;)V
|
||||||
|
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
--- a/com/tidal/android/feature/appscaffold/ui/composable/i.smali
|
||||||
|
+++ b/com/tidal/android/feature/appscaffold/ui/composable/i.smali
|
||||||
|
@@ -2819,4 +2819,10 @@
|
||||||
|
.line 147
|
||||||
|
+ const/4 v8, 0x0
|
||||||
|
+
|
||||||
|
+ invoke-static {v10, v11, v15, v8}, Lradiant/MiniPlayerBackground;->color(JLandroidx/compose/runtime/Composer;I)J # dynamic bg or fallback
|
||||||
|
+
|
||||||
|
+ move-result-wide v10
|
||||||
|
+
|
||||||
|
sget-object v8, Lcom/tidal/android/feature/appscaffold/ui/composable/a;->c:Landroidx/compose/foundation/shape/RoundedCornerShape;
|
||||||
|
|
||||||
|
.line 148
|
||||||
|
--- a/com/tidal/android/feature/playerscreen/ui/PlayerViewModel.smali
|
||||||
|
+++ b/com/tidal/android/feature/playerscreen/ui/PlayerViewModel.smali
|
||||||
|
@@ -1047,9 +1047,13 @@
|
||||||
|
invoke-static {v2, v1, v4, v3}, Lkotlinx/coroutines/flow/FlowKt;->stateIn(Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/SharingStarted;Ljava/lang/Object;)Lkotlinx/coroutines/flow/StateFlow;
|
||||||
|
|
||||||
|
move-result-object v1
|
||||||
|
|
||||||
|
iput-object v1, v0, Lcom/tidal/android/feature/playerscreen/ui/PlayerViewModel;->U:Lkotlinx/coroutines/flow/StateFlow;
|
||||||
|
|
||||||
|
+ iget-object v1, v0, Lcom/tidal/android/feature/playerscreen/ui/PlayerViewModel;->O:Lkotlin/h;
|
||||||
|
+
|
||||||
|
+ invoke-interface {v1}, Lkotlin/h;->getValue()Ljava/lang/Object; # init player bg color
|
||||||
|
+
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
@@ -1607,6 +1611,8 @@
|
||||||
|
:goto_6
|
||||||
|
invoke-interface {v9, v10}, Lkotlinx/coroutines/flow/MutableStateFlow;->setValue(Ljava/lang/Object;)V
|
||||||
|
|
||||||
|
+ invoke-static {v10}, Lradiant/MiniPlayerBackground;->setHex(Ljava/lang/String;)V # store player bg hex
|
||||||
|
+
|
||||||
|
.line 263
|
||||||
|
.line 264
|
||||||
|
.line 265
|
||||||
|
@@ -2306,6 +2312,8 @@
|
||||||
|
.line 598
|
||||||
|
invoke-interface {v1, v5}, Lkotlinx/coroutines/flow/MutableStateFlow;->setValue(Ljava/lang/Object;)V
|
||||||
|
|
||||||
|
+ invoke-static {v5}, Lradiant/MiniPlayerBackground;->setHex(Ljava/lang/String;)V # clear bg color
|
||||||
|
+
|
||||||
|
.line 599
|
||||||
|
.line 600
|
||||||
|
.line 601
|
||||||
|
@@ -2523,6 +2531,8 @@
|
||||||
|
.line 704
|
||||||
|
invoke-interface {v1, v5}, Lkotlinx/coroutines/flow/MutableStateFlow;->setValue(Ljava/lang/Object;)V
|
||||||
|
|
||||||
|
+ invoke-static {v5}, Lradiant/MiniPlayerBackground;->setHex(Ljava/lang/String;)V # clear bg color
|
||||||
|
+
|
||||||
|
.line 705
|
||||||
|
.line 706
|
||||||
|
.line 707
|
||||||
Reference in New Issue
Block a user