jetc.dev Newsletter Issue #188
This week, we look at how to tell that you’re on a TV (for composables) and whether
we can have
Modifier be returned by a composable. We explore slot APIs,
and MapBox’s Compose UI support. Plus, we examine libraries for placeholders, calendars,
and button toggle groups.
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
In other words, how does the system decide to apply
layout-television for layout resources?
The answer appears to be that it detects
FEATURE_LEANBACK, and so we can use that
to decide whether to use a mobile or a TV-specific composable. However, I argue that
there may be better options than doing this on a granular basis, in this week’s highlighted
Stack Overflow question.
We’re told to move away from using
Modifier.composed(). However, sometimes, we need
to read a composition local from within a modifier… and reading a composition local
can only be done inside of a composable. Learn why
composed() is still OK for the short
term, and other limits of using a composable to return a modifier, in this week’s
#compose Slack thread.
Posts, videos, and other new information related to Jetpack Compose!
Bharadwaj Rns takes a practical look at
ConstraintLayout(), the Compose UI equivalent
ConstraintLayout that dominated newer
View-based Android UI construction.
The sample code explores creating and employing references to describe the relationships
between composables via the
Medium: How to use Official Mapbox Maps Compose Extension with Permission Flow and
Other Interesting Links
- Left and Right align text simultaneously inside a button on the same line in Jetpack Compose
- Mastering Jetpack Compose: Best Practices for Superior Android App Development
- Medium: Creating Rich Interactions with Custom Gestures in Compose
- Medium: Elevate Your Android App’s Visual Appeal with Simple and Elegant Animations in Jetpack Compose
- Medium: Harmonizing Modifiers in Jetpack Compose: A Tale of Flexibility and Usability
- Medium: Integrating Jetpack Compose with Existing Android Projects: A Step-by-Step Tutorial
- Medium: Jetpack Compose Layouts: Crafting with Column and Row
- Medium: Make your Bottom Nav bar Beautiful with this UI in Jetpack compose!
- Medium: Mastering State Retention with Composable ViewModel: Navigating Orientation Changes
- Medium: Picking Images From Gallery Using Jetpack Compose
- Medium: Settings a custom content description on composables with no corresponding parameter
- Medium: Understanding @Stable, @Immutable, ImmutableCollection, and PersistentCollection in Jetpack Compose
- Medium: Useful Modifiers In Jetpack Compose Part — II
100% pure code!
GitHub user robertlevonyan created a Compose UI implementation of the MaterialButtonToggleGroup
from the Material3 spec. You provide the
RowToggleButtonGroup() with the icons, or
ColumnToggleButtonGroup() with the icons and labels, and the composables render
the toggle button group from there.
Other Interesting Links
- Gist: Mikkareem / GlassyImage.kt (blur-based glass effect)
- GitHub: GuilhE / KMP-ComposeUIViewController
- GitHub: mmoczkowski / Chart (Compose Multiplatform tiled map renderer)
- 2023-11-21: Compose/Material3/Wear Compose updates! remember()! Adaptive layouts! Compose Multiplatform in 2024! @email@example.com on BasicTextField2()! Compose Multiplatform charts! And... is TV Compose in trouble?!?
- 2023-11-14: Compose Compiler! BasicTextField2()! @firstname.lastname@example.org and animations! Optimization! @email@example.com, JetBrains, and Fleet! JetBrains and plotting! And... we collapse?!?
- 2023-11-07: Compose Multiplatform! Chips in fields! Diffing! Custom fonts in Glance app widgets! Heatmaps! PIN input! And @firstname.lastname@example.org is in a bit of a haze?!?