This is a small Gradle DSL that can be used to include multiple modules. Let's imagine that we have a set up like this:
root
+-- app
+-- modules
+-- core
+-- androidx
| #!/bin/bash | |
| # some helper vars | |
| # https://unix.stackexchange.com/a/10065/138249 | |
| if test -t 1; then | |
| ncolors=$(tput colors) | |
| if test -n "$ncolors" && test $ncolors -ge 8; then | |
| bold=$(tput bold) | |
| normal=$(tput sgr0) | |
| success=$(tput setaf 2) |
| private val rotation = FloatPropKey() | |
| private fun createDefinition(duration: Int) = transitionDefinition { | |
| state(0) { this[rotation] = 0f } | |
| state(1) { this[rotation] = 360f } | |
| transition { | |
| rotation using repeatable { | |
| animation = tween { | |
| easing = LinearEasing |
| import androidx.animation.PhysicsBuilder | |
| import androidx.animation.Spring.DampingRatioHighBouncy | |
| import androidx.animation.Spring.StiffnessLow | |
| import androidx.compose.Composable | |
| import androidx.compose.Model | |
| import androidx.compose.remember | |
| import androidx.ui.animation.animate | |
| import androidx.ui.core.DrawClipToBounds | |
| import androidx.ui.core.Text | |
| import androidx.ui.core.drawLayer |
Hello guys, I've raised into that problem for a days, but i think I've found one solution, maybe this isn't the better way to do that, but... I will share it. (This is inspired in the Firebase multiplatform repo -> https://github.com/RubyLichtenstein/Kotlin-Multiplatform-Firebase, I'm just summarizing that)
If you want to call some code from a DataSource or Repository from your common code, and the libraries you're using use callbacks,
you need to wrap them and there are some problems:
Let me explain it with an example:
expect class RemoteDataSource() {| import android.annotation.TargetApi | |
| import android.os.Build.VERSION_CODES | |
| import android.view.View | |
| import android.view.Window | |
| object WindowSpy { | |
| /** | |
| * Installs a listener for new [Window] instances. This should only be called once, any new call | |
| * will uninstall the previous listener. |
| package se.hellsoft.markdowncomposer | |
| import android.util.Log | |
| import androidx.compose.foundation.Box | |
| import androidx.compose.foundation.ContentGravity | |
| import androidx.compose.foundation.Text | |
| import androidx.compose.foundation.layout.fillMaxWidth | |
| import androidx.compose.foundation.text.InlineTextContent | |
| import androidx.compose.foundation.text.appendInlineContent | |
| import androidx.compose.material.Colors |
| package com.alexjlockwood.wavesquare | |
| import android.os.Bundle | |
| import androidx.appcompat.app.AppCompatActivity | |
| import androidx.compose.animation.animatedFloat | |
| import androidx.compose.animation.core.AnimationConstants | |
| import androidx.compose.animation.core.LinearEasing | |
| import androidx.compose.animation.core.repeatable | |
| import androidx.compose.animation.core.tween | |
| import androidx.compose.foundation.Canvas |
| import androidx.compose.animation.* | |
| import androidx.compose.animation.core.tween | |
| import androidx.compose.material.* | |
| import androidx.compose.runtime.Composable | |
| import androidx.compose.runtime.onCommit | |
| import androidx.compose.ui.Modifier | |
| @OptIn(ExperimentalAnimationApi::class, ExperimentalMaterialApi::class) | |
| @Composable | |
| fun <T> AnimatedSwipeDismiss( |