diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 6920c59..9d74c83 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -1,42 +1,51 @@ name: Generate APK Debug on: - # Triggers the workflow on push or pull request events but only for default and protected branches push: branches: - - master + - '*' + paths-ignore: + - '**.md' pull_request: - branches: - - master + branches: + - '*' + paths-ignore: + - '**.md' + workflow_dispatch: + jobs: build: runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - - uses: actions/checkout@v3 + - name: Check out repository + uses: actions/checkout@v3 + with: + submodules: true - - name: Set Up JDK + - name: Set up Java 11 uses: actions/setup-java@v3 with: - distribution: 'zulu' - java-version: '11' - + java-version: 11 + distribution: 'adopt' + cache: gradle + - name: Change wrapper permissions run: chmod +x ./gradlew - + - name: Run tests run: ./gradlew test - # Create APK Debug - name: Build apk debug run: ./gradlew app:assembleDefaultDebug - name: Build apk fdroid-debug run: ./gradlew app:assembleFdroidDebug - # Upload Artifact Build - # Noted For Output [module-name]/build/outputs/apk - name: Upload apk debug uses: actions/upload-artifact@v3 with: diff --git a/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java b/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java index 78af378..f268c87 100644 --- a/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java +++ b/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java @@ -161,27 +161,53 @@ public class SettingsActivity extends FoxActivity implements LanguageActivity { if (BuildConfig.DEBUG) { Log.d(TAG, "Transparent theme is being set, disabling monet"); } - findPreference("pref_enable_monet").setEnabled(false); - ((TwoStatePreference) findPreference("pref_enable_monet")).setChecked(false); - editor.putBoolean("pref_enable_monet", false).apply(); - findPreference("pref_enable_monet").setSummary(R.string.monet_disabled_summary); - // Same for blur - findPreference("pref_enable_blur").setEnabled(false); - ((TwoStatePreference) findPreference("pref_enable_blur")).setChecked(false); - editor.putBoolean("pref_enable_blur", false).apply(); - findPreference("pref_enable_blur").setSummary(R.string.blur_disabled_summary); + // Show a dialogue warning the user about issues with transparent themes and + // that blur/monet will be disabled + new MaterialAlertDialogBuilder(requireContext()) + .setTitle(R.string.transparent_theme_dialogue_title) + .setMessage(R.string.transparent_theme_dialogue_message) + .setPositiveButton(R.string.ok, (dialog, which) -> { + // Toggle monet off + ((TwoStatePreference) findPreference("pref_enable_monet")).setChecked(false); + editor.putBoolean("pref_enable_monet", false).apply(); + // Set summary + findPreference("pref_enable_monet").setSummary(R.string.monet_disabled_summary); + // Same for blur + ((TwoStatePreference) findPreference("pref_enable_blur")).setChecked(false); + editor.putBoolean("pref_enable_blur", false).apply(); + findPreference("pref_enable_blur").setSummary(R.string.blur_disabled_summary); + // Refresh activity + devModeStep = 0; + UiThreadHandler.handler.postDelayed(() -> { + MainApplication.getINSTANCE().updateTheme(); + FoxActivity.getFoxActivity(this).setThemeRecreate( + MainApplication.getINSTANCE().getManagerThemeResId()); + }, 1); + }) + .setNegativeButton(R.string.cancel, (dialog, which) -> { + // Revert to system theme + ((ListPreference) findPreference("pref_theme")).setValue("system"); + // Refresh activity + devModeStep = 0; + UiThreadHandler.handler.postDelayed(() -> { + MainApplication.getINSTANCE().updateTheme(); + FoxActivity.getFoxActivity(this).setThemeRecreate( + MainApplication.getINSTANCE().getManagerThemeResId()); + }, 1); + }) + .show(); } else { findPreference("pref_enable_monet").setEnabled(true); findPreference("pref_enable_monet").setSummary(null); findPreference("pref_enable_blur").setEnabled(true); findPreference("pref_enable_blur").setSummary(null); + devModeStep = 0; + UiThreadHandler.handler.postDelayed(() -> { + MainApplication.getINSTANCE().updateTheme(); + FoxActivity.getFoxActivity(this).setThemeRecreate( + MainApplication.getINSTANCE().getManagerThemeResId()); + }, 1); } - devModeStep = 0; - UiThreadHandler.handler.postDelayed(() -> { - MainApplication.getINSTANCE().updateTheme(); - FoxActivity.getFoxActivity(this).setThemeRecreate( - MainApplication.getINSTANCE().getManagerThemeResId()); - }, 1); return true; }); // Crash reporting diff --git a/app/src/main/res/values-pl/arrays.xml b/app/src/main/res/values-pl/arrays.xml index 273c086..4e2a658 100644 --- a/app/src/main/res/values-pl/arrays.xml +++ b/app/src/main/res/values-pl/arrays.xml @@ -1,9 +1,10 @@ - Zgodny z systemem - Ciemny - AMOLED Black + Zgodny z systemem + Ciemny + Czarny Transparent (light) - Jasny + Jasny + Nie pytaj ponownie diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7d3428a..1b8bf95 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -201,4 +201,6 @@ Update of %1$s failed. Please try again later. Monet is not compatible with transparent themes. Blur is not compatible with transparent themes. + You are setting a transparent theme + Transparent themes may have some inconsistencies and may not work on all ROMs. In additon, monet and blur will be disabled. You can change back at any time.