mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-18 06:40:07 +00:00
remove progressbar alert dialog
This commit is contained in:
parent
0b16d5c826
commit
af78f01682
@ -2,10 +2,6 @@
|
||||
|
||||
## 0.5.7
|
||||
|
||||
* `Android`
|
||||
* `Alerts`
|
||||
* `Common`
|
||||
* New extension `progressBarAlertDialog`
|
||||
* `Pagination`
|
||||
* `Ktor`
|
||||
* `Server`
|
||||
|
@ -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)
|
@ -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>
|
Loading…
Reference in New Issue
Block a user