feat(YouTube): Support versions 18.48.39, 18.49.37, 19.01.34 (#547)

Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
This commit is contained in:
oSumAtrIX 2024-01-16 21:58:07 +01:00 committed by GitHub
parent abdaa30719
commit eaaa6fbd20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 11 deletions

View File

@ -1,8 +1,10 @@
package app.revanced.integrations.youtube.patches;
import com.google.android.apps.youtube.app.watchwhile.WatchWhileActivity;
import android.app.Activity;
import app.revanced.integrations.shared.Logger;
@SuppressWarnings("unused")
public class FixBackToExitGesturePatch {
/**
* State whether the scroll position reaches the top.
@ -14,7 +16,7 @@ public class FixBackToExitGesturePatch {
*
* @param activity The activity, the app is launched with to finish.
*/
public static void onBackPressed(WatchWhileActivity activity) {
public static void onBackPressed(Activity activity) {
if (!isTopView) return;
Logger.printDebug(() -> "Activity is closed");

View File

@ -348,6 +348,11 @@ public class ReturnYouTubeDislikePatch {
} else {
view.setCompoundDrawables(separator, null, null, null);
}
// Liking/disliking can cause the span to grow in size,
// which is ok and is laid out correctly,
// but if the user then undoes their action the layout will not remove the extra padding.
// Use a center alignment to take up any extra space.
view.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
// Single line mode does not clip words if the span is larger than the view bounds.
// The styled span applied to the view should always have the same bounds,
// but use this feature just in case the measurements are somehow off by a few pixels.
@ -364,6 +369,7 @@ public class ReturnYouTubeDislikePatch {
Logger.printDebug(() -> "Removing rolling number TextView changes");
view.setCompoundDrawablePadding(0);
view.setCompoundDrawables(null, null, null, null);
view.setTextAlignment(View.TEXT_ALIGNMENT_GRAVITY); // Default alignment
view.setSingleLine(false);
}
}

View File

@ -5,7 +5,7 @@ import app.revanced.integrations.youtube.Event
import app.revanced.integrations.shared.Logger
/**
* WatchWhile player type.
* Main player type.
*/
enum class PlayerType {
/**

View File

@ -22,7 +22,7 @@ import java.lang.ref.WeakReference
/**
* The main controller for volume and brightness swipe controls.
* note that the superclass is overwritten to the superclass of the WatchWhileActivity at patch time
* note that the superclass is overwritten to the superclass of the MainActivity at patch time
*
* @smali Lapp/revanced/integrations/swipecontrols/SwipeControlsHostActivity;
*/

View File

@ -1,7 +0,0 @@
package com.google.android.apps.youtube.app.watchwhile;
import android.app.Activity;
// Dummy class
public final class WatchWhileActivity extends Activity { }