Mohammad Jahidul Islam
08/13/2021, 4:48 AMDeepak Gahlot
08/13/2021, 7:05 AMJeff
08/13/2021, 9:29 AMjava.lang.ClassCastException: androidx.fragment.app.FragmentViewLifecycleOwner cannot be cast to androidx.activity.ComponentActivity
I'm using setContent with the latest activity-compose
dimsuz
08/13/2021, 10:31 AMBox {
Image(contentScale = FillBounds, painter = painterResource(R.drawable.myPng))
Content() // can by of various height depending on the children
}
How do I make the image fill the same height as Content()
. Currently Image
gets only as big as its resource, ignoring FillBounds flagKarim Hassan
08/13/2021, 10:34 AMKViewModel.kt
var errorState by mutableState<Error>(Error(""))
private set
var successState by mutableState<Success>(Success(""))
private set
fetchData(){
viewModelScope.launch {
when(val result = repo.fetchData){
Result.success -> successState = result.data
Result.error -> errorState = result.error
}
}
}
in Screen.kt
@Composable
fun Screen(viewModel : KViewModel ) {
ShowData(viewModel.successState)
ShowError(viewModel.errorState)
}
dan.the.man
08/13/2021, 3:43 PMLazyColumn(
modifier = Modifier.fillMaxSize(),
) {
// My Books section
item {
Column(modifier = Modifier.fillMaxWidth()) {
Text("My Books")
LazyRow {
items(books) { item ->
// Each Item
}
}
}
}
// Whishlisted Books title
item {
Text("Whishlisted Books", style = MaterialTheme.typography.h4)
}
// Turning the list in a list of lists of two elements each
items(wishlisted.windowed(2, 2, true)) { item ->
Row {
// Draw item[0]
// Draw item[1]
}
}
}
to a SO question, but what is the point of multiple item{}
blocks instead of just having it all in one?theapache64
08/13/2021, 4:47 PMArtem
08/13/2021, 6:59 PMBottomSheetDialogFragment
and inside that ComposeView
there are verticalScroll()
and scroll works properly only when it reaches BottomSheetDialogFragment
scroll constraints.Alexander Black
08/13/2021, 9:19 PMdan.the.man
08/13/2021, 9:41 PMonViewAttachedToWindow
or something I could use to track when something is drawn on screen for impression tracking/user tracking analytics?Florian
08/13/2021, 11:17 PMScott Kruse
08/13/2021, 11:29 PMBerkeli Alashov
08/14/2021, 3:59 AMAdib Faramarzi
08/14/2021, 6:39 AMcontentColor
not working on SnackBar
? It seems to totally ignore it. Even when providing LocalContentColor
.Rafiul Islam
08/14/2021, 8:37 AMCompositionLocalProvider {
LocalLayoutDirection provides LayoutDirection.Rtl
Scaffold(
drawerContent = {}
)
}
Rafiul Islam
08/14/2021, 8:55 AMLuis Daivid
08/14/2021, 10:50 AMShakil Karim
08/14/2021, 11:09 AMtry catch
in Composable function? Code in 🧵Pawel
08/14/2021, 11:42 AMFlorian
08/14/2021, 3:58 PMbatuhan ardor
08/14/2021, 4:58 PMAshu
08/14/2021, 9:09 PMcreateVerticalChain(
toolbar, text1, text2,
chainStyle = ChainStyle.Packed
)
Now it works all fine but the issue is I don't know how to set margins in this scenario. How do I set top and bottom margin to text1?
Also, text1 has following constraints
constrain(text1) {
height = Dimension.preferredWrapContent
width = Dimension.preferredWrapContent
}
What I am trying to do here is to set text1 height as wrap content but not bigger than the layout. But if the text is large then the whole text is shown. How do I keep it as wrap content and fill constraint layout but not increase size of constraint layout and ellipsize the remaining text?Colton Idle
08/15/2021, 1:16 AMAnton Dmytryshyn
08/15/2021, 2:28 AMcarbaj0
08/15/2021, 4:37 AMCustomBasicTextField
(request focus?) 🧵Colton Idle
08/15/2021, 4:46 AManimateContentSize()
to the box, but it causes the entire screen to (seemingly) animate upwards. How can I make this Box screen with a bottom button smoother when it's parent expands vertically (i.e. bottomNavigation hides). Thanks!Ashu
08/15/2021, 7:54 AMPHondogo
08/15/2021, 9:15 AMFlorian
08/15/2021, 10:38 AMverticalArrangement
.Florian
08/15/2021, 12:27 PMmaxLines = 1
placed in a Row. Is there an easy way to let the first Text not push the 2nd one out of the screen if it becomes too big?
I could use weight
but that won't work well with different languages and string lengths. I'm looking for something like `RelativeLayout`'s endBefore
.Florian
08/15/2021, 12:27 PMmaxLines = 1
placed in a Row. Is there an easy way to let the first Text not push the 2nd one out of the screen if it becomes too big?
I could use weight
but that won't work well with different languages and string lengths. I'm looking for something like `RelativeLayout`'s endBefore
.ursus
08/15/2021, 1:24 PMFlorian
08/15/2021, 2:39 PMErlan Amanatov
08/15/2021, 2:50 PMursus
08/15/2021, 3:17 PMFlorian
08/15/2021, 4:47 PM