Swipeable Tab Rows - UX With Material3

  Рет қаралды 28,430

Philipp Lackner

Philipp Lackner

Күн бұрын

Пікірлер: 75
@Alchemist10241
@Alchemist10241 Жыл бұрын
This is the simplest and easiest solution for implementing swipeable tab rows in jetpack compose I've seen so far, well done and thanks Phillips
@Luffy_2804
@Luffy_2804 Жыл бұрын
you are one of the best just because of you i just switched to jetpack , initially i was hating this jetpack stuff and finding xml , easy as compared to jetpack , but now i started liking jetpack too much , it is really amazing , initially it becomes way to difficult , not able to understand what is happening with regular practice efforts and i am able to understand how it is working
@tusharbhatia6777
@tusharbhatia6777 8 ай бұрын
For anyone facing the delay in indicator changing , i fixed the issue code: val scope = rememberCoroutineScope() LaunchedEffect(pagerState.currentPage) { selectedTabIndex = pagerState.currentPage } in Tab ,onclick = { scope.launch { pagerState.animateScrollToPage(index) } selectedTabIndex = index } remove the other LauchedEffect he typed in video
@nadirseddaoui8136
@nadirseddaoui8136 8 ай бұрын
thx bro !
@makix08
@makix08 4 ай бұрын
This is the correct way to do it, thanks
@ritikrawat2447
@ritikrawat2447 3 ай бұрын
What if we need to add composables in side these tab rows how can we do it can you help pls
@tusharbhatia6777
@tusharbhatia6777 3 ай бұрын
We call that composable Like Screen A() Screen B()
@MuhammadUbaid-j4o
@MuhammadUbaid-j4o 3 ай бұрын
great work bro
@azickri
@azickri 6 ай бұрын
This is the best of Tutorial, you explain all need we must learn without chitchat 🎉🎉🎉
@teovladusic
@teovladusic 10 ай бұрын
PagerState has a property called "targetPage", it works better than what Philipp suggested as there is some delay when waiting pager animation to finish.
@tonymont72
@tonymont72 9 ай бұрын
How did you handle the delay?
@cyrdas
@cyrdas 7 күн бұрын
@@tonymont72 I've used setup by @tusharbhatia6777 's comment, but replaced the pagerState.currentPage with pagerState.targetPage, that prevents the weird flickering issue happening otherwise as you scroll over the in-between pages.
@ChrisAthanas
@ChrisAthanas Жыл бұрын
@Phillip Lackner The Source code link is responding with 404... is the link correct?
@Ayor88
@Ayor88 8 ай бұрын
First, thank you very much for all of your content, I watch almost all of your videos. While it works, The tab doesn't update until the end of the scrolling. It would be better if booth where synchronized
@JJSS90
@JJSS90 7 ай бұрын
Philp you are the best
@kirwakelvinkering3122
@kirwakelvinkering3122 Жыл бұрын
Philip you've been my best teacher in Kotlin .was just wondering if we could modify the Tab indicator to have rounded corners like that of twitter .
@wikigerman
@wikigerman 10 ай бұрын
Thank you very much Philipp,, is it possible to reduce the space between tabs? the current default value is: private val ScrollableTabRowMinimumTabWidth = 90.dp
@lucachangretta2025
@lucachangretta2025 5 ай бұрын
Dude ur so so so underrated
@nastenkaoo
@nastenkaoo 8 ай бұрын
thanks Philipp, you are great
@anthonydanyameabuah4542
@anthonydanyameabuah4542 Жыл бұрын
Funny thing I spent almost the last two days figuring this thing out and now it's here. Should've waited. Question : When using the scrollable tab, how do you keep the selected tab focused on the screen when swiping the horizontal pager to a tab that isn't on the screen yet(say the last screen). I hope my question is clear
@funclips767
@funclips767 Жыл бұрын
keep the good work❤
@Leon-un2ii
@Leon-un2ii Жыл бұрын
So this could also easily be bottom Navigation bar or should we then stick to the other video for this topic? I am a bit confused. Your way in this video now looks better and has more features.
@GandhiWibowo-h7f
@GandhiWibowo-h7f Жыл бұрын
Hy Philip. Sorry if asking off topic. I've seen your video creating an Instagram profile page. I want to ask, how can the list of "content" that appears continue to scroll down?
@wilianc.b.3065
@wilianc.b.3065 8 ай бұрын
Hi! Thanks for the video. One question please: When I use isScrollInProgress, there is a bit of a lag to move the selectedTabIndex in the TabRow. Is there a solution for this lag?
@nadirseddaoui8136
@nadirseddaoui8136 8 ай бұрын
Hi! I have the same issue. Did you got any solution ? when i dont use isScrollInProgress there is still a very little lag. I mean this is not smooth as Watsapp swip for exemple.
@itsusinn
@itsusinn 8 ай бұрын
i came into this wired situation too
@itsusinn
@itsusinn 8 ай бұрын
@wilianc.b.3065 @nadirseddaoui8136 LaunchedEffect(pagerState.targetPage){ selectedTabIndex= pagerState.targetPage } should fix this problem
@JJSS90
@JJSS90 7 ай бұрын
@@itsusinn Thanks, this fixed the issue
@luciferGOD1234
@luciferGOD1234 Жыл бұрын
What will be best way achieve bottom bar? I mean viewpager is better or bottom bar layout?
@johnoricha7088
@johnoricha7088 Жыл бұрын
Did something very similar on flutter very recently 😅. My implementation was for 2 tabs and 2 pages.
@unknownBoy85lover
@unknownBoy85lover Жыл бұрын
Thank you so useful it's I need it just right now 😂❤
@david_whyte
@david_whyte 5 ай бұрын
Hi why are you not using button nav bar in the scaffold?
@wyneci
@wyneci Жыл бұрын
Hi Phillip, please make a tutorial with MongoDB 🙏
@dreW1-
@dreW1- Жыл бұрын
you just solved me a bug with the horizontal pager to get the index, i was executing a method inside the horizontal pager instead of launched effect.... those timings insane
@zulhijananda5772
@zulhijananda5772 10 ай бұрын
Source code is 404, where can i get it. I have problem, my pager does not change when tab is changed
@abada-s
@abada-s Жыл бұрын
Why didn't you use the pagerState.currentPage as the index of the selected tab? also tab onClick will animate the pager state to the selected index
@PhilippLackner
@PhilippLackner Жыл бұрын
Does that also behave correctly when switching from start to end tab?
@abada-s
@abada-s Жыл бұрын
@@PhilippLackner I didn't test it but it should be fine because we are dealing with one state
@PhilippLackner
@PhilippLackner Жыл бұрын
@@abada-s if that works well, it seems like the better solution. Thanks for adding 👍🏼
@wesd3fer
@wesd3fer Жыл бұрын
@@abada-s Just wanted to chime in and say that I tested this and it works as expected. The only minor thing is that for the onClick you have to account for PagerState.animateScrollToPage being a suspending function.
@John-qt6qk
@John-qt6qk Жыл бұрын
Awesome!! well done
@gamecool2110
@gamecool2110 8 ай бұрын
thanks so much you saved me
@padmakargarg9720
@padmakargarg9720 11 ай бұрын
Hi ,XIaomi device does not dismiss lockscreen when opening Activity from background (VOIP Call) please help me out regarding this point
@jishnupdileep3143
@jishnupdileep3143 7 ай бұрын
@saeedghiassy5435
@saeedghiassy5435 Жыл бұрын
Like always great videos , thanks you very much ! :)
@rakam.a8070
@rakam.a8070 Жыл бұрын
Can you make a video how to combine TabRows with TopAppBar that has scroll behaviour?
@anthonydanyameabuah4542
@anthonydanyameabuah4542 Жыл бұрын
Especially how to keep the selected tab in focus. This would be very helpful as I'm struggling to figure out
@divyathakur5885
@divyathakur5885 11 ай бұрын
How can I make multiple pages with different stateflow list?? spwiping pages are worling terrible and recreating multiple ties if using live data inside it.
@DmitryZatuchny
@DmitryZatuchny 6 ай бұрын
Page not found for repo in description
@TheFlexath
@TheFlexath Жыл бұрын
Thank you Sir
@denisk3852
@denisk3852 Жыл бұрын
Great 👍
@زيد_اليماني
@زيد_اليماني Жыл бұрын
amazing
@m777rmc3
@m777rmc3 Жыл бұрын
Thank you!!!!!
@nijithebuji
@nijithebuji Жыл бұрын
Source code link is saying 404 not found
@lariniabdellah1820
@lariniabdellah1820 Жыл бұрын
tabrow is deprecated now so what alternative can i use
@dr.paradoxdelusionsofgrandeur
@dr.paradoxdelusionsofgrandeur Жыл бұрын
I still have difficulty in using jetpack compose because it doesn't have the xml view where you can just drag and drop your designs (from figma) then code the functions in the background.
@KaroKaro290
@KaroKaro290 Жыл бұрын
Bro 🤣
@thelight786
@thelight786 5 ай бұрын
github url not taking me to the code. ?
@goole-k3z
@goole-k3z 4 ай бұрын
고아워여
@DasBy768
@DasBy768 Жыл бұрын
Hi everyone, I repeated exactly the code from the video, but when I got to two Lauchedeffect's, they did not change the operation of the application in any way and even with them the application works the same as without them. I don't understand what's wrong here. Thanks to everyone who can help me
@tushar_mahale
@tushar_mahale Жыл бұрын
Please provide a good promo code for your " Ultimate PL course bundle"
@ritikrawat2447
@ritikrawat2447 3 ай бұрын
What if we need to add composables in side these tab rows how can we do it can anyone help pls
@ritikrawat2447
@ritikrawat2447 3 ай бұрын
Answer HorizontalPager(state = pagerState, modifier = Modifier .fillMaxWidth() .weight(1f) ){ index -> Box( modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center ){ when ( index ){ 0 -> PersonalScreen() 1 -> ServicesScreen() 2 -> BusinessScreen() } } }
@lawrence1519
@lawrence1519 Жыл бұрын
heeey :D Can you make a video about cucumber(BDD) in android (with hilt)?
@MohdAflah.k
@MohdAflah.k 2 ай бұрын
Mool😮😅
@goole-k3z
@goole-k3z 4 ай бұрын
방해해..누가
@goole-k3z
@goole-k3z 4 ай бұрын
😂😂
@goole-k3z
@goole-k3z 4 ай бұрын
😂
@GRIFTYRODRIGUEZ
@GRIFTYRODRIGUEZ 11 ай бұрын
bruh why you make your voice sound so weird. sounds like metal gear solid and the codec is running out of batteries
@Relax-4-Relax
@Relax-4-Relax 6 ай бұрын
Hello, I am writing through a translator so it may not be clear... In the place where there is a comment ( //Some screen) I place my screen. In your example, there are a lot of unnecessary recompositions. see if I made the changes correctly. Thank you Surface( modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background ) { val pagerState = rememberPagerState { tabItem.size } val coroutineScope = rememberCoroutineScope() Column( modifier = Modifier.fillMaxSize() ) { TabRow(selectedTabIndex = pagerState.currentPage) { tabItem.forEachIndexed { index, tabItem -> Tab( selected = true, onClick = { coroutineScope.launch { pagerState.animateScrollToPage(index) } }, text = { Text(text = tabItem.title) }, icon = { Icon( imageVector = if (index == pagerState.currentPage) tabItem.selected else tabItem.unselected, contentDescription = null ) }) } } HorizontalPager( modifier = Modifier.weight(1f), state = pagerState ) { index -> //Some screen } } }
@enriqueajin6016
@enriqueajin6016 5 ай бұрын
Thanks! I this approach works perfectly.
@tech_ch1211
@tech_ch1211 4 ай бұрын
This solution is better than the one provided in the video, and without lags and workarounds. Thanks
Text Fields - UX With Material3
20:27
Philipp Lackner
Рет қаралды 20 М.
Top App Bar (Toolbar) - UX With Material3
17:11
Philipp Lackner
Рет қаралды 26 М.
КОГДА К БАТЕ ПРИШЕЛ ДРУГ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 6 МЛН
Seja Gentil com os Pequenos Animais 😿
00:20
Los Wagners
Рет қаралды 85 МЛН
小蚂蚁会选到什么呢!#火影忍者 #佐助 #家庭
00:47
火影忍者一家
Рет қаралды 130 МЛН
Random Emoji Beatbox Challenge #beatbox #tiktok
00:47
BeatboxJCOP
Рет қаралды 45 МЛН
95% Don't Understand THIS About Coroutines (Main-Safety)
9:38
Philipp Lackner
Рет қаралды 30 М.
The ONLY Correct Way to Load Initial Data In Your Android App?
12:27
Philipp Lackner
Рет қаралды 34 М.
Jetpack Compose | Doctor Appointment UI | Part 1
26:43
Hari Agus W
Рет қаралды 1,4 М.
Type-Safe Navigation with the OFFICIAL Compose Navigation Library
10:03
The ULTIMATE Guide to Sharing Data Between Screens in Jetpack Compose
24:08
ViewModels & Configuration Changes - Android Basics 2023
18:46
Philipp Lackner
Рет қаралды 127 М.
Navigation Drawer - UX With Material3
13:10
Philipp Lackner
Рет қаралды 25 М.
TabRow with Horizontal Pager in 4 Minutes - Jetpack Compose
4:28
КОГДА К БАТЕ ПРИШЕЛ ДРУГ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 6 МЛН