reference the SupportActionBar title at updating it
This commit is contained in:
parent
0285b97a17
commit
bb2659d018
|
@ -151,7 +151,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||
handlePermission(PERMISSION_WRITE_STORAGE) {
|
||||
if (it) {
|
||||
val dirName = getHumanizedFilename(mPath)
|
||||
title = if (mShowAll) resources.getString(R.string.all_folders) else dirName
|
||||
supportActionBar?.title = if (mShowAll) resources.getString(R.string.all_folders) else dirName
|
||||
getMedia()
|
||||
setupLayoutManager()
|
||||
checkIfColorChanged()
|
||||
|
|
|
@ -79,7 +79,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
|
|||
val bundle = Bundle()
|
||||
val file = File(mUri.toString())
|
||||
mMedium = Medium(getFilenameFromUri(mUri!!), mUri.toString(), mIsVideo, 0, 0, file.length())
|
||||
title = mMedium!!.name
|
||||
supportActionBar?.title = mMedium!!.name
|
||||
bundle.putSerializable(MEDIUM, mMedium)
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
|
|
|
@ -185,7 +185,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
showSystemUI()
|
||||
|
||||
mDirectory = File(mPath).parent
|
||||
title = mPath.getFilenameFromPath()
|
||||
supportActionBar?.title = mPath.getFilenameFromPath()
|
||||
|
||||
view_pager.onGlobalLayout {
|
||||
if (!isActivityDestroyed()) {
|
||||
|
@ -463,7 +463,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
private fun toggleFileVisibility(hide: Boolean) {
|
||||
toggleFileVisibility(getCurrentFile(), hide) {
|
||||
val newFileName = it.absolutePath.getFilenameFromPath()
|
||||
title = newFileName
|
||||
supportActionBar?.title = newFileName
|
||||
|
||||
getCurrentMedium()!!.apply {
|
||||
name = newFileName
|
||||
|
@ -835,7 +835,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
private fun updateActionbarTitle() {
|
||||
runOnUiThread {
|
||||
if (mPos < getCurrentMedia().size) {
|
||||
title = getCurrentMedia()[mPos].path.getFilenameFromPath()
|
||||
supportActionBar?.title = getCurrentMedia()[mPos].path.getFilenameFromPath()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue