parent
5d844e0911
commit
f39b3af4fa
@ -0,0 +1,245 @@
|
|||||||
|
package com.fox2code.mmm;
|
||||||
|
|
||||||
|
import static com.fox2code.mmm.utils.IntentHelper.getActivity;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.ActionBar;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
|
import com.fox2code.foxcompat.app.FoxActivity;
|
||||||
|
import com.fox2code.mmm.databinding.ActivitySetupBinding;
|
||||||
|
import com.fox2code.rosettax.LanguageActivity;
|
||||||
|
import com.fox2code.rosettax.LanguageSwitcher;
|
||||||
|
import com.google.android.material.button.MaterialButton;
|
||||||
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
|
import com.google.android.material.materialswitch.MaterialSwitch;
|
||||||
|
import com.topjohnwu.superuser.internal.UiThreadHandler;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class SetupActivity extends FoxActivity implements LanguageActivity {
|
||||||
|
|
||||||
|
private ActivitySetupBinding binding;
|
||||||
|
private boolean mSupportsDarkText;
|
||||||
|
|
||||||
|
@SuppressLint({"ApplySharedPref", "RestrictedApi"})
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
this.setTitle(R.string.app_name);
|
||||||
|
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, 0);
|
||||||
|
// Set theme
|
||||||
|
SharedPreferences prefs = MainApplication.getSharedPreferences();
|
||||||
|
switch (prefs.getString("theme", "system")) {
|
||||||
|
case "light":
|
||||||
|
setTheme(R.style.Theme_MagiskModuleManager_Monet_Light);
|
||||||
|
break;
|
||||||
|
case "dark":
|
||||||
|
setTheme(R.style.Theme_MagiskModuleManager_Monet_Dark);
|
||||||
|
break;
|
||||||
|
case "system":
|
||||||
|
setTheme(R.style.Theme_MagiskModuleManager_Monet);
|
||||||
|
break;
|
||||||
|
case "black":
|
||||||
|
setTheme(R.style.Theme_MagiskModuleManager_Monet_Black);
|
||||||
|
break;
|
||||||
|
case "transparent_light":
|
||||||
|
setTheme(R.style.Theme_MagiskModuleManager_Transparent_Light);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
binding = ActivitySetupBinding.inflate(getLayoutInflater());
|
||||||
|
setContentView(binding.getRoot());
|
||||||
|
// Show setup box. Put the setup_box in the main activity layout
|
||||||
|
View view = binding.setupBox;
|
||||||
|
// Make the setup_box linear layout the sole child of the root_container constraint layout
|
||||||
|
setContentView(view);
|
||||||
|
// Handle action bar. Set it to setup_title and make it visible
|
||||||
|
ActionBar actionBar = getSupportActionBar();
|
||||||
|
if (actionBar != null) {
|
||||||
|
actionBar.setTitle(R.string.app_name);
|
||||||
|
// Set solid color background
|
||||||
|
actionBar.show();
|
||||||
|
}
|
||||||
|
((MaterialSwitch) Objects.requireNonNull(view.findViewById(R.id.setup_background_update_check))).setChecked(BuildConfig.ENABLE_AUTO_UPDATER);
|
||||||
|
((MaterialSwitch) Objects.requireNonNull(view.findViewById(R.id.setup_crash_reporting))).setChecked(BuildConfig.DEFAULT_ENABLE_CRASH_REPORTING);
|
||||||
|
// Repos are a little harder, as the enabled_repos build config is an arraylist
|
||||||
|
((MaterialSwitch) Objects.requireNonNull(view.findViewById(R.id.setup_androidacy_repo))).setChecked(BuildConfig.ENABLED_REPOS.contains("androidacy_repo"));
|
||||||
|
((MaterialSwitch) Objects.requireNonNull(view.findViewById(R.id.setup_magisk_alt_repo))).setChecked(BuildConfig.ENABLED_REPOS.contains("magisk_alt_repo"));
|
||||||
|
// On debug builds, log when a switch is toggled
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
((MaterialSwitch) Objects.requireNonNull(view.findViewById(R.id.setup_background_update_check))).setOnCheckedChangeListener((buttonView, isChecked) -> Log.i("SetupWizard", "Background Update Check: " + isChecked));
|
||||||
|
((MaterialSwitch) Objects.requireNonNull(view.findViewById(R.id.setup_crash_reporting))).setOnCheckedChangeListener((buttonView, isChecked) -> Log.i("SetupWizard", "Crash Reporting: " + isChecked));
|
||||||
|
((MaterialSwitch) Objects.requireNonNull(view.findViewById(R.id.setup_androidacy_repo))).setOnCheckedChangeListener((buttonView, isChecked) -> Log.i("SetupWizard", "Androidacy Repo: " + isChecked));
|
||||||
|
((MaterialSwitch) Objects.requireNonNull(view.findViewById(R.id.setup_magisk_alt_repo))).setOnCheckedChangeListener((buttonView, isChecked) -> Log.i("SetupWizard", "Magisk Alt Repo: " + isChecked));
|
||||||
|
}
|
||||||
|
// Setup popup dialogue for the setup_theme_button
|
||||||
|
MaterialButton themeButton = view.findViewById(R.id.setup_theme_button);
|
||||||
|
themeButton.setOnClickListener(v -> {
|
||||||
|
// Create a new dialog for the theme picker
|
||||||
|
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this);
|
||||||
|
builder.setTitle(R.string.setup_theme_title);
|
||||||
|
// Create a new array of theme names (system, light, dark, black, transparent light)
|
||||||
|
String[] themeNames = new String[]{getString(R.string.theme_system), getString(R.string.theme_light), getString(R.string.theme_dark), getString(R.string.theme_black), getString(R.string.theme_transparent_light)};
|
||||||
|
// Create a new array of theme values (system, light, dark, black, transparent_light)
|
||||||
|
String[] themeValues = new String[]{"system", "light", "dark", "black", "transparent_light"};
|
||||||
|
// if pref_theme is set, check the relevant theme_* menu item, otherwise check the default (theme_system)
|
||||||
|
String prefTheme = prefs.getString("pref_theme", "system");
|
||||||
|
int checkedItem = 0;
|
||||||
|
switch (prefTheme) {
|
||||||
|
case "system":
|
||||||
|
break;
|
||||||
|
case "light":
|
||||||
|
checkedItem = 1;
|
||||||
|
break;
|
||||||
|
case "dark":
|
||||||
|
checkedItem = 2;
|
||||||
|
break;
|
||||||
|
case "black":
|
||||||
|
checkedItem = 3;
|
||||||
|
break;
|
||||||
|
case "transparent_light":
|
||||||
|
checkedItem = 4;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
builder.setCancelable(true);
|
||||||
|
// Create the dialog
|
||||||
|
builder.setSingleChoiceItems(themeNames, checkedItem, (dialog, which) -> {
|
||||||
|
// Set the theme
|
||||||
|
prefs.edit().putString("pref_theme", themeValues[which]).commit();
|
||||||
|
// Restart the activity
|
||||||
|
UiThreadHandler.run(() -> {
|
||||||
|
Intent intent = getIntent();
|
||||||
|
finish();
|
||||||
|
startActivity(intent);
|
||||||
|
});
|
||||||
|
// Set the theme button text to the selected theme
|
||||||
|
themeButton.setText(themeNames[which]);
|
||||||
|
// Dismiss the dialog
|
||||||
|
dialog.dismiss();
|
||||||
|
// Set the theme
|
||||||
|
UiThreadHandler.handler.postDelayed(() -> {
|
||||||
|
switch (prefs.getString("pref_theme", "system")) {
|
||||||
|
case "light":
|
||||||
|
setTheme(R.style.Theme_MagiskModuleManager_Monet_Light);
|
||||||
|
break;
|
||||||
|
case "dark":
|
||||||
|
setTheme(R.style.Theme_MagiskModuleManager_Monet_Dark);
|
||||||
|
break;
|
||||||
|
case "system":
|
||||||
|
setTheme(R.style.Theme_MagiskModuleManager_Monet);
|
||||||
|
break;
|
||||||
|
case "black":
|
||||||
|
setTheme(R.style.Theme_MagiskModuleManager_Monet_Black);
|
||||||
|
break;
|
||||||
|
case "transparent_light":
|
||||||
|
setTheme(R.style.Theme_MagiskModuleManager_Transparent_Light);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
});
|
||||||
|
builder.show();
|
||||||
|
});
|
||||||
|
// Setup language selector
|
||||||
|
MaterialButton languageSelector = view.findViewById(R.id.setup_language_button);
|
||||||
|
languageSelector.setOnClickListener(preference -> {
|
||||||
|
LanguageSwitcher ls = new LanguageSwitcher(Objects.requireNonNull(getActivity(this)));
|
||||||
|
ls.setSupportedStringLocales(MainApplication.supportedLocales);
|
||||||
|
ls.showChangeLanguageDialog((FragmentActivity) getActivity(this));
|
||||||
|
});
|
||||||
|
// Set up the buttons
|
||||||
|
// Setup button
|
||||||
|
MaterialButton setupButton = view.findViewById(R.id.setup_continue);
|
||||||
|
setupButton.setOnClickListener(v -> {
|
||||||
|
// Set first launch to false
|
||||||
|
// get instance of editor
|
||||||
|
SharedPreferences.Editor editor = prefs.edit();
|
||||||
|
editor.putBoolean("first_time_user", false);
|
||||||
|
// Set the background update check pref
|
||||||
|
editor.putBoolean("pref_background_update_check", ((MaterialSwitch) Objects.requireNonNull(view.findViewById(R.id.setup_background_update_check))).isChecked());
|
||||||
|
// Set the crash reporting pref
|
||||||
|
editor.putBoolean("pref_crash_reporting", ((MaterialSwitch) Objects.requireNonNull(view.findViewById(R.id.setup_crash_reporting))).isChecked());
|
||||||
|
// Set the repos
|
||||||
|
// first pref_magisk_alt_repo_enabled then pref_androidacy_repo_enabled
|
||||||
|
editor.putBoolean("pref_magisk_alt_repo_enabled", ((MaterialSwitch) Objects.requireNonNull(view.findViewById(R.id.setup_magisk_alt_repo))).isChecked());
|
||||||
|
editor.putBoolean("pref_androidacy_repo_enabled", ((MaterialSwitch) Objects.requireNonNull(view.findViewById(R.id.setup_androidacy_repo))).isChecked());
|
||||||
|
// Commit the changes
|
||||||
|
editor.commit();
|
||||||
|
// Sleep for 1 second to allow the user to see the changes
|
||||||
|
try {
|
||||||
|
Thread.sleep(500);
|
||||||
|
} catch (
|
||||||
|
InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
// Log the changes if debug
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
Log.d("SetupWizard", "Background update check: " + prefs.getBoolean("pref_background_update_check", false));
|
||||||
|
Log.i("SetupWizard", "Crash reporting: " + prefs.getBoolean("pref_crash_reporting", false));
|
||||||
|
Log.i("SetupWizard", "Magisk Alt Repo: " + prefs.getBoolean("pref_magisk_alt_repo_enabled", false));
|
||||||
|
Log.i("SetupWizard", "Androidacy Repo: " + prefs.getBoolean("pref_androidacy_repo_enabled", false));
|
||||||
|
}
|
||||||
|
// Restart the activity
|
||||||
|
MainActivity.doSetupRestarting = true;
|
||||||
|
Intent intent = new Intent(this, MainActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
});
|
||||||
|
// Cancel button
|
||||||
|
MaterialButton cancelButton = view.findViewById(R.id.setup_cancel);
|
||||||
|
cancelButton.setText(R.string.cancel);
|
||||||
|
cancelButton.setOnClickListener(v -> {
|
||||||
|
// Set first launch to false and restart the activity
|
||||||
|
prefs.edit().putBoolean("first_time_user", false).commit();
|
||||||
|
MainActivity.doSetupRestarting = true;
|
||||||
|
Intent intent = new Intent(this, MainActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Resources.Theme getTheme() {
|
||||||
|
Resources.Theme theme = super.getTheme();
|
||||||
|
// Set the theme
|
||||||
|
SharedPreferences prefs = MainApplication.getSharedPreferences();
|
||||||
|
switch (prefs.getString("pref_theme", "system")) {
|
||||||
|
case "light":
|
||||||
|
theme.applyStyle(R.style.Theme_MagiskModuleManager_Monet_Light, true);
|
||||||
|
break;
|
||||||
|
case "dark":
|
||||||
|
theme.applyStyle(R.style.Theme_MagiskModuleManager_Monet_Dark, true);
|
||||||
|
break;
|
||||||
|
case "system":
|
||||||
|
theme.applyStyle(R.style.Theme_MagiskModuleManager_Monet, true);
|
||||||
|
break;
|
||||||
|
case "black":
|
||||||
|
theme.applyStyle(R.style.Theme_MagiskModuleManager_Monet_Black, true);
|
||||||
|
break;
|
||||||
|
case "transparent_light":
|
||||||
|
theme.applyStyle(R.style.Theme_MagiskModuleManager_Transparent_Light, true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return theme;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressLint({"InlinedApi", "RestrictedApi"})
|
||||||
|
public void refreshRosettaX() {
|
||||||
|
// refresh app language
|
||||||
|
runOnUiThread(() -> {
|
||||||
|
// refresh activity
|
||||||
|
Intent intent = getIntent();
|
||||||
|
finish();
|
||||||
|
startActivity(intent);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<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:id="@+id/setup_box"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:fitsSystemWindowsInsets="left|right"
|
||||||
|
tools:context=".SetupActivity">
|
||||||
|
|
||||||
|
<include android:id="@+id/include2" layout="@layout/content_scrolling" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@ -0,0 +1,215 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
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="wrap_content"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
|
tools:context=".SetupActivity"
|
||||||
|
tools:showIn="@layout/activity_setup">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="8dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/setup_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/setup_title" android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@+id/setup_scroll" />
|
||||||
|
|
||||||
|
<com.google.android.material.textview.MaterialTextView
|
||||||
|
android:id="@+id/setup_summary"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/setup_message" />
|
||||||
|
|
||||||
|
<!-- Theme radio select. Options are system, light, dark, black, transparent_light -->
|
||||||
|
|
||||||
|
<!-- Button to trigger theme selection, half width, and in container with language -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/LinearLayout02"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/setup_theme_button"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:backgroundTint="@color/gray_900"
|
||||||
|
android:foreground="?attr/selectableItemBackground"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:text="@string/setup_theme_button"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:icon="@drawable/ic_baseline_palette_24"
|
||||||
|
app:iconGravity="textStart"
|
||||||
|
app:iconPadding="8dp"
|
||||||
|
app:iconTint="@color/white"
|
||||||
|
app:iconTintMode="src_in"
|
||||||
|
app:rippleColor="@color/gray_800" tools:ignore="DuplicateSpeakableTextCheck" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/setup_language_button"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:backgroundTint="@color/gray_900"
|
||||||
|
android:foreground="?attr/selectableItemBackground"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:text="@string/setup_language_button"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:icon="@drawable/ic_baseline_language_24"
|
||||||
|
app:iconGravity="textStart"
|
||||||
|
app:iconPadding="8dp"
|
||||||
|
app:iconTint="@color/white"
|
||||||
|
app:iconTintMode="src_in"
|
||||||
|
app:rippleColor="@color/gray_800" tools:ignore="DuplicateSpeakableTextCheck" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.textview.MaterialTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:text="@string/repos"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Material.Headline" /><com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/setup_androidacy_repo"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:checked="false"
|
||||||
|
android:key="pref_androidacy_repo_enabled"
|
||||||
|
android:text="@string/setup_androidacy_repo"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Material.Subhead" />
|
||||||
|
|
||||||
|
<!-- Small summary for above switch -->
|
||||||
|
<com.google.android.material.textview.MaterialTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:drawableStart="@drawable/ic_baseline_info_24"
|
||||||
|
android:drawablePadding="8dp"
|
||||||
|
android:text="@string/setup_androidacy_repo_summary"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Material.Small" />
|
||||||
|
|
||||||
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/setup_magisk_alt_repo"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:checked="false"
|
||||||
|
android:key="pref_magisk_alt_repo_enabled"
|
||||||
|
android:text="@string/setup_magisk_alt_repo"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Material.Subhead" />
|
||||||
|
|
||||||
|
<!-- Small summary for above switch -->
|
||||||
|
<com.google.android.material.textview.MaterialTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:drawableStart="@drawable/ic_baseline_info_24"
|
||||||
|
android:drawablePadding="8dp"
|
||||||
|
android:text="@string/setup_magisk_alt_repo_summary"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Material.Small" />
|
||||||
|
|
||||||
|
<com.google.android.material.textview.MaterialTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:text="@string/setup_custom_repos"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Material.Caption" />
|
||||||
|
|
||||||
|
<com.google.android.material.textview.MaterialTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:text="@string/misc"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Material.Headline" />
|
||||||
|
|
||||||
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/setup_crash_reporting"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:checked="false"
|
||||||
|
android:key="pref_crash_reporting_enabled"
|
||||||
|
android:text="@string/setup_crash_reporting"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Material.Subhead" />
|
||||||
|
|
||||||
|
<com.google.android.material.textview.MaterialTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:drawableStart="@drawable/ic_baseline_info_24"
|
||||||
|
android:drawablePadding="8dp"
|
||||||
|
android:text="@string/setup_crash_reporting_summary"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Material.Small" />
|
||||||
|
|
||||||
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/setup_background_update_check"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:checked="false"
|
||||||
|
android:key="pref_background_update_check"
|
||||||
|
android:text="@string/setup_background_update_check"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Material.Subhead" />
|
||||||
|
|
||||||
|
<com.google.android.material.textview.MaterialTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:drawableStart="@drawable/ic_baseline_info_24"
|
||||||
|
android:drawablePadding="8dp"
|
||||||
|
android:text="@string/setup_background_update_check_summary"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Material.Small"
|
||||||
|
app:icon="@drawable/ic_baseline_info_24" />
|
||||||
|
|
||||||
|
<!-- Placeholder for future settings -->
|
||||||
|
<!--<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/setup_app_analytics"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:checked="false"
|
||||||
|
android:key="pref_app_analytics"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Material.Small"
|
||||||
|
android:text="@string/setup_app_analytics" />-->
|
||||||
|
|
||||||
|
<!-- Linear layout for the finish and cancel buttons -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/setup_cancel"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="2dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/cancel" android:textColor="#5D4037" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/setup_continue"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/finish" android:textColor="#5D4037" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
<menu 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"
|
||||||
|
tools:context="com.fox2code.mmm.SetupActivity">
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_settings"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
android:title="@string/action_settings"
|
||||||
|
app:showAsAction="never" />
|
||||||
|
</menu>
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
<resources>
|
||||||
|
<dimen name="fab_margin">48dp</dimen>
|
||||||
|
<dimen name="text_margin">48dp</dimen>
|
||||||
|
</resources>
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
<resources>
|
||||||
|
<dimen name="fab_margin">200dp</dimen>
|
||||||
|
</resources>
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
<resources>
|
||||||
|
<dimen name="fab_margin">48dp</dimen>
|
||||||
|
<dimen name="text_margin">48dp</dimen>
|
||||||
|
</resources>
|
||||||
Loading…
Reference in New Issue