generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(YouTube): Add
Change form factor
patch (#4217)
- Loading branch information
1 parent
da4aeac
commit 644ac5b
Showing
18 changed files
with
365 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...s/youtube/src/main/java/app/revanced/extension/youtube/patches/ChangeFormFactorPatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package app.revanced.extension.youtube.patches; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
import app.revanced.extension.shared.Utils; | ||
import app.revanced.extension.youtube.settings.Settings; | ||
|
||
@SuppressWarnings("unused") | ||
public class ChangeFormFactorPatch { | ||
|
||
public enum FormFactor { | ||
/** | ||
* Unmodified, and same as un-patched. | ||
*/ | ||
DEFAULT(null), | ||
/** | ||
* <pre> | ||
* Some changes include: | ||
* - Explore tab is present. | ||
* - watch history is missing. | ||
* - feed thumbnails fade in. | ||
*/ | ||
UNKNOWN(0), | ||
SMALL(1), | ||
LARGE(2), | ||
/** | ||
* Cars with 'Google built-in'. | ||
* Layout seems identical to {@link #UNKNOWN} | ||
* even when using an Android Automotive device. | ||
*/ | ||
AUTOMOTIVE(3), | ||
WEARABLE(4); | ||
|
||
@Nullable | ||
final Integer formFactorType; | ||
|
||
FormFactor(@Nullable Integer formFactorType) { | ||
this.formFactorType = formFactorType; | ||
} | ||
} | ||
|
||
@Nullable | ||
private static final Integer FORM_FACTOR_TYPE = Settings.CHANGE_FORM_FACTOR.get().formFactorType; | ||
|
||
/** | ||
* Injection point. | ||
*/ | ||
public static int getFormFactor(int original) { | ||
return FORM_FACTOR_TYPE == null | ||
? original | ||
: FORM_FACTOR_TYPE; | ||
} | ||
|
||
} |
16 changes: 0 additions & 16 deletions
16
...sions/youtube/src/main/java/app/revanced/extension/youtube/patches/TabletLayoutPatch.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.