mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
fix #270, temporarily show hidden files when opening a third party intent
This commit is contained in:
parent
52e95827ec
commit
5a4b6065fb
3 changed files with 14 additions and 0 deletions
|
@ -21,6 +21,7 @@ import com.simplemobiletools.gallery.extensions.*
|
||||||
import com.simplemobiletools.gallery.fragments.PhotoFragment
|
import com.simplemobiletools.gallery.fragments.PhotoFragment
|
||||||
import com.simplemobiletools.gallery.fragments.VideoFragment
|
import com.simplemobiletools.gallery.fragments.VideoFragment
|
||||||
import com.simplemobiletools.gallery.fragments.ViewPagerFragment
|
import com.simplemobiletools.gallery.fragments.ViewPagerFragment
|
||||||
|
import com.simplemobiletools.gallery.helpers.IS_VIEW_INTENT
|
||||||
import com.simplemobiletools.gallery.helpers.MEDIUM
|
import com.simplemobiletools.gallery.helpers.MEDIUM
|
||||||
import com.simplemobiletools.gallery.models.Medium
|
import com.simplemobiletools.gallery.models.Medium
|
||||||
import kotlinx.android.synthetic.main.fragment_holder.*
|
import kotlinx.android.synthetic.main.fragment_holder.*
|
||||||
|
@ -119,6 +120,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
|
||||||
|
|
||||||
private fun sendViewPagerIntent(path: String) {
|
private fun sendViewPagerIntent(path: String) {
|
||||||
Intent(this, ViewPagerActivity::class.java).apply {
|
Intent(this, ViewPagerActivity::class.java).apply {
|
||||||
|
putExtra(IS_VIEW_INTENT, true)
|
||||||
putExtra(MEDIUM, path)
|
putExtra(MEDIUM, path)
|
||||||
startActivity(this)
|
startActivity(this)
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (intent.extras?.containsKey(IS_VIEW_INTENT) == true) {
|
||||||
|
config.temporarilyShowHidden = true
|
||||||
|
}
|
||||||
|
|
||||||
mMedia = ArrayList<Medium>()
|
mMedia = ArrayList<Medium>()
|
||||||
showSystemUI()
|
showSystemUI()
|
||||||
|
|
||||||
|
@ -107,6 +111,13 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
view_pager.background = ColorDrawable(Color.BLACK)
|
view_pager.background = ColorDrawable(Color.BLACK)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
super.onDestroy()
|
||||||
|
if (intent.extras?.containsKey(IS_VIEW_INTENT) == true) {
|
||||||
|
config.temporarilyShowHidden = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun setupOrientationEventListener() {
|
private fun setupOrientationEventListener() {
|
||||||
mOrientationEventListener = object : OrientationEventListener(this, SensorManager.SENSOR_DELAY_NORMAL) {
|
mOrientationEventListener = object : OrientationEventListener(this, SensorManager.SENSOR_DELAY_NORMAL) {
|
||||||
override fun onOrientationChanged(orientation: Int) {
|
override fun onOrientationChanged(orientation: Int) {
|
||||||
|
|
|
@ -33,6 +33,7 @@ val GET_VIDEO_INTENT = "get_video_intent"
|
||||||
val GET_ANY_INTENT = "get_any_intent"
|
val GET_ANY_INTENT = "get_any_intent"
|
||||||
val SET_WALLPAPER_INTENT = "set_wallpaper_intent"
|
val SET_WALLPAPER_INTENT = "set_wallpaper_intent"
|
||||||
val DIRECTORIES = "directories2"
|
val DIRECTORIES = "directories2"
|
||||||
|
val IS_VIEW_INTENT = "is_view_intent"
|
||||||
|
|
||||||
val REQUEST_EDIT_IMAGE = 1
|
val REQUEST_EDIT_IMAGE = 1
|
||||||
val REQUEST_SET_WALLPAPER = 2
|
val REQUEST_SET_WALLPAPER = 2
|
||||||
|
|
Loading…
Reference in a new issue