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

View file

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

View file

@ -1,3 +1,3 @@
package eu.depau.etchdroid.enums 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 negativeButton: String? = null
var message: String? = null var message: String? = null
var listener: DialogListener? = null var listener: DialogListener? = null
val dialogTheme: Int val dialogTheme: Int = if (nightMode) R.style.DialogThemeDark else R.style.DialogThemeLight
constructor() : this(false) constructor() : this(false)
init { init {
dialogTheme = if (nightMode) R.style.DialogThemeDark else R.style.DialogThemeLight
setStyle(DialogFragment.STYLE_NORMAL, dialogTheme) setStyle(DialogFragment.STYLE_NORMAL, dialogTheme)
} }