Has anyone used the FoldingFeature.State class? Would like to know how to use it.

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/AndroidStudio

Our great sponsors
  • SonarLint - Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
  • Scout APM - Less time debugging, more time building
  • OPS - Build and Run Open Source Unikernels
  • GitHub repo compose-samples

    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.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts