remove progressbar alert dialog

This commit is contained in:
InsanusMokrassar 2021-06-06 10:43:42 +06:00
parent 0b16d5c826
commit af78f01682
3 changed files with 0 additions and 58 deletions

View File

@ -2,10 +2,6 @@
## 0.5.7
* `Android`
* `Alerts`
* `Common`
* New extension `progressBarAlertDialog`
* `Pagination`
* `Ktor`
* `Server`

View File

@ -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<TextView>(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)

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:background="@android:color/transparent">
<ProgressBar
android:id="@+id/alertDialogProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/alertDialogProgressBarTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"/>
</LinearLayout>