feat: Add anko

parent b9fd5509
......@@ -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
......
......@@ -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())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment