Skip to content
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

feat(YouTube - Shorts components): Add styles to custom actions dialog #107

Merged

Conversation

Francesco146
Copy link

@Francesco146 Francesco146 commented Dec 15, 2024

i didn't find any solution for the dialog menu not dismissed, but i think it's an issue not related to the PR, and it's reproducible on upstream

edit: another bug is that the Open Video action doesn't check for the "Enable open link directly" setting

Preview
light theme dark theme

@YT-Advanced
Copy link

Uhm the dialog seem not follow app theme

@0xrxL
Copy link

0xrxL commented Dec 16, 2024

Hey @Francesco146.

Your "Open Video" button was a great idea: through it I was able to automatically bypass the shorts player. Now shorts (even if opened from the navigation button) are always played in the video player, and moreover the next track button works as swipe action (so it's still possible to watch next shorts).

Unfortunately I spent much time to disable the ClickListener for shorts thumbnails (THAT FUC**** LITHO!), but at the end I reached the goal. :-D

@0xrxL
Copy link

0xrxL commented Dec 16, 2024

Note: uDrop is the key. 😉

Screen_Recording_20241216_072056.mp4

@Francesco146
Copy link
Author

that's great news @0xrxL, open a pr!

@Francesco146
Copy link
Author

Francesco146 commented Dec 16, 2024

Uhm the dialog seem not follow app theme

icons too big? it would be helpful to also know why you think that :_)

edit: if you mean the background color, then no. I tested it for both light and dark theme

@0xrxL
Copy link

0xrxL commented Dec 16, 2024

that's great news @0xrxL, open a pr!

I'm allergic to kotlin. I'll ask to @inotia00 if he is interested to port this to RvX. 👍

@0xrxL
Copy link

0xrxL commented Dec 16, 2024

@0xrxL can you send a preview on how it is handled in the Shorts navigation button?

I have it disabled at the moment on the current build, but it's handled in this way:

  • Click on the button.
  • Button lights up.
  • The first short is opened as a normal video
  • Eventually other shorts can be reached through "skip to next" button.

There's just one annyoing bug: Upper-Left back button appears after click on shorts navigation bug. I need to find a way to hide it.

Screenshot_20241216_083332

@0xrxL
Copy link

0xrxL commented Dec 16, 2024

@Francesco146 this is the patch, if you want to give it a look: https://github.com/0xrxL/uDrop/blob/28de4031b9ba0cc9bc35b0b9c87d1f8c80b9f638/Code/Patches.cs#L5761

@Francesco146 Francesco146 marked this pull request as draft December 16, 2024 08:14
@Francesco146
Copy link
Author

i marked this as draft because i want to mimic the fly out menu more.

@0xrxL
Copy link

0xrxL commented Dec 16, 2024

@Francesco146 To finalize my patch, I'll probably adopt a hybrid solution: shorts player accessible from navigation bar, and video player for shorts on home feed and search list.

I already have a value map of navigation buttons, so I can exactly know which I clicked.

After this, I'll post here the integration code I used and the smali file to patch. Will be more easy for everyone involved in an eventual port to RvX.

@Francesco146
Copy link
Author

after this patch, I'll consider this if inotia won't beat be on time xD

@YT-Advanced
Copy link

YT-Advanced commented Dec 17, 2024

@0xrxL Uhm can u share how u hook it. I'm interested in porting it into rvx xD

As I read in your source code, u seem hook PlaybackStartDescriptor.toString()

@0xrxL
Copy link

0xrxL commented Dec 17, 2024

@0xrxL Uhm can u share how u hook it. I'm interested in porting it into rvx xD

As I read in your source code, u seem hook PlaybackStartDescriptor.toString()

Yeah...but from a specific method, which contains the following strings:

  • "com.google.android.apps.youtube.PlaybackStartDescriptor"
  • "com.google.android.apps.youtube.ReelWatchActivityIntentCreator.CSI_START_BASELINE_KEY"
  • "com.google.android.apps.youtube.ReelWatchActivityIntentCreator.LOAD_TYPE_KEY"
  • "com.google.android.apps.youtube.ReelWatchActivityIntentCreator.IS_REFERRED_FROM_DISCOVER_KEY"

On version 19.50.36 (for example) is idx.smali.

This method create the entire shorts player layout, so if you put a return-void here you'll disable every shorts preview button.

@YT-Advanced
Copy link

Can u take a screenshot of the code after hooking. I still don't seem to understand your idea very well.

@0xrxL
Copy link

0xrxL commented Dec 17, 2024

Can u take a screenshot of the code after hooking. I still don't seem to understand your idea very well.

If you already found the method, just put the following code at the method start:

move-object/from16 v0, p1

invoke-virtual {v0}, Lcom/google/android/libraries/youtube/player/model/PlaybackStartDescriptor;->r()Ljava/lang/String;

move-result-object v0 // Shorts video ID

invoke-static {v0}, LuTools/uBlocker;->ShortsPlayerBypassing(Ljava/lang/String;)V

return-void

@Francesco146
Copy link
Author

This method create the entire shorts player layout, so if you put a return-void here you'll disable every shorts preview button.

what about the automatic "Playback in Feed", the player reacts well?

@0xrxL
Copy link

0xrxL commented Dec 17, 2024

This method create the entire shorts player layout, so if you put a return-void here you'll disable every shorts preview button.

what about the automatic "Playback in Feed", the player reacts well?

It should. I blocked the shorts layout onCreate(), used by Litho. In any case you can do further tests before create a PR. 👍

@Francesco146 Francesco146 marked this pull request as ready for review December 17, 2024 20:54
@inotia00
Copy link
Owner

It looks like it's okay to merge now
Is there anything else I should check?

@Francesco146
Copy link
Author

Francesco146 commented Dec 19, 2024

todos:

  • tune the settings dependencies if needed
  • add a conditional that, at least one custom action needs to be enabled in order to create the alert menu (because rn you can enable only the alert menu with no custom actions and the alert is just an empty box)

@Francesco146
Copy link
Author

Francesco146 commented Dec 19, 2024

It looks like it's okay to merge now Is there anything else I should check?

related to this PR i think it's ok :)

…ust be enabled to appear in the toolbar or flyout menu)
@inotia00 inotia00 changed the title feat(YouTube - Shorts components): add styles to the menu feat(YouTube - Shorts components): Add styles to custom actions dialog Dec 19, 2024
@inotia00
Copy link
Owner

Thanks

@inotia00 inotia00 merged commit 7653041 into inotia00:dev Dec 19, 2024
@Francesco146 Francesco146 deleted the style-custom-action-more-button-menu branch December 19, 2024 05:55
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.

4 participants