mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-06-02 19:36:30 +02:00
47 lines
1.3 KiB
Java
47 lines
1.3 KiB
Java
package app.revanced.integrations.youtube.videoplayer;
|
|
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
import app.revanced.integrations.youtube.patches.CopyVideoUrlPatch;
|
|
import app.revanced.integrations.youtube.settings.Settings;
|
|
import app.revanced.integrations.shared.Logger;
|
|
|
|
/** @noinspection unused*/
|
|
public class CopyVideoUrlButton extends BottomControlButton {
|
|
@Nullable
|
|
private static CopyVideoUrlButton instance;
|
|
|
|
public CopyVideoUrlButton(ViewGroup viewGroup) {
|
|
super(
|
|
viewGroup,
|
|
"revanced_copy_video_url_button",
|
|
Settings.COPY_VIDEO_URL,
|
|
view -> CopyVideoUrlPatch.copyUrl(false),
|
|
view -> {
|
|
CopyVideoUrlPatch.copyUrl(true);
|
|
return true;
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Injection point.
|
|
*/
|
|
public static void initializeButton(View view) {
|
|
try {
|
|
instance = new CopyVideoUrlButton((ViewGroup) view);
|
|
} catch (Exception ex) {
|
|
Logger.printException(() -> "initializeButton failure", ex);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Injection point.
|
|
*/
|
|
public static void changeVisibility(boolean showing) {
|
|
if (instance != null) instance.setVisibility(showing);
|
|
}
|
|
} |