Skip to content

Instantly share code, notes, and snippets.

View thomaskioko's full-sized avatar
👨‍💻
Writing Code

Thomas Kioko thomaskioko

👨‍💻
Writing Code
View GitHub Profile
dependencies {
implementation(libs.androidx.appCompat)
implementation(libs.androidx.coreKtx)
...
}
enableFeaturePreview("VERSION_CATALOGS")
include(":app")
enableFeaturePreview("VERSION_CATALOGS")
dependencyResolutionManagement {
@Suppress("UnstableApiUsage")
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
@thomaskioko
thomaskioko / libs.versions.toml
Last active May 17, 2021 16:04
Version catalog example
[versions]
gradle = "7.0.1"
kotlin = "1.4.32"
appCompat = "1.3.0-rc01"
coreKtx = "1.6.0-alpha02"
constraintLayout = "2.1.0-beta01"
[libraries]
androidx-appCompat = { module = "androidx.appcompat:appcompat", version.ref = "appCompat" }
dependencies {
implementation(Dependencies.AndroidX.appCompat)
implementation(Dependencies.AndroidX.coreKtx)
implementation(Dependencies.AndroidX.constraintLayout)
}
object Dependencies {
const val timber = "com.jakewharton.timber:timber:${DependencyVersions.timber}"
object AndroidX {
const val appCompat = "androidx.appcompat:appcompat:${DependencyVersions.appCompat}"
const val coreKtx = "androidx.core:core-ktx:${DependencyVersions.coreKtx}"
const val constraintLayout = "androidx.constraintlayout:constraintlayout:${DependencyVersions.constraintLayout}"
}
}
<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<Transition
app:constraintSetEnd="@id/collapsed"
app:constraintSetStart="@id/expanded">
<OnSwipe
app:dragDirection="dragUp"
app:touchAnchorId="@id/recycler_view_tweets"
app:touchAnchorSide="top" />
<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<Transition
app:constraintSetEnd="@id/collapsed"
app:constraintSetStart="@id/expanded">
<OnSwipe
app:dragDirection="dragUp"
<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<Transition
app:constraintSetEnd="@id/collapsed"
app:constraintSetStart="@id/expanded">
<OnSwipe
app:dragDirection="dragUp"
<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<Transition
app:constraintSetEnd="@id/collapsed"
app:constraintSetStart="@id/expanded">
<OnSwipe
app:dragDirection="dragUp"