mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-06-05 21:59:19 +02:00
show a More apps from us menu button at the top menu
This commit is contained in:
@ -43,6 +43,7 @@ class MainActivity : SimpleActivity() {
|
||||
setContentView(R.layout.activity_main)
|
||||
appLaunched(BuildConfig.APPLICATION_ID)
|
||||
setupOptionsMenu()
|
||||
refreshMenuItems()
|
||||
|
||||
mBus = EventBus.getDefault()
|
||||
changeIconColor(getContrastColor(), stroboscope_btn)
|
||||
@ -129,6 +130,7 @@ class MainActivity : SimpleActivity() {
|
||||
private fun setupOptionsMenu() {
|
||||
main_toolbar.setOnMenuItemClickListener { menuItem ->
|
||||
when (menuItem.itemId) {
|
||||
R.id.more_apps_from_us -> launchMoreAppsFromUsIntent()
|
||||
R.id.settings -> launchSettings()
|
||||
R.id.about -> launchAbout()
|
||||
else -> return@setOnMenuItemClickListener false
|
||||
@ -137,6 +139,12 @@ class MainActivity : SimpleActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun refreshMenuItems() {
|
||||
main_toolbar.menu.apply {
|
||||
findItem(R.id.more_apps_from_us).isVisible = !resources.getBoolean(R.bool.hide_google_relations)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
outState.putBoolean(FLASHLIGHT_STATE, mIsFlashlightOn)
|
||||
outState.putBoolean(STROBOSCOPE_STATE, stroboscope_bar.isVisible())
|
||||
|
Reference in New Issue
Block a user