parent
7482cf8a96
commit
bdb96c9629
@ -0,0 +1,28 @@ |
||||
package io.legado.app.ui.widget.dialog |
||||
|
||||
import android.app.Dialog |
||||
import android.content.Context |
||||
import io.legado.app.databinding.DialogWaitBinding |
||||
|
||||
|
||||
@Suppress("unused") |
||||
class WaitDialog(context: Context) : Dialog(context) { |
||||
|
||||
val binding = DialogWaitBinding.inflate(layoutInflater) |
||||
|
||||
init { |
||||
setCanceledOnTouchOutside(false) |
||||
setContentView(binding.root) |
||||
} |
||||
|
||||
fun setText(text: String): WaitDialog { |
||||
binding.tvMsg.text = text |
||||
return this |
||||
} |
||||
|
||||
fun setText(res: Int): WaitDialog { |
||||
binding.tvMsg.setText(res) |
||||
return this |
||||
} |
||||
|
||||
} |
@ -0,0 +1,25 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:background="@color/background" |
||||
android:gravity="center" |
||||
android:padding="20dp" |
||||
android:orientation="horizontal"> |
||||
|
||||
<ProgressBar |
||||
android:id="@+id/pb" |
||||
android:layout_width="30dp" |
||||
android:layout_height="30dp" |
||||
android:indeterminateBehavior="repeat" |
||||
android:indeterminateOnly="true" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_msg" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:padding="6dp" |
||||
android:gravity="center" |
||||
android:text="执行中......" |
||||
android:textColor="@color/primaryText" /> |
||||
</LinearLayout> |
Loading…
Reference in new issue