This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
This file contains hidden or 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.util.stickyheader | |
import android.content.Context | |
import android.graphics.PointF | |
import android.os.Parcel | |
import android.os.Parcelable | |
import android.view.View | |
import android.view.ViewGroup | |
import android.view.ViewTreeObserver | |
import androidx.recyclerview.widget.LinearLayoutManager |
This file contains hidden or 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.compose.layout | |
import androidx.compose.runtime.Composable | |
import androidx.compose.ui.Alignment | |
import androidx.compose.ui.Layout | |
import androidx.compose.ui.Modifier | |
@Composable | |
fun FlowLayout( | |
modifier: Modifier = Modifier, |
This file contains hidden or 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.bifff.coil | |
import android.view.View | |
import androidx.core.view.ViewCompat | |
import androidx.core.view.isVisible | |
import coil.annotation.ExperimentalCoilApi | |
import coil.decode.DataSource | |
import coil.drawable.CrossfadeDrawable | |
import coil.request.ErrorResult | |
import coil.request.RequestResult |
This file contains hidden or 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
import android.os.Bundle | |
import androidx.core.os.bundleOf | |
import androidx.fragment.app.Fragment | |
import androidx.fragment.app.FragmentManager | |
import androidx.fragment.app.FragmentResultListener | |
import androidx.lifecycle.LifecycleOwner | |
interface FragmentResultContract<T> { | |
fun toBundle(result: T): Bundle |
This file contains hidden or 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.samples.utils | |
import android.view.MotionEvent | |
import androidx.recyclerview.widget.RecyclerView | |
import androidx.recyclerview.widget.RecyclerView.OnItemTouchListener | |
import kotlin.math.abs | |
fun RecyclerView.enforceSingleScrollDirection() { | |
val enforcer = SingleScrollDirectionEnforcer() | |
addOnItemTouchListener(enforcer) |
This file contains hidden or 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.samples.utils; | |
import android.view.MotionEvent; | |
import androidx.annotation.NonNull; | |
import androidx.recyclerview.widget.RecyclerView; | |
import androidx.viewpager2.widget.ViewPager2; | |
public class RecyclerViewUtils { |