feat: Add anko

parent b9fd5509
...@@ -42,6 +42,7 @@ android { ...@@ -42,6 +42,7 @@ android {
ext { ext {
roomVersion = '1.1.1' roomVersion = '1.1.1'
archLifecycleVersion = '1.1.1' archLifecycleVersion = '1.1.1'
ankoVersion = '0.10.8'
} }
dependencies { dependencies {
...@@ -73,7 +74,12 @@ dependencies { ...@@ -73,7 +74,12 @@ dependencies {
// Paging // Paging
implementation "androidx.paging:paging-runtime:2.1.0" implementation "androidx.paging:paging-runtime:2.1.0"
// KTX
implementation 'androidx.core:core-ktx:1.1.0-alpha04' 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 // endregion
// region Tests // region Tests
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
package fr.plnech.lifelogger.ui package fr.plnech.lifelogger.ui
import android.os.Bundle import android.os.Bundle
import com.google.android.material.snackbar.Snackbar
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
...@@ -28,6 +27,7 @@ import fr.plnech.lifelogger.model.Log ...@@ -28,6 +27,7 @@ import fr.plnech.lifelogger.model.Log
import fr.plnech.lifelogger.model.LogAdapter import fr.plnech.lifelogger.model.LogAdapter
import kotlinx.android.synthetic.main.activity_home.* import kotlinx.android.synthetic.main.activity_home.*
import kotlinx.android.synthetic.main.content_home.* import kotlinx.android.synthetic.main.content_home.*
import org.jetbrains.anko.design.snackbar
class HomeActivity : AppCompatActivity() { class HomeActivity : AppCompatActivity() {
...@@ -40,8 +40,7 @@ class HomeActivity : AppCompatActivity() { ...@@ -40,8 +40,7 @@ class HomeActivity : AppCompatActivity() {
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
fab.setOnClickListener { view -> fab.setOnClickListener { view ->
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) view.snackbar("Replace with your own action", "Action") {}
.setAction("Action", null).show()
} }
adapter = LogAdapter(this, generateDebugData()) 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