Mikołaj Kąkol
06/09/2020, 9:56 AMMikael Alfredsson
06/09/2020, 2:52 PMmanueldidonna
06/09/2020, 3:40 PMlaunch
a coroutine, delay
it and then mutate the state. How can I correctly handle the lifecycle of the composition?jim
06/09/2020, 4:55 PMKlaas Kabini
06/09/2020, 6:34 PMallan.conda
06/09/2020, 11:38 PMSiyamed
06/10/2020, 2:50 AMVal Salamakha
06/10/2020, 3:17 AMpavi2410
06/10/2020, 2:52 PMpavi2410
06/10/2020, 2:54 PMApex
06/10/2020, 6:50 PMhttps://youtu.be/2Nn4ahU-4tE▾
John O'Reilly
06/10/2020, 7:02 PMDiego Marulanda
06/10/2020, 8:12 PM@Composable
fun Residencelist(){
coreApiService.get("${BASE_URL}list/") { response: String ->
val response = Gson().fromJson(response, ResponseResidences::class.java)
MaterialTheme {
Column(Modifier.padding(bottom = 1.dp).fillMaxWidth()) {
VerticalScroller() {
Column(Modifier.padding(3.dp).fillMaxWidth()) {
response.residences!!.forEach {
if (it != null) {
newCarrouselCard(it.name!!,
it.mainImage!!,
it.additionalInformation!!.images,
it.residenceDescription!!,
"${it.price} ${it.currency}")
Divider(height = 10.dp)
} else newCard("Residences not found")
}
}
}
}
}
}
}
and when I try to compile, get this error: Functions which invoke @Composable functions must be marked with the @Composable annotation
in the val
line, but I don't understand why? because I call other normal functions from Glide library and it works,Vinay Gaba
06/10/2020, 8:53 PMGuy Bieber
06/10/2020, 10:51 PMromainguy
06/11/2020, 1:45 AMmanueldidonna
06/11/2020, 10:52 AMkrtko
06/11/2020, 6:28 PMDaniele B
06/11/2020, 7:56 PMHanzhen
06/11/2020, 8:33 PMmanueldidonna
06/11/2020, 10:57 PMcodeslubber
06/12/2020, 3:50 AMKazemihabib1996
06/12/2020, 8:22 AMreturn the amount of the [dragDistance] that has been consumed.
? I'm trying to understand the below sentence
consume all delta no matter the bounds to avoid nested dragging (as example)
https://android.googlesource.com/platform/frameworks/support/+/androidx-master-dev/ui/ui-foundation/samples/src/main/java/androidx/ui/foundation/samples/DraggableSamples.kt#100manueldidonna
06/12/2020, 2:15 PMAdapterList
. The composable receives a read-only List
, each item has a proper equals method. If an item must change, the composable is invoked with a new list.
var items by state { emptyList<Item>() }
AdapterList(items) { item ->
ItemUI(item, onClick = { items = /** new read-only List with only one item changed**/ })
}
Should I replace the MutableState
with a ModelList
?Hanzhen
06/12/2020, 2:59 PMDiego Marulanda
06/12/2020, 4:58 PMe: java.lang.AbstractMethodError: androidx.compose.plugins.kotlin.ComposeIrGenerationExtension.generate(Lorg/jetbrains/kotlin/ir/declarations/IrModuleFragment;Lorg/jetbrains/kotlin/backend/common/extensions/IrPluginContext;)V
Execution failed for task ':app:compileDebugKotlin'.
> Internal compiler error. See log for more details
w: C:\Users\quind\.gradle\caches\transforms-2\files-2.1\beeb88e94e944fd412bff1cbd6499676\jetified-kotlin-stdlib-jdk7-1.3.72.jar: Runtime JAR file has version 1.3 which is older than required for API version 1.4
I get that when try to run my project, I went back to a previous commit where it was working fine and keeps throwing me the same errorVinay Gaba
06/12/2020, 5:11 PMromainguy
06/12/2020, 8:08 PMgrandstaish
06/12/2020, 8:20 PMcollectAsState
but it is resulting in an infinite composition loop. When I call collectAsState
it seems to just get the latest state and then trigger a recomposition, and then repeats that loop forever. Does anyone know what I am missing? I’m new to both technologies so it’s probably something really obvious!Merhawifissehaye
06/12/2020, 8:30 PMsetContent
doesn't seem to be available outside of an Activity? I also learned in a comment inside this stackoverflow question that there is a work in progress to add support for Fragments. Are there any updates on that? Or else what options do I have to be able to use compose inside fragments?Merhawifissehaye
06/12/2020, 8:30 PMsetContent
doesn't seem to be available outside of an Activity? I also learned in a comment inside this stackoverflow question that there is a work in progress to add support for Fragments. Are there any updates on that? Or else what options do I have to be able to use compose inside fragments?Zach Klippenstein (he/him) [MOD]
06/12/2020, 8:44 PMFrameLayout
as your content view and then call setContent
on the FrameLayout
.Andrey Kulikov
06/12/2020, 9:05 PMabstract class ComposableFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
) = FrameLayout(requireContext()).apply {
setContent(Recomposer.current()) {
Content()
}
}
@Composable
abstract fun Content()
}
Javier
06/12/2020, 9:23 PMLeland Richardson [G]
06/12/2020, 9:27 PMJavier
06/12/2020, 9:28 PMLeland Richardson [G]
06/12/2020, 9:30 PMJavier
06/12/2020, 10:03 PMMerhawifissehaye
06/13/2020, 10:41 AMcomposeOptions {
kotlinCompilerVersion "1.3.70-dev-withExperimentalGoogleExtensions-20200424"
kotlinCompilerExtensionVersion "0.1.0-dev13"
}
I am on a multi module project, and I have added the option to both build.gradle files.