mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-26 15:10:13 +01:00
fix warnings
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
parent
bb81da23a1
commit
665711afa5
@ -62,27 +62,31 @@ class FullScreenImageActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
return if (item.itemId == android.R.id.home) {
|
return when (item.itemId) {
|
||||||
onBackPressedDispatcher.onBackPressed()
|
android.R.id.home -> {
|
||||||
true
|
onBackPressedDispatcher.onBackPressed()
|
||||||
} else if (item.itemId == R.id.share) {
|
true
|
||||||
val shareUri = FileProvider.getUriForFile(
|
|
||||||
this,
|
|
||||||
BuildConfig.APPLICATION_ID,
|
|
||||||
File(path)
|
|
||||||
)
|
|
||||||
|
|
||||||
val shareIntent: Intent = Intent().apply {
|
|
||||||
action = Intent.ACTION_SEND
|
|
||||||
putExtra(Intent.EXTRA_STREAM, shareUri)
|
|
||||||
type = IMAGE_PREFIX_GENERIC
|
|
||||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
|
||||||
}
|
}
|
||||||
startActivity(Intent.createChooser(shareIntent, resources.getText(R.string.send_to)))
|
R.id.share -> {
|
||||||
|
val shareUri = FileProvider.getUriForFile(
|
||||||
|
this,
|
||||||
|
BuildConfig.APPLICATION_ID,
|
||||||
|
File(path)
|
||||||
|
)
|
||||||
|
|
||||||
true
|
val shareIntent: Intent = Intent().apply {
|
||||||
} else {
|
action = Intent.ACTION_SEND
|
||||||
super.onOptionsItemSelected(item)
|
putExtra(Intent.EXTRA_STREAM, shareUri)
|
||||||
|
type = IMAGE_PREFIX_GENERIC
|
||||||
|
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||||
|
}
|
||||||
|
startActivity(Intent.createChooser(shareIntent, resources.getText(R.string.send_to)))
|
||||||
|
|
||||||
|
true
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
super.onOptionsItemSelected(item)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +100,7 @@ class FullScreenImageActivity : AppCompatActivity() {
|
|||||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||||
initWindowInsetsController()
|
initWindowInsetsController()
|
||||||
applyWindowInsets()
|
applyWindowInsets()
|
||||||
binding.photoView.setOnPhotoTapListener { view, x, y ->
|
binding.photoView.setOnPhotoTapListener { _, _, _ ->
|
||||||
toggleFullscreen()
|
toggleFullscreen()
|
||||||
}
|
}
|
||||||
binding.photoView.setOnOutsidePhotoTapListener {
|
binding.photoView.setOnOutsidePhotoTapListener {
|
||||||
@ -185,7 +189,7 @@ class FullScreenImageActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val TAG = "FullScreenImageActivity"
|
private const val TAG = "FullScreenImageActivity"
|
||||||
private const val HUNDRED_MB = 100 * 1024 * 1024
|
private const val HUNDRED_MB = 100 * 1024 * 1024
|
||||||
private const val MAX_SCALE = 6.0f
|
private const val MAX_SCALE = 6.0f
|
||||||
private const val MEDIUM_SCALE = 2.45f
|
private const val MEDIUM_SCALE = 2.45f
|
||||||
|
@ -73,27 +73,31 @@ class FullScreenMediaActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
return if (item.itemId == android.R.id.home) {
|
return when (item.itemId) {
|
||||||
onBackPressedDispatcher.onBackPressed()
|
android.R.id.home -> {
|
||||||
true
|
onBackPressedDispatcher.onBackPressed()
|
||||||
} else if (item.itemId == R.id.share) {
|
true
|
||||||
val shareUri = FileProvider.getUriForFile(
|
|
||||||
this,
|
|
||||||
BuildConfig.APPLICATION_ID,
|
|
||||||
File(path)
|
|
||||||
)
|
|
||||||
|
|
||||||
val shareIntent: Intent = Intent().apply {
|
|
||||||
action = Intent.ACTION_SEND
|
|
||||||
putExtra(Intent.EXTRA_STREAM, shareUri)
|
|
||||||
type = VIDEO_PREFIX_GENERIC
|
|
||||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
|
||||||
}
|
}
|
||||||
startActivity(Intent.createChooser(shareIntent, resources.getText(R.string.send_to)))
|
R.id.share -> {
|
||||||
|
val shareUri = FileProvider.getUriForFile(
|
||||||
|
this,
|
||||||
|
BuildConfig.APPLICATION_ID,
|
||||||
|
File(path)
|
||||||
|
)
|
||||||
|
|
||||||
true
|
val shareIntent: Intent = Intent().apply {
|
||||||
} else {
|
action = Intent.ACTION_SEND
|
||||||
super.onOptionsItemSelected(item)
|
putExtra(Intent.EXTRA_STREAM, shareUri)
|
||||||
|
type = VIDEO_PREFIX_GENERIC
|
||||||
|
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||||
|
}
|
||||||
|
startActivity(Intent.createChooser(shareIntent, resources.getText(R.string.send_to)))
|
||||||
|
|
||||||
|
true
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
super.onOptionsItemSelected(item)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user