From a574052dcc28d2688c110809bb0f673211a7e44b Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 1 Dec 2017 14:21:03 +0100 Subject: [PATCH] update commons to 3.0.20 --- app/build.gradle | 2 +- .../dialogs/AddAppLauncherDialog.kt | 16 +++++++------- .../applauncher/dialogs/EditDialog.kt | 21 ++++++++++--------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b1c872c..caa7f3e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -39,7 +39,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:3.0.13' + implementation 'com.simplemobiletools:commons:3.0.20' implementation 'com.facebook.stetho:stetho:1.5.0' implementation 'com.android.support:multidex:1.0.2' } diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/dialogs/AddAppLauncherDialog.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/dialogs/AddAppLauncherDialog.kt index cbfb050..c215031 100644 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/dialogs/AddAppLauncherDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/dialogs/AddAppLauncherDialog.kt @@ -25,14 +25,14 @@ class AddAppLauncherDialog(val activity: Activity, val displayedLaunchers: Array .setPositiveButton(R.string.ok, { dialogInterface, i -> confirmSelection() }) .setNegativeButton(R.string.cancel, null) .create().apply { - activity.setupDialogStuff(view, this) - - Thread({ - adapter = LaunchersDialogAdapter(activity, getNotDisplayedLaunchers()) - activity.runOnUiThread { - view.pick_launchers_holder.adapter = adapter - } - }).start() + activity.setupDialogStuff(view, this) { + Thread { + adapter = LaunchersDialogAdapter(activity, getNotDisplayedLaunchers()) + activity.runOnUiThread { + view.pick_launchers_holder.adapter = adapter + } + }.start() + } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/dialogs/EditDialog.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/dialogs/EditDialog.kt index 24b09c1..3774605 100644 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/dialogs/EditDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/dialogs/EditDialog.kt @@ -24,18 +24,19 @@ class EditDialog(val activity: Activity, val appLauncher: AppLauncher, val callb .setNegativeButton(R.string.cancel, null) .create().apply { window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) - activity.setupDialogStuff(view, this, R.string.rename) - getButton(android.app.AlertDialog.BUTTON_POSITIVE).setOnClickListener { - val newName = view.edit_launcher_edittext.value - if (!newName.isEmpty()) { - if (activity.dbHelper.updateLauncherName(appLauncher.id, newName)) { - callback() - dismiss() + activity.setupDialogStuff(view, this, R.string.rename) { + getButton(android.app.AlertDialog.BUTTON_POSITIVE).setOnClickListener { + val newName = view.edit_launcher_edittext.value + if (!newName.isEmpty()) { + if (activity.dbHelper.updateLauncherName(appLauncher.id, newName)) { + callback() + dismiss() + } else { + activity.toast(R.string.unknown_error_occurred) + } } else { - activity.toast(R.string.unknown_error_occurred) + activity.toast(R.string.enter_launcher_name) } - } else { - activity.toast(R.string.enter_launcher_name) } } }