mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 08:18:00 +01:00
Several fixes to make code work with platform 30
This commit is contained in:
parent
cf3e27a25d
commit
02da4e4e32
6 changed files with 19 additions and 17 deletions
|
@ -808,7 +808,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
||||||
if (newPath.isEmpty()) {
|
if (newPath.isEmpty()) {
|
||||||
val filename = applicationContext.getFilenameFromContentUri(saveUri) ?: ""
|
val filename = applicationContext.getFilenameFromContentUri(saveUri) ?: ""
|
||||||
if (filename.isNotEmpty()) {
|
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"
|
newPath = "$path/$filename"
|
||||||
shouldAppendFilename = false
|
shouldAppendFilename = false
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
||||||
|
|
||||||
media_refresh_layout.setOnRefreshListener { getMedia() }
|
media_refresh_layout.setOnRefreshListener { getMedia() }
|
||||||
try {
|
try {
|
||||||
mPath = intent.getStringExtra(DIRECTORY)
|
mPath = intent.getStringExtra(DIRECTORY) ?: ""
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
showErrorToast(e)
|
showErrorToast(e)
|
||||||
finish()
|
finish()
|
||||||
|
|
|
@ -20,8 +20,9 @@ import com.simplemobiletools.gallery.pro.extensions.updateDirectoryPath
|
||||||
|
|
||||||
open class SimpleActivity : BaseSimpleActivity() {
|
open class SimpleActivity : BaseSimpleActivity() {
|
||||||
val observer = object : ContentObserver(null) {
|
val observer = object : ContentObserver(null) {
|
||||||
override fun onChange(selfChange: Boolean, uri: Uri) {
|
override fun onChange(selfChange: Boolean, uri: Uri?) {
|
||||||
super.onChange(selfChange, uri)
|
super.onChange(selfChange, uri)
|
||||||
|
if (uri != null) {
|
||||||
val path = getRealPathFromURI(uri)
|
val path = getRealPathFromURI(uri)
|
||||||
if (path != null) {
|
if (path != null) {
|
||||||
updateDirectoryPath(path.getParentPath())
|
updateDirectoryPath(path.getParentPath())
|
||||||
|
@ -29,6 +30,7 @@ open class SimpleActivity : BaseSimpleActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun getAppIconIDs() = arrayListOf(
|
override fun getAppIconIDs() = arrayListOf(
|
||||||
R.mipmap.ic_launcher_red,
|
R.mipmap.ic_launcher_red,
|
||||||
|
|
|
@ -618,16 +618,16 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
|
||||||
mIsDragged = false
|
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 {
|
ensureBackgroundThread {
|
||||||
mExoPlayer?.setVideoSurface(Surface(video_surface!!.surfaceTexture))
|
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 {
|
} else {
|
||||||
try {
|
try {
|
||||||
mPath = intent.getStringExtra(PATH)
|
mPath = intent.getStringExtra(PATH) ?: ""
|
||||||
mShowAll = config.showAll
|
mShowAll = config.showAll
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
showErrorToast(e)
|
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 {
|
ensureBackgroundThread {
|
||||||
mExoPlayer?.setVideoSurface(Surface(mTextureView.surfaceTexture))
|
mExoPlayer?.setVideoSurface(Surface(mTextureView.surfaceTexture))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue