use property access syntax, join declaration and assignment in DoNotShowAgainDialogFragment, and other small misc changes

Signed-off-by: Taco <SkytkRSfan3895@gmail.com>
This commit is contained in:
Taco 2018-12-20 17:13:00 -05:00 committed by Davide Depau
parent b457ed7571
commit 2074390179
Signed by: depau
GPG Key ID: C7D999B6A55EFE86
4 changed files with 5 additions and 6 deletions

View File

@ -95,7 +95,7 @@ class ConfirmationActivity : ActivityBase() {
for (trial in 0..1) {
try {
StateKeeper.usbMassStorageDevice!!.init()
val blockDev = StateKeeper.usbMassStorageDevice?.blockDevice
val blockDev = StateKeeper.usbMassStorageDevice!!.blockDevice
if (blockDev != null) {
val devSize = (blockDev.size.toLong() * blockDev.blockSize.toLong())
@ -178,7 +178,7 @@ class ConfirmationActivity : ActivityBase() {
else
startService(intent)
moveTaskToBack(true);
moveTaskToBack(true)
finish()
}

View File

@ -83,7 +83,7 @@ class StartActivity : ActivityBase() {
FlashMethod.FLASH_API -> {
val intent = Intent(Intent.ACTION_OPEN_DOCUMENT)
intent.addCategory(Intent.CATEGORY_OPENABLE)
intent.setType("*/*");
intent.type = "*/*"
startActivityForResult(intent, READ_REQUEST_CODE)
}
FlashMethod.FLASH_DMG_API -> {

View File

@ -1,3 +1,3 @@
package eu.depau.etchdroid.enums
enum class PartitionType {}
enum class PartitionType

View File

@ -16,12 +16,11 @@ class DoNotShowAgainDialogFragment(nightMode: Boolean) : DialogFragment() {
var negativeButton: String? = null
var message: String? = null
var listener: DialogListener? = null
val dialogTheme: Int
val dialogTheme: Int = if (nightMode) R.style.DialogThemeDark else R.style.DialogThemeLight
constructor() : this(false)
init {
dialogTheme = if (nightMode) R.style.DialogThemeDark else R.style.DialogThemeLight
setStyle(DialogFragment.STYLE_NORMAL, dialogTheme)
}