move the UI toggle functions out of extensions, as they arent
This commit is contained in:
parent
35fb696d30
commit
733d8e58d9
|
@ -42,7 +42,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentClic
|
||||||
mFragment.arguments = bundle
|
mFragment.arguments = bundle
|
||||||
supportFragmentManager.beginTransaction().replace(R.id.fragment_holder, mFragment).commit()
|
supportFragmentManager.beginTransaction().replace(R.id.fragment_holder, mFragment).commit()
|
||||||
}
|
}
|
||||||
hideUI()
|
hideSystemUI()
|
||||||
|
|
||||||
if (mUri.scheme == "content") {
|
if (mUri.scheme == "content") {
|
||||||
val proj = arrayOf(MediaStore.Images.Media.TITLE)
|
val proj = arrayOf(MediaStore.Images.Media.TITLE)
|
||||||
|
@ -91,9 +91,9 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentClic
|
||||||
override fun fragmentClicked() {
|
override fun fragmentClicked() {
|
||||||
mIsFullScreen = !mIsFullScreen
|
mIsFullScreen = !mIsFullScreen
|
||||||
if (mIsFullScreen) {
|
if (mIsFullScreen) {
|
||||||
hideUI()
|
hideSystemUI()
|
||||||
} else {
|
} else {
|
||||||
showUI()
|
showSystemUI()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,11 @@ import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.support.v7.app.AppCompatActivity
|
import android.support.v7.app.AppCompatActivity
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
|
import android.view.View
|
||||||
import com.simplemobiletools.filepicker.extensions.isShowingWritePermissions
|
import com.simplemobiletools.filepicker.extensions.isShowingWritePermissions
|
||||||
import com.simplemobiletools.gallery.Config
|
import com.simplemobiletools.gallery.Config
|
||||||
import com.simplemobiletools.gallery.OPEN_DOCUMENT_TREE
|
import com.simplemobiletools.gallery.OPEN_DOCUMENT_TREE
|
||||||
import com.simplemobiletools.gallery.R
|
import com.simplemobiletools.gallery.R
|
||||||
import com.simplemobiletools.gallery.extensions.hideSystemUI
|
|
||||||
import com.simplemobiletools.gallery.extensions.showSystemUI
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
open class SimpleActivity : AppCompatActivity() {
|
open class SimpleActivity : AppCompatActivity() {
|
||||||
|
@ -56,7 +55,20 @@ open class SimpleActivity : AppCompatActivity() {
|
||||||
|
|
||||||
fun isShowingPermDialog(file: File) = isShowingWritePermissions(file, mConfig.treeUri, OPEN_DOCUMENT_TREE)
|
fun isShowingPermDialog(file: File) = isShowingWritePermissions(file, mConfig.treeUri, OPEN_DOCUMENT_TREE)
|
||||||
|
|
||||||
fun hideUI() = hideSystemUI(supportActionBar, window)
|
fun showSystemUI() {
|
||||||
|
supportActionBar?.show()
|
||||||
|
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
|
||||||
|
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
|
||||||
|
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
|
}
|
||||||
|
|
||||||
fun showUI() = showSystemUI(supportActionBar, window)
|
fun hideSystemUI() {
|
||||||
|
supportActionBar?.hide()
|
||||||
|
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
|
||||||
|
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
|
||||||
|
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or
|
||||||
|
View.SYSTEM_UI_FLAG_LOW_PROFILE or
|
||||||
|
View.SYSTEM_UI_FLAG_FULLSCREEN or
|
||||||
|
View.SYSTEM_UI_FLAG_IMMERSIVE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
mIsFullScreen = true
|
mIsFullScreen = true
|
||||||
mToBeDeleted = ""
|
mToBeDeleted = ""
|
||||||
mBeingDeleted = ""
|
mBeingDeleted = ""
|
||||||
hideUI()
|
hideSystemUI()
|
||||||
|
|
||||||
scanPath(mPath) {}
|
scanPath(mPath) {}
|
||||||
addUndoMargin()
|
addUndoMargin()
|
||||||
|
@ -401,9 +401,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
deleteFile()
|
deleteFile()
|
||||||
mIsFullScreen = !mIsFullScreen
|
mIsFullScreen = !mIsFullScreen
|
||||||
if (mIsFullScreen) {
|
if (mIsFullScreen) {
|
||||||
hideUI()
|
hideSystemUI()
|
||||||
} else {
|
} else {
|
||||||
showUI()
|
showSystemUI()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
package com.simplemobiletools.gallery.extensions
|
|
||||||
|
|
||||||
import android.app.Activity
|
|
||||||
import android.support.v7.app.ActionBar
|
|
||||||
import android.view.View
|
|
||||||
import android.view.Window
|
|
||||||
|
|
||||||
fun Activity.showSystemUI(actionbar: ActionBar?, window: Window) {
|
|
||||||
actionbar?.show()
|
|
||||||
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
|
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
|
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Activity.hideSystemUI(actionbar: ActionBar?, window: Window) {
|
|
||||||
actionbar?.hide()
|
|
||||||
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
|
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
|
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or
|
|
||||||
View.SYSTEM_UI_FLAG_LOW_PROFILE or
|
|
||||||
View.SYSTEM_UI_FLAG_FULLSCREEN or
|
|
||||||
View.SYSTEM_UI_FLAG_IMMERSIVE
|
|
||||||
}
|
|
Loading…
Reference in New Issue