mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-21 07:37:59 +01:00
removing some old support action bar references
This commit is contained in:
parent
f246bca4b8
commit
f896fc885a
8 changed files with 11 additions and 20 deletions
|
@ -106,7 +106,6 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
||||||
storeStateVariables()
|
storeStateVariables()
|
||||||
|
|
||||||
if (mShowAll) {
|
if (mShowAll) {
|
||||||
supportActionBar?.setDisplayHomeAsUpEnabled(false)
|
|
||||||
registerFileUpdateListener()
|
registerFileUpdateListener()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,6 @@ open class PanoramaPhotoActivity : SimpleActivity() {
|
||||||
requestWindowFeature(Window.FEATURE_NO_TITLE)
|
requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_panorama_photo)
|
setContentView(R.layout.activity_panorama_photo)
|
||||||
supportActionBar?.hide()
|
|
||||||
|
|
||||||
checkNotchSupport()
|
checkNotchSupport()
|
||||||
setupButtonMargins()
|
setupButtonMargins()
|
||||||
|
|
|
@ -45,7 +45,6 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList
|
||||||
requestWindowFeature(Window.FEATURE_NO_TITLE)
|
requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_panorama_video)
|
setContentView(R.layout.activity_panorama_video)
|
||||||
supportActionBar?.hide()
|
|
||||||
|
|
||||||
checkNotchSupport()
|
checkNotchSupport()
|
||||||
checkIntent()
|
checkIntent()
|
||||||
|
|
|
@ -75,7 +75,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun refreshMenuItems() {
|
fun refreshMenuItems() {
|
||||||
val visibleBottomActions = if (config.bottomActions) config.visibleBottomActions else 0
|
val visibleBottomActions = if (config.bottomActions) config.visibleBottomActions else 0
|
||||||
|
|
||||||
fragment_viewer_toolbar.menu.apply {
|
fragment_viewer_toolbar.menu.apply {
|
||||||
|
|
|
@ -74,7 +74,6 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
top_shadow.layoutParams.height = statusBarHeight + actionBarHeight
|
top_shadow.layoutParams.height = statusBarHeight + actionBarHeight
|
||||||
supportActionBar?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
|
||||||
window.statusBarColor = Color.TRANSPARENT
|
window.statusBarColor = Color.TRANSPARENT
|
||||||
window.navigationBarColor = Color.TRANSPARENT
|
window.navigationBarColor = Color.TRANSPARENT
|
||||||
if (config.blackBackground) {
|
if (config.blackBackground) {
|
||||||
|
|
|
@ -140,7 +140,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
}
|
}
|
||||||
|
|
||||||
setupOrientation()
|
setupOrientation()
|
||||||
invalidateOptionsMenu()
|
refreshMenuItems()
|
||||||
|
|
||||||
val filename = getCurrentMedium()?.name ?: mPath.getFilenameFromPath()
|
val filename = getCurrentMedium()?.name ?: mPath.getFilenameFromPath()
|
||||||
medium_viewer_toolbar.title = filename
|
medium_viewer_toolbar.title = filename
|
||||||
|
@ -166,7 +166,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun refreshMenuItems() {
|
fun refreshMenuItems() {
|
||||||
val currentMedium = getCurrentMedium() ?: return
|
val currentMedium = getCurrentMedium() ?: return
|
||||||
currentMedium.isFavorite = mFavoritePaths.contains(currentMedium.path)
|
currentMedium.isFavorite = mFavoritePaths.contains(currentMedium.path)
|
||||||
val visibleBottomActions = if (config.bottomActions) config.visibleBottomActions else 0
|
val visibleBottomActions = if (config.bottomActions) config.visibleBottomActions else 0
|
||||||
|
@ -375,7 +375,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
isShowingRecycleBin -> RECYCLE_BIN
|
isShowingRecycleBin -> RECYCLE_BIN
|
||||||
else -> mPath.getParentPath()
|
else -> mPath.getParentPath()
|
||||||
}
|
}
|
||||||
supportActionBar?.title = mPath.getFilenameFromPath()
|
medium_viewer_toolbar.title = mPath.getFilenameFromPath()
|
||||||
|
|
||||||
view_pager.onGlobalLayout {
|
view_pager.onGlobalLayout {
|
||||||
if (!isDestroyed) {
|
if (!isDestroyed) {
|
||||||
|
@ -691,7 +691,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
private fun toggleFileVisibility(hide: Boolean, callback: (() -> Unit)? = null) {
|
private fun toggleFileVisibility(hide: Boolean, callback: (() -> Unit)? = null) {
|
||||||
toggleFileVisibility(getCurrentPath(), hide) {
|
toggleFileVisibility(getCurrentPath(), hide) {
|
||||||
val newFileName = it.getFilenameFromPath()
|
val newFileName = it.getFilenameFromPath()
|
||||||
supportActionBar?.title = newFileName
|
medium_viewer_toolbar.title = newFileName
|
||||||
|
|
||||||
getCurrentMedium()!!.apply {
|
getCurrentMedium()!!.apply {
|
||||||
name = newFileName
|
name = newFileName
|
||||||
|
|
|
@ -171,20 +171,12 @@ fun BaseSimpleActivity.handleMediaManagementPrompt(callback: () -> Unit) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun AppCompatActivity.showSystemUI(toggleActionBarVisibility: Boolean) {
|
fun AppCompatActivity.showSystemUI(toggleActionBarVisibility: Boolean) {
|
||||||
if (toggleActionBarVisibility) {
|
|
||||||
supportActionBar?.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
|
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
|
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
}
|
}
|
||||||
|
|
||||||
fun AppCompatActivity.hideSystemUI(toggleActionBarVisibility: Boolean) {
|
fun AppCompatActivity.hideSystemUI(toggleActionBarVisibility: Boolean) {
|
||||||
if (toggleActionBarVisibility) {
|
|
||||||
supportActionBar?.hide()
|
|
||||||
}
|
|
||||||
|
|
||||||
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
|
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
|
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
|
||||||
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or
|
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or
|
||||||
|
|
|
@ -45,9 +45,9 @@ import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||||
import com.simplemobiletools.commons.helpers.isRPlus
|
import com.simplemobiletools.commons.helpers.isRPlus
|
||||||
|
import com.simplemobiletools.commons.helpers.mydebug
|
||||||
import com.simplemobiletools.gallery.pro.R
|
import com.simplemobiletools.gallery.pro.R
|
||||||
import com.simplemobiletools.gallery.pro.activities.PanoramaPhotoActivity
|
import com.simplemobiletools.gallery.pro.activities.*
|
||||||
import com.simplemobiletools.gallery.pro.activities.PhotoActivity
|
|
||||||
import com.simplemobiletools.gallery.pro.adapters.PortraitPhotosAdapter
|
import com.simplemobiletools.gallery.pro.adapters.PortraitPhotosAdapter
|
||||||
import com.simplemobiletools.gallery.pro.extensions.config
|
import com.simplemobiletools.gallery.pro.extensions.config
|
||||||
import com.simplemobiletools.gallery.pro.extensions.saveRotatedImageToFile
|
import com.simplemobiletools.gallery.pro.extensions.saveRotatedImageToFile
|
||||||
|
@ -709,7 +709,10 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
doubleTapZoomScale = getDoubleTapZoomScale(useWidth, useHeight)
|
doubleTapZoomScale = getDoubleTapZoomScale(useWidth, useHeight)
|
||||||
mCurrentRotationDegrees = (mCurrentRotationDegrees + degrees) % 360
|
mCurrentRotationDegrees = (mCurrentRotationDegrees + degrees) % 360
|
||||||
loadBitmap(false)
|
loadBitmap(false)
|
||||||
activity?.invalidateOptionsMenu()
|
|
||||||
|
// ugly, but it works
|
||||||
|
(activity as? ViewPagerActivity)?.refreshMenuItems()
|
||||||
|
(activity as? PhotoVideoActivity)?.refreshMenuItems()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpEvent() {
|
override fun onUpEvent() {
|
||||||
|
|
Loading…
Reference in a new issue