Official Jetpack Compose samples.
Oh, I’m sorry. I didn’t realize you already looked at those. Those should go into a Window Size file. You can call it whatever, I called mine WindowSize and WindowUtil. These files should be written once and used on all your apps. So design them with that in mind. You can call them in your main Activity file or anywhere else you need it. Here is a good example of using the code in the documentation inside a news info App. This is their main activity file [theirs is written in kotlin, but can be translated into Java] https://github.com/android/compose-samples/blob/main/JetNews/app/src/main/java/com/example/jetnews/ui/MainActivity.kt And here is their window size class files -- https://github.com/android/compose-samples/blob/main/JetNews/app/src/main/java/com/example/jetnews/utils/WindowSize.kt https://github.com/android/compose-samples/blob/main/Jetcaster/app/src/main/java/com/example/jetcaster/util/WindowInfoUtil.kt You should also go into your manifest file and put - android:resizeableActivity="true" or false [depends on what you want resized] In the application or activity section depending on isolation of activity or not.. And here is a YT video with good points - always code for device unknown. That way it wouldn’t matter the screen size, resolution, hardware config. Ext. -- It doesn't give much on syntax usage, but good insight info. Build apps for foldable, multi-display, and large-screen devices (Google I/O'19) https://youtu.be/8uQEzv3upy8 Considering you are just starting out and getting the hang of things. I would look at all their files in the App source code above and see how the classes and functions are being used. Download the source files and tear it apart. The best way of learning any coding language is looking at code and playing with it then going back to the documentation to further understand it. I hope this helps. Good luck.
Compose Destinations: simple and type-safe navigation in Jetpack Compose
1 project | reddit.com/r/androiddev | 9 Jan 2022
ComposePrefs - Fully featured preferences library for Jetpack Compose
3 projects | reddit.com/r/Kotlin | 8 Jan 2022
Fully featured preferences library for Jetpack Compose
1 project | reddit.com/r/coolgithubprojects | 8 Jan 2022
What is the thing you most struggle with when using Jetpack Compose?
2 projects | reddit.com/r/androiddev | 7 Jan 2022
Experimental desktop version of TwidereX client for Twitter
2 projects | news.ycombinator.com | 29 Dec 2021