From 53424f69a0285c86f3f08342d3d93713c203dc25 Mon Sep 17 00:00:00 2001 From: atbest Date: Wed, 22 May 2019 06:08:32 -0400 Subject: [PATCH] Use anko extensions --- app/src/main/java/io/legado/app/ui/main/MainActivity.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index 5e1b735d6..18d6c561a 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -8,8 +8,8 @@ import androidx.appcompat.app.AppCompatActivity import androidx.core.view.GravityCompat import androidx.drawerlayout.widget.DrawerLayout import com.google.android.material.navigation.NavigationView -import com.google.android.material.snackbar.Snackbar import io.legado.app.R +import io.legado.app.utils.longSnackbar import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.app_bar_main.* @@ -22,10 +22,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte setSupportActionBar(toolbar) - fab.setOnClickListener { view -> - Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) - .setAction("Action", null).show() - } + fab.setOnClickListener { it.longSnackbar(R.string.action) } val toggle = ActionBarDrawerToggle( this, drawer_layout, toolbar,