How to Support All Screen Sizes in Jetpack Compose

  Рет қаралды 31,335

Philipp Lackner

Philipp Lackner

Күн бұрын

Пікірлер: 62
@siarheisudakou4455
@siarheisudakou4455 2 жыл бұрын
Very good solution and clear example! Thanks a lot for the excellent video!
@opletter
@opletter 2 жыл бұрын
Is there a reason WindowType is a sealed class instead of an enum?
@mv2e19
@mv2e19 2 жыл бұрын
I was wondering the same thing. I understand the usefulness of sealed classes, but I don't see the purpose using them here. It'd be simpler to just use an enum class.
@JavierLopezPR
@JavierLopezPR 9 ай бұрын
Thanks Philipp
@henrik908
@henrik908 Жыл бұрын
This man is truly the best creator
@Mhung08
@Mhung08 2 жыл бұрын
Good tutorial. Thanks
@FreedivingTrainer
@FreedivingTrainer 2 жыл бұрын
Why it called "remember"? It run on every recomposition
@nCodeLab
@nCodeLab 2 жыл бұрын
nice video.....short and to the point..i am sure if this video is anyone's first video from your channel , they will subscribe for sure...this kind of video what make me check your channel everyday..
@aleksandrnikolaev2914
@aleksandrnikolaev2914 Жыл бұрын
Maybe I don't understand something. But why didn’t the designer of jetpack compose assign sizes, for example in percentages or in other units that adjust to screen sizes like in html stuff? Or, for example, there are no breakpoints feature implemented for different screen sizes in which we could completely change the location and size of the elements?
@jflavio11
@jflavio11 2 жыл бұрын
Really good. However I miss why is necessary to have two variables of WindowType: one for width and another one for height. Is there any particular reason?
@PhilippLackner
@PhilippLackner 2 жыл бұрын
In case you'd like more fine grained control over when it should change
@denisk3852
@denisk3852 2 жыл бұрын
Great tutorial 👍
@DiegoLoL
@DiegoLoL Жыл бұрын
Gracias amigo!!
@OgabekDev
@OgabekDev Жыл бұрын
Great Bro. Good luck
@tiltedbybox6118
@tiltedbybox6118 2 жыл бұрын
I just started learning compose and was about to google this, lol.
@AkshayTaru
@AkshayTaru 2 жыл бұрын
Question: Previously we used to have dimes.xml file for various screen sizes. But in Compose everyone seems to be using hardcoded values. For example 12.dp or X.dp and Y.sp. How does this will affect different screen sizes?
@farazahmed7
@farazahmed7 Жыл бұрын
we still use dimens. He is just not using it for some reason
@lbarq
@lbarq 2 жыл бұрын
Great video once more.
@mustafaammar551
@mustafaammar551 2 жыл бұрын
very cool thank you bro
@mrsoommy9162
@mrsoommy9162 2 жыл бұрын
Can someone post a link to the doc page where those dp values are present? I need to check on the ones regarding TV. Thanks in advnce!
@PracticalCoding
@PracticalCoding 2 жыл бұрын
Here's the link to the doc page regarding the dp values. I didn't see anything about TV screen sizes though developer.android.com/guide/topics/large-screens/support-different-screen-sizes#window_size_classes
@Abd-Elrahman_Esam
@Abd-Elrahman_Esam 2 жыл бұрын
what about the size of the icons,images and fonts etc ??? with xml we have used sdp lib what now ???
@johndominicjasmin
@johndominicjasmin 2 жыл бұрын
Thanks man
@thespacejedi
@thespacejedi 2 жыл бұрын
Hi Phillip, could you do a video on Dagger scopes? Thank you!
@abada-s
@abada-s 2 жыл бұрын
Very good job, I hope you to show us your keyboard shortcuts in next videos
@theguy4084
@theguy4084 Жыл бұрын
is threre any library that offers bootstrape css like code pattern?
@clamum9648
@clamum9648 2 жыл бұрын
Nice man! I actually understood this (just learning Jetpack and Kotlin both now) too. Although I'll be interested in clicking an item in the left list and loading a detail composable on the right, as opposed to on a smaller screen clicking a list item and then going to a whole new composable for the detail display. Hopefully that shouldn't be too bad. Have a question on your WindowInfo/WindowType support classes: I've noticed that the return type in your "sealed" class is "ClassName()" with parentheses, but the return type in the "data" class is just "ClassName." This was also true in the Jetpack MVVM Notes app that I followed along to. What's the reason for the difference in those? Very much appreciate your awesome videos on Jetpack.
@OEThe11
@OEThe11 2 жыл бұрын
I'm literally about to do the same thing. Where you able to do it as of yet?
@clamum9648
@clamum9648 2 жыл бұрын
@@OEThe11 Haven't even gotten close to that point yet. I want to finish the app first, then try supporting bigger screen sizes. But I'm having a hell of a time with it. I know it's old and crapped on, but old Java/Sqlite is so much easier than Jetpack/Room. I'm actually considering starting over, keeping Kotlin/Jetpack, just architecting it a little more simply. I'm only maybe half done with rewriting the app and it's got at least double the files/classes as my old Java app in its final state and is way more complicated.
@OEThe11
@OEThe11 2 жыл бұрын
@@clamum9648 That's very interesting that you say that. I started with SQLite/Room by originally crating apps with Java and XML files. I find Jetpack pretty straightforward. There's a bit of a learning curve, but once you have that down, it makes all the sense in the world. I was wondering about different screen sizes for JC and now have my answer for it lol.
@clamum9648
@clamum9648 2 жыл бұрын
@@OEThe11 Yeah I actually prefer Jetpack but I don't care for Room at all. My database is insanely simple and I've constantly gotten stuck on doing what should be easy. Right now it's having a problem returning a column from a table that's a part of a join. I dunno why there's an issue cause I join to other tables and return those columns fine. That and just my architecture of the app is way over complicated. I tried implementing a Clean Architecture approach, to learn something new and because it may be useful in the future in my professional job, but it's way overkill for this little simple app and just over complicates things. But yeah I like Kotlin and Jetpack in general otherwise. I guess my main complaint is Room. All the tutorials I see are total crap and way too simple to be much use.
@OEThe11
@OEThe11 2 жыл бұрын
@@clamum9648 There's another database option called Realm. It's a NoSQL type of database and has the ability to store info on a cloud that you can use with other devices simultaneously. You should check it out.
@viledogvd3539
@viledogvd3539 25 күн бұрын
Get a single variable that hold screen orientation would not be enough? Why so complicated?
@outsourcing4work253
@outsourcing4work253 2 жыл бұрын
Hi, Please make tutorial to move point/Offset randomly across the canvas continuously without user input. Same like bouncing ball
@x32gx
@x32gx 2 жыл бұрын
I think I am missing something. The rememberWindowInfo Composable is not really remembered in this case right? Does this mean scrolled lists will not retain their scroll position?
@ShodaiThox
@ShodaiThox Жыл бұрын
My exact thought, don't get the why this works, because initially the class is initialized with the start configuration, and then upon rotating does it create another instance of that class with the changes ?? does a recomposition happen upon screen rotation ??
@ankitverma3932
@ankitverma3932 2 жыл бұрын
Felt some issues with the values oh height and width, I have a samsung M31 phone , in landscape mode it switched from compact to expanded instead of medium, I checked the width in landscape which showed as 859 dp . Which should not be the case. Plz help
@nadavpicar
@nadavpicar Ай бұрын
The source code you provided is missing a lot of the code in the video.
@lebanoncedarslebanoncedars8894
@lebanoncedarslebanoncedars8894 2 жыл бұрын
Nice work, do u have it in Java mode by any chance pls, Thank you.?
@smartapps8770
@smartapps8770 2 жыл бұрын
is there any way to make a composable full-screen without changing its state?
@花未开
@花未开 2 жыл бұрын
I think.If the screen changes, the interface reorganizes, not the state changes.
@Bluckyism
@Bluckyism 2 жыл бұрын
what text theme that guy use?
@mrwaseemmalik5766
@mrwaseemmalik5766 2 жыл бұрын
But we have to divide single list into two separate list
@aklncarslan8326
@aklncarslan8326 4 күн бұрын
!! Don't compare window info based on screenWidth, you will get EXPANDED when the device is LANDSCAPE orientation, you will get COMPACT when the device is PORTRAIT !!
@karolmaciejewski340
@karolmaciejewski340 2 жыл бұрын
Haven't seen any video about multi module application. I'm curious about your approach and how you solve communication between modules.
@iliasg
@iliasg 2 жыл бұрын
He made a course about that, I highly recommend that one.
@carlosmartinezsuarez3541
@carlosmartinezsuarez3541 Жыл бұрын
I just fucking love you jajaja literally
@mateusrabelo556
@mateusrabelo556 Жыл бұрын
youre the goat.
@КаЩеЙ-ш3с
@КаЩеЙ-ш3с 2 ай бұрын
need update
@konstantinchernyaev3011
@konstantinchernyaev3011 2 жыл бұрын
Yeah... No Grid Layout in Compose, pretty duplicated code 😒👍
@sabbib007madness
@sabbib007madness Жыл бұрын
better to have duplicate code over wrong abstraction - Sandi Metz 😊
@foreverrafs
@foreverrafs 2 жыл бұрын
I'm the first here, I think :)
@kios1973
@kios1973 2 жыл бұрын
thanks for this
@outsourcing4work253
@outsourcing4work253 2 жыл бұрын
Hi, Please make tutorial to move point/Offset randomly across the canvas continuously without user input. Same like bouncing ball
@outsourcing4work253
@outsourcing4work253 2 жыл бұрын
Hi, Please make tutorial to move point/Offset randomly across the canvas continuously without user input. Same like bouncing ball
@outsourcing4work253
@outsourcing4work253 2 жыл бұрын
Hi, Please make tutorial to move point/Offset randomly across the canvas continuously without user input. Same like bouncing ball
@outsourcing4work253
@outsourcing4work253 2 жыл бұрын
Hi, Please make tutorial to move point/Offset randomly across the canvas continuously without user input. Same like bouncing ball
@outsourcing4work253
@outsourcing4work253 2 жыл бұрын
Hi, Please make tutorial to move point/Offset randomly across the canvas continuously without user input. Same like bouncing ball
@outsourcing4work253
@outsourcing4work253 2 жыл бұрын
Hi, Please make tutorial to move point/Offset randomly across the canvas continuously without user input. Same like bouncing ball
@outsourcing4work253
@outsourcing4work253 2 жыл бұрын
Hi, Please make tutorial to move point/Offset randomly across the canvas continuously without user input. Same like bouncing ball
@outsourcing4work253
@outsourcing4work253 2 жыл бұрын
Hi, Please make tutorial to move point/Offset randomly across the canvas continuously without user input. Same like bouncing ball
ViewModels & Configuration Changes - Android Basics 2023
18:46
Philipp Lackner
Рет қаралды 141 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
Support Multi-Screen Sizes in Jetpack Compose
12:00
Ahmed Guedmioui
Рет қаралды 2,6 М.
Implementing Android apps for all screen sizes
13:53
Android Developers
Рет қаралды 36 М.
How to Support ALL Screen Sizes on Android - Full Guide
19:10
Philipp Lackner
Рет қаралды 116 М.
Multiple Screen Size Support in Android Jetpack Compose.
11:42
Mohsen Mashkour
Рет қаралды 1,3 М.
Compose: Implementing responsive UI for larger screens
18:28
Android Developers
Рет қаралды 10 М.
Turning bad React code into senior React code
13:10
Cosden Solutions
Рет қаралды 94 М.
Should You Use Compose State or StateFlow in Your ViewModels?
13:59
Philipp Lackner
Рет қаралды 85 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН