This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package be.digitalia.common.flow | |
import androidx.datastore.core.DataStore | |
import kotlinx.coroutines.CancellationException | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.Deferred | |
import kotlinx.coroutines.ExperimentalCoroutinesApi | |
import kotlinx.coroutines.async | |
import kotlinx.coroutines.flow.Flow | |
import kotlinx.coroutines.flow.MutableStateFlow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun MaterialClickableText( | |
text: AnnotatedString, | |
modifier: Modifier = Modifier, | |
color: Color = Color.Unspecified, | |
fontSize: TextUnit = TextUnit.Unspecified, | |
fontStyle: FontStyle? = null, | |
fontWeight: FontWeight? = null, | |
fontFamily: FontFamily? = null, | |
letterSpacing: TextUnit = TextUnit.Unspecified, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun patchDesugarConfig(config: Property<String>) { | |
val defaultConfig = config as org.gradle.api.internal.provider.DefaultProperty<String> | |
val patchedDesugarConfig = defaultConfig.provider.map { | |
it.replace( | |
"\"support_all_callbacks_from_library\":true", | |
"\"support_all_callbacks_from_library\":false" | |
) | |
} | |
config.set(patchedDesugarConfig) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package be.digitalia.common.ui | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.fillMaxWidth | |
import androidx.compose.foundation.layout.padding | |
import androidx.compose.foundation.rememberScrollState | |
import androidx.compose.foundation.verticalScroll | |
import androidx.compose.material.ContentAlpha | |
import androidx.compose.material.LocalContentAlpha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package be.digitalia.common.fragment | |
import android.view.View | |
import androidx.fragment.app.Fragment | |
import androidx.lifecycle.Lifecycle | |
import androidx.lifecycle.LifecycleEventObserver | |
import androidx.lifecycle.LifecycleOwner | |
/** | |
* A lazy property that gets cleaned up when the fragment's view is destroyed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package be.digitalia.flow | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.ExperimentalCoroutinesApi | |
import kotlinx.coroutines.Job | |
import kotlinx.coroutines.channels.BufferOverflow | |
import kotlinx.coroutines.flow.Flow | |
import kotlinx.coroutines.flow.FlowCollector | |
import kotlinx.coroutines.flow.MutableSharedFlow | |
import kotlinx.coroutines.flow.MutableStateFlow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static def patchDesugarConfig(Property<String> config) { | |
def patchedDesugarConfig = config.getProvider().map { | |
it.replace( | |
"\"support_all_callbacks_from_library\":true", | |
"\"support_all_callbacks_from_library\":false" | |
) | |
} | |
config.set(patchedDesugarConfig) | |
} | |
afterEvaluate { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package androidx.lifecycle | |
import be.digitalia.utils.CompositeLifecycleOwner | |
private const val VIEW_LIFECYCLE_KEY = "androidx.lifecycle.VIEW_LIFECYCLE" | |
val ViewModel.lifecycleOwner: CompositeLifecycleOwner | |
get() { | |
return getTag(VIEW_LIFECYCLE_KEY) | |
?: setTagIfAbsent(VIEW_LIFECYCLE_KEY, CompositeLifecycleOwner()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package be.digitalia.utils | |
import android.os.Handler | |
import android.os.Looper | |
import androidx.lifecycle.Lifecycle | |
import androidx.lifecycle.LifecycleEventObserver | |
import androidx.lifecycle.LifecycleObserver | |
import androidx.lifecycle.LifecycleOwner | |
import androidx.lifecycle.LifecycleRegistry | |
import java.io.Closeable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add the following to your Android app module build.gradle file, after the android section: | |
// Replace "proguard.txt" with the actual name of the proguard rules file in the library aar, if different | |
afterEvaluate { | |
// Update configuration of the minify tasks to exclude specific consumer Proguard rules files | |
tasks.findAll { task -> task.name.startsWith('minify') }.each { task -> | |
task.configure { | |
configurationFiles.from.collect().each { fileCollection -> | |
if (fileCollection instanceof FileCollection) { | |
configurationFiles.from.remove fileCollection |
NewerOlder