RU
EN
Main Page
Download
Addons
Forum
Blog
Feedback
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Help
Search
Login
Register
News:
AIMP v5.40
AIMP Forum
»
AIMP for Android
»
Skin Editor, Skin Engine
»
Suggestions
»
Implement ViewPager2 to swipe on the Current Played Track/ Album Cover
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Implement ViewPager2 to swipe on the Current Played Track/ Album Cover (Read 5784 times)
0 Members and 1 Guest are viewing this topic.
Implement ViewPager2 to swipe on the Current Played Track/ Album Cover
«
on:
June 28, 2021, 11:21:26 »
heinrich27
Новичок
Posts: 3
Карма: +0/-0
Hi,
I'd suggest to integrate/use the Androidx ViewPager2 View in the player screen for the Album Cover and the Currently Played Track in the Navbar. Why? This allows a more smooth Navigation between Songs (Next & Previous) and also supports Swiping. You can also make a nicer transition when a new song is played.
Examples from my Test App:
Whats the ViewPager2?
Thats Androids Carousel View/Widget, that allows to display a "list" of ViewHolders/Layouts. Its implemented pretty similar to how ListViews are created.
Some notes about Implementing the ViewPager2: (i used it in a Player I've been working on)
- The ViewPager2s Listener has to respect a couple conditions inside the OnPageSelected Method:
- call the Skip Method/Play Method only when the User swiped. (I have a boolean that is set to true when the Pagers page is updated from Code, because a new song is played etc., and set to false in the OnPageSelected, and Skip/Play/Prev is only called if that boolean was false)
- the adapter might just take a similar dataset as the Playlist Views.
Logged
Re: Implement ViewPager2 to swipe on the Current Played Track/ Album Cover
«
Reply #1 on:
June 28, 2021, 21:00:55 »
Artem
Администратор
Супермен
Posts: 17670
Карма: +3009/-65
ViewPager2 is useless, the bottleneck is track loading performance, player cannot load tracks and its album arts fastly.
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
AIMP Forum
»
AIMP for Android
»
Skin Editor, Skin Engine
»
Suggestions
»
Implement ViewPager2 to swipe on the Current Played Track/ Album Cover