Skip to content

Commit

Permalink
Minor code improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
naveensingh committed Jan 8, 2025
1 parent 41d65f0 commit 7736ab3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.fossify.commons.activities.BaseSimpleActivity
import org.fossify.commons.extensions.getAlertDialogBuilder
import org.fossify.commons.extensions.getProperPrimaryColor
import org.fossify.commons.extensions.setupDialogStuff
import org.fossify.commons.helpers.MEDIUM_ALPHA
import org.fossify.commons.helpers.ensureBackgroundThread
import org.fossify.voicerecorder.R
import org.fossify.voicerecorder.databinding.DialogMoveRecordingsBinding
Expand Down Expand Up @@ -51,7 +52,7 @@ class MoveRecordingsDialog(
getButton(AlertDialog.BUTTON_NEGATIVE)
).forEach { button ->
button.isEnabled = false
button.alpha = 0.6f
button.alpha = MEDIUM_ALPHA
}

moveAllRecordings()
Expand All @@ -75,4 +76,4 @@ class MoveRecordingsDialog(
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private fun BaseSimpleActivity.moveRecordingsSAF(
sourceParentDocumentUri,
destinationParentDocumentUri
)
} catch (e: IllegalStateException) {
} catch (@Suppress("SwallowedException") e: IllegalStateException) {
val sourceUri = recording.path.toUri()
contentResolver.openInputStream(sourceUri)?.use { inputStream ->
val targetPath = File(destinationParent, recording.title).absolutePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ fun Context.createDocumentFile(path: String): Uri? {
path.getMimeType(),
path.getFilenameFromPath()
)
} catch (e: IllegalStateException) {
} catch (@Suppress("SwallowedException") e: IllegalStateException) {
null
}
}
}

0 comments on commit 7736ab3

Please sign in to comment.