spierce7
11/11/2020, 11:17 PMColumn(
Modifier
.weight(1f)
.fillMaxSize()
.background(
VerticalGradient(
colors = listOf(
Color(125, 206, 250),
Color(82, 88, 245),
),
startY = 0f,
endY = 100f
)
)
) {
SecondarySection()
}
nitrog42
11/11/2020, 11:51 PMBradleycorn
11/12/2020, 12:09 AMCoilImage
composable from the Accompanist library that @cb put together? I’m wondering what’s the best way to use a placeholder image resource when my composable is displayed via a @Preview
? During preview the image state is Empty
, so I thought about using the content composable and setting a placeholder image when image state is empty. That works. But, the placeholder image is also displayed briefly (before the actual image is loaded) when the app is run on a device, and I don’t want that.redrield
11/12/2020, 12:46 AMDenis Sakhapov
11/12/2020, 3:22 AMandroidx.compose.runtime.stateFor
has been removed in alpha07
. What is the replacement for that?Sam
11/12/2020, 5:33 AMWindowInsetsAnimation
within a Jetpack Compose project? This allows fine grain control and coordination of the keyboard animation (as described in this article). Most examples I've seen utilize setWindowInsetsAnimationCallback
(like in this sample code) but I'm not sure how this would work in Compose?Daniel
11/12/2020, 8:41 AMe: java.lang.NoSuchMethodError: 'org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl org.jetbrains.kotlin.parcelize.ParcelizeResolveExtension$Companion$createMethod$functionDescriptor$1.initialize(org.jetbrains.kotlin.descriptors.ReceiverParameterDescriptor, org.jetbrains.kotlin.descriptors.ReceiverParameterDescriptor, java.util.List, java.util.List, org.jetbrains.kotlin.types.KotlinType, org.jetbrains.kotlin.descriptors.Modality, org.jetbrains.kotlin.descriptors.DescriptorVisibility)'
Rafs
11/12/2020, 9:38 AMBitmap
Just like what we do with View.drawToBitmap()
Dieter Holz
11/12/2020, 9:58 AMprivate val soundPlayer by lazy { MediaPlayer.create(context, R.raw.transporter) }
soundPlayer.start()
R.raw.transporter is a mp3-File
Any hints?Vivek Sharma
11/12/2020, 11:44 AMimplementation "androidx.navigation:navigation-compose:1.0.0-alpha01"
and I didnt write any code in main activity except the code which is generated at build of new project and app didnt run
Logcat showing :
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/compose/foundation/Background;
at androidx.compose.foundation.BackgroundKt.background-1xq40Q0(Background.kt:44)
at androidx.compose.material.SurfaceKt.Surface-biUpMIw(Surface.kt:101)
Grigorii Yurkov
11/12/2020, 12:48 PMColor
has 3 properties named red
green
blue
if Color
can store non-RGB colors, for instance HSV. Isn't it confusing?Daniele B
11/12/2020, 1:54 PMGifgroen
11/12/2020, 3:17 PMunresolv3d reference: InspectableParameter
Bryan Herbst
11/12/2020, 5:10 PMandroidx.compose.material
named as though they are the the canonical implementation, when the messaging so far is that Material is an implementation of a specific design system?
Text
is a great example- it’s name alone ensures that it will be the first text Composable that most engineers reach for, but that presents two problems in my mind:
• Today, any project with its own design system has the burden of ensuring its engineers use their design system’s text instead of the innocent and generic sounding Text
• When a new Android-default design system inevitably comes along in the future, we have a similar problem- does the new design system create a HoloText
, create its own Composable named Text
, or does Material rename Text
to something else?
Contrast that with the Material Components library with View
s, which explicitly labels the material-themed components e.g. MaterialRadioButton
. There are some tricks under the hood to swap them in for framework components in some cases, but they still get a clear name in the library.David Attias
11/12/2020, 5:31 PMD/InputMethodManager: showSoftInput - cancel : mServedView != view : DecorView@c9ce8f2[MainActivity] view : androidx.compose.ui.platform.AndroidComposeView{800f9 VFED..... ........ 0,0-1080,2181}
grandstaish
11/12/2020, 5:38 PMTextField
composable? https://material.io/components/text-fields#anatomy. I realise we can just add text manually underneath the TextField
component, but if it were built-in then you’d get the right text style, color, and positioning for free.Zach Klippenstein (he/him) [MOD]
11/12/2020, 6:29 PMSlackbot
11/12/2020, 7:33 PMKirill Grouchnikov
11/12/2020, 9:58 PMSam
11/12/2020, 11:01 PMval countries by remember { listOf(Locale.getISOCountries().map { Locale("", it) }) }
with exception: Type 'TypeVariable(T)' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
Ian Sikes
11/12/2020, 11:09 PMuseEffect
. For example:
val (session, setSession) = remember(sessionId) {
mutableStateOf(Session(sessionId))
}
When the sessionId
changes, a new Session
is created. But I need to call session.close()
beforehand. I can probably think of some hacky way to handle this but I'm trying to figure out what the "correct" Compose way isArkadii Ivanov
11/13/2020, 12:01 AM@Composable
fun foo1(dependency: () -> Dependency) {
val x = remember { Bar(dependency()) }
}
@Composable
fun foo2(dependency: Dependency) {
val x = remember { Bar(dependency) }
}
zoha131
11/13/2020, 12:26 AMfkrauthan
11/13/2020, 1:04 AMMehdi Haghgoo
11/13/2020, 4:55 AMKshitij Patil
11/13/2020, 5:25 AMbharat to
11/13/2020, 7:43 AMModifier.clickable()
? for every *Button
this behavior is common. I couldn't find any online resources to do this in compose.Ashwani Singh
11/13/2020, 9:14 AMprivate fun subscribeObservers() {
homePageViewModel.viewState.observe(this) { viewState ->
if (viewState != null) {
viewState.pageUILayoutList?.let { pageUILayoutList ->
printLogD("HomePageFragment | pageUILayoutList", pageUILayoutList.toString())
}
viewState.allModulesForPage?.let { allModulesContent ->
printLogD("HomePageFragment | allContents", "" + allModulesContent.toString())
}
}
}
}
I used below code, but its not work
val homePageViewModel = (ContextAmbient.current as DashboardActivity).homePageViewModel
onActive {
homePageViewModel.setStateEvent(
HomePageStateEvent.GetPageModuleEvent()
)
homePageViewModel.setStateEvent(
HomePageStateEvent.GetContentEvent()
)
}
val viewState: HomePageViewState by homePageViewModel.viewState.observeAsState(
HomePageViewState()
)
var pageUIMap: HashMap<String, String>? = null
if (viewState.pageUILayoutList != null) {
// But not getting any call here
}
Vivek Sharma
11/13/2020, 10:30 AMProfile Composable
and other is FriendList Composable
, using as eg.
and below as onClick code
onClick = {
// This is the equivalent to popUpTo the start destination
navController.popBackStack(navController.graph.startDestination, false)
if (currentRoute != screen.route) {
navController.navigate(screen.route)
}
}
)
Lets say
So startDestination is Profile
, then we clicked on FriendList
bottom nav item, and then we clicked Profile, then FriendList
When I press back, I never go back to FriendList, though I have visited it twice
How does popBackStack works here, popping till Profile and not including ProfileAnimesh Sahu
11/13/2020, 11:04 AM