updating commons + code cleanup

This commit is contained in:
tibbi
2022-07-17 21:42:53 +02:00
parent 459f9ecfec
commit ebfdbb30c3
2 changed files with 10 additions and 27 deletions

View File

@ -63,7 +63,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:b4ea9f1e0d' implementation 'com.github.SimpleMobileTools:Simple-Commons:8ee6c0c17b'
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
} }

View File

@ -34,10 +34,10 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main) setContentView(R.layout.activity_main)
appLaunched(BuildConfig.APPLICATION_ID)
setupOptionsMenu() setupOptionsMenu()
refreshMenuItems() refreshMenuItems()
appLaunched(BuildConfig.APPLICATION_ID)
setupEmptyView() setupEmptyView()
setupLaunchers() setupLaunchers()
checkWhatsNewDialog() checkWhatsNewDialog()
@ -90,32 +90,15 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
private fun setupOptionsMenu() { private fun setupOptionsMenu() {
main_toolbar.setOnMenuItemClickListener { menuItem -> main_toolbar.setOnMenuItemClickListener { menuItem ->
when (menuItem.itemId) { when (menuItem.itemId) {
R.id.sort -> { R.id.sort -> showSortingDialog()
showSortingDialog() R.id.toggle_app_name -> toggleAppName()
true R.id.increase_column_count -> increaseColumnCount()
} R.id.reduce_column_count -> reduceColumnCount()
R.id.toggle_app_name -> { R.id.settings -> launchSettings()
toggleAppName() R.id.about -> launchAbout()
true else -> return@setOnMenuItemClickListener false
}
R.id.increase_column_count -> {
increaseColumnCount()
true
}
R.id.reduce_column_count -> {
reduceColumnCount()
true
}
R.id.settings -> {
launchSettings()
true
}
R.id.about -> {
launchAbout()
true
}
else -> false
} }
return@setOnMenuItemClickListener true
} }
} }