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()
|
||||
|
||||
if (mShowAll) {
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(false)
|
||||
registerFileUpdateListener()
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@ open class PanoramaPhotoActivity : SimpleActivity() {
|
|||
requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_panorama_photo)
|
||||
supportActionBar?.hide()
|
||||
|
||||
checkNotchSupport()
|
||||
setupButtonMargins()
|
||||
|
|
|
@ -45,7 +45,6 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList
|
|||
requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_panorama_video)
|
||||
supportActionBar?.hide()
|
||||
|
||||
checkNotchSupport()
|
||||
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
|
||||
|
||||
fragment_viewer_toolbar.menu.apply {
|
||||
|
|
|
@ -74,7 +74,6 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
|
|||
override fun onResume() {
|
||||
super.onResume()
|
||||
top_shadow.layoutParams.height = statusBarHeight + actionBarHeight
|
||||
supportActionBar?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||
window.statusBarColor = Color.TRANSPARENT
|
||||
window.navigationBarColor = Color.TRANSPARENT
|
||||
if (config.blackBackground) {
|
||||
|
|
|
@ -140,7 +140,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
}
|
||||
|
||||
setupOrientation()
|
||||
invalidateOptionsMenu()
|
||||
refreshMenuItems()
|
||||
|
||||
val filename = getCurrentMedium()?.name ?: mPath.getFilenameFromPath()
|
||||
medium_viewer_toolbar.title = filename
|
||||
|
@ -166,7 +166,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
}
|
||||
}
|
||||
|
||||
private fun refreshMenuItems() {
|
||||
fun refreshMenuItems() {
|
||||
val currentMedium = getCurrentMedium() ?: return
|
||||
currentMedium.isFavorite = mFavoritePaths.contains(currentMedium.path)
|
||||
val visibleBottomActions = if (config.bottomActions) config.visibleBottomActions else 0
|
||||
|
@ -375,7 +375,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
isShowingRecycleBin -> RECYCLE_BIN
|
||||
else -> mPath.getParentPath()
|
||||
}
|
||||
supportActionBar?.title = mPath.getFilenameFromPath()
|
||||
medium_viewer_toolbar.title = mPath.getFilenameFromPath()
|
||||
|
||||
view_pager.onGlobalLayout {
|
||||
if (!isDestroyed) {
|
||||
|
@ -691,7 +691,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
private fun toggleFileVisibility(hide: Boolean, callback: (() -> Unit)? = null) {
|
||||
toggleFileVisibility(getCurrentPath(), hide) {
|
||||
val newFileName = it.getFilenameFromPath()
|
||||
supportActionBar?.title = newFileName
|
||||
medium_viewer_toolbar.title = newFileName
|
||||
|
||||
getCurrentMedium()!!.apply {
|
||||
name = newFileName
|
||||
|
|
|
@ -171,20 +171,12 @@ fun BaseSimpleActivity.handleMediaManagementPrompt(callback: () -> Unit) {
|
|||
}
|
||||
|
||||
fun AppCompatActivity.showSystemUI(toggleActionBarVisibility: Boolean) {
|
||||
if (toggleActionBarVisibility) {
|
||||
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 AppCompatActivity.hideSystemUI(toggleActionBarVisibility: Boolean) {
|
||||
if (toggleActionBarVisibility) {
|
||||
supportActionBar?.hide()
|
||||
}
|
||||
|
||||
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_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.helpers.ensureBackgroundThread
|
||||
import com.simplemobiletools.commons.helpers.isRPlus
|
||||
import com.simplemobiletools.commons.helpers.mydebug
|
||||
import com.simplemobiletools.gallery.pro.R
|
||||
import com.simplemobiletools.gallery.pro.activities.PanoramaPhotoActivity
|
||||
import com.simplemobiletools.gallery.pro.activities.PhotoActivity
|
||||
import com.simplemobiletools.gallery.pro.activities.*
|
||||
import com.simplemobiletools.gallery.pro.adapters.PortraitPhotosAdapter
|
||||
import com.simplemobiletools.gallery.pro.extensions.config
|
||||
import com.simplemobiletools.gallery.pro.extensions.saveRotatedImageToFile
|
||||
|
@ -709,7 +709,10 @@ class PhotoFragment : ViewPagerFragment() {
|
|||
doubleTapZoomScale = getDoubleTapZoomScale(useWidth, useHeight)
|
||||
mCurrentRotationDegrees = (mCurrentRotationDegrees + degrees) % 360
|
||||
loadBitmap(false)
|
||||
activity?.invalidateOptionsMenu()
|
||||
|
||||
// ugly, but it works
|
||||
(activity as? ViewPagerActivity)?.refreshMenuItems()
|
||||
(activity as? PhotoVideoActivity)?.refreshMenuItems()
|
||||
}
|
||||
|
||||
override fun onUpEvent() {
|
||||
|
|
Loading…
Reference in a new issue