mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
Merge pull request #2073 from fgndev/master
Several fixes to make code work with platform 30
This commit is contained in:
commit
1b754d68b3
6 changed files with 19 additions and 17 deletions
|
@ -808,7 +808,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
|||
if (newPath.isEmpty()) {
|
||||
val filename = applicationContext.getFilenameFromContentUri(saveUri) ?: ""
|
||||
if (filename.isNotEmpty()) {
|
||||
val path = if (intent.extras?.containsKey(REAL_FILE_PATH) == true) intent.getStringExtra(REAL_FILE_PATH).getParentPath() else internalStoragePath
|
||||
val path = if (intent.extras?.containsKey(REAL_FILE_PATH) == true) intent.getStringExtra(REAL_FILE_PATH)?.getParentPath() else internalStoragePath
|
||||
newPath = "$path/$filename"
|
||||
shouldAppendFilename = false
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
|||
|
||||
media_refresh_layout.setOnRefreshListener { getMedia() }
|
||||
try {
|
||||
mPath = intent.getStringExtra(DIRECTORY)
|
||||
mPath = intent.getStringExtra(DIRECTORY) ?: ""
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
finish()
|
||||
|
|
|
@ -20,8 +20,9 @@ import com.simplemobiletools.gallery.pro.extensions.updateDirectoryPath
|
|||
|
||||
open class SimpleActivity : BaseSimpleActivity() {
|
||||
val observer = object : ContentObserver(null) {
|
||||
override fun onChange(selfChange: Boolean, uri: Uri) {
|
||||
override fun onChange(selfChange: Boolean, uri: Uri?) {
|
||||
super.onChange(selfChange, uri)
|
||||
if (uri != null) {
|
||||
val path = getRealPathFromURI(uri)
|
||||
if (path != null) {
|
||||
updateDirectoryPath(path.getParentPath())
|
||||
|
@ -29,6 +30,7 @@ open class SimpleActivity : BaseSimpleActivity() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getAppIconIDs() = arrayListOf(
|
||||
R.mipmap.ic_launcher_red,
|
||||
|
|
|
@ -618,16 +618,16 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
|
|||
mIsDragged = false
|
||||
}
|
||||
|
||||
override fun onSurfaceTextureUpdated(surface: SurfaceTexture?) {
|
||||
override fun onSurfaceTextureUpdated(surface: SurfaceTexture) {
|
||||
}
|
||||
|
||||
override fun onSurfaceTextureDestroyed(surface: SurfaceTexture?) = false
|
||||
override fun onSurfaceTextureDestroyed(surface: SurfaceTexture) = false
|
||||
|
||||
override fun onSurfaceTextureAvailable(surface: SurfaceTexture?, width: Int, height: Int) {
|
||||
override fun onSurfaceTextureAvailable(surface: SurfaceTexture, width: Int, height: Int) {
|
||||
ensureBackgroundThread {
|
||||
mExoPlayer?.setVideoSurface(Surface(video_surface!!.surfaceTexture))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSurfaceTextureSizeChanged(surface: SurfaceTexture?, width: Int, height: Int) {}
|
||||
override fun onSurfaceTextureSizeChanged(surface: SurfaceTexture, width: Int, height: Int) {}
|
||||
}
|
||||
|
|
|
@ -272,7 +272,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
}
|
||||
} else {
|
||||
try {
|
||||
mPath = intent.getStringExtra(PATH)
|
||||
mPath = intent.getStringExtra(PATH) ?: ""
|
||||
mShowAll = config.showAll
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
|
|
|
@ -759,13 +759,13 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
|
|||
}
|
||||
}
|
||||
|
||||
override fun onSurfaceTextureSizeChanged(surface: SurfaceTexture?, width: Int, height: Int) {}
|
||||
override fun onSurfaceTextureSizeChanged(surface: SurfaceTexture, width: Int, height: Int) {}
|
||||
|
||||
override fun onSurfaceTextureUpdated(surface: SurfaceTexture?) {}
|
||||
override fun onSurfaceTextureUpdated(surface: SurfaceTexture) {}
|
||||
|
||||
override fun onSurfaceTextureDestroyed(surface: SurfaceTexture?) = false
|
||||
override fun onSurfaceTextureDestroyed(surface: SurfaceTexture) = false
|
||||
|
||||
override fun onSurfaceTextureAvailable(surface: SurfaceTexture?, width: Int, height: Int) {
|
||||
override fun onSurfaceTextureAvailable(surface: SurfaceTexture, width: Int, height: Int) {
|
||||
ensureBackgroundThread {
|
||||
mExoPlayer?.setVideoSurface(Surface(mTextureView.surfaceTexture))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue