From af78f01682a797e4880964524bc42ddab941104a Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 6 Jun 2021 10:43:42 +0600 Subject: [PATCH] remove progressbar alert dialog --- CHANGELOG.md | 4 --- .../alerts/common/ProgressBarAlertDialog.kt | 33 ------------------- .../res/layout/alert_dialog_progress_bar.xml | 21 ------------ 3 files changed, 58 deletions(-) delete mode 100644 android/alerts/common/src/main/kotlin/dev/inmo/micro_utils/android/alerts/common/ProgressBarAlertDialog.kt delete mode 100644 android/alerts/common/src/main/res/layout/alert_dialog_progress_bar.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index 25859e1bb38..3c9c34c0ed3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,6 @@ ## 0.5.7 -* `Android` - * `Alerts` - * `Common` - * New extension `progressBarAlertDialog` * `Pagination` * `Ktor` * `Server` diff --git a/android/alerts/common/src/main/kotlin/dev/inmo/micro_utils/android/alerts/common/ProgressBarAlertDialog.kt b/android/alerts/common/src/main/kotlin/dev/inmo/micro_utils/android/alerts/common/ProgressBarAlertDialog.kt deleted file mode 100644 index d844a0d1cab..00000000000 --- a/android/alerts/common/src/main/kotlin/dev/inmo/micro_utils/android/alerts/common/ProgressBarAlertDialog.kt +++ /dev/null @@ -1,33 +0,0 @@ -package dev.inmo.micro_utils.android.alerts.common - -import android.content.Context -import android.graphics.Color -import android.graphics.drawable.ColorDrawable -import android.view.LayoutInflater -import android.widget.TextView -import androidx.annotation.StringRes - -fun Context.createProgressBarAlertDialog( - text: String? = null, - onClick: (() -> Unit)? = null -) = createCustomViewAlertDialog { - (it.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater).inflate( - R.layout.alert_dialog_progress_bar, null, false - ).apply { - onClick ?.let { - setOnClickListener { onClick() } - } ?: setOnClickListener { /* do nothing */ } - text ?.let { - findViewById(R.id.alertDialogProgressBarTitle).text = it - } - } -}.apply { - window ?.apply { - setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)) - } -} - -fun Context.createProgressBarAlertDialog( - @StringRes textRes: Int, - onClick: (() -> Unit)? = null -) = createProgressBarAlertDialog(getString(textRes), onClick) diff --git a/android/alerts/common/src/main/res/layout/alert_dialog_progress_bar.xml b/android/alerts/common/src/main/res/layout/alert_dialog_progress_bar.xml deleted file mode 100644 index 734ff777c3b..00000000000 --- a/android/alerts/common/src/main/res/layout/alert_dialog_progress_bar.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - -