Skip to content

feat(YouTube - Swipe controls): Add option for vertical progress bar #4811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Apr 23, 2025

Conversation

MarcaDian
Copy link
Contributor

@MarcaDian MarcaDian commented Apr 16, 2025

Screenshot_2025-04-16-18-43-33-172_app revancede android youtube

This pull request introduces a new vertical swipe overlay style for the Swipe controls, along with several enhancements to improve user experience and customization.
Also closes #4669 and #4571

Changes

  1. New Vertical Swipe Overlay Style:

    • Added a new vertical overlay style (VERTICAL and VERTICAL_MINIMAL).
    • During brightness gestures, the overlay appears on the right side of the screen; for volume gestures, it appears on the left side, ensuring visibility.
    • Implemented an indent from the screen edge to prevent interference with camera cutouts.
  2. Screen Size Adaptation:

    • Adapted all overlay variables (e.g., sizes, positions, margins) to scale dynamically based on the user's screen size.
    • Improves compatibility across devices with varying resolutions and aspect ratios.
  3. Overlay Style Selection in Settings:

    • Added a list option in the settings UI to allow users to select their preferred swipe overlay style (e.g., HORIZONTAL, CIRCULAR, VERTICAL, or their minimal variants).
  4. Progress Bar Color Customization:

    • Introduced a new setting to allow users to change the progress bar color in the overlay.
  5. Overlay Text Adjustment:

    • Restored the ability to adjust the overlay text size, with a range of 1 to 30 dp (default: 14 dp).
    • Restored localization for the word "Auto" in the brightness overlay (displayed as "А" in vertical overlay style).
    • Overlay adapts dynamically to content, improving readability and consistency.

Screenshot_2025-04-16-18-58-25-423_app revancede android youtube

This was linked to issues Apr 16, 2025
Copilot

This comment was marked as resolved.

@LisoUseInAIKyrios LisoUseInAIKyrios changed the title feat(YouTube - Swipe controls): Adding a vertical progress bar feat(YouTube - Swipe controls): Add option for vertical progress bar Apr 17, 2025
@MarcaDian
Copy link
Contributor Author

MarcaDian commented Apr 18, 2025

I noticed here that in fullscreen portrait mode the horizontal progress bar is slightly covered by the front camera.
Maybe need to lower the layout a bit, or maybe it can only be lowered in this mode. Or leave it as is?

@LisoUseInAIKyrios
Copy link
Contributor

I think that only affects thru hole punch cameras.

You could adjust the location based on WindowInsets.getDisplayCutout() if the display cutout bounds overlap the swipe UI overlay.

See https://developer.android.com/develop/ui/views/layout/display-cutout

@MarcaDian

This comment was marked as outdated.

@MarcaDian

This comment was marked as outdated.

@MarcaDian
Copy link
Contributor Author

for some reason, in fullscreen mode only safeInsetTop is used for all orientations
safeInsetLeft and safeInsetRight not used

and when I add a margin for the camera cutout, everything is fine in fullscreen portrait mode, but in landscape fullscreen mode, these margins are also preserved, which should not be the case.

It's bad that there's no variable for fullscreen portrait mode, that would solve the problem quickly, but now need to think how solve this problem.

@LisoUseInAIKyrios
Copy link
Contributor

What about the window display frame?

    Window window = getActivity().getWindow();
    window.getDecorView().getWindowVisibleDisplayFrame(rectangle);
    int statusBarHeight = rectangle.top;

@MarcaDian
Copy link
Contributor Author

MarcaDian commented Apr 18, 2025

Not sure if this will work, as the status bar is hidden in fullscreen mode.
Can try it and see what happens.

Or do you mean to determine which side the status bar is on and add a inset?

@LisoUseInAIKyrios
Copy link
Contributor

LisoUseInAIKyrios commented Apr 18, 2025

I meant to check if just the status bar is visible using the window frame

I don't think the left/right insets are needed to adjust for the camera hole. When in landscape fullscreen the 'top' inset will be the correct side (and not the unrotated top/bottom side of the screen).

@MarcaDian
Copy link
Contributor Author

MarcaDian commented Apr 18, 2025

I think can leave a 20f topMargin as a solution of the problem.
I just checked, the 2x speed overlay is also almost completely covered by the camera cutout in fullscreen portrait.

@LisoUseInAIKyrios
Copy link
Contributor

Anything todo before merging?

@MarcaDian
Copy link
Contributor Author

MarcaDian commented Apr 22, 2025

Everything seems fine, ready to merge.

@LisoUseInAIKyrios LisoUseInAIKyrios merged commit ebee07e into ReVanced:dev Apr 23, 2025
1 check passed
github-actions bot pushed a commit that referenced this pull request Apr 23, 2025
# [5.21.0-dev.10](v5.21.0-dev.9...v5.21.0-dev.10) (2025-04-23)

### Features

* **YouTube - Swipe controls:** Add option for vertical progress bar ([#4811](#4811)) ([ebee07e](ebee07e))
@MarcaDian MarcaDian deleted the swipe_refactor branch April 23, 2025 12:28
@VitinhoVK

This comment was marked as spam.

@MarcaDian
Copy link
Contributor Author

I don't understand what you're talking about, the swipe behavior hasn't changed.

@VitinhoVK

This comment was marked as spam.

@VitinhoVK

This comment was marked as spam.

@MarcaDian
Copy link
Contributor Author

MarcaDian commented Apr 23, 2025

I understand that you misread.

The swipe behavior has not changed, brightness on the left, volume on the right.

The changes you are confusing only apply to the vertical swipe style. This is done for convenience, because when swiping from the left, the swipe overlay will be hidden under your finger, so I decided to show it opposite, on the right.

Also, icons and values ​​should now display correctly according to screen density without increasing padding.

If everything is correct, you should see something like the screenshot above.

@VitinhoVK

This comment was marked as spam.

github-actions bot pushed a commit that referenced this pull request Apr 25, 2025
# [5.21.0](v5.20.1...v5.21.0) (2025-04-25)

### Bug Fixes

* `Hide ADB status` patch ([#4814](#4814)) ([dc89be0](dc89be0))
* **GmsCore Support:** Correct the description to refer to the app being patched ([2bbcf9d](2bbcf9d))
* **Wide search bar:** Fix patching `19.16.39` ([433dbc3](433dbc3))
* **YouTube - Change start page:** Add option to always override start page on app launch ([#4832](#4832)) ([5062e24](5062e24))
* **YouTube - Disable auto captions:** Correctly hide captions with YT 20.12 ([5ecbe82](5ecbe82))
* **YouTube - Hide video action buttons:** Add option to hide 'Ask' button ([#4852](#4852)) ([43bcf5a](43bcf5a))
* **YouTube - Hide video action buttons:** Hide A/B layout buttons ([4db5d3c](4db5d3c))
* **YouTube - Wide search bar:** Do not force phone layout for tablet devices ([#4827](#4827)) ([0cb38f9](0cb38f9))

### Features

* Add `Hide ADB status` patch ([#4585](#4585)) ([1ea8047](1ea8047))
* **X / Twitter:** Support version `10.86.0-release.0` ([#4805](#4805)) ([655b390](655b390))
* **YouTube - Swipe controls:** Add option for vertical progress bar ([#4811](#4811)) ([ebee07e](ebee07e))
* **YouTube:** Support version `20.12.46` ([#4779](#4779)) ([703359f](703359f))
@VitinhoVK

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: new swipe controls ui feat: slider size function
3 participants