diff --git a/app/build.gradle b/app/build.gradle index 00c2358..d11ae8e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -42,6 +42,7 @@ android { ext { roomVersion = '1.1.1' archLifecycleVersion = '1.1.1' + ankoVersion = '0.10.8' } dependencies { @@ -73,7 +74,12 @@ dependencies { // Paging implementation "androidx.paging:paging-runtime:2.1.0" + // KTX implementation 'androidx.core:core-ktx:1.1.0-alpha04' + + // Anko + implementation "org.jetbrains.anko:anko-commons:$ankoVersion" + implementation "org.jetbrains.anko:anko-design:$ankoVersion" // For SnackBars // endregion // region Tests diff --git a/app/src/main/java/fr/plnech/lifelogger/ui/HomeActivity.kt b/app/src/main/java/fr/plnech/lifelogger/ui/HomeActivity.kt index f88dee4..a153221 100644 --- a/app/src/main/java/fr/plnech/lifelogger/ui/HomeActivity.kt +++ b/app/src/main/java/fr/plnech/lifelogger/ui/HomeActivity.kt @@ -18,7 +18,6 @@ package fr.plnech.lifelogger.ui import android.os.Bundle -import com.google.android.material.snackbar.Snackbar import androidx.appcompat.app.AppCompatActivity import android.view.Menu import android.view.MenuItem @@ -28,6 +27,7 @@ import fr.plnech.lifelogger.model.Log import fr.plnech.lifelogger.model.LogAdapter import kotlinx.android.synthetic.main.activity_home.* import kotlinx.android.synthetic.main.content_home.* +import org.jetbrains.anko.design.snackbar class HomeActivity : AppCompatActivity() { @@ -40,8 +40,7 @@ class HomeActivity : AppCompatActivity() { setSupportActionBar(toolbar) fab.setOnClickListener { view -> - Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) - .setAction("Action", null).show() + view.snackbar("Replace with your own action", "Action") {} } adapter = LogAdapter(this, generateDebugData())