mirror of
https://git.h3cjp.net/H3cJP/citra.git
synced 2024-11-22 18:02:51 +00:00
citra_android: fix DiskShaderCacheProgress crash (#6346)
This commit is contained in:
parent
2cbf6fbb17
commit
aa8df317af
|
@ -6,7 +6,6 @@ package org.citra.citra_emu.disk_shader_cache;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
@ -56,10 +55,10 @@ public class DiskShaderCacheProgress {
|
|||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final Activity emulationActivity = Objects.requireNonNull(getActivity());
|
||||
final Activity emulationActivity = requireActivity();
|
||||
|
||||
final String title = Objects.requireNonNull(Objects.requireNonNull(getArguments()).getString("title"));
|
||||
final String message = Objects.requireNonNull(Objects.requireNonNull(getArguments()).getString("message"));
|
||||
final String title = Objects.requireNonNull(requireArguments().getString("title"));
|
||||
final String message = Objects.requireNonNull(requireArguments().getString("message"));
|
||||
|
||||
LayoutInflater inflater = LayoutInflater.from(emulationActivity);
|
||||
View view = inflater.inflate(R.layout.dialog_progress_bar, null);
|
||||
|
@ -75,15 +74,17 @@ public class DiskShaderCacheProgress {
|
|||
finishLock.notifyAll();
|
||||
}
|
||||
|
||||
return new MaterialAlertDialogBuilder(emulationActivity)
|
||||
dialog = new MaterialAlertDialogBuilder(emulationActivity)
|
||||
.setView(view)
|
||||
.setTitle(title)
|
||||
.setMessage(message)
|
||||
.setNegativeButton(android.R.string.cancel, (dialog, which) -> emulationActivity.onBackPressed())
|
||||
.create();
|
||||
return dialog;
|
||||
}
|
||||
|
||||
private void onUpdateProgress(String msg, int progress, int max) {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(() -> {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
progressBar.setProgress(progress);
|
||||
progressBar.setMax(max);
|
||||
progressText.setText(String.format("%d/%d", progress, max));
|
||||
|
|
Loading…
Reference in a new issue