Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
chore: Merge branch dev to main (#650)
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX authored Jun 23, 2024
2 parents 4f11b1d + e018746 commit fac49c7
Show file tree
Hide file tree
Showing 25 changed files with 673 additions and 114 deletions.
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,73 @@
# [1.11.0-dev.7](https://github.com/ReVanced/revanced-integrations/compare/v1.11.0-dev.6...v1.11.0-dev.7) (2024-06-17)


### Bug Fixes

* **YouTube - Hide description components:** Replace `Hide game section` and `Hide music section` with `Hide attributes section` ([#654](https://github.com/ReVanced/revanced-integrations/issues/654)) ([f82dfce](https://github.com/ReVanced/revanced-integrations/commit/f82dfce887bbeccbfdb8e8f8d3d84db6ce28539a))

# [1.11.0-dev.6](https://github.com/ReVanced/revanced-integrations/compare/v1.11.0-dev.5...v1.11.0-dev.6) (2024-06-17)


### Features

* **YouTube - Comments:** Add `Hide 'Create a Short' button` option ([#656](https://github.com/ReVanced/revanced-integrations/issues/656)) ([064d8e9](https://github.com/ReVanced/revanced-integrations/commit/064d8e99a96167282f63725d33502f251632dcdb))

# [1.11.0-dev.5](https://github.com/ReVanced/revanced-integrations/compare/v1.11.0-dev.4...v1.11.0-dev.5) (2024-06-09)


### Features

* **YouTube - Comments:** Add `Hide Thanks button` and `Hide 'Comments by members' header` options ([#653](https://github.com/ReVanced/revanced-integrations/issues/653)) ([240e805](https://github.com/ReVanced/revanced-integrations/commit/240e805489e3603df026a7a3cf78b939461f5f9e))

# [1.11.0-dev.4](https://github.com/ReVanced/revanced-integrations/compare/v1.11.0-dev.3...v1.11.0-dev.4) (2024-06-09)


### Bug Fixes

* **YouTube - Client spoof:** Correctly play more livestreams using Android VR ([#652](https://github.com/ReVanced/revanced-integrations/issues/652)) ([58f8172](https://github.com/ReVanced/revanced-integrations/commit/58f8172b2d30fecd31d541f7470abf61b7e303c7))

# [1.11.0-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v1.11.0-dev.2...v1.11.0-dev.3) (2024-06-08)


### Features

* **Boost For Reddit:** Add `Fix /s/ links` patch ([#631](https://github.com/ReVanced/revanced-integrations/issues/631)) ([0c9ad35](https://github.com/ReVanced/revanced-integrations/commit/0c9ad35fc9024efe33c97b51714225c5d5226f59))

# [1.11.0-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.11.0-dev.1...v1.11.0-dev.2) (2024-06-08)


### Bug Fixes

* **YouTube:** Rename `Minimized playback` to `Remove background playback restrictions` ([#651](https://github.com/ReVanced/revanced-integrations/issues/651)) ([84c50c0](https://github.com/ReVanced/revanced-integrations/commit/84c50c080c2a8c096b7709164cbaec5466a8492c))

# [1.11.0-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.10.1-dev.3...v1.11.0-dev.1) (2024-06-07)


### Features

* **YouTube - Miniplayer:** Rename `Tablet mini player` and allow selecting the style of the in-app miniplayer ([#649](https://github.com/ReVanced/revanced-integrations/issues/649)) ([f483af6](https://github.com/ReVanced/revanced-integrations/commit/f483af6d3a2c1003cd566b4bf36fa4a257d1d6d3))

## [1.10.1-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v1.10.1-dev.2...v1.10.1-dev.3) (2024-06-07)


### Bug Fixes

* **YouTube - Spoof client:** Correctly play as background audio only with Android VR ([9adbc66](https://github.com/ReVanced/revanced-integrations/commit/9adbc66197e8342d3321dc77d151c648be65595b))

## [1.10.1-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.10.1-dev.1...v1.10.1-dev.2) (2024-06-06)


### Bug Fixes

* **YouTube - Return YouTube Dislike:** Do not replace view count with dislikes ([5f79196](https://github.com/ReVanced/revanced-integrations/commit/5f7919669250e95fc47c1a2705b352b53aa226f6))

## [1.10.1-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0...v1.10.1-dev.1) (2024-06-06)


### Bug Fixes

* **YouTube - Spoof client:** Correctly play some live streams when using Android VR ([f74fb17](https://github.com/ReVanced/revanced-integrations/commit/f74fb17a127b1ed8094db23a04e228d8abd05440))

# [1.10.0](https://github.com/ReVanced/revanced-integrations/compare/v1.9.2...v1.10.0) (2024-06-02)


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package app.revanced.integrations.boostforreddit;

import com.rubenmayayo.reddit.ui.activities.WebViewActivity;

import app.revanced.integrations.shared.fixes.slink.BaseFixSLinksPatch;

/** @noinspection unused*/
public class FixSLinksPatch extends BaseFixSLinksPatch {
static {
INSTANCE = new FixSLinksPatch();
}

private FixSLinksPatch() {
webViewActivityClass = WebViewActivity.class;
}

public static boolean patchResolveSLink(String link) {
return INSTANCE.resolveSLink(link);
}

public static void patchSetAccessToken(String accessToken) {
INSTANCE.setAccessToken(accessToken);
}
}
54 changes: 46 additions & 8 deletions app/src/main/java/app/revanced/integrations/shared/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,32 @@ public static String getAppVersionName() {
return versionName;
}


/**
* Hide a view by setting its layout height and width to 1dp.
*
* @param condition The setting to check for hiding the view.
* @param view The view to hide.
*/
public static void hideViewBy0dpUnderCondition(BooleanSetting condition, View view) {
if (!condition.get()) return;
if (hideViewBy0dpUnderCondition(condition.get(), view)) {
Logger.printDebug(() -> "View hidden by setting: " + condition);
}
}

Logger.printDebug(() -> "Hiding view with setting: " + condition);
/**
* Hide a view by setting its layout height and width to 1dp.
*
* @param condition The setting to check for hiding the view.
* @param view The view to hide.
*/
public static boolean hideViewBy0dpUnderCondition(boolean condition, View view) {
if (condition) {
hideViewByLayoutParams(view);
return true;
}

hideViewByLayoutParams(view);
return false;
}

/**
Expand All @@ -110,20 +124,42 @@ public static void hideViewBy0dpUnderCondition(BooleanSetting condition, View vi
* @param view The view to hide.
*/
public static void hideViewUnderCondition(BooleanSetting condition, View view) {
if (!condition.get()) return;
if (hideViewUnderCondition(condition.get(), view)) {
Logger.printDebug(() -> "View hidden by setting: " + condition);
}
}

Logger.printDebug(() -> "Hiding view with setting: " + condition);
/**
* Hide a view by setting its visibility to GONE.
*
* @param condition The setting to check for hiding the view.
* @param view The view to hide.
*/
public static boolean hideViewUnderCondition(boolean condition, View view) {
if (condition) {
view.setVisibility(View.GONE);
return true;
}

return false;
}

view.setVisibility(View.GONE);
public static void hideViewByRemovingFromParentUnderCondition(BooleanSetting condition, View view) {
if (hideViewByRemovingFromParentUnderCondition(condition.get(), view)) {
Logger.printDebug(() -> "View hidden by setting: " + condition);
}
}

public static void removeViewFromParentUnderConditions(BooleanSetting setting, View view) {
if (setting.get()) {
public static boolean hideViewByRemovingFromParentUnderCondition(boolean setting, View view) {
if (setting) {
ViewParent parent = view.getParent();
if (parent instanceof ViewGroup) {
((ViewGroup) parent).removeView(view);
return true;
}
}

return false;
}

/**
Expand Down Expand Up @@ -236,6 +272,8 @@ public static <T extends View> T getChildView(@NonNull ViewGroup viewGroup, bool
@NonNull MatchFilter<View> filter) {
for (int i = 0, childCount = viewGroup.getChildCount(); i < childCount; i++) {
View childAt = viewGroup.getChildAt(i);
Logger.printDebug(() -> "View id: " + childAt.getId() + " tag: " + childAt.getTag());

if (filter.matches(childAt)) {
//noinspection unchecked
return (T) childAt;
Expand Down
Loading

0 comments on commit fac49c7

Please sign in to comment.