Large diffs are not rendered by default.

@@ -14,12 +14,15 @@
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;

import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.utils.DirectoryInitialization;
import org.dolphinemu.dolphinemu.utils.Log;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
import org.dolphinemu.dolphinemu.utils.ThreadUtil;

import java.io.File;
@@ -50,6 +53,8 @@ public static void launch(Context context)
@Override
protected void onCreate(Bundle savedInstanceState)
{
ThemeHelper.setTheme(this);

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_user_data);
@@ -80,7 +85,8 @@ protected void onCreate(Bundle savedInstanceState)

buttonExportUserData.setOnClickListener(view -> exportUserData());

// show up button
Toolbar tb = findViewById(R.id.toolbar_user_data);
setSupportActionBar(tb);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}

@@ -100,26 +106,25 @@ public void onActivityResult(int requestCode, int resultCode, Intent data)
{
Uri uri = data.getData();

AlertDialog.Builder builder = new AlertDialog.Builder(this);

builder.setMessage(R.string.user_data_import_warning);
builder.setNegativeButton(R.string.no, (dialog, i) -> dialog.dismiss());
builder.setPositiveButton(R.string.yes, (dialog, i) ->
{
dialog.dismiss();

ThreadUtil.runOnThreadAndShowResult(this, R.string.import_in_progress,
R.string.do_not_close_app, () -> getResources().getString(importUserData(uri)),
(dialogInterface) ->
{
if (sMustRestartApp)
{
System.exit(0);
}
});
});

builder.show();
new MaterialAlertDialogBuilder(this)
.setMessage(R.string.user_data_import_warning)
.setNegativeButton(R.string.no, (dialog, i) -> dialog.dismiss())
.setPositiveButton(R.string.yes, (dialog, i) ->
{
dialog.dismiss();

ThreadUtil.runOnThreadAndShowResult(this, R.string.import_in_progress,
R.string.do_not_close_app,
() -> getResources().getString(importUserData(uri)),
(dialogInterface) ->
{
if (sMustRestartApp)
{
System.exit(0);
}
});
})
.show();
}
else if (requestCode == REQUEST_CODE_EXPORT && resultCode == Activity.RESULT_OK)
{
@@ -148,7 +153,7 @@ private void openFileManager()
{
// Activity not found. Perhaps it was removed by the OEM, or by some new Android version
// that didn't exist at the time of writing. Not much we can do other than tell the user
new AlertDialog.Builder(this)
new MaterialAlertDialogBuilder(this)
.setMessage(R.string.user_data_open_system_file_manager_failed)
.setPositiveButton(R.string.ok, null)
.show();
@@ -62,7 +62,8 @@ public CharSequence getPageTitle(int position)
// Apparently a workaround for TabLayout not supporting icons.
// TODO: This workaround will eventually not be necessary; switch to more legit methods when that is the case
// TODO: Also remove additional hax from styles.xml
Drawable drawable = mContext.getResources().getDrawable(TAB_ICONS[position]);
Drawable drawable =
mContext.getResources().getDrawable(TAB_ICONS[position], mContext.getTheme());
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());

ImageSpan imageSpan = new ImageSpan(drawable, ImageSpan.ALIGN_BOTTOM);
@@ -6,9 +6,10 @@
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;

import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.activities.EmulationActivity;
@@ -47,7 +48,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState)
boolean isWarning = requireArguments().getBoolean(ARG_IS_WARNING);
setCancelable(false);

AlertDialog.Builder builder = new AlertDialog.Builder(emulationActivity)
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(emulationActivity)
.setTitle(title)
.setMessage(message);

@@ -9,9 +9,10 @@
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;

import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.model.GameFile;
@@ -38,7 +39,6 @@ public Dialog onCreateDialog(Bundle savedInstanceState)
{
GameFile gameFile = GameFileCacheManager.addOrGet(getArguments().getString(ARG_GAME_PATH));

AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity());
ViewGroup contents = (ViewGroup) getActivity().getLayoutInflater()
.inflate(R.layout.dialog_game_details, null);

@@ -116,7 +116,8 @@ public Dialog onCreateDialog(Bundle savedInstanceState)

PicassoUtils.loadGameBanner(banner, gameFile);

builder.setView(contents);
return builder.create();
return new MaterialAlertDialogBuilder(requireActivity())
.setView(contents)
.create();
}
}
@@ -8,9 +8,10 @@
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;

import org.dolphinemu.dolphinemu.DolphinApplication;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.activities.ConvertActivity;
@@ -117,16 +118,16 @@ public Dialog onCreateDialog(Bundle savedInstanceState)
itemsBuilder.add(R.string.properties_clear_game_settings, (dialog, i) ->
clearGameSettingsWithConfirmation(gameId));

AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireContext())
.setTitle(requireContext()
.getString(R.string.preferences_game_properties_with_game_id, gameId));
itemsBuilder.applyToBuilder(builder);
builder.setTitle(requireContext()
.getString(R.string.preferences_game_properties_with_game_id, gameId));
return builder.create();
}

private void clearGameSettingsWithConfirmation(String gameId)
{
new AlertDialog.Builder(requireContext())
new MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.properties_clear_game_settings)
.setMessage(R.string.properties_clear_game_settings_confirmation)
.setPositiveButton(R.string.yes, (dialog, i) -> clearGameSettings(gameId))
@@ -3,13 +3,29 @@
package org.dolphinemu.dolphinemu.dialogs;

import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.TypedValue;
import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.MotionEvent;

import androidx.annotation.AttrRes;
import androidx.annotation.NonNull;
import androidx.annotation.StyleRes;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.view.ContextThemeWrapper;
import androidx.core.view.ViewCompat;

import com.google.android.material.color.MaterialColors;
import com.google.android.material.dialog.MaterialDialogs;
import com.google.android.material.resources.MaterialAttributes;
import com.google.android.material.shape.MaterialShapeDrawable;

import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.features.settings.model.view.InputBindingSetting;
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter;
import org.dolphinemu.dolphinemu.utils.ControllerMappingHelper;
@@ -18,12 +34,20 @@
import java.util.ArrayList;
import java.util.List;

import static com.google.android.material.theme.overlay.MaterialThemeOverlay.wrap;

/**
* {@link AlertDialog} derivative that listens for
* motion events from controllers and joysticks.
*/
public final class MotionAlertDialog extends AlertDialog
{
@AttrRes private static final int DEF_STYLE_ATTR = R.attr.alertDialogStyle;
@StyleRes private static final int DEF_STYLE_RES = R.style.MaterialAlertDialog_MaterialComponents;

@AttrRes
private static final int MATERIAL_ALERT_DIALOG_THEME_OVERLAY = R.attr.materialAlertDialogTheme;

// The selected input preference
private final InputBindingSetting setting;
private final ArrayList<Float> mPreviousValues = new ArrayList<>();
@@ -39,10 +63,63 @@ public final class MotionAlertDialog extends AlertDialog
*/
public MotionAlertDialog(Context context, InputBindingSetting setting, SettingsAdapter adapter)
{
super(context);
super(createMaterialAlertDialogThemedContext(context));

this.setting = setting;
mAdapter = adapter;

// Using code from MaterialAlertDialogBuilder allows us to nearly perfectly recreate its look
context = getContext();
Resources.Theme theme = context.getTheme();

int surfaceColor =
MaterialColors.getColor(context, R.attr.colorSurface, getClass().getCanonicalName());
MaterialShapeDrawable materialShapeDrawable =
new MaterialShapeDrawable(context, null, R.attr.alertDialogStyle,
R.style.MaterialAlertDialog_MaterialComponents);
materialShapeDrawable.initializeElevationOverlay(context);
materialShapeDrawable.setFillColor(ColorStateList.valueOf(surfaceColor));
materialShapeDrawable.setElevation(ViewCompat.getElevation(this.getWindow().getDecorView()));
this.getWindow().setBackgroundDrawable(materialShapeDrawable);

Rect backgroundInsets =
MaterialDialogs.getDialogBackgroundInsets(context, R.attr.alertDialogStyle,
R.style.MaterialAlertDialog_MaterialComponents);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
{
TypedValue dialogCornerRadiusValue = new TypedValue();
theme.resolveAttribute(android.R.attr.dialogCornerRadius, dialogCornerRadiusValue, true);
float dialogCornerRadius =
dialogCornerRadiusValue.getDimension(context.getResources().getDisplayMetrics());
if (dialogCornerRadiusValue.type == TypedValue.TYPE_DIMENSION && dialogCornerRadius >= 0)
{
materialShapeDrawable.setCornerSize(dialogCornerRadius);
}
}
Drawable insetDrawable = MaterialDialogs.insetDrawable(materialShapeDrawable, backgroundInsets);
this.getWindow().setBackgroundDrawable(insetDrawable);
}

private static Context createMaterialAlertDialogThemedContext(@NonNull Context context)
{
int themeOverlayId = getMaterialAlertDialogThemeOverlay(context);
Context themedContext = wrap(context, null, DEF_STYLE_ATTR, DEF_STYLE_RES);
if (themeOverlayId == 0)
{
return themedContext;
}
return new ContextThemeWrapper(themedContext, themeOverlayId);
}

private static int getMaterialAlertDialogThemeOverlay(@NonNull Context context)
{
TypedValue materialAlertDialogThemeOverlay =
MaterialAttributes.resolve(context, MATERIAL_ALERT_DIALOG_THEME_OVERLAY);
if (materialAlertDialogThemeOverlay == null)
{
return 0;
}
return materialAlertDialogThemeOverlay.data;
}

public boolean onKeyEvent(int keyCode, KeyEvent event)
@@ -7,16 +7,17 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ScrollView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textfield.TextInputLayout;

import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.features.cheats.model.Cheat;
import org.dolphinemu.dolphinemu.features.cheats.model.CheatsViewModel;
@@ -25,14 +26,14 @@ public class CheatDetailsFragment extends Fragment
{
private View mRoot;
private ScrollView mScrollView;
private TextView mLabelName;
private EditText mEditName;
private TextView mLabelCreator;
private EditText mEditCreator;
private TextView mLabelNotes;
private EditText mEditNotes;
private TextView mLabelCode;
private EditText mEditCode;
private TextInputLayout mEditNameLayout;
private TextInputEditText mEditName;
private TextInputLayout mEditCreatorLayout;
private TextInputEditText mEditCreator;
private TextInputLayout mEditNotesLayout;
private TextInputEditText mEditNotes;
private TextInputLayout mEditCodeLayout;
private TextInputEditText mEditCode;
private Button mButtonDelete;
private Button mButtonEdit;
private Button mButtonCancel;
@@ -54,14 +55,14 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
{
mRoot = view.findViewById(R.id.root);
mScrollView = view.findViewById(R.id.scroll_view);
mLabelName = view.findViewById(R.id.label_name);
mEditName = view.findViewById(R.id.edit_name);
mLabelCreator = view.findViewById(R.id.label_creator);
mEditCreator = view.findViewById(R.id.edit_creator);
mLabelNotes = view.findViewById(R.id.label_notes);
mEditNotes = view.findViewById(R.id.edit_notes);
mLabelCode = view.findViewById(R.id.label_code);
mEditCode = view.findViewById(R.id.edit_code);
mEditNameLayout = view.findViewById(R.id.edit_name);
mEditName = view.findViewById(R.id.edit_name_input);
mEditCreatorLayout = view.findViewById(R.id.edit_creator);
mEditCreator = view.findViewById(R.id.edit_creator_input);
mEditNotesLayout = view.findViewById(R.id.edit_notes);
mEditNotes = view.findViewById(R.id.edit_notes_input);
mEditCodeLayout = view.findViewById(R.id.edit_code);
mEditCode = view.findViewById(R.id.edit_code_input);
mButtonDelete = view.findViewById(R.id.button_delete);
mButtonEdit = view.findViewById(R.id.button_edit);
mButtonCancel = view.findViewById(R.id.button_cancel);
@@ -84,18 +85,17 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat

private void clearEditErrors()
{
mEditName.setError(null);
mEditCode.setError(null);
mEditNameLayout.setError(null);
mEditCodeLayout.setError(null);
}

private void onDeleteClicked(View view)
{
AlertDialog.Builder builder =
new AlertDialog.Builder(requireContext());
builder.setMessage(getString(R.string.cheats_delete_confirmation, mCheat.getName()));
builder.setPositiveButton(R.string.yes, (dialog, i) -> mViewModel.deleteSelectedCheat());
builder.setNegativeButton(R.string.no, null);
builder.show();
new MaterialAlertDialogBuilder(requireContext())
.setMessage(getString(R.string.cheats_delete_confirmation, mCheat.getName()))
.setPositiveButton(R.string.yes, (dialog, i) -> mViewModel.deleteSelectedCheat())
.setNegativeButton(R.string.no, null)
.show();
}

private void onEditClicked(View view)
@@ -134,19 +134,19 @@ private void onOkClicked(View view)
mButtonEdit.requestFocus();
break;
case Cheat.TRY_SET_FAIL_NO_NAME:
mEditName.setError(getString(R.string.cheats_error_no_name));
mScrollView.smoothScrollTo(0, mLabelName.getTop());
mEditNameLayout.setError(getString(R.string.cheats_error_no_name));
mScrollView.smoothScrollTo(0, mEditName.getTop());
break;
case Cheat.TRY_SET_FAIL_NO_CODE_LINES:
mEditCode.setError(getString(R.string.cheats_error_no_code_lines));
mEditCodeLayout.setError(getString(R.string.cheats_error_no_code_lines));
mScrollView.smoothScrollTo(0, mEditCode.getBottom());
break;
case Cheat.TRY_SET_FAIL_CODE_MIXED_ENCRYPTION:
mEditCode.setError(getString(R.string.cheats_error_mixed_encryption));
mEditCodeLayout.setError(getString(R.string.cheats_error_mixed_encryption));
mScrollView.smoothScrollTo(0, mEditCode.getBottom());
break;
default:
mEditCode.setError(getString(R.string.cheats_error_on_line, result));
mEditCodeLayout.setError(getString(R.string.cheats_error_on_line, result));
mScrollView.smoothScrollTo(0, mEditCode.getBottom());
break;
}
@@ -161,12 +161,9 @@ private void onSelectedCheatUpdated(@Nullable Cheat cheat)
int creatorVisibility = cheat != null && cheat.supportsCreator() ? View.VISIBLE : View.GONE;
int notesVisibility = cheat != null && cheat.supportsNotes() ? View.VISIBLE : View.GONE;
int codeVisibility = cheat != null && cheat.supportsCode() ? View.VISIBLE : View.GONE;
mLabelCreator.setVisibility(creatorVisibility);
mEditCreator.setVisibility(creatorVisibility);
mLabelNotes.setVisibility(notesVisibility);
mEditNotes.setVisibility(notesVisibility);
mLabelCode.setVisibility(codeVisibility);
mEditCode.setVisibility(codeVisibility);
mEditCreatorLayout.setVisibility(creatorVisibility);
mEditNotesLayout.setVisibility(notesVisibility);
mEditCodeLayout.setVisibility(codeVisibility);

boolean userDefined = cheat != null && cheat.getUserDefined();
mButtonDelete.setEnabled(userDefined);
@@ -13,17 +13,21 @@
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.ViewCompat;
import androidx.lifecycle.ViewModelProvider;
import androidx.slidingpanelayout.widget.SlidingPaneLayout;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;

import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.features.cheats.model.Cheat;
import org.dolphinemu.dolphinemu.features.cheats.model.CheatsViewModel;
import org.dolphinemu.dolphinemu.features.cheats.model.GeckoCheat;
import org.dolphinemu.dolphinemu.features.settings.model.Settings;
import org.dolphinemu.dolphinemu.ui.TwoPaneOnBackPressedCallback;
import org.dolphinemu.dolphinemu.ui.main.MainPresenter;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;

public class CheatsActivity extends AppCompatActivity
implements SlidingPaneLayout.PanelSlideListener
@@ -60,6 +64,8 @@ public static void launch(Context context, String gameId, String gameTdbId, int
@Override
protected void onCreate(Bundle savedInstanceState)
{
ThemeHelper.setTheme(this);

super.onCreate(savedInstanceState);

MainPresenter.skipRescanningLibrary();
@@ -94,7 +100,8 @@ protected void onCreate(Bundle savedInstanceState)

mViewModel.getOpenDetailsViewEvent().observe(this, this::openDetailsView);

// show up button
Toolbar tb = findViewById(R.id.toolbar_cheats);
setSupportActionBar(tb);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}

@@ -191,10 +198,10 @@ public Settings loadGameSpecificSettings()

public void downloadGeckoCodes()
{
AlertDialog progressDialog = new AlertDialog.Builder(this).create();
progressDialog.setTitle(R.string.cheats_downloading);
progressDialog.setCancelable(false);
progressDialog.show();
AlertDialog progressDialog = new MaterialAlertDialogBuilder(this)
.setMessage(R.string.cheats_downloading)
.setCancelable(false)
.show();

new Thread(() ->
{
@@ -206,14 +213,14 @@ public void downloadGeckoCodes()

if (codes == null)
{
new AlertDialog.Builder(this)
new MaterialAlertDialogBuilder(this)
.setMessage(getString(R.string.cheats_download_failed))
.setPositiveButton(R.string.ok, null)
.show();
}
else if (codes.length == 0)
{
new AlertDialog.Builder(this)
new MaterialAlertDialogBuilder(this)
.setMessage(getString(R.string.cheats_download_empty))
.setPositiveButton(R.string.ok, null)
.show();
@@ -223,7 +230,7 @@ else if (codes.length == 0)
int cheatsAdded = mViewModel.addDownloadedGeckoCodes(codes);
String message = getString(R.string.cheats_download_succeeded, codes.length, cheatsAdded);

new AlertDialog.Builder(this)
new MaterialAlertDialogBuilder(this)
.setMessage(message)
.setPositiveButton(R.string.ok, null)
.show();
@@ -17,6 +17,7 @@
import org.dolphinemu.dolphinemu.features.riivolution.model.RiivolutionPatches;
import org.dolphinemu.dolphinemu.features.settings.model.StringSetting;
import org.dolphinemu.dolphinemu.utils.DirectoryInitialization;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;

public class RiivolutionBootActivity extends AppCompatActivity
{
@@ -41,6 +42,8 @@ public static void launch(Context context, String gamePath, String gameId, int r
@Override
protected void onCreate(Bundle savedInstanceState)
{
ThemeHelper.setTheme(this);

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_riivolution_boot);
@@ -33,6 +33,7 @@ public enum IntSetting implements AbstractIntSetting
MAIN_CONTROL_OPACITY(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID, "ControlOpacity", 65),
MAIN_EMULATION_ORIENTATION(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID,
"EmulationOrientation", ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE),
MAIN_INTERFACE_THEME(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID, "InterfaceTheme", 0),
MAIN_LAST_PLATFORM_TAB(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID, "LastPlatformTab", 0),
MAIN_MOTION_CONTROLS(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID, "MotionControls", 1),
MAIN_IR_MODE(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID, "IRMode",
@@ -2,7 +2,6 @@

package org.dolphinemu.dolphinemu.features.settings.ui;

import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@@ -15,13 +14,18 @@
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.ViewModelProvider;

import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;

import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.ui.main.MainPresenter;
import org.dolphinemu.dolphinemu.utils.FileBrowserHelper;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;

import java.util.Set;

@@ -34,7 +38,9 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
private static final String FRAGMENT_TAG = "settings";
private SettingsActivityPresenter mPresenter;

private ProgressDialog dialog;
private AlertDialog dialog;

private CollapsingToolbarLayout mToolbarLayout;

public static void launch(Context context, MenuTag menuTag, String gameId, int revision,
boolean isWii)
@@ -58,6 +64,8 @@ public static void launch(Context context, MenuTag menuTag)
@Override
protected void onCreate(Bundle savedInstanceState)
{
ThemeHelper.setTheme(this);

super.onCreate(savedInstanceState);

// If we came here from the game list, we don't want to rescan when returning to the game list.
@@ -80,7 +88,9 @@ protected void onCreate(Bundle savedInstanceState)
mPresenter = new SettingsActivityPresenter(this, getSettings());
mPresenter.onCreate(savedInstanceState, menuTag, gameID, revision, isWii, this);

// show up button
Toolbar tb = findViewById(R.id.toolbar_settings);
mToolbarLayout = findViewById(R.id.toolbar_settings_layout);
setSupportActionBar(tb);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}

@@ -211,11 +221,12 @@ public void showLoading()
{
if (dialog == null)
{
dialog = new ProgressDialog(this);
dialog.setMessage(getString(R.string.load_settings));
dialog.setIndeterminate(true);
dialog = new MaterialAlertDialogBuilder(this)
.setTitle(getString(R.string.load_settings))
.setView(getLayoutInflater().inflate(R.layout.dialog_indeterminate_progress, null,
false))
.create();
}

dialog.show();
}

@@ -228,7 +239,7 @@ public void hideLoading()
@Override
public void showGameIniJunkDeletionQuestion()
{
new AlertDialog.Builder(this)
new MaterialAlertDialogBuilder(this)
.setTitle(getString(R.string.game_ini_junk_title))
.setMessage(getString(R.string.game_ini_junk_question))
.setPositiveButton(R.string.yes, (dialogInterface, i) -> mPresenter.clearSettings())
@@ -312,4 +323,9 @@ private SettingsFragment getFragment()
{
return (SettingsFragment) getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG);
}

public void setToolbarTitle(String title)
{
mToolbarLayout.setTitle(title);
}
}
@@ -108,4 +108,9 @@
* Tell the user that there is junk in the game INI and ask if they want to delete the whole file.
*/
void showGameIniJunkDeletionQuestion();

/**
* Accesses the material toolbar layout and changes the title
*/
void setToolbarTitle(String title);
}
@@ -10,13 +10,16 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.SeekBar;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.RecyclerView;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.slider.Slider;
import com.google.android.material.textfield.TextInputEditText;

import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.dialogs.MotionAlertDialog;
import org.dolphinemu.dolphinemu.features.settings.model.Settings;
@@ -56,15 +59,14 @@
import java.util.ArrayList;

public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolder>
implements DialogInterface.OnClickListener, SeekBar.OnSeekBarChangeListener
implements DialogInterface.OnClickListener, Slider.OnChangeListener
{
private final SettingsFragmentView mView;
private final Context mContext;
private ArrayList<SettingsItem> mSettings;

private SettingsItem mClickedItem;
private int mClickedPosition;
private int mSeekbarMinValue;
private int mSeekbarProgress;

private AlertDialog mDialog;
@@ -204,28 +206,27 @@ public void onInputStringClick(InputStringSetting item, int position)
{
LayoutInflater inflater = LayoutInflater.from(mContext);

AlertDialog.Builder builder = new AlertDialog.Builder(mContext, R.style.DolphinDialogBase);
View dialogView = inflater.inflate(R.layout.dialog_input_string, null);
EditText input = (EditText) dialogView.findViewById(R.id.input);
TextInputEditText input = dialogView.findViewById(R.id.input);
input.setText(item.getSelectedValue(getSettings()));

builder.setView(dialogView);
builder.setMessage(item.getDescription());
builder.setPositiveButton(R.string.ok, (dialogInterface, i) ->
{
String editTextInput = input.getText().toString();

if (!item.getSelectedValue(mView.getSettings()).equals(editTextInput))
{
notifyItemChanged(position);
mView.onSettingChanged();
}
mDialog = new MaterialAlertDialogBuilder(mView.getActivity())
.setView(dialogView)
.setMessage(item.getDescription())
.setPositiveButton(R.string.ok, (dialogInterface, i) ->
{
String editTextInput = input.getText().toString();

item.setSelectedValue(mView.getSettings(), editTextInput);
});
builder.setNegativeButton(R.string.cancel, null);
if (!item.getSelectedValue(mView.getSettings()).equals(editTextInput))
{
notifyItemChanged(position);
mView.onSettingChanged();
}

mDialog = builder.show();
item.setSelectedValue(mView.getSettings(), editTextInput);
})
.setNegativeButton(R.string.cancel, null)
.show();
}

public void onSingleChoiceClick(SingleChoiceSetting item, int position)
@@ -235,26 +236,22 @@ public void onSingleChoiceClick(SingleChoiceSetting item, int position)

int value = getSelectionForSingleChoiceValue(item);

AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity());

builder.setTitle(item.getName());
builder.setSingleChoiceItems(item.getChoicesId(), value, this);

mDialog = builder.show();
mDialog = new MaterialAlertDialogBuilder(mView.getActivity())
.setTitle(item.getName())
.setSingleChoiceItems(item.getChoicesId(), value, this)
.show();
}

public void onStringSingleChoiceClick(StringSingleChoiceSetting item, int position)
{
mClickedItem = item;
mClickedPosition = position;

AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity());

builder.setTitle(item.getName());
builder.setSingleChoiceItems(item.getChoices(), item.getSelectedValueIndex(getSettings()),
this);

mDialog = builder.show();
mDialog = new MaterialAlertDialogBuilder(mView.getActivity())
.setTitle(item.getName())
.setSingleChoiceItems(item.getChoices(), item.getSelectedValueIndex(getSettings()),
this)
.show();
}

public void onSingleChoiceDynamicDescriptionsClick(SingleChoiceSettingDynamicDescriptions item,
@@ -265,46 +262,39 @@ public void onSingleChoiceDynamicDescriptionsClick(SingleChoiceSettingDynamicDes

int value = getSelectionForSingleChoiceDynamicDescriptionsValue(item);

AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity());

builder.setTitle(item.getName());
builder.setSingleChoiceItems(item.getChoicesId(), value, this);

mDialog = builder.show();
mDialog = new MaterialAlertDialogBuilder(mView.getActivity())
.setTitle(item.getName())
.setSingleChoiceItems(item.getChoicesId(), value, this)
.show();
}

public void onSliderClick(SliderSetting item, int position)
{
mClickedItem = item;
mClickedPosition = position;
mSeekbarMinValue = item.getMin();
mSeekbarProgress = item.getSelectedValue(getSettings());
AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity());

LayoutInflater inflater = LayoutInflater.from(mView.getActivity());
View view = inflater.inflate(R.layout.dialog_seekbar, null);
View view = inflater.inflate(R.layout.dialog_slider, null);

builder.setTitle(item.getName());
builder.setView(view);
builder.setPositiveButton(R.string.ok, this);
mDialog = builder.show();
mDialog = new MaterialAlertDialogBuilder(mView.getActivity())
.setTitle(item.getName())
.setView(view)
.setPositiveButton(R.string.ok, this)
.show();

mTextSliderValue = view.findViewById(R.id.text_value);
mTextSliderValue.setText(String.valueOf(mSeekbarProgress));

TextView units = view.findViewById(R.id.text_units);
units.setText(item.getUnits());

SeekBar seekbar = view.findViewById(R.id.seekbar);

// TODO: Once we require API 26, uncomment this line and remove the mSeekbarMinValue variable
//seekbar.setMin(item.getMin());

seekbar.setMax(item.getMax() - mSeekbarMinValue);
seekbar.setProgress(mSeekbarProgress - mSeekbarMinValue);
seekbar.setKeyProgressIncrement(5);

seekbar.setOnSeekBarChangeListener(this);
Slider slider = view.findViewById(R.id.slider);
slider.setValueFrom(item.getMin());
slider.setValueTo(item.getMax());
slider.setValue(mSeekbarProgress);
slider.setStepSize(1);
slider.addOnChangeListener(this);
}

public void onSubmenuClick(SubmenuSetting item)
@@ -339,10 +329,10 @@ public void onFilePickerDirectoryClick(SettingsItem item, int position)

if (!PermissionsHandler.isExternalStorageLegacy())
{
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
builder.setMessage(R.string.path_not_changeable_scoped_storage);
builder.setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss());
builder.show();
new MaterialAlertDialogBuilder(mContext)
.setMessage(R.string.path_not_changeable_scoped_storage)
.setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss())
.show();
}
else
{
@@ -509,22 +499,12 @@ public void closeDialog()
}

@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
public void onValueChange(@NonNull Slider slider, float progress, boolean fromUser)
{
mSeekbarProgress = progress + mSeekbarMinValue;
mSeekbarProgress = (int) progress;
mTextSliderValue.setText(String.valueOf(mSeekbarProgress));
}

@Override
public void onStartTrackingTouch(SeekBar seekBar)
{
}

@Override
public void onStopTrackingTouch(SeekBar seekBar)
{
}

private int getValueForSingleChoiceSelection(SingleChoiceSetting item, int which)
{
int valuesId = item.getValuesId();
@@ -127,7 +127,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat

if (titles.containsKey(menuTag))
{
getActivity().setTitle(titles.get(menuTag));
mActivity.setToolbarTitle(getString(titles.get(menuTag)));
}

LinearLayoutManager manager = new LinearLayoutManager(getActivity());
@@ -43,6 +43,7 @@
import org.dolphinemu.dolphinemu.ui.main.MainPresenter;
import org.dolphinemu.dolphinemu.utils.BooleanSupplier;
import org.dolphinemu.dolphinemu.utils.EGLHelper;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
import org.dolphinemu.dolphinemu.utils.ThreadUtil;
import org.dolphinemu.dolphinemu.utils.WiiUtils;

@@ -323,6 +324,50 @@ private void addInterfaceSettings(ArrayList<SettingsItem> sl)
R.string.download_game_covers, 0));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.MAIN_SHOW_GAME_TITLES,
R.string.show_titles_in_game_list, R.string.show_titles_in_game_list_description));

AbstractIntSetting appTheme = new AbstractIntSetting()
{
@Override public boolean isOverridden(Settings settings)
{
return IntSetting.MAIN_INTERFACE_THEME.isOverridden(settings);
}

@Override public boolean isRuntimeEditable()
{
// This only affects app UI
return true;
}

@Override public boolean delete(Settings settings)
{
ThemeHelper.deleteThemeKey(mView.getActivity());
return IntSetting.MAIN_INTERFACE_THEME.delete(settings);
}

@Override public int getInt(Settings settings)
{
return IntSetting.MAIN_INTERFACE_THEME.getInt(settings);
}

@Override public void setInt(Settings settings, int newValue)
{
ThemeHelper.saveTheme(mView.getActivity(), newValue);
IntSetting.MAIN_INTERFACE_THEME.setInt(settings, newValue);
mView.getActivity().recreate();
}
};

// If a Monet theme is run on a device below API 31, the app will crash
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
{
sl.add(new SingleChoiceSetting(mContext, appTheme, R.string.change_theme, 0,
R.array.themeEntriesA12, R.array.themeValuesA12));
}
else
{
sl.add(new SingleChoiceSetting(mContext, appTheme, R.string.change_theme, 0,
R.array.themeEntries, R.array.themeValues));
}
}

private void addAudioSettings(ArrayList<SettingsItem> sl)
@@ -6,7 +6,7 @@
import android.text.method.LinkMovementMethod;
import android.view.View;

import androidx.core.content.ContextCompat;
import com.google.android.material.color.MaterialColors;

import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
@@ -27,7 +27,8 @@ public HeaderHyperLinkViewHolder(View itemView, SettingsAdapter adapter, Context
public void bind(SettingsItem item)
{
super.bind(item);

mHeaderName.setMovementMethod(LinkMovementMethod.getInstance());
mHeaderName.setLinkTextColor(ContextCompat.getColor(mContext, R.color.dolphin_blue_secondary));
mHeaderName.setLinkTextColor(MaterialColors.getColor(itemView, R.attr.colorTertiary));
}
}
@@ -8,7 +8,8 @@
import android.widget.Toast;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;

import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.features.settings.model.view.RunRunnable;
@@ -54,19 +55,16 @@ public void onClick(View clicked)

if (alertTextID > 0)
{
AlertDialog.Builder builder = new AlertDialog.Builder(mContext)
new MaterialAlertDialogBuilder(mContext)
.setTitle(mItem.getName())
.setMessage(alertTextID);

builder
.setMessage(alertTextID)
.setPositiveButton(R.string.ok, (dialog, whichButton) ->
{
runRunnable();
dialog.dismiss();
})
.setNegativeButton(R.string.cancel, (dialog, whichButton) -> dialog.dismiss());

builder.show();
.setNegativeButton(R.string.cancel, (dialog, whichButton) -> dialog.dismiss())
.show();
}
else
{
@@ -10,9 +10,10 @@
import android.widget.Toast;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.RecyclerView;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;

import org.dolphinemu.dolphinemu.DolphinApplication;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
@@ -96,20 +97,17 @@ public boolean onLongClick(View clicked)

Context context = clicked.getContext();

AlertDialog.Builder builder = new AlertDialog.Builder(context)
.setMessage(R.string.setting_clear_confirm);

builder
new MaterialAlertDialogBuilder(context)
.setMessage(R.string.setting_clear_confirm)
.setPositiveButton(R.string.ok, (dialog, whichButton) ->
{
getAdapter().clearSetting(item, getBindingAdapterPosition());
bind(item);
Toast.makeText(context, R.string.setting_cleared, Toast.LENGTH_SHORT).show();
dialog.dismiss();
})
.setNegativeButton(R.string.cancel, (dialog, whichButton) -> dialog.dismiss());

builder.show();
.setNegativeButton(R.string.cancel, (dialog, whichButton) -> dialog.dismiss())
.show();

return true;
}
@@ -7,10 +7,11 @@

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import androidx.lifecycle.ViewModelProvider;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;

import org.dolphinemu.dolphinemu.R;

public class OnlineUpdateRegionSelectDialogFragment extends DialogFragment
@@ -23,7 +24,7 @@ public Dialog onCreateDialog(@Nullable Bundle savedInstanceState)
R.string.japan), getString(R.string.korea), getString(R.string.united_states)};
int checkedItem = -1;

return new AlertDialog.Builder(requireContext())
return new MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.region_select_title)
.setSingleChoiceItems(items, checkedItem, (dialog, which) ->
{
@@ -35,8 +36,6 @@ public Dialog onCreateDialog(@Nullable Bundle savedInstanceState)
new SystemUpdateProgressBarDialogFragment();
progressBarFragment
.show(getParentFragmentManager(), "OnlineUpdateProgressBarDialogFragment");
progressBarFragment.setCancelable(false);

dismiss();
})
.create();
@@ -5,18 +5,19 @@
import android.app.Dialog;
import android.os.Bundle;

import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;

import org.dolphinemu.dolphinemu.R;

public class SystemMenuNotInstalledDialogFragment extends DialogFragment
{
@Override
public Dialog onCreateDialog(Bundle savedInstanceState)
{
return new AlertDialog.Builder(requireContext())
return new MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.system_menu_not_installed_title)
.setMessage(R.string.system_menu_not_installed_message)
.setPositiveButton(R.string.yes, (dialog, which) ->
@@ -27,10 +28,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState)
dialogFragment.show(fragmentManager, "OnlineUpdateRegionSelectDialogFragment");
dismiss();
})
.setNegativeButton(R.string.no, (dialog, which) ->
{
dismiss();
})
.setNegativeButton(R.string.no, (dialog, which) -> dismiss())
.create();
}
}
@@ -3,15 +3,20 @@
package org.dolphinemu.dolphinemu.features.sysupdate.ui;

import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import androidx.lifecycle.ViewModelProvider;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.progressindicator.LinearProgressIndicator;

import org.dolphinemu.dolphinemu.R;

public class SystemUpdateProgressBarDialogFragment extends DialogFragment
@@ -28,28 +33,20 @@ public Dialog onCreateDialog(@Nullable Bundle savedInstanceState)
SystemUpdateViewModel viewModel =
new ViewModelProvider(requireActivity()).get(SystemUpdateViewModel.class);

ProgressDialog progressDialog = new ProgressDialog(requireContext());
progressDialog.setTitle(getString(R.string.updating));
View dialogView = getLayoutInflater().inflate(R.layout.dialog_progress, null, false);
LinearProgressIndicator progressBar = dialogView.findViewById(R.id.update_progress);

// We need to set the message to something here, otherwise the text will not appear when we set it later.
progressDialog.setMessage("");
progressDialog.setButton(Dialog.BUTTON_NEGATIVE, getString(R.string.cancel), (dialog, i) ->
{
});
progressDialog.setOnShowListener((dialogInterface) ->
{
// By default, the ProgressDialog will immediately dismiss itself upon a button being pressed.
// Setting the OnClickListener again after the dialog is shown overrides this behavior.
progressDialog.getButton(Dialog.BUTTON_NEGATIVE).setOnClickListener((view) ->
{
viewModel.setCanceled();
});
});
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
AlertDialog progressDialog = new MaterialAlertDialogBuilder(requireContext())
.setTitle(getString(R.string.updating))
.setMessage("")
.setNegativeButton(getString(R.string.cancel), null)
.setView(dialogView)
.setCancelable(false)
.create();

viewModel.getProgressData().observe(this, (@Nullable Integer progress) ->
{
progressDialog.setProgress(progress.intValue());
});
viewModel.getProgressData()
.observe(this, (@Nullable Integer progress) -> progressBar.setProgress(progress));

viewModel.getTotalData().observe(this, (@Nullable Integer total) ->
{
@@ -58,13 +55,11 @@ public Dialog onCreateDialog(@Nullable Bundle savedInstanceState)
return;
}

progressDialog.setMax(total.intValue());
progressBar.setMax(total);
});

viewModel.getTitleIdData().observe(this, (@Nullable Long titleId) ->
{
progressDialog.setMessage(getString(R.string.updating_message, titleId));
});
viewModel.getTitleIdData().observe(this, (@Nullable Long titleId) -> progressDialog.setMessage(
getString(R.string.updating_message, titleId)));

viewModel.getResultData().observe(this, (@Nullable Integer result) ->
{
@@ -88,4 +83,17 @@ public Dialog onCreateDialog(@Nullable Bundle savedInstanceState)
}
return progressDialog;
}

// By default, the ProgressDialog will immediately dismiss itself upon a button being pressed.
// Setting the OnClickListener again after the dialog is shown overrides this behavior.
@Override
public void onResume()
{
super.onResume();
AlertDialog alertDialog = (AlertDialog) getDialog();
SystemUpdateViewModel viewModel =
new ViewModelProvider(requireActivity()).get(SystemUpdateViewModel.class);
Button negativeButton = alertDialog.getButton(Dialog.BUTTON_NEGATIVE);
negativeButton.setOnClickListener(v -> viewModel.setCanceled());
}
}
@@ -6,10 +6,11 @@
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import androidx.lifecycle.ViewModelProvider;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;

import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.utils.WiiUtils;

@@ -88,13 +89,10 @@ public Dialog onCreateDialog(Bundle savedInstanceState)
throw new IllegalStateException("Unexpected value: " + mResult);
}

return new AlertDialog.Builder(requireContext())
return new MaterialAlertDialogBuilder(requireContext())
.setTitle(title)
.setMessage(message)
.setPositiveButton(R.string.ok, (dialog, which) ->
{
dismiss();
})
.setPositiveButton(R.string.ok, (dialog, which) -> dismiss())
.create();
}

@@ -3,7 +3,6 @@
package org.dolphinemu.dolphinemu.fragments;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
@@ -22,6 +21,9 @@
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.progressindicator.LinearProgressIndicator;

import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.model.GameFile;
@@ -361,12 +363,11 @@ private Runnable addAreYouSureDialog(Runnable action, @StringRes int warning_tex
return () ->
{
Context context = requireContext();
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setMessage(warning_text)
new MaterialAlertDialogBuilder(context)
.setMessage(warning_text)
.setPositiveButton(R.string.yes, (dialog, i) -> action.run())
.setNegativeButton(R.string.no, null);
AlertDialog alert = builder.create();
alert.show();
.setNegativeButton(R.string.no, null)
.show();
};
}

@@ -422,20 +423,16 @@ private void convert(String outPath)

mCanceled = false;

// For some reason, setting R.style.DolphinDialogBase as the theme here gives us white text
// on a white background when the device is set to dark mode, so let's not set a theme.
ProgressDialog progressDialog = new ProgressDialog(context);

progressDialog.setTitle(R.string.convert_converting);

progressDialog.setIndeterminate(false);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setMax(PROGRESS_RESOLUTION);
View dialogView = getLayoutInflater().inflate(R.layout.dialog_progress, null, false);
LinearProgressIndicator progressBar = dialogView.findViewById(R.id.update_progress);
progressBar.setMax(PROGRESS_RESOLUTION);

progressDialog.setCancelable(true);
progressDialog.setOnCancelListener((dialog) -> mCanceled = true);

progressDialog.show();
AlertDialog progressDialog = new MaterialAlertDialogBuilder(context)
.setTitle(R.string.convert_converting)
.setOnCancelListener((dialog) -> mCanceled = true)
.setNegativeButton(getString(R.string.cancel), (dialog, i) -> dialog.dismiss())
.setView(dialogView)
.show();

mThread = new Thread(() ->
{
@@ -447,9 +444,8 @@ private void convert(String outPath)
requireActivity().runOnUiThread(() ->
{
progressDialog.setMessage(text);
progressDialog.setProgress((int) (completion * PROGRESS_RESOLUTION));
progressBar.setProgress((int) (completion * PROGRESS_RESOLUTION));
});

return !mCanceled;
});

@@ -459,7 +455,7 @@ private void convert(String outPath)
{
progressDialog.dismiss();

AlertDialog.Builder builder = new AlertDialog.Builder(context);
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
if (success)
{
builder.setMessage(R.string.convert_success_message)
@@ -475,8 +471,7 @@ private void convert(String outPath)
builder.setMessage(R.string.convert_failure_message)
.setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss());
}
AlertDialog alert = builder.create();
alert.show();
builder.show();
});
}
});
@@ -37,20 +37,23 @@
import org.dolphinemu.dolphinemu.utils.FileBrowserHelper;
import org.dolphinemu.dolphinemu.utils.PermissionsHandler;
import org.dolphinemu.dolphinemu.utils.StartupHandler;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
import org.dolphinemu.dolphinemu.utils.WiiUtils;

/**
* The main Activity of the Lollipop style UI. Manages several PlatformGamesFragments, which
* individually display a grid of available games for each Fragment, in a tabbed layout.
*/
public final class MainActivity extends AppCompatActivity
implements MainView, SwipeRefreshLayout.OnRefreshListener
implements MainView, SwipeRefreshLayout.OnRefreshListener, ThemeProvider
{
private ViewPager mViewPager;
private Toolbar mToolbar;
private TabLayout mTabLayout;
private FloatingActionButton mFab;

private int mThemeId;

private final MainPresenter mPresenter = new MainPresenter(this, this);

@Override
@@ -60,6 +63,8 @@ protected void onCreate(Bundle savedInstanceState)
splashScreen.setKeepOnScreenCondition(
() -> !DirectoryInitialization.areDolphinDirectoriesReady());

ThemeHelper.setTheme(this);

super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

@@ -74,7 +79,10 @@ protected void onCreate(Bundle savedInstanceState)

// Stuff in this block only happens when this activity is newly created (i.e. not a rotation)
if (savedInstanceState == null)
{
StartupHandler.HandleInit(this);
new AfterDirectoryInitializationRunner().runWithLifecycle(this, this::checkTheme);
}

if (!DirectoryInitialization.isWaitingForWriteAccess(this))
{
@@ -86,6 +94,8 @@ protected void onCreate(Bundle savedInstanceState)
@Override
protected void onResume()
{
ThemeHelper.setCorrectTheme(this);

super.onResume();

if (DirectoryInitialization.shouldStart(this))
@@ -355,4 +365,22 @@ public void onTabSelected(@NonNull TabLayout.Tab tab)
showGames();
GameFileCacheManager.startLoad(this);
}

@Override
public void setTheme(int themeId)
{
super.setTheme(themeId);
this.mThemeId = themeId;
}

@Override
public int getThemeId()
{
return mThemeId;
}

private void checkTheme()
{
ThemeHelper.setCorrectTheme(this);
}
}
@@ -7,11 +7,12 @@
import android.net.Uri;

import androidx.activity.ComponentActivity;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;

import org.dolphinemu.dolphinemu.BuildConfig;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.activities.EmulationActivity;
@@ -171,11 +172,12 @@ public void onDirectorySelected(Intent result)
if (Arrays.stream(childNames).noneMatch((name) -> FileBrowserHelper.GAME_EXTENSIONS.contains(
FileBrowserHelper.getExtension(name, false))))
{
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
builder.setMessage(mActivity.getString(R.string.wrong_file_extension_in_directory,
FileBrowserHelper.setToSortedDelimitedString(FileBrowserHelper.GAME_EXTENSIONS)));
builder.setPositiveButton(R.string.ok, null);
builder.show();
new MaterialAlertDialogBuilder(mActivity)
.setMessage(mActivity.getString(R.string.wrong_file_extension_in_directory,
FileBrowserHelper.setToSortedDelimitedString(
FileBrowserHelper.GAME_EXTENSIONS)))
.setPositiveButton(R.string.ok, null)
.show();
}

ContentResolver contentResolver = mActivity.getContentResolver();
@@ -209,13 +211,12 @@ public void importWiiSave(String path)
{
mActivity.runOnUiThread(() ->
{
AlertDialog.Builder builder =
new AlertDialog.Builder(mActivity);
builder.setMessage(R.string.wii_save_exists);
builder.setCancelable(false);
builder.setPositiveButton(R.string.yes, (dialog, i) -> canOverwriteFuture.complete(true));
builder.setNegativeButton(R.string.no, (dialog, i) -> canOverwriteFuture.complete(false));
builder.show();
new MaterialAlertDialogBuilder(mActivity)
.setMessage(R.string.wii_save_exists)
.setCancelable(false)
.setPositiveButton(R.string.yes, (dialog, i) -> canOverwriteFuture.complete(true))
.setNegativeButton(R.string.no, (dialog, i) -> canOverwriteFuture.complete(false))
.show();
});

try
@@ -255,26 +256,23 @@ public void importWiiSave(String path)

public void importNANDBin(String path)
{
AlertDialog.Builder builder =
new AlertDialog.Builder(mActivity);

builder.setMessage(R.string.nand_import_warning);
builder.setNegativeButton(R.string.no, (dialog, i) -> dialog.dismiss());
builder.setPositiveButton(R.string.yes, (dialog, i) ->
{
dialog.dismiss();

ThreadUtil.runOnThreadAndShowResult(mActivity, R.string.import_in_progress,
R.string.do_not_close_app, () ->
{
// ImportNANDBin unfortunately doesn't provide any result value...
// It does however show a panic alert if something goes wrong.
WiiUtils.importNANDBin(path);
return null;
});
});

builder.show();
new MaterialAlertDialogBuilder(mActivity)
.setMessage(R.string.nand_import_warning)
.setNegativeButton(R.string.no, (dialog, i) -> dialog.dismiss())
.setPositiveButton(R.string.yes, (dialog, i) ->
{
dialog.dismiss();

ThreadUtil.runOnThreadAndShowResult(mActivity, R.string.import_in_progress,
R.string.do_not_close_app, () ->
{
// ImportNANDBin unfortunately doesn't provide any result value...
// It does however show a panic alert if something goes wrong.
WiiUtils.importNANDBin(path);
return null;
});
})
.show();
}

public static void skipRescanningLibrary()
@@ -0,0 +1,9 @@
package org.dolphinemu.dolphinemu.ui.main;

public interface ThemeProvider
{
/**
* Provides theme ID by overriding an activity's 'setTheme' method and returning that result
*/
int getThemeId();
}
@@ -6,7 +6,6 @@
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.util.TypedValue;

import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
@@ -121,10 +120,6 @@ void setupUI()
{
mSwipeRefresh = findViewById(R.id.swipe_refresh);

TypedValue typedValue = new TypedValue();
getTheme().resolveAttribute(R.attr.colorPrimary, typedValue, true);
mSwipeRefresh.setColorSchemeColors(typedValue.data);

mSwipeRefresh.setOnRefreshListener(this);

setRefreshing(GameFileCacheManager.isLoadingOrRescanning());
@@ -138,7 +133,7 @@ void setupUI()

// Set display parameters for the BrowseFragment
mBrowseFragment.setHeadersState(BrowseSupportFragment.HEADERS_ENABLED);
mBrowseFragment.setBrandColor(ContextCompat.getColor(this, R.color.dolphin_blue_secondary));
mBrowseFragment.setBrandColor(ContextCompat.getColor(this, R.color.dolphin_blue));
buildRowsAdapter();

mBrowseFragment.setOnItemViewClickedListener(
@@ -364,39 +359,39 @@ private ListRow buildSettingsRow()
ArrayObjectAdapter rowItems = new ArrayObjectAdapter(new SettingsRowPresenter());

rowItems.add(new TvSettingsItem(R.id.menu_settings,
R.drawable.ic_settings,
R.drawable.ic_settings_tv,
R.string.grid_menu_settings));

rowItems.add(new TvSettingsItem(R.id.button_add_directory,
R.drawable.ic_add_tv,
R.string.add_directory_title));

rowItems.add(new TvSettingsItem(R.id.menu_refresh,
R.drawable.ic_refresh,
R.drawable.ic_refresh_tv,
R.string.grid_menu_refresh));

rowItems.add(new TvSettingsItem(R.id.menu_open_file,
R.drawable.ic_play,
R.drawable.ic_play_tv,
R.string.grid_menu_open_file));

rowItems.add(new TvSettingsItem(R.id.menu_install_wad,
R.drawable.ic_folder,
R.drawable.ic_folder_tv,
R.string.grid_menu_install_wad));

rowItems.add(new TvSettingsItem(R.id.menu_load_wii_system_menu,
R.drawable.ic_folder,
R.drawable.ic_folder_tv,
R.string.grid_menu_load_wii_system_menu));

rowItems.add(new TvSettingsItem(R.id.menu_import_wii_save,
R.drawable.ic_folder,
R.drawable.ic_folder_tv,
R.string.grid_menu_import_wii_save));

rowItems.add(new TvSettingsItem(R.id.menu_import_nand_backup,
R.drawable.ic_folder,
R.drawable.ic_folder_tv,
R.string.grid_menu_import_nand_backup));

rowItems.add(new TvSettingsItem(R.id.menu_online_system_update,
R.drawable.ic_folder,
R.drawable.ic_folder_tv,
R.string.grid_menu_online_system_update));

// Create a header for this row.
@@ -3,7 +3,6 @@
package org.dolphinemu.dolphinemu.ui.platform;

import android.os.Bundle;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -15,6 +14,8 @@
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;

import com.google.android.material.color.MaterialColors;

import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.adapters.GameAdapter;
import org.dolphinemu.dolphinemu.services.GameFileCacheManager;
@@ -62,9 +63,10 @@ public void onViewCreated(@NonNull View view, Bundle savedInstanceState)
RecyclerView.LayoutManager layoutManager = new GridLayoutManager(getActivity(), columns);
mAdapter = new GameAdapter();

TypedValue typedValue = new TypedValue();
requireActivity().getTheme().resolveAttribute(R.attr.colorPrimary, typedValue, true);
mSwipeRefresh.setColorSchemeColors(typedValue.data);
// Set theme color to the refresh animation's background
mSwipeRefresh.setProgressBackgroundColorSchemeColor(
MaterialColors.getColor(mSwipeRefresh, R.attr.colorSurfaceVariant));
mSwipeRefresh.setColorSchemeColors(MaterialColors.getColor(mSwipeRefresh, R.attr.colorPrimary));

mSwipeRefresh.setOnRefreshListener(mOnRefreshListener);

@@ -5,7 +5,7 @@
import android.content.Context;
import android.content.DialogInterface.OnClickListener;

import androidx.appcompat.app.AlertDialog;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;

import java.util.ArrayList;

@@ -33,7 +33,7 @@ public void add(CharSequence label, OnClickListener listener)
mListeners.add(listener);
}

public void applyToBuilder(AlertDialog.Builder builder)
public void applyToBuilder(MaterialAlertDialogBuilder builder)
{
CharSequence[] labels = new CharSequence[mLabels.size()];
labels = mLabels.toArray(labels);
@@ -6,10 +6,10 @@
import android.os.Build;

import androidx.annotation.Keep;
import androidx.appcompat.app.AlertDialog;

import com.android.volley.Request;
import com.android.volley.toolbox.StringRequest;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;

import org.dolphinemu.dolphinemu.DolphinApplication;
import org.dolphinemu.dolphinemu.R;
@@ -36,17 +36,11 @@ public static void checkAnalyticsInit(Context context)

private static void showMessage(Context context)
{
new AlertDialog.Builder(context)
new MaterialAlertDialogBuilder(context)
.setTitle(context.getString(R.string.analytics))
.setMessage(context.getString(R.string.analytics_desc))
.setPositiveButton(R.string.yes, (dialogInterface, i) ->
{
firstAnalyticsAdd(true);
})
.setNegativeButton(R.string.no, (dialogInterface, i) ->
{
firstAnalyticsAdd(false);
})
.setPositiveButton(R.string.yes, (dialogInterface, i) -> firstAnalyticsAdd(true))
.setNegativeButton(R.string.no, (dialogInterface, i) -> firstAnalyticsAdd(false))
.show();
}

@@ -20,6 +20,7 @@
import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.activities.EmulationActivity;
import org.dolphinemu.dolphinemu.features.settings.model.IntSetting;

import java.io.File;
import java.io.FileOutputStream;
@@ -77,6 +78,15 @@ private static void init(Context context)

areDirectoriesAvailable = true;

SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
if (IntSetting.MAIN_INTERFACE_THEME.getIntGlobal() !=
preferences.getInt(ThemeHelper.CURRENT_THEME, ThemeHelper.DEFAULT))
{
preferences.edit()
.putInt(ThemeHelper.CURRENT_THEME, IntSetting.MAIN_INTERFACE_THEME.getIntGlobal())
.apply();
}

if (wiimoteIniWritten)
{
// This has to be done after calling NativeLibrary.Initialize(),
@@ -8,9 +8,9 @@
import android.os.Environment;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentActivity;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.nononsenseapps.filepicker.FilePickerActivity;
import com.nononsenseapps.filepicker.Utils;

@@ -126,7 +126,7 @@ public static void runAfterExtensionCheck(Context context, Uri uri, Set<String>
setToSortedDelimitedString(validExtensions));
}

new AlertDialog.Builder(context)
new MaterialAlertDialogBuilder(context)
.setMessage(message)
.setPositiveButton(R.string.yes, (dialogInterface, i) -> runnable.run())
.setNegativeButton(R.string.no, null)
@@ -0,0 +1,107 @@
package org.dolphinemu.dolphinemu.utils;

import android.app.Activity;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Build;
import android.preference.PreferenceManager;

import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.ui.main.ThemeProvider;

public class ThemeHelper
{
public static final String CURRENT_THEME = "current_theme";

public static final int DEFAULT = 0;
public static final int MONET = 1;
public static final int MATERIAL_DEFAULT = 2;
public static final int GREEN = 3;
public static final int PINK = 4;

public static void setTheme(Activity activity)
{
// We have to use shared preferences in addition to Dolphin's settings to guarantee that the
// requested theme id is ready before the onCreate method of any given Activity.
SharedPreferences preferences =
PreferenceManager.getDefaultSharedPreferences(activity.getApplicationContext());
switch (preferences.getInt(CURRENT_THEME, DEFAULT))
{
case DEFAULT:
activity.setTheme(R.style.Theme_Dolphin_Main);
activity.getWindow()
.setStatusBarColor(activity.getResources().getColor(R.color.dolphin_surface));
break;

case MONET:
activity.setTheme(R.style.Theme_Dolphin_Main_MaterialYou);
int currentNightMode = activity.getResources().getConfiguration().uiMode &
Configuration.UI_MODE_NIGHT_MASK;
switch (currentNightMode)
{
case Configuration.UI_MODE_NIGHT_NO:
activity.getWindow().setStatusBarColor(
activity.getResources().getColor(R.color.m3_sys_color_dynamic_light_surface));
break;
case Configuration.UI_MODE_NIGHT_YES:
activity.getWindow().setStatusBarColor(
activity.getResources().getColor(R.color.m3_sys_color_dynamic_dark_surface));
break;
}
break;

case MATERIAL_DEFAULT:
activity.setTheme(R.style.Theme_Dolphin_Main_Material);
activity.getWindow()
.setStatusBarColor(activity.getResources().getColor(R.color.dolphin_surface));
break;

case GREEN:
activity.setTheme(R.style.Theme_Dolphin_Main_Green);
activity.getWindow()
.setStatusBarColor(activity.getResources().getColor(R.color.green_surface));
break;

case PINK:
activity.setTheme(R.style.Theme_Dolphin_Main_Pink);
activity.getWindow()
.setStatusBarColor(activity.getResources().getColor(R.color.pink_surface));
break;
}

// Since the top app bar matches the color of the status bar, devices below API 23 have to get a
// black status bar since their icons do not adapt based on background color
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M)
{
activity.getWindow()
.setStatusBarColor(activity.getResources().getColor(android.R.color.black));
}
}

public static void saveTheme(Activity activity, int themeValue)
{
SharedPreferences preferences =
PreferenceManager.getDefaultSharedPreferences(activity.getApplicationContext());
preferences.edit().putInt(CURRENT_THEME, themeValue).apply();
}

public static void deleteThemeKey(Activity activity)
{
SharedPreferences preferences =
PreferenceManager.getDefaultSharedPreferences(activity.getApplicationContext());
preferences.edit().remove(CURRENT_THEME).apply();
activity.setTheme(R.style.Theme_Dolphin_Main);
activity.recreate();
}

public static void setCorrectTheme(Activity activity)
{
int currentTheme = ((ThemeProvider) activity).getThemeId();
setTheme(activity);

if (currentTheme != ((ThemeProvider) activity).getThemeId())
{
activity.recreate();
}
}
}
@@ -10,6 +10,8 @@
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;

import org.dolphinemu.dolphinemu.R;

import java.util.function.Supplier;
@@ -27,12 +29,14 @@ public static void runOnThreadAndShowResult(Activity activity, int progressTitle
@Nullable DialogInterface.OnDismissListener onResultDismiss)
{
Resources resources = activity.getResources();
AlertDialog progressDialog = new AlertDialog.Builder(activity)
AlertDialog progressDialog = new MaterialAlertDialogBuilder(activity)
.setTitle(progressTitle)
.setCancelable(false)
.create();
progressDialog.setTitle(progressTitle);

if (progressMessage != 0)
progressDialog.setMessage(resources.getString(progressMessage));
progressDialog.setCancelable(false);

progressDialog.show();

new Thread(() ->
@@ -44,12 +48,11 @@ public static void runOnThreadAndShowResult(Activity activity, int progressTitle

if (result != null)
{
AlertDialog.Builder builder =
new AlertDialog.Builder(activity);
builder.setMessage(result);
builder.setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss());
builder.setOnDismissListener(onResultDismiss);
builder.show();
new MaterialAlertDialogBuilder(activity)
.setMessage(result)
.setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss())
.setOnDismissListener(onResultDismiss)
.show();
}
});
}, resources.getString(progressTitle)).start();

This file was deleted.

@@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:fillColor="?attr/colorControlNormal"
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>
@@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:fillColor="?attr/colorOnSurface"
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>
@@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:fillColor="?attr/colorPrimary"
android:pathData="M10,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V8c0,-1.1 -0.9,-2 -2,-2h-8l-2,-2z"/>
</vector>
@@ -5,5 +5,5 @@
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M17,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7l-4,-4zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM15,9L5,9L5,5h10v4z"/>
android:pathData="M10,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V8c0,-1.1 -0.9,-2 -2,-2h-8l-2,-2z"/>
</vector>
@@ -3,14 +3,14 @@
android:width="24dp"
android:viewportHeight="1402"
android:viewportWidth="1402" >
<path android:fillColor="#ffffff"
<path android:fillColor="?attr/colorPrimary"
android:pathData="M634.7,41.1c-38.4,21.9 -70.2,39.9 -70.7,39.9 -0.4,-0 -7,3.6 -14.6,7.9 -23,13.1 -339.6,193.5 -387.6,220.9 -24.7,14 -44.8,25.7 -44.8,26.1 0.1,0.3 40.9,25 90.7,54.9l90.7,54.3 40,-23c22.1,-12.6 113.2,-64.8 202.5,-116 89.3,-51.2 162.7,-93.1 163.2,-93.1 0.4,-0 64.6,38.3 142.6,85.1 78,46.8 142.3,85.3 142.9,85.6 1.1,0.4 44.5,-25.1 49.5,-29.1 1.4,-1.2 32.1,-19.7 68.1,-41.1 53.6,-31.9 65.2,-39.2 63.9,-40.1 -3,-2 -464.3,-271.6 -465.5,-271.9 -0.6,-0.2 -32.5,17.6 -70.9,39.6z"/>
<path android:fillColor="#ffffff"
<path android:fillColor="?attr/colorPrimary"
android:pathData="M99,369.2c0,17.1 -4.4,473.4 -6.2,644l-0.3,26.7 13,7.7c7.2,4.2 72.6,42.9 145.5,85.9 72.9,43 178.9,105.5 235.5,139 56.7,33.4 126.5,74.7 155.2,91.6 28.7,17 52.5,30.9 52.8,30.9 0.3,-0 0.5,-48.5 0.5,-107.8l0,-107.7 -207.5,-117 -207.5,-117 0,-244 0,-244 -88.1,-54c-48.5,-29.7 -89.2,-54.6 -90.5,-55.3l-2.4,-1.3 0,22.3z"/>
<path android:fillColor="#ffffff"
<path android:fillColor="?attr/colorPrimary"
android:pathData="M1268.5,378.6c-22,12.9 -154.5,93 -294.5,178.2l-254.5,154.9 -0.3,152.1 -0.2,152.1 6.7,-3.8c9.6,-5.4 164.8,-91.9 213.3,-118.9 22.3,-12.3 41,-23 41.6,-23.6 0.8,-0.7 1.7,-18.8 2.9,-55.6 0.9,-30 1.9,-54.8 2.1,-55.2 0.9,-1.4 137.3,-82.8 138.8,-82.8 1.4,-0 1.6,13.3 1.6,133.2l0,133.3 -43.3,25.1c-38.1,22.2 -114.5,66.5 -308.2,179.1l-55,32 -0.3,106.6c-0.1,58.7 0,106.7 0.2,106.7 0.2,-0 75.2,-42.8 166.7,-95.1 91.5,-52.3 168.2,-95.9 170.4,-96.9 3.8,-1.7 249.3,-141.5 250.5,-142.6 0.4,-0.4 2,-701.7 1.6,-702 -0.1,-0 -18.1,10.4 -40.1,23.2z"/>
<path android:fillColor="#ffffff"
<path android:fillColor="?attr/colorPrimary"
android:pathData="M576.5,451.1c-74.2,42.4 -135.4,77.4 -135.8,77.9 -0.5,0.4 59.2,36.8 132.7,80.9l133.5,80.2 134.6,-78.3c74,-43 134.2,-78.5 133.8,-78.9 -0.5,-0.4 -59,-35.6 -130.1,-78.3 -71.1,-42.7 -130.3,-78.3 -131.5,-79.1 -2.1,-1.3 -10.4,3.3 -137.2,75.6z"/>
<path android:fillColor="#ffffff"
<path android:fillColor="?attr/colorPrimary"
android:pathData="M428,554.1c0,3 -0.7,59.4 -1.5,125.4 -0.8,66 -1.5,133.3 -1.6,149.5l-0.1,29.5 65.3,37.8c163.7,94.7 202.2,116.9 203.5,117.4 1.2,0.4 1.4,-21.1 1.2,-150.7l-0.3,-151.3 -132,-81c-72.6,-44.5 -132.6,-81.1 -133.2,-81.4 -1,-0.4 -1.3,1 -1.3,4.8z"/>
</vector>
@@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:fillColor="?attr/colorControlNormal"
android:pathData="M8,5v14l11,-7z"/>
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M8,5v14l11,-7z"/>
</vector>
@@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:fillColor="?attr/colorControlNormal"
android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -7.99,8s3.57,8 7.99,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z"/>
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -7.99,8s3.57,8 7.99,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z"/>
</vector>

This file was deleted.

@@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:fillColor="?attr/colorControlNormal"
android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
</vector>
@@ -4,14 +4,14 @@
android:width="24dp"
android:viewportHeight="2157"
android:viewportWidth="2157">
<path android:fillColor="#ffffff"
<path android:fillColor="?attr/colorPrimary"
android:pathData="M1593,564.1c-55.8,6.9 -99.4,51 -105,106.4 -5.7,55.8 33.7,110.3 90.9,125.7 9.6,2.6 35.1,3.6 47.3,1.9 17,-2.5 38,-9.2 50.8,-16.3 18.8,-10.4 35.9,-28.5 45.9,-48.6 15.9,-31.7 16,-73.6 0.4,-104.7 -6.1,-11.9 -17.7,-25.6 -32.4,-37.8 -21.3,-17.7 -45.2,-26.1 -77.9,-27.2 -6.9,-0.2 -15.9,-0 -20,0.6z"/>
<path android:fillColor="#ffffff"
<path android:fillColor="?attr/colorPrimary"
android:pathData="M2014.5,564.2c-12.5,1.4 -26,5.4 -38.1,11.2 -53.2,26 -79.8,86.4 -61.8,140.5 13.7,41.4 50.1,73.6 92.2,81.7 4.1,0.8 13.4,1.4 21.2,1.4 40.9,-0 78.8,-15.8 100.6,-41.9 32.4,-38.7 37.2,-94.7 11.7,-136 -5.9,-9.6 -27.8,-31.7 -38.4,-38.7 -21.7,-14.5 -56.5,-21.7 -87.4,-18.2z"/>
<path android:fillColor="#ffffff"
<path android:fillColor="?attr/colorPrimary"
android:pathData="M677.5,613.6c-19.6,2.7 -27.7,5 -41.5,11.9 -15.9,8.1 -29.9,19.3 -41.1,33.2 -19.9,24.8 -26.1,41.5 -56.3,152.3 -18.2,66.9 -62.7,235.8 -115.2,437.5 -10.9,41.8 -20,76.3 -20.3,76.7 -0.3,0.4 -12.2,-45.1 -26.5,-101 -95.8,-376.4 -151.6,-593.9 -154.1,-600.4 -0.4,-0.9 -1.6,-1.9 -2.8,-2.2 -3,-0.8 -218.7,-0.8 -218.7,-0 0,0.7 4.4,16.5 74.6,268.9 110.9,398.3 151.9,542.4 166.4,585 8.7,25.6 18.4,43 35,62.8 20,23.8 49.2,43.9 74.3,51.1 16.9,4.9 54.5,5.9 76.5,2 16.1,-2.8 35.2,-11 50.2,-21.5 9.7,-6.8 27.9,-25.1 35.4,-35.8 12.9,-18.1 23.4,-39.3 31.8,-64.1 7.1,-20.9 37,-127.4 84.9,-302 38.7,-140.8 63.4,-228.5 68.7,-244l1.9,-5.5 1.1,3.5c1.8,5.7 9.3,33 54.2,197.5 69.4,254.4 85.1,310.1 99.4,352 14.2,41.8 23,57 46.6,80.5 24.3,24.1 41.9,34.1 69.8,39.7 12.3,2.4 51.8,2.5 64.8,-0 52,-9.6 98.8,-53.9 119.4,-113.2 18.9,-54.6 62.3,-206.4 192.9,-676 22,-79.2 42.3,-151.9 45,-161.5 2.7,-9.6 4.5,-17.9 4.1,-18.4 -1.7,-1.7 -38.9,-2.5 -128.7,-2.5 -86.9,-0.1 -92.2,-0 -92.7,1.6 -0.3,1 -19.9,77.8 -43.6,170.8 -76.7,300.5 -110.5,431.6 -126.5,490 -10.1,36.8 -10.5,38.2 -11.5,36.5 -1.1,-2.1 -12.2,-43.8 -59.5,-224.5 -91.7,-350.5 -101.4,-385.3 -113.9,-409.9 -18.6,-36.6 -49.5,-61.4 -86.1,-69.2 -6.7,-1.5 -50.7,-2.8 -58,-1.8z"/>
<path android:fillColor="#ffffff"
<path android:fillColor="?attr/colorPrimary"
android:pathData="M1509,1250.5l0,336.5 104.5,-0 104.5,-0 0,-336.5 0,-336.5 -104.5,-0 -104.5,-0 0,336.5z"/>
<path android:fillColor="#ffffff"
<path android:fillColor="?attr/colorPrimary"
android:pathData="M1930,1250.5l0,336.5 104.8,-0.2 104.7,-0.3 0.3,-336.3 0.2,-336.2 -105,-0 -105,-0 0,336.5z"/>
</vector>
@@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_selected="true"
android:drawable="@color/dolphin_blue"/>
android:drawable="@color/dolphin_primary"/>
<item
android:drawable="@color/tv_card_unselected"/>
</selector>
@@ -1,22 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar_user_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_user_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurface" />

</com.google.android.material.appbar.AppBarLayout>

<TextView
android:id="@+id/text_type"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_medlarge"
tools:text="@string/user_data_new_location"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/divider"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/text_path"
app:layout_constraintEnd_toStartOf="@id/divider"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appbar_user_data"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintWidth_max="400dp" />
app:layout_constraintWidth_max="400dp"
tools:text="@string/user_data_new_location" />

<TextView
android:id="@+id/text_path"
@@ -74,11 +91,10 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_open_system_file_manager"
android:textColor="@color/dolphin_white"
app:layout_constraintStart_toEndOf="@id/divider"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/button_import_user_data"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/barrier_text"
app:layout_constraintTop_toBottomOf="@+id/appbar_user_data"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintWidth_max="400dp" />

@@ -88,8 +104,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_import"
android:textColor="@color/dolphin_white"
app:layout_constraintStart_toEndOf="@id/divider"
app:layout_constraintStart_toEndOf="@id/barrier_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_open_system_file_manager"
app:layout_constraintBottom_toTopOf="@id/button_export_user_data"
@@ -101,8 +116,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_export"
android:textColor="@color/dolphin_white"
app:layout_constraintStart_toEndOf="@id/divider"
app:layout_constraintStart_toEndOf="@id/barrier_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_import_user_data"
app:layout_constraintBottom_toBottomOf="parent"
@@ -29,7 +29,6 @@
android:focusable="true"
android:gravity="center"
android:nextFocusRight="@id/root"
android:buttonTint="@color/dolphin_blue"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/text_name"
@@ -38,8 +38,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="@dimen/spacing_small"
android:background="@color/dolphin_blue"
android:textColor="@color/lb_tv_white"
android:text="@string/emulation_done"
android:visibility="gone"/>

@@ -1,22 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.slidingpanelayout.widget.SlidingPaneLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/sliding_pane_layout"
android:id="@+id/coordinator_main"
android:layout_width="match_parent"
android:layout_height="match_parent">

<androidx.fragment.app.FragmentContainerView
android:layout_width="320dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="@+id/cheat_list"
android:name="org.dolphinemu.dolphinemu.features.cheats.ui.CheatListFragment" />
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar_cheats"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true">

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_cheats"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurface"/>

</com.google.android.material.appbar.AppBarLayout>

<androidx.fragment.app.FragmentContainerView
android:layout_width="320dp"
<androidx.slidingpanelayout.widget.SlidingPaneLayout
android:id="@+id/sliding_pane_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="@+id/cheat_details"
android:name="org.dolphinemu.dolphinemu.features.cheats.ui.CheatDetailsFragment" />
android:layout_marginTop="56dp">

<androidx.fragment.app.FragmentContainerView
android:id="@+id/cheat_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="org.dolphinemu.dolphinemu.features.cheats.ui.CheatListFragment" />

<androidx.fragment.app.FragmentContainerView
android:id="@+id/cheat_details"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="org.dolphinemu.dolphinemu.features.cheats.ui.CheatDetailsFragment" />

</androidx.slidingpanelayout.widget.SlidingPaneLayout>

</androidx.slidingpanelayout.widget.SlidingPaneLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
@@ -1,55 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/coordinator_main"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:id="@+id/appbar_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar">
android:layout_height="wrap_content">

<androidx.appcompat.widget.Toolbar
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_main"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/dolphin_blue"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/Theme.MaterialComponents.DayNight" />
android:background="?attr/colorSurface"
app:layout_scrollFlags="scroll|enterAlways|snap"
app:subtitleTextColor="?attr/colorOnSurface"
app:titleTextColor="?attr/colorOnSurface" />

<com.google.android.material.tabs.TabLayout
android:id="@+id/tabs_platforms"
style="@style/Widget.Design.TabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/dolphin_blue"
android:background="?attr/colorSurface"
app:tabGravity="fill"
app:tabIndicatorColor="@color/dolphin_white"
app:tabIndicatorColor="?attr/colorPrimary"
app:tabIndicatorHeight="3dp"
app:tabMode="fixed"
app:tabTextAppearance="@style/MyCustomTextAppearance" />
app:tabMode="fixed" />

</com.google.android.material.appbar.AppBarLayout>

<androidx.viewpager.widget.ViewPager
android:id="@+id/pager_platforms"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorSurface"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/button_add_directory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:backgroundTint="@color/dolphin_blue"
android:minHeight="48dp"
android:src="@drawable/ic_add"
app:borderWidth="0dp"
app:layout_anchor="@+id/pager_platforms"
app:layout_anchorGravity="bottom|right|end"
app:tint="@android:color/white" />
app:layout_anchorGravity="bottom|right|end" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
@@ -1,5 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/frame_content"/>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/coordinator_main"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar_settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true">

<com.google.android.material.appbar.CollapsingToolbarLayout
style="?attr/collapsingToolbarLayoutMediumStyle"
android:id="@+id/toolbar_settings_layout"
android:layout_width="match_parent"
android:layout_height="?attr/collapsingToolbarLayoutMediumSize"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_settings"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorSurface"
app:layout_collapseMode="pin" />

</com.google.android.material.appbar.CollapsingToolbarLayout>

</com.google.android.material.appbar.AppBarLayout>

<FrameLayout
android:id="@+id/frame_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
@@ -1,22 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar_user_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_user_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurface" />

</com.google.android.material.appbar.AppBarLayout>

<TextView
android:id="@+id/text_type"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_medlarge"
tools:text="@string/user_data_new_location"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/text_path"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appbar_user_data"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintWidth_max="400dp" />
app:layout_constraintWidth_max="400dp"
tools:text="@string/user_data_new_location" />

<TextView
android:id="@+id/text_path"
@@ -50,7 +67,6 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_open_system_file_manager"
android:textColor="@color/dolphin_white"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_android_11"
@@ -62,7 +78,6 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_import"
android:textColor="@color/dolphin_white"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_open_system_file_manager"
@@ -74,7 +89,6 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_export"
android:textColor="@color/dolphin_white"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_import_user_data"
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.google.android.material.progressindicator.CircularProgressIndicator
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_margin="16dp"
android:indeterminate="true"
app:trackCornerRadius="2dp" />

</RelativeLayout>