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,