mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
initialize mMedium asap at fragments
This commit is contained in:
parent
d8e0e87cb1
commit
e9c23d3d7b
2 changed files with 3 additions and 2 deletions
|
@ -92,6 +92,8 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
return mView
|
return mView
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mMedium = arguments!!.getSerializable(MEDIUM) as Medium
|
||||||
|
|
||||||
mView.apply {
|
mView.apply {
|
||||||
subsampling_view.setOnClickListener { photoClicked() }
|
subsampling_view.setOnClickListener { photoClicked() }
|
||||||
gestures_view.setOnClickListener { photoClicked() }
|
gestures_view.setOnClickListener { photoClicked() }
|
||||||
|
@ -149,7 +151,6 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
mIsFragmentVisible = true
|
mIsFragmentVisible = true
|
||||||
}
|
}
|
||||||
|
|
||||||
mMedium = arguments!!.getSerializable(MEDIUM) as Medium
|
|
||||||
if (mMedium.path.startsWith("content://") && !mMedium.path.startsWith("content://mms/")) {
|
if (mMedium.path.startsWith("content://") && !mMedium.path.startsWith("content://mms/")) {
|
||||||
val originalPath = mMedium.path
|
val originalPath = mMedium.path
|
||||||
mMedium.path = context!!.getRealPathFromURI(Uri.parse(originalPath)) ?: mMedium.path
|
mMedium.path = context!!.getRealPathFromURI(Uri.parse(originalPath)) ?: mMedium.path
|
||||||
|
|
|
@ -74,6 +74,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
|
||||||
private lateinit var mSeekBar: SeekBar
|
private lateinit var mSeekBar: SeekBar
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
|
mMedium = arguments!!.getSerializable(MEDIUM) as Medium
|
||||||
mConfig = context!!.config
|
mConfig = context!!.config
|
||||||
mView = inflater.inflate(R.layout.pager_video_item, container, false).apply {
|
mView = inflater.inflate(R.layout.pager_video_item, container, false).apply {
|
||||||
instant_prev_item.setOnClickListener { listener?.goToPrevItem() }
|
instant_prev_item.setOnClickListener { listener?.goToPrevItem() }
|
||||||
|
@ -122,7 +123,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mMedium = arguments!!.getSerializable(MEDIUM) as Medium
|
|
||||||
if (!arguments!!.getBoolean(SHOULD_INIT_FRAGMENT, true)) {
|
if (!arguments!!.getBoolean(SHOULD_INIT_FRAGMENT, true)) {
|
||||||
return mView
|
return mView
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue