Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(settings): fully drop deprecated ProgressDialog
- Loading branch information
1 parent
da5d73d
commit eb3790d
Showing
7 changed files
with
66 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.osfans.trime.util | ||
|
||
import android.content.Context | ||
import android.view.LayoutInflater | ||
import androidx.appcompat.app.AlertDialog | ||
import com.osfans.trime.databinding.DialogLoadingBinding | ||
|
||
fun createLoadingDialog(context: Context, textId: Int): AlertDialog { | ||
val binding = DialogLoadingBinding.inflate(LayoutInflater.from(context), null, false) | ||
binding.loadingText.text = context.getText(textId) | ||
|
||
return AlertDialog.Builder(context) | ||
.setCancelable(false) | ||
.setView(binding.root) | ||
.create() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
tools:context=".settings.PrefMainActivity"> | ||
|
||
<ProgressBar | ||
android:id="@+id/loading_bar" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="20dp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toStartOf="@id/loading_text" | ||
app:layout_constraintHorizontal_chainStyle="packed" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:id="@+id/loading_text" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="20dp" | ||
android:textSize="18sp" | ||
app:layout_constraintBottom_toBottomOf="@id/loading_bar" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toEndOf="@id/loading_bar" | ||
app:layout_constraintTop_toTopOf="@id/loading_bar" | ||
tools:text="Loading text here ..."/> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |