Skip to content

Commit

Permalink
feat(YouTube): Support versions 18.48.39, 18.49.37, 19.01.34 (#547
Browse files Browse the repository at this point in the history
)

Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
  • Loading branch information
oSumAtrIX and LisoUseInAIKyrios authored Jan 16, 2024
1 parent abdaa30 commit eaaa6fb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@ private static void addRollingNumberPatchChanges(TextView view) {
} 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.
Expand All @@ -364,6 +369,7 @@ private static void removeRollingNumberPatchChanges(TextView view) {
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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
*/
Expand Down

This file was deleted.

0 comments on commit eaaa6fb

Please sign in to comment.