summaryrefslogtreecommitdiff
path: root/src/android
diff options
context:
space:
mode:
Diffstat (limited to 'src/android')
-rw-r--r--src/android/app/build.gradle.kts19
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/IndeterminateProgressDialogFragment.kt34
2 files changed, 43 insertions, 10 deletions
diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts
index fe79a701c..431f899b3 100644
--- a/src/android/app/build.gradle.kts
+++ b/src/android/app/build.gradle.kts
@@ -77,13 +77,30 @@ android {
buildConfigField("String", "BRANCH", "\"${getBranch()}\"")
}
+ val keystoreFile = System.getenv("ANDROID_KEYSTORE_FILE")
+ if (keystoreFile != null) {
+ signingConfigs {
+ create("release") {
+ storeFile = file(keystoreFile)
+ storePassword = System.getenv("ANDROID_KEYSTORE_PASS")
+ keyAlias = System.getenv("ANDROID_KEY_ALIAS")
+ keyPassword = System.getenv("ANDROID_KEYSTORE_PASS")
+ }
+ }
+ }
+
// Define build types, which are orthogonal to product flavors.
buildTypes {
// Signed by release key, allowing for upload to Play Store.
release {
+ signingConfig = if (keystoreFile != null) {
+ signingConfigs.getByName("release")
+ } else {
+ signingConfigs.getByName("debug")
+ }
+
resValue("string", "app_name_suffixed", "yuzu")
- signingConfig = signingConfigs.getByName("debug")
isMinifyEnabled = true
isDebuggable = false
proguardFiles(
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/IndeterminateProgressDialogFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/IndeterminateProgressDialogFragment.kt
index ea8eb073a..18bc34b9f 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/IndeterminateProgressDialogFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/IndeterminateProgressDialogFragment.kt
@@ -5,6 +5,9 @@ package org.yuzu.yuzu_emu.fragments
import android.app.Dialog
import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.DialogFragment
@@ -21,22 +24,40 @@ import org.yuzu.yuzu_emu.model.TaskViewModel
class IndeterminateProgressDialogFragment : DialogFragment() {
private val taskViewModel: TaskViewModel by activityViewModels()
+ private lateinit var binding: DialogProgressBarBinding
+
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val titleId = requireArguments().getInt(TITLE)
- val progressBinding = DialogProgressBarBinding.inflate(layoutInflater)
- progressBinding.progressBar.isIndeterminate = true
+ binding = DialogProgressBarBinding.inflate(layoutInflater)
+ binding.progressBar.isIndeterminate = true
val dialog = MaterialAlertDialogBuilder(requireContext())
.setTitle(titleId)
- .setView(progressBinding.root)
+ .setView(binding.root)
.create()
dialog.setCanceledOnTouchOutside(false)
+ if (!taskViewModel.isRunning.value) {
+ taskViewModel.runTask()
+ }
+ return dialog
+ }
+
+ override fun onCreateView(
+ inflater: LayoutInflater,
+ container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View {
+ return binding.root
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
viewLifecycleOwner.lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.CREATED) {
taskViewModel.isComplete.collect {
if (it) {
- dialog.dismiss()
+ dismiss()
when (val result = taskViewModel.result.value) {
is String -> Toast.makeText(requireContext(), result, Toast.LENGTH_LONG)
.show()
@@ -51,11 +72,6 @@ class IndeterminateProgressDialogFragment : DialogFragment() {
}
}
}
-
- if (!taskViewModel.isRunning.value) {
- taskViewModel.runTask()
- }
- return dialog
}
companion object {