mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 21:27:43 +02:00
feat(YouTube Music - Hide action bar components): Limit the available versions of the Override Download action button
setting to 7.16.53
This commit is contained in:
@ -7,10 +7,7 @@ import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import app.revanced.extension.music.settings.Settings;
|
||||
import app.revanced.extension.music.utils.VideoUtils;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class ActionBarPatch {
|
||||
@ -42,41 +39,6 @@ public class ActionBarPatch {
|
||||
);
|
||||
}
|
||||
|
||||
private static final String senderView = "com.google.android.libraries.youtube.rendering.elements.sender_view";
|
||||
|
||||
public static boolean inAppDownloadButtonOnClick(Map mMap) {
|
||||
if (!Settings.EXTERNAL_DOWNLOADER_ACTION_BUTTON.get()) {
|
||||
return false;
|
||||
}
|
||||
if (mMap == null || mMap.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if (!mMap.containsKey(senderView)) {
|
||||
return false;
|
||||
}
|
||||
if (!(getLithoViewFromMap(mMap, senderView, View.class) instanceof View view)) {
|
||||
return false;
|
||||
}
|
||||
VideoUtils.launchExternalDownloader();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rest of the implementation added by patch.
|
||||
*/
|
||||
private static Object getLithoViewFromMap(Map mMap, Object mObject, Class<?> mClass) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void inAppDownloadButtonOnClick(View view) {
|
||||
if (!Settings.EXTERNAL_DOWNLOADER_ACTION_BUTTON.get()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (buttonType.equals(ActionButton.DOWNLOAD.name))
|
||||
view.setOnClickListener(imageView -> VideoUtils.launchExternalDownloader());
|
||||
}
|
||||
|
||||
public static void setButtonType(@NonNull Object obj) {
|
||||
final String buttonType = obj.toString();
|
||||
|
||||
|
Reference in New Issue
Block a user