Chris Johnson
05/23/2022, 6:03 PMWindowCompat.setDecorFitsSystemWindows(window, false)
in a fragment, but then when that fragment is navigated away from set it back to true. Currently I get a little bit of jitter setting it in onResume/onStop of the fragment. The end goal is to allow imePadding on one screen only and disallow it everywhere elseNikolas Alvelo
05/23/2022, 8:32 PMFlowRow
seems to crash instantly with the verticalScroll
Modifier if running on a Tablet, has anyone else run into this and found a fix?
java.lang.IllegalStateException: Nesting scrollable in the same direction layouts like LazyColumn and Column(Modifier.verticalScroll()) is not allowed.
Even if all that's in the FlowRow is a Text(...)
mkrussel
05/24/2022, 2:48 PMJakob K
05/26/2022, 3:12 AMText
composables? I can increase it, but not reduce it - and the default height seems way to big. Also, it does not seem like it scales with the fontSize.wck
05/27/2022, 12:33 AM@Composable
fun TextButton(
modifier: Modifier = Modifier,
wck
05/27/2022, 12:37 AM* For functions with one / more modifier parameters, the first modifier parameter must:
* - Be named `modifier`
* - Have a type of `Modifier`
* - Either have no default value, or have a default value of `Modifier`
* - If optional, be the first optional parameter in the parameter list
Cristina Uroz
05/27/2022, 8:54 AM@AndroidEntryPoint
class MainActivity : ComponentActivity() {
...
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
...
setContent {
val viewModel: MainActivityViewModel = hiltViewModel()
MainTheme {
MainActivityNav(state = viewModel.state.value)
}
}
}
@Composable
fun MainActivityNav(state: MainActivityState) {
val mainNavController = rememberNavController()
...
Mjahangiry75
05/29/2022, 9:04 PMJames Adefehinti
05/31/2022, 8:09 AMMini
05/31/2022, 1:24 PMVitaliy Zarubin
06/01/2022, 3:32 PMjannis
06/02/2022, 2:12 PMLazyColumn
. It started since Compose 1.2.0-beta02
and is still occurring in 1.2.0-beta03
. It seems similar to this issue: https://issuetracker.google.com/issues/234336057
But instead of a flickering color my item heights are just occupying the whole screen.
Anyone else has this problem?Satyam G
06/02/2022, 2:46 PMComponentActivity
and has abstract method SetComposable
. Each Activity now extend BaseActivity
and overrides SetComposable
which shows Composable screen. InAppUpdates
is integrated in application of type Flexible
for updating application. Once user has downloaded the update, the requirement is to show Snackbar
on Composable screen which can be any screen as user has flexibility to keep using app when update is downloading. How to handle this condition as placing Snackbar
inside each composable is not a good option but it needs to be shown when update is downloaded.
The code for BaseActivity
is
abstract class BaseActivity : ComponentActivity() {
@Inject
lateinit var appUpdate: AppUpdate
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
appUpdate.setUpdateType(AppUpdateTypes.IMMEDIATE)
appUpdate.launchImmediateUpdate(this)
setContent {
MyAppTheme {
SetComposable()
}
}
}
/**
* Set the composable content for the screen
*/
@Composable
abstract fun SetComposable()
}.
The code for other Activities look like
@AndroidEntryPoint
class HomeActivity : BaseActivity() {
private lateinit var navController: NavController
@Composable
override fun SetComposable() {
}
}
How to handle this Use-case ????Daniel Perez
06/02/2022, 4:22 PM{args}
in this case with the dynamic nature of this.
In my case, Composable A has an optional navArg that Navigates to Composable B. B navigates to A with an actual navArg instead of the default. It looks like the following:
A(defaultValue) -> B -> A(actualValueFromB)
This can repeat in a circular way too:
...A(actualValueFromB -> B -> A(actualValueFromB)
I'm unsure how to retrieve the exact route from A
in B
. Does anyone have any suggestions?
Edit: I've answered my own question with the following
route = navController.previousBackStackEntry!!.destination.route!!
Iuhas Cezar
06/03/2022, 11:59 AMDestinationsNavHost
instead of a NavHost
and all the examples I've seen are with a NavHost
where you can easily add animations in each composable. The only example I saw with DestinationsNavHost
is this.
val navHostEngine = rememberAnimatedNavHostEngine(
navHostContentAlignment = Alignment.TopCenter,
rootDefaultAnimations = RootNavGraphDefaultAnimations.ACCOMPANIST_FADING, //default `rootDefaultAnimations` means no animations
defaultAnimationsForNestedNavGraph = mapOf(
NavGraphs.settings to NestedNavGraphDefaultAnimations(
enterTransition = { fadeIn(animationSpec = tween(2000)) },
exitTransition = { fadeOut(animationSpec = tween(2000)) }
),
NavGraphs.otherNestedGraph to NestedNavGraphDefaultAnimations.ACCOMPANIST_FADING
) // all other nav graphs not specified in this map, will get their animations from the `rootDefaultAnimations` above.
)
But I'm a bit confused. I'm guessing NavGraphs.settings
and NavGraphs.otherNestedGraph
are the NestedGraphs that will have the animation applied to them. That's exactly what I wanna do. I have a NestedGraph that I wanna apply those animations to but it can't find it when I'm calling it there. What am I doing wrong?Heikki Rauhala
06/03/2022, 2:02 PMrememberImagePainter
and they're just embedded deep within the Composition, with nothing referring them.jim
06/04/2022, 4:32 PMmyanmarking
06/07/2022, 11:01 AMmattinger
06/07/2022, 1:20 PMbharath
06/07/2022, 5:39 PMNabeel
06/07/2022, 6:14 PMRayeW47
06/08/2022, 9:44 AMMehdi Haghgoo
06/09/2022, 9:05 AMjasu
06/10/2022, 6:46 AM<img>
tag which is not loading, any idea why?Paul Woitaschek
06/10/2022, 9:07 AMsuppressKotlinVersionCompatibilityCheck
?Lukasz Kalnik
06/13/2022, 8:36 AMColumn
containing an inner Column
with elevated `Card`s. However the shadows under the `Card`s get clipped when the external Column
sets the padding. Can I turn the content clipping off?Matti MK
06/13/2022, 12:42 PM<http://android.app|android.app>
with Compose. My question is: should there be some specific considerations to use it because it’s not a compose component?
Currently, I’m doing something like so:
val context = LocalContext.current
Button(onClick = {
TimePickerDialog(
context,
R.style.themeOnverlay_timePicker,
{ _, selectedHour: Int, selectedMinute: Int ->
// some action
}, 11, 11, true
).show()
}) {
Text("Click to open picker")
}
andrew
06/14/2022, 2:04 AMKshitij Patil
06/15/2022, 7:23 AMHorizontalPager
(accompanist). Notice at the end of video I performed the swipe gesture but that didn’t register. This happens 1/4 times. I’m using compose 1.2.0-beta03
and this is happening in the release build. With some debugging I realised that the initialVelocity=-0.0f
in the flingBehaviour
whenever snap to next page failsTolriq
06/15/2022, 4:24 PM