new cache btn
This commit is contained in:
@@ -38,17 +38,38 @@ public class MusicBottomSheetHook {
|
||||
}
|
||||
}
|
||||
|
||||
if (isCached(trackid)){
|
||||
actions.add(getRemoveCacheTrackAction());
|
||||
} else {
|
||||
actions.add(addToCacheTrackAction());
|
||||
}
|
||||
|
||||
actions.add(downloadAsMp3Action());
|
||||
|
||||
return actions;
|
||||
}
|
||||
|
||||
|
||||
public static ArrayList<MusicAction> hookDownloadBTN(ArrayList<MusicAction> actions, MusicTrack musicTrack) {
|
||||
var trackid = asId(musicTrack);
|
||||
|
||||
if (isCached(trackid)){
|
||||
actions.add(new MusicAction(
|
||||
AndroidUtils.getIdentifier("music_action_toggle_download", "id"),
|
||||
milkshake() ? R.drawable.ic_delete_outline_28 : R.drawable.ic_delete_24,
|
||||
AndroidUtils.getIdentifier("remove_from_cache", "string"),
|
||||
musicTrack.F1() ? R.color.music_action_button_gray_50_alpha : R.color.caption_gray,
|
||||
R.string.music_talkback_empty,
|
||||
false
|
||||
));
|
||||
} else {
|
||||
actions.add(new MusicAction(
|
||||
AndroidUtils.getIdentifier("music_action_toggle_download", "id"),
|
||||
milkshake() ? R.drawable.ic_download_outline_28 : R.drawable.ic_download_24,
|
||||
AndroidUtils.getIdentifier("add_to_cache", "string"),
|
||||
musicTrack.F1() ? R.color.music_action_button_gray_50_alpha : R.color.caption_gray,
|
||||
R.string.music_talkback_empty,
|
||||
false
|
||||
));
|
||||
}
|
||||
|
||||
return actions;
|
||||
}
|
||||
|
||||
public static ArrayList<MusicAction> hook(ArrayList<MusicAction> actions, Playlist playlist) {
|
||||
if (isVkxInstalled())
|
||||
actions.add(getPlayInVKXAction());
|
||||
@@ -88,16 +109,6 @@ public class MusicBottomSheetHook {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (actionId == AndroidUtils.getIdentifier("remove_from_cache", "id")) {
|
||||
removeTrackFromCache(track.D);
|
||||
AndroidUtils.sendToast("remove_from_cache");
|
||||
return true;
|
||||
} else if (actionId == AndroidUtils.getIdentifier("add_to_cache", "id")) {
|
||||
// TODO make music caching
|
||||
AndroidUtils.sendToast("add_to_cache");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (actionId == AndroidUtils.getIdentifier("download_mp3", "id")) {
|
||||
MP3Downloader.downloadMP3(track);
|
||||
AndroidUtils.sendToast("download_mp3");
|
||||
|
||||
+33
-25
@@ -62,52 +62,60 @@
|
||||
|
||||
if-nez v2, :cond_4
|
||||
|
||||
.line 4
|
||||
new-instance v2, Lcom/vk/music/bottomsheets/a/MusicAction;
|
||||
# .line 4
|
||||
# new-instance v2, Lcom/vk/music/bottomsheets/a/MusicAction;
|
||||
|
||||
const v4, 0x7f0a087c
|
||||
# const v4, 0x7f0a087c
|
||||
|
||||
const v3, 0x7f08043c
|
||||
# const v3, 0x7f08043c
|
||||
|
||||
const v5, 0x7f08043a
|
||||
# const v5, 0x7f08043a
|
||||
|
||||
invoke-virtual {v0, v3, v5}, Lcom/vk/music/bottomsheets/track/d/VkMusicTrackBottomSheetActionsFactory;->a(II)I
|
||||
# invoke-virtual {v0, v3, v5}, Lcom/vk/music/bottomsheets/track/d/VkMusicTrackBottomSheetActionsFactory;->a(II)I
|
||||
|
||||
move-result v5
|
||||
# move-result v5
|
||||
|
||||
const/4 v6, 0x0
|
||||
# const/4 v6, 0x0
|
||||
|
||||
invoke-virtual/range {p1 .. p1}, Lcom/vk/dto/music/MusicTrack;->F1()Z
|
||||
# invoke-virtual/range {p1 .. p1}, Lcom/vk/dto/music/MusicTrack;->F1()Z
|
||||
|
||||
move-result v3
|
||||
# move-result v3
|
||||
|
||||
const v12, 0x7f060156
|
||||
# const v12, 0x7f060156
|
||||
|
||||
const v13, 0x7f060077
|
||||
# const v13, 0x7f060077
|
||||
|
||||
if-eqz v3, :cond_0
|
||||
# if-eqz v3, :cond_0
|
||||
|
||||
const v7, 0x7f060156
|
||||
# const v7, 0x7f060156
|
||||
|
||||
goto :goto_0
|
||||
# goto :goto_0
|
||||
|
||||
:cond_0
|
||||
const v7, 0x7f060077
|
||||
# :cond_0
|
||||
# const v7, 0x7f060077
|
||||
|
||||
:goto_0
|
||||
const v8, 0x7f12087d
|
||||
# :goto_0
|
||||
# const v8, 0x7f12087d
|
||||
|
||||
const/4 v9, 0x0
|
||||
# const/4 v9, 0x0
|
||||
|
||||
const/16 v10, 0x20
|
||||
# const/16 v10, 0x20
|
||||
|
||||
const/4 v11, 0x0
|
||||
# const/4 v11, 0x0
|
||||
|
||||
move-object v3, v2
|
||||
# move-object v3, v2
|
||||
|
||||
invoke-direct/range {v3 .. v11}, Lcom/vk/music/bottomsheets/a/MusicAction;-><init>(IIIIIZILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
# invoke-direct/range {v3 .. v11}, Lcom/vk/music/bottomsheets/a/MusicAction;-><init>(IIIIIZILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
|
||||
invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
||||
# invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
||||
|
||||
move-object/from16 v10, p1
|
||||
|
||||
invoke-static {v1, v10}, Lru/vtosters/lite/hooks/ui/MusicBottomSheetHook;->hookDownloadBTN(Ljava/util/ArrayList;Lcom/vk/dto/music/MusicTrack;)Ljava/util/ArrayList;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
move-object/from16 p1, v10
|
||||
|
||||
.line 5
|
||||
sget-object v2, Lcom/vk/music/common/Music$a;->j:Lcom/vk/music/common/Music$a;
|
||||
|
||||
Reference in New Issue
Block a user