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

Adjust the playlist bookmark item layout for RTL languages #11024

Merged
merged 4 commits into from
Nov 14, 2024

Conversation

AbdeltwabMF
Copy link
Contributor

@AbdeltwabMF AbdeltwabMF commented Apr 30, 2024

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

The playlists' bookmark items do not align correctly and have a layout overlap issue when the channel name is in a right-to-left (RTL) language, such as Arabic. Therefore, this change focuses on adding a right boundary to the uploader element, similar to the playlist title, to resolve this issue.

Also, make small adjustments to some items to align them with the uploader element.
Screenshot 2024-05-01 021233

Before/After Screenshots/Screen Record

Before After
Before After

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

@github-actions github-actions bot added the size/medium PRs with less than 250 changed lines label Apr 30, 2024
@TobiGr TobiGr added the GUI Issue is related to the graphical user interface label May 1, 2024
@github-actions github-actions bot added size/small PRs with less than 50 changed lines and removed size/medium PRs with less than 250 changed lines labels May 1, 2024
@AbdeltwabMF
Copy link
Contributor Author

@TobiGr, for some reason, Android Studio cannot symbolically link this file during the local build

However, it magically works when I try to copy the content it points to. I'm unsure why it works here with this symlink and doesn't work on my local build!

@TobiGr
Copy link
Member

TobiGr commented May 8, 2024

Are you using Windows?

@AbdeltwabMF
Copy link
Contributor Author

Are you using Windows?

Yes. Windows 11 Pro 23H2

Copy link
Contributor

@snaik20 snaik20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes, looking good!

I'm curious about the adjustment to the height. Is there a specific reason it needs to be changed? Could you elaborate on why 51dp was chosen?

If you want to position an element relative to another element, you could consider using constraints like layout_alignParentTop, layout_below similar attributes in RelativeLayout.

Additionally, to help visualize the impact of the changes, would it be possible to share some before/after screenshots with layout bounds enabled or using a layout inspector tool? Seeing the layouts with large font size configurations would also be helpful for review.

@AbdeltwabMF
Copy link
Contributor Author

@snaik20, thank you. I am glad to contribute.

Regarding the adjustment to the height, I scaled down the ImageView to match the width of the title and uploader text, as illustrated in the screenshots below, hence the "51dp".

As you suggested, instead of directly setting the static height, I used the layout_alignTop and layout_alignBottom constraints.

Before

image

After

image

After last fix (using layout_alignTop/Bottom)

image

@AbdeltwabMF AbdeltwabMF requested a review from snaik20 May 18, 2024 13:59
Copy link

sonarcloud bot commented May 18, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@Stypox Stypox merged commit 6fe417a into TeamNewPipe:dev Nov 14, 2024
6 checks passed
@Paragraph1148
Copy link

Tested on nightly build apk after the merge of this request gave this exception:-

Exception

  • User Action: ui error
  • Request: ACRA report
  • Content Country: US
  • Content Language: en-US
  • App Language: en_US
  • Service: none
  • Version: 0.27.2-1008-202411150111
  • OS: Linux Android 14 - 34
Crash log

android.view.InflateException: Binary XML file line #24 in org.schabi.newpipe.nightly:layout/list_playlist_bookmark_item: Binary XML file line #24: You must supply a layout_height attribute., theme={InheritanceMap=[id=0x7f130177org.schabi.newpipe.nightly:style/LightTheme.YouTube, id=0x7f130173org.schabi.newpipe.nightly:style/LightTheme, id=0x7f130016org.schabi.newpipe.nightly:style/Base.LightTheme, id=0x7f1300cdorg.schabi.newpipe.nightly:style/Base.V29.LightTheme, id=0x7f1300c7org.schabi.newpipe.nightly:style/Base.V27.LightTheme, id=0x7f1300aborg.schabi.newpipe.nightly:style/Base.V21.LightTheme, id=0x7f13000borg.schabi.newpipe.nightly:style/Base, id=0x7f1300caorg.schabi.newpipe.nightly:style/Base.V29, id=0x7f1300c4org.schabi.newpipe.nightly:style/Base.V27, id=0x7f1300a8org.schabi.newpipe.nightly:style/Base.V21, id=0x7f130297org.schabi.newpipe.nightly:style/Theme.AppCompat.DayNight.NoActionBar, id=0x7f1302a3org.schabi.newpipe.nightly:style/Theme.AppCompat.Light.NoActionBar, id=0x7f13029dorg.schabi.newpipe.nightly:style/Theme.AppCompat.Light, id=0x7f130059org.schabi.newpipe.nightly:style/Base.Theme.AppCompat.Light, id=0x7f1300c9org.schabi.newpipe.nightly:style/Base.V28.Theme.AppCompat.Light, id=0x7f1300c2org.schabi.newpipe.nightly:style/Base.V26.Theme.AppCompat.Light, id=0x7f1300bcorg.schabi.newpipe.nightly:style/Base.V23.Theme.AppCompat.Light, id=0x7f1300baorg.schabi.newpipe.nightly:style/Base.V22.Theme.AppCompat.Light, id=0x7f1300aforg.schabi.newpipe.nightly:style/Base.V21.Theme.AppCompat.Light, id=0x7f1300d0org.schabi.newpipe.nightly:style/Base.V7.Theme.AppCompat.Light, id=0x7f130191org.schabi.newpipe.nightly:style/Platform.AppCompat.Light, id=0x7f13019corg.schabi.newpipe.nightly:style/Platform.V25.AppCompat.Light, id=0x1030241android:style/Theme.Material.Light.NoActionBar, id=0x1030237android:style/Theme.Material.Light, id=0x103000candroid:style/Theme.Light, id=0x1030005android:style/Theme], Themes=[org.schabi.newpipe.nightly:style/LightTheme.YouTube, forced, org.schabi.newpipe.nightly:style/OpeningTheme, forced, org.schabi.newpipe.nightly:style/Theme.AppCompat.Empty, forced, android:style/Theme.DeviceDefault.Light.DarkActionBar, forced]}
Caused by: java.lang.UnsupportedOperationException: Binary XML file line #24: You must supply a layout_height attribute., theme={InheritanceMap=[id=0x7f130177org.schabi.newpipe.nightly:style/LightTheme.YouTube, id=0x7f130173org.schabi.newpipe.nightly:style/LightTheme, id=0x7f130016org.schabi.newpipe.nightly:style/Base.LightTheme, id=0x7f1300cdorg.schabi.newpipe.nightly:style/Base.V29.LightTheme, id=0x7f1300c7org.schabi.newpipe.nightly:style/Base.V27.LightTheme, id=0x7f1300aborg.schabi.newpipe.nightly:style/Base.V21.LightTheme, id=0x7f13000borg.schabi.newpipe.nightly:style/Base, id=0x7f1300caorg.schabi.newpipe.nightly:style/Base.V29, id=0x7f1300c4org.schabi.newpipe.nightly:style/Base.V27, id=0x7f1300a8org.schabi.newpipe.nightly:style/Base.V21, id=0x7f130297org.schabi.newpipe.nightly:style/Theme.AppCompat.DayNight.NoActionBar, id=0x7f1302a3org.schabi.newpipe.nightly:style/Theme.AppCompat.Light.NoActionBar, id=0x7f13029dorg.schabi.newpipe.nightly:style/Theme.AppCompat.Light, id=0x7f130059org.schabi.newpipe.nightly:style/Base.Theme.AppCompat.Light, id=0x7f1300c9org.schabi.newpipe.nightly:style/Base.V28.Theme.AppCompat.Light, id=0x7f1300c2org.schabi.newpipe.nightly:style/Base.V26.Theme.AppCompat.Light, id=0x7f1300bcorg.schabi.newpipe.nightly:style/Base.V23.Theme.AppCompat.Light, id=0x7f1300baorg.schabi.newpipe.nightly:style/Base.V22.Theme.AppCompat.Light, id=0x7f1300aforg.schabi.newpipe.nightly:style/Base.V21.Theme.AppCompat.Light, id=0x7f1300d0org.schabi.newpipe.nightly:style/Base.V7.Theme.AppCompat.Light, id=0x7f130191org.schabi.newpipe.nightly:style/Platform.AppCompat.Light, id=0x7f13019corg.schabi.newpipe.nightly:style/Platform.V25.AppCompat.Light, id=0x1030241android:style/Theme.Material.Light.NoActionBar, id=0x1030237android:style/Theme.Material.Light, id=0x103000candroid:style/Theme.Light, id=0x1030005android:style/Theme], Themes=[org.schabi.newpipe.nightly:style/LightTheme.YouTube, forced, org.schabi.newpipe.nightly:style/OpeningTheme, forced, org.schabi.newpipe.nightly:style/Theme.AppCompat.Empty, forced, android:style/Theme.DeviceDefault.Light.DarkActionBar, forced]}
	at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:839)
	at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:8259)
	at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:8456)
	at android.widget.RelativeLayout$LayoutParams.<init>(RelativeLayout.java:1296)
	at android.widget.RelativeLayout.generateLayoutParams(RelativeLayout.java:1110)
	at android.widget.RelativeLayout.generateLayoutParams(RelativeLayout.java:89)
	at android.view.LayoutInflater.rInflate(LayoutInflater.java:1137)
	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1096)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:694)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:538)
	at org.schabi.newpipe.local.holder.LocalItemHolder.<init>(LocalItemHolder.java:39)
	at org.schabi.newpipe.local.holder.PlaylistItemHolder.<init>(PlaylistItemHolder.java:22)
	at org.schabi.newpipe.local.holder.LocalPlaylistItemHolder.<init>(LocalPlaylistItemHolder.java:26)
	at org.schabi.newpipe.local.holder.LocalBookmarkPlaylistItemHolder.<init>(LocalBookmarkPlaylistItemHolder.java:25)
	at org.schabi.newpipe.local.holder.LocalBookmarkPlaylistItemHolder.<init>(LocalBookmarkPlaylistItemHolder.java:20)
	at org.schabi.newpipe.local.LocalItemListAdapter.onCreateViewHolder(LocalItemListAdapter.java:331)
	at androidx.recyclerview.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:7788)
	at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6873)
	at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6757)
	at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6753)
	at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2362)
	at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1662)
	at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1622)
	at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:687)
	at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4645)
	at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:4348)
	at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4919)
	at android.view.View.layout(View.java:24430)
	at android.view.ViewGroup.layout(ViewGroup.java:6440)
	at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1103)
	at android.view.View.layout(View.java:24430)
	at android.view.ViewGroup.layout(ViewGroup.java:6440)
	at androidx.viewpager.widget.ViewPager.onLayout(ViewPager.java:1775)
	at android.view.View.layout(View.java:24430)
	at android.view.ViewGroup.layout(ViewGroup.java:6440)
	at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1103)
	at android.view.View.layout(View.java:24430)
	at android.view.ViewGroup.layout(ViewGroup.java:6440)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
	at android.view.View.layout(View.java:24430)
	at android.view.ViewGroup.layout(ViewGroup.java:6440)
	at androidx.coordinatorlayout.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1213)
	at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:899)
	at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:919)
	at android.view.View.layout(View.java:24430)
	at android.view.ViewGroup.layout(ViewGroup.java:6440)
	at androidx.drawerlayout.widget.DrawerLayout.onLayout(DrawerLayout.java:1263)
	at android.view.View.layout(View.java:24430)
	at android.view.ViewGroup.layout(ViewGroup.java:6440)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
	at android.view.View.layout(View.java:24430)
	at android.view.ViewGroup.layout(ViewGroup.java:6440)
	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1891)
	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1729)
	at android.widget.LinearLayout.onLayout(LinearLayout.java:1638)
	at android.view.View.layout(View.java:24430)
	at android.view.ViewGroup.layout(ViewGroup.java:6440)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
	at android.view.View.layout(View.java:24430)
	at android.view.ViewGroup.layout(ViewGroup.java:6440)
	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1891)
	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1729)
	at android.widget.LinearLayout.onLayout(LinearLayout.java:1638)
	at android.view.View.layout(View.java:24430)
	at android.view.ViewGroup.layout(ViewGroup.java:6440)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
	at com.android.internal.policy.DecorView.onLayout(DecorView.java:789)
	at android.view.View.layout(View.java:24430)
	at android.view.ViewGroup.layout(ViewGroup.java:6440)
	at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:4317)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3642)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2514)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9398)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1475)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1484)
	at android.view.Choreographer.doCallbacks(Choreographer.java:1076)
	at android.view.Choreographer.doFrame(Choreographer.java:1004)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1451)
	at android.os.Handler.handleCallback(Handler.java:958)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:334)
	at android.app.ActivityThread.main(ActivityThread.java:8291)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:557)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:981)


Stypox added a commit to Stypox/NewPipe that referenced this pull request Nov 16, 2024
@Stypox
Copy link
Member

Stypox commented Nov 16, 2024

@Paragraph1148 thanks for reporting, see #11711

@Stypox Stypox mentioned this pull request Nov 17, 2024
7 tasks
@AbdeltwabMF AbdeltwabMF deleted the fix/rtl_lang_adjustment_bookmark branch November 18, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI Issue is related to the graphical user interface size/small PRs with less than 50 changed lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants