renaming some variables

This commit is contained in:
tibbi 2022-07-27 11:51:02 +02:00
parent 0c56a7ea73
commit bfca4a89fd
2 changed files with 21 additions and 21 deletions

View File

@ -64,7 +64,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:f8b1a5a510' implementation 'com.github.SimpleMobileTools:Simple-Commons:becd38a3b7'
implementation 'com.github.tibbi:AndroidPdfViewer:da57ff410e' implementation 'com.github.tibbi:AndroidPdfViewer:da57ff410e'
implementation 'com.github.Stericson:RootTools:df729dcb13' implementation 'com.github.Stericson:RootTools:df729dcb13'
implementation 'com.github.Stericson:RootShell:1.6' implementation 'com.github.Stericson:RootShell:1.6'

View File

@ -58,12 +58,12 @@ class MainActivity : SimpleActivity() {
private var mIsPasswordProtectionPending = false private var mIsPasswordProtectionPending = false
private var mWasProtectionHandled = false private var mWasProtectionHandled = false
private var mTabsToShow = ArrayList<Int>() private var mTabsToShow = ArrayList<Int>()
private var searchMenuItem: MenuItem? = null private var mSearchMenuItem: MenuItem? = null
private var storedFontSize = 0 private var mStoredFontSize = 0
private var storedDateFormat = "" private var mStoredDateFormat = ""
private var storedTimeFormat = "" private var mStoredTimeFormat = ""
private var storedShowTabs = 0 private var mStoredShowTabs = 0
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -103,27 +103,27 @@ class MainActivity : SimpleActivity() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (storedShowTabs != config.showTabs) { if (mStoredShowTabs != config.showTabs) {
config.lastUsedViewPagerPage = 0 config.lastUsedViewPagerPage = 0
System.exit(0) System.exit(0)
return return
} }
setupTabColors() setupTabColors()
setupToolbar(main_toolbar, searchMenuItem = searchMenuItem) setupToolbar(main_toolbar, searchMenuItem = mSearchMenuItem)
refreshMenuItems() refreshMenuItems()
getAllFragments().forEach { getAllFragments().forEach {
it?.onResume(getProperTextColor()) it?.onResume(getProperTextColor())
} }
if (storedFontSize != config.fontSize) { if (mStoredFontSize != config.fontSize) {
getAllFragments().forEach { getAllFragments().forEach {
(it as? ItemOperationsListener)?.setupFontSize() (it as? ItemOperationsListener)?.setupFontSize()
} }
} }
if (storedDateFormat != config.dateFormat || storedTimeFormat != getTimeFormat()) { if (mStoredDateFormat != config.dateFormat || mStoredTimeFormat != getTimeFormat()) {
getAllFragments().forEach { getAllFragments().forEach {
(it as? ItemOperationsListener)?.setupDateTimeFormat() (it as? ItemOperationsListener)?.setupDateTimeFormat()
} }
@ -247,8 +247,8 @@ class MainActivity : SimpleActivity() {
private fun setupSearch(menu: Menu) { private fun setupSearch(menu: Menu) {
val searchManager = getSystemService(Context.SEARCH_SERVICE) as SearchManager val searchManager = getSystemService(Context.SEARCH_SERVICE) as SearchManager
searchMenuItem = menu.findItem(R.id.search) mSearchMenuItem = menu.findItem(R.id.search)
(searchMenuItem!!.actionView as SearchView).apply { (mSearchMenuItem!!.actionView as SearchView).apply {
setSearchableInfo(searchManager.getSearchableInfo(componentName)) setSearchableInfo(searchManager.getSearchableInfo(componentName))
isSubmitButtonEnabled = false isSubmitButtonEnabled = false
queryHint = getString(R.string.search) queryHint = getString(R.string.search)
@ -264,7 +264,7 @@ class MainActivity : SimpleActivity() {
}) })
} }
MenuItemCompat.setOnActionExpandListener(searchMenuItem, object : MenuItemCompat.OnActionExpandListener { MenuItemCompat.setOnActionExpandListener(mSearchMenuItem, object : MenuItemCompat.OnActionExpandListener {
override fun onMenuItemActionExpand(item: MenuItem?): Boolean { override fun onMenuItemActionExpand(item: MenuItem?): Boolean {
isSearchOpen = true isSearchOpen = true
(getCurrentFragment() as? ItemsFragment)?.searchOpened() (getCurrentFragment() as? ItemsFragment)?.searchOpened()
@ -281,10 +281,10 @@ class MainActivity : SimpleActivity() {
private fun storeStateVariables() { private fun storeStateVariables() {
config.apply { config.apply {
storedFontSize = fontSize mStoredFontSize = fontSize
storedDateFormat = dateFormat mStoredDateFormat = dateFormat
storedTimeFormat = context.getTimeFormat() mStoredTimeFormat = context.getTimeFormat()
storedShowTabs = showTabs mStoredShowTabs = showTabs
} }
} }
@ -422,7 +422,7 @@ class MainActivity : SimpleActivity() {
mTabsToShow.remove(TAB_STORAGE_ANALYSIS) mTabsToShow.remove(TAB_STORAGE_ANALYSIS)
if (mTabsToShow.none { it and config.showTabs != 0 }) { if (mTabsToShow.none { it and config.showTabs != 0 }) {
config.showTabs = TAB_FILES config.showTabs = TAB_FILES
storedShowTabs = TAB_FILES mStoredShowTabs = TAB_FILES
mTabsToShow = arrayListOf(TAB_FILES) mTabsToShow = arrayListOf(TAB_FILES)
} }
} }
@ -502,7 +502,7 @@ class MainActivity : SimpleActivity() {
getAllFragments().forEach { getAllFragments().forEach {
(it as? ItemOperationsListener)?.searchQueryChanged("") (it as? ItemOperationsListener)?.searchQueryChanged("")
} }
searchMenuItem?.collapseActionView() mSearchMenuItem?.collapseActionView()
} }
} }
@ -718,8 +718,8 @@ class MainActivity : SimpleActivity() {
} }
fun openedDirectory() { fun openedDirectory() {
if (searchMenuItem != null) { if (mSearchMenuItem != null) {
MenuItemCompat.collapseActionView(searchMenuItem) MenuItemCompat.collapseActionView(mSearchMenuItem)
} }
} }