recreate setup activity

Signed-off-by: androidacy-user <opensource@androidacy.com>
pull/27/head
androidacy-user 3 years ago
parent f63f433104
commit 5d844e0911

@ -316,6 +316,9 @@ android {
includeInApk false
includeInBundle false
}
buildFeatures {
viewBinding true
}
}
// Safeguard (Do not remove)

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:enableOnBackInvokedCallback="true"
tools:ignore="QueryAllPackagesPermission"
tools:targetApi="tiramisu">
@ -10,23 +11,15 @@
<intent>
<action android:name="com.fox2code.mmm.utils.intent.action.OPEN_EXTERNAL" />
</intent>
</queries>
<!-- Wifi is not the only way to get an internet connection -->
</queries> <!-- Wifi is not the only way to get an internet connection -->
<uses-feature
android:name="android.hardware.wifi" android:required="false" />
<!-- Retrieve online modules -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- WebView offline webpage support -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Check if there is modules updates on boot -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<!-- Open config apps for applications -->
<uses-permission-sdk-23 android:name="android.permission.QUERY_ALL_PACKAGES" />
<!-- Supposed to fix bugs with old firmware, only requested on pre Marshmallow -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<!-- Post background notifications -->
android:name="android.hardware.wifi"
android:required="false" /> <!-- Retrieve online modules -->
<uses-permission android:name="android.permission.INTERNET" /> <!-- WebView offline webpage support -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- Check if there is modules updates on boot -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <!-- Open config apps for applications -->
<uses-permission-sdk-23 android:name="android.permission.QUERY_ALL_PACKAGES" /> <!-- Supposed to fix bugs with old firmware, only requested on pre Marshmallow -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- Post background notifications -->
<uses-permission-sdk-23 android:name="android.permission.POST_NOTIFICATIONS" />
<application
@ -45,8 +38,14 @@
tools:ignore="ManifestResource"
tools:replace="android:supportsRtl"
tools:targetApi="s">
<activity
android:name=".SetupActivity"
android:exported="false"
android:label="@string/title_activity_setup"
android:theme="@style/Theme.MagiskModuleManager.NoActionBar" />
<receiver
android:name="com.fox2code.mmm.background.BackgroundBootListener"
android:name=".background.BackgroundBootListener"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
@ -69,6 +68,7 @@
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
@ -79,18 +79,22 @@
android:parentActivityName=".MainActivity"
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity">
<!-- <intent-filter>
<!--
<intent-filter>
<action android:name="${applicationId}.intent.action.INSTALL_MODULE_INTERNAL" />
</intent-filter> -->
</activity>
<!-- We can handle zip files -->
</intent-filter>
-->
</activity> <!-- We can handle zip files -->
<activity
android:name="com.fox2code.mmm.utils.ZipFileOpener"
android:name=".utils.ZipFileOpener"
android:exported="true"
android:theme="@style/Theme.MagiskModuleManager">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/zip" />
<data android:mimeType="application/x-zip-compressed" />
<data android:scheme="content" />
@ -106,9 +110,12 @@
android:exported="false"
android:parentActivityName=".MainActivity"
android:theme="@style/Theme.MagiskModuleManager">
<!-- <intent-filter>
<!--
<intent-filter>
<action android:name="${applicationId}.intent.action.OPEN_ANDROIDACY_INTERNAL" />
</intent-filter> -->
</intent-filter>
-->
</activity>
<activity
android:name="com.mikepenz.aboutlibraries.ui.LibsActivity"
@ -126,42 +133,34 @@
android:name="androidx.work.WorkManagerInitializer"
tools:node="remove" />
</provider>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.file-provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/shared_file_paths" />
</provider>
<meta-data
android:name="io.sentry.auto-init"
android:value="false" />
<meta-data
android:name="io.sentry.dsn"
android:value="https://198c68516cb0412b9832204631a3fac8@o993586.ingest.sentry.io/4504069942804480" />
<!-- Sane value, but feel free to lower it -->
android:value="https://198c68516cb0412b9832204631a3fac8@o993586.ingest.sentry.io/4504069942804480" /> <!-- Sane value, but feel free to lower it -->
<meta-data
android:name="io.sentry.traces.sample-rate"
android:value="0.5" />
<!-- Doesn't actually monitor anything, just used to get the activities the user went through -->
android:value="0.5" /> <!-- Doesn't actually monitor anything, just used to get the activities the user went through -->
<meta-data
android:name="io.sentry.traces.user-interaction.enable"
android:value="true" />
<!-- Just a screenshot of ONLY the current activity at the time of the crash -->
android:value="true" /> <!-- Just a screenshot of ONLY the current activity at the time of the crash -->
<meta-data
android:name="io.sentry.attach-screenshot"
android:value="true" />
<!-- Just the current activity at the time of the crash -->
android:value="true" /> <!-- Just the current activity at the time of the crash -->
<meta-data
android:name="io.sentry.attach-stacktrace"
android:value="true" />
<!-- Don't send PII, this is actually default but let's be explicit -->
android:value="true" /> <!-- Don't send PII, this is actually default but let's be explicit -->
<meta-data
android:name="io.sentry.sendDefaultPii"
android:value="false" />
@ -169,4 +168,5 @@
android:name="io.sentry.traces.profiling.sample-rate"
android:value="0.25" />
</application>
</manifest>

@ -26,7 +26,6 @@ import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.SearchView;
import androidx.cardview.widget.CardView;
import androidx.core.app.ActivityCompat;
@ -52,11 +51,8 @@ import com.fox2code.mmm.utils.BlurUtils;
import com.fox2code.mmm.utils.ExternalHelper;
import com.fox2code.mmm.utils.Http;
import com.fox2code.mmm.utils.IntentHelper;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.materialswitch.MaterialSwitch;
import com.google.android.material.progressindicator.LinearProgressIndicator;
import com.topjohnwu.superuser.internal.UiThreadHandler;
import org.chromium.net.ExperimentalCronetEngine;
import org.chromium.net.urlconnection.CronetURLStreamHandlerFactory;
@ -66,7 +62,6 @@ import org.json.JSONObject;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Objects;
import eightbitlab.com.blurview.BlurView;
@ -90,7 +85,7 @@ public class MainActivity extends FoxActivity implements SwipeRefreshLayout.OnRe
private CardView searchCard;
private SearchView searchView;
private boolean initMode;
private boolean doSetupRestarting = false;
public static boolean doSetupRestarting = false;
private boolean urlFactoryInstalled = false;
public MainActivity() {
@ -747,122 +742,13 @@ public class MainActivity extends FoxActivity implements SwipeRefreshLayout.OnRe
Log.i("SetupWizard", "First launch: " + firstLaunch);
if (firstLaunch) {
doSetupNowRunning = true;
// Show setup box. Put the setup_box in the main activity layout
View view = getLayoutInflater().inflate(R.layout.setup_box, null);
// Make the setup_box linear layout the sole child of the root_container constraint layout
setContentView(view);
updateScreenInsets();
// 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();
// Set the theme button text to the selected theme
themeButton.setText(themeNames[which]);
// Dismiss the dialog
dialog.dismiss();
// Set the theme
UiThreadHandler.handler.postDelayed(() -> {
MainApplication.getINSTANCE().updateTheme();
FoxActivity.getFoxActivity(this).setThemeRecreate(MainApplication.getINSTANCE().getManagerThemeResId());
}, 1);
});
builder.show();
});
// Set up the buttons
// 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();
finish();
startActivity(getIntent());
});
// 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
doSetupRestarting = true;
finish();
startActivity(getIntent());
});
// Launch setup wizard
if (BuildConfig.DEBUG)
Log.i("SetupWizard", "Launching setup wizard");
// Show setup activity
Intent intent = new Intent(this, SetupActivity.class);
finish();
startActivity(intent);
} else {
ensurePermissions();
}

@ -37,6 +37,7 @@ import com.topjohnwu.superuser.Shell;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
import java.util.Locale;
import java.util.Objects;
import java.util.Random;
@ -79,6 +80,10 @@ public class MainApplication extends FoxApplication implements androidx.work.Con
private FoxThemeWrapper markwonThemeContext;
private Markwon markwon;
// Warning! Locales that are't exist will crash the app
// Anything that is commented out is supported but the translation is not complete to at least 60%
public static HashSet<String> supportedLocales = new HashSet<>();
public MainApplication() {
if (INSTANCE != null && INSTANCE != this)
throw new IllegalStateException("Duplicate application instance!");
@ -280,6 +285,30 @@ public class MainApplication extends FoxApplication implements androidx.work.Con
@Override
public void onCreate() {
// supportedLocales.add("ar");
// supportedLocales.add("ar_SA");
supportedLocales.add("cs");
supportedLocales.add("de");
// supportedLocales.add("el");
supportedLocales.add("es");
supportedLocales.add("es-rMX");
// supportedLocales.add("et");
supportedLocales.add("fr");
supportedLocales.add("id");
supportedLocales.add("it");
// supportedLocales.add("ja");
// supportedLocales.add("nb-rNO");
supportedLocales.add("pl");
supportedLocales.add("pt-rBR");
supportedLocales.add("ro");
supportedLocales.add("ru");
supportedLocales.add("sk");
supportedLocales.add("tr");
supportedLocales.add("uk");
// supportedLocales.add("vi");
supportedLocales.add("zh-rCH");
// supportedLocales.add("zh-rTW");
supportedLocales.add("en");
if (INSTANCE == null)
INSTANCE = this;
relPackageName = this.getPackageName();

@ -76,7 +76,6 @@ import org.json.JSONException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.security.NoSuchAlgorithmException;
import java.util.HashSet;
import java.util.Locale;
import java.util.Objects;
import java.util.Random;
@ -329,38 +328,10 @@ public class SettingsActivity extends FoxActivity implements LanguageActivity {
return true;
});
// Warning! Locales that are't exist will crash the app
// Anything that is commented out is supported but the translation is not complete to at least 60%
HashSet<String> supportedLocales = new HashSet<>();
// supportedLocales.add("ar");
// supportedLocales.add("ar_SA");
supportedLocales.add("cs");
supportedLocales.add("de");
// supportedLocales.add("el");
supportedLocales.add("es");
supportedLocales.add("es-rMX");
// supportedLocales.add("et");
supportedLocales.add("fr");
supportedLocales.add("id");
supportedLocales.add("it");
// supportedLocales.add("ja");
// supportedLocales.add("nb-rNO");
supportedLocales.add("pl");
supportedLocales.add("pt-rBR");
supportedLocales.add("ro");
supportedLocales.add("ru");
supportedLocales.add("sk");
supportedLocales.add("tr");
supportedLocales.add("uk");
// supportedLocales.add("vi");
supportedLocales.add("zh-rCH");
// supportedLocales.add("zh-rTW");
supportedLocales.add("en");
Preference languageSelector = findPreference("pref_language_selector");
languageSelector.setOnPreferenceClickListener(preference -> {
LanguageSwitcher ls = new LanguageSwitcher(getActivity());
ls.setSupportedStringLocales(supportedLocales);
ls.setSupportedStringLocales(MainApplication.supportedLocales);
ls.showChangeLanguageDialog(getActivity());
return true;
});

@ -1,194 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- App name as subheader -->
<ScrollView
<LinearLayout
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_scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill"
android:orientation="vertical"
android:fillViewport="true"
android:padding="6dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<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 -->
<com.google.android.material.button.MaterialButton
android:id="@+id/setup_theme_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:backgroundTint="@color/gray_900"
android:foreground="?attr/selectableItemBackground"
android:padding="8dp"
android:text="@string/setup_theme_button"
android:textColor="@color/white"
android:textSize="16sp"
app:cornerRadius="8dp"
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.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" />
android:layout_height="wrap_content" android:orientation="vertical">
<!-- 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>
</ScrollView>
</LinearLayout>

@ -5,4 +5,7 @@
<dimen name="markdown_side_clearance">0dp</dimen>
<dimen name="markdown_topdown_clearance">32dp</dimen>
<dimen name="markdown_border_content">8dp</dimen>
<dimen name="app_bar_height">180dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="text_margin">16dp</dimen>
</resources>

@ -278,5 +278,96 @@
<string name="contributors">And of course, thanks to all of our contributors, whether it\'s translations, code, or just being fun to hang out with! We love you all.</string>
<string name="zip_unpacking">Inspecting module…</string>
<string name="warning_message">Warning! This module has indicators it may have been installed without your knowledge, or may be attempting to hide itself. Uninstall is strongly recommended.</string>
<string name="understand">I understand</string><string name="setup_theme_title">Choose theme</string>
<string name="understand">I understand</string><string name="setup_theme_title">Choose theme</string><string name="setup_language_button">Choose language</string>
<string name="title_activity_setup">SetupActivity</string>
<string name="large_text">
"Material is the metaphor.\n\n"
"A material metaphor is the unifying theory of a rationalized space and a system of motion."
"The material is grounded in tactile reality, inspired by the study of paper and ink, yet "
"technologically advanced and open to imagination and magic.\n"
"Surfaces and edges of the material provide visual cues that are grounded in reality. The "
"use of familiar tactile attributes helps users quickly understand affordances. Yet the "
"flexibility of the material creates new affordances that supercede those in the physical "
"world, without breaking the rules of physics.\n"
"The fundamentals of light, surface, and movement are key to conveying how objects move, "
"interact, and exist in space and in relation to each other. Realistic lighting shows "
"seams, divides space, and indicates moving parts.\n\n"
"Bold, graphic, intentional.\n\n"
"The foundational elements of print based design typography, grids, space, scale, color, "
"and use of imagery guide visual treatments. These elements do far more than please the "
"eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge "
"imagery, large scale typography, and intentional white space create a bold and graphic "
"interface that immerse the user in the experience.\n"
"An emphasis on user actions makes core functionality immediately apparent and provides "
"waypoints for the user.\n\n"
"Motion provides meaning.\n\n"
"Motion respects and reinforces the user as the prime mover. Primary user actions are "
"inflection points that initiate motion, transforming the whole design.\n"
"All action takes place in a single environment. Objects are presented to the user without "
"breaking the continuity of experience even as they transform and reorganize.\n"
"Motion is meaningful and appropriate, serving to focus attention and maintain continuity. "
"Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n"
"3D world.\n\n"
"The material environment is a 3D space, which means all objects have x, y, and z "
"dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the "
"positive z-axis extending towards the viewer. Every sheet of material occupies a single "
"position along the z-axis and has a standard 1dp thickness.\n"
"On the web, the z-axis is used for layering and not for perspective. The 3D world is "
"emulated by manipulating the y-axis.\n\n"
"Light and shadow.\n\n"
"Within the material environment, virtual lights illuminate the scene. Key lights create "
"directional shadows, while ambient light creates soft shadows from all angles.\n"
"Shadows in the material environment are cast by these two light sources. In Android "
"development, shadows occur when light sources are blocked by sheets of material at "
"various positions along the z-axis. On the web, shadows are depicted by manipulating the "
"y-axis only. The following example shows the card with a height of 6dp.\n\n"
"Resting elevation.\n\n"
"All material objects, regardless of size, have a resting elevation, or default elevation "
"that does not change. If an object changes elevation, it should return to its resting "
"elevation as soon as possible.\n\n"
"Component elevations.\n\n"
"The resting elevation for a component type is consistent across apps (e.g., FAB elevation "
"does not vary from 6dp in one app to 16dp in another app).\n"
"Components may have different resting elevations across platforms, depending on the depth "
"of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n"
"Responsive elevation and dynamic elevation offsets.\n\n"
"Some component types have responsive elevation, meaning they change elevation in response "
"to user input (e.g., normal, focused, and pressed) or system events. These elevation "
"changes are consistently implemented using dynamic elevation offsets.\n"
"Dynamic elevation offsets are the goal elevation that a component moves towards, relative "
"to the components resting state. They ensure that elevation changes are consistent "
"across actions and component types. For example, all components that lift on press have "
"the same elevation change relative to their resting elevation.\n"
"Once the input event is completed or cancelled, the component will return to its resting "
"elevation.\n\n"
"Avoiding elevation interference.\n\n"
"Components with responsive elevations may encounter other components as they move between "
"their resting elevations and dynamic elevation offsets. Because material cannot pass "
"through other material, components avoid interfering with one another any number of ways, "
"whether on a per component basis or using the entire app layout.\n"
"On a component level, components can move or be removed before they cause interference. "
"For example, a floating action button (FAB) can disappear or move off screen before a "
"user picks up a card, or it can move if a snackbar appears.\n"
"On the layout level, design your app layout to minimize opportunities for interference. "
"For example, position the FAB to one side of stream of a cards so the FAB wont interfere "
"when a user tries to pick up one of cards.\n\n"
</string>
<string name="action_settings">Settings</string>
</resources>

@ -1,7 +1,7 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="Theme.MagiskModuleManager.Light" parent="Theme.Material3.Light">
<item name="android:isLightTheme"
tools:targetApi="q">true</item>
tools:targetApi="q">true</item>
<item name="isLightTheme">true</item>
<!-- Primary brand color. -->
<item name="colorPrimary">@color/orange_200</item>
@ -14,7 +14,7 @@
<!-- Status bar color. -->
<item name="android:statusBarColor">@color/status_bar_color</item>
<item name="android:navigationBarColor">@color/transparent</item>
<item name="android:windowLightStatusBar" >true</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">true</item>
<!-- Customize your theme here. -->
<item name="android:windowActivityTransitions">true</item>
@ -53,7 +53,7 @@
<style name="Theme.MagiskModuleManager.Dark" parent="Theme.Material3.Dark">
<item name="android:isLightTheme"
tools:targetApi="q">false</item>
tools:targetApi="q">false</item>
<item name="isLightTheme">false</item>
<!-- Primary brand color. -->
<item name="colorPrimary">@color/orange_200</item>
@ -66,7 +66,7 @@
<!-- Status bar color. -->
<item name="android:statusBarColor">@color/status_bar_color</item>
<item name="android:navigationBarColor">@color/transparent</item>
<item name="android:windowLightStatusBar" >false</item>
<item name="android:windowLightStatusBar">false</item>
<item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">false</item>
<!-- Customize your theme here. -->
<item name="android:windowActivityTransitions">true</item>
@ -125,5 +125,11 @@
</style>
<style name="Theme.MagiskModuleManager"
parent="Theme.MagiskModuleManager.Light" />
parent="Theme.MagiskModuleManager.Light" />
<style name="Theme.MagiskModuleManager.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.MagiskModuleManager.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.MagiskModuleManager.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
Loading…
Cancel
Save