pull/18/head
GKF 6 years ago
parent 76f5afb11c
commit d69880138e
  1. 1
      app/.gitignore
  2. 3
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt
  3. 5
      app/src/main/java/io/legado/app/ui/main/MainModel.kt
  4. 9
      app/src/main/java/io/legado/app/ui/main/MainViewModel.kt

1
app/.gitignore vendored

@ -1 +1,2 @@
/build
/schemas

@ -7,6 +7,7 @@ import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.GravityCompat
import androidx.drawerlayout.widget.DrawerLayout
import androidx.lifecycle.ViewModelProviders
import com.google.android.material.navigation.NavigationView
import io.legado.app.R
import io.legado.app.utils.longSnackbar
@ -19,7 +20,6 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
setSupportActionBar(toolbar)
fab.setOnClickListener { it.longSnackbar(R.string.app_name) }
@ -33,6 +33,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
toggle.syncState()
nav_view.setNavigationItemSelectedListener(this)
val mainViewModel = ViewModelProviders.of(this).get(MainViewModel::class.java)
}
override fun onBackPressed() {

@ -0,0 +1,5 @@
package io.legado.app.ui.main
class MainModel {
}

@ -0,0 +1,9 @@
package io.legado.app.ui.main
import android.app.Application
import androidx.lifecycle.AndroidViewModel
class MainViewModel(application: Application) : AndroidViewModel(application) {
}
Loading…
Cancel
Save