From c7a3e947b2be4cccdc5cd9447d1ec0edb663cd54 Mon Sep 17 00:00:00 2001 From: verNANDo57 Date: Mon, 29 Aug 2022 22:08:00 +0700 Subject: [PATCH] app: introduce 1.1.6 - UI improvements - Ability to use SDCard - Ability to share content - Code cleanup - Minor fixes & improvements --- app/build.gradle | 13 +- app/src/main/AndroidManifest.xml | 15 +- .../rulebook_educational/MainActivity.java | 8 +- .../app/CustomActivityResult.java | 96 +++++++++++ .../bookmarks/AppBookmarkUtils.java | 2 +- .../preferences/AppSettingsFragment.java | 93 +++++++--- .../preferences/PreferenceKeys.java | 8 +- .../RulebookApplicationSharedPreferences.java | 19 ++- .../rules/AppBaseScrollableActivity.java | 160 ++++++++++++++++-- .../rulebook_educational/utils/AppUtils.java | 136 ++++++++++++--- .../utils/ColorUtils.java | 2 +- .../res/drawable-hdpi/colorpicker_alpha.png | Bin 81 -> 0 bytes .../colorpicker_popup_background.9.png | Bin 1204 -> 0 bytes .../colorpicker_popup_background.9.png | Bin 747 -> 0 bytes .../res/drawable-xhdpi/colorpicker_alpha.png | Bin 93 -> 0 bytes .../colorpicker_popup_background.9.png | Bin 1738 -> 0 bytes .../res/drawable-xxhdpi/colorpicker_alpha.png | Bin 101 -> 0 bytes .../colorpicker_popup_background.9.png | Bin 2972 -> 0 bytes .../res/drawable/app_bottomappbar_icon.xml | 9 - .../main/res/drawable/app_delete_forever.xml | 10 ++ app/src/main/res/drawable/app_sdcard.xml | 10 ++ app/src/main/res/drawable/app_share.xml | 9 + app/src/main/res/drawable/ic_actionmenu.xml | 10 ++ app/src/main/res/drawable/ic_close.xml | 6 +- .../{ic_home_black.xml => ic_home.xml} | 0 app/src/main/res/drawable/ic_refresh.xml | 6 +- .../{ic_save_icon.xml => ic_save_toolbar.xml} | 0 app/src/main/res/drawable/ic_searchword.xml | 2 +- ...ings_black.xml => ic_settings_toolbar.xml} | 0 app/src/main/res/drawable/ic_share.xml | 9 + app/src/main/res/drawable/ic_warning.xml | 3 +- .../app_rulebook_productsans_fontfamily.xml | 1 - .../{font => font-v26}/productsans_bold.ttf | Bin .../productsans_bolditalic.ttf | Bin .../{font => font-v26}/productsans_italic.ttf | Bin .../{font => font-v26}/productsans_medium.ttf | Bin .../productsans_mediumitalic.ttf | Bin .../productsans_regular.ttf | Bin .../res/layout/app_bottomappbar_about.xml | 2 +- .../app_bottomappbar_analyze_methods.xml | 2 +- .../res/layout/app_scrollable_activity.xml | 3 +- .../app_scrollable_activity_content.xml | 5 +- app/src/main/res/menu-v17/app_menu.xml | 2 +- app/src/main/res/menu/app_menu.xml | 2 +- .../res/menu/app_scrollableactivity_menu.xml | 11 +- app/src/main/res/values-night-v23/styles.xml | 43 +++++ app/src/main/res/values-night-v31/styles.xml | 43 +++++ app/src/main/res/values-night/styles.xml | 19 +-- app/src/main/res/values-v21/styles.xml | 3 +- app/src/main/res/values-v23/styles.xml | 41 +++++ app/src/main/res/values-v26/styles.xml | 15 +- app/src/main/res/values-v31/styles.xml | 44 +++++ app/src/main/res/values/arrays.xml | 14 ++ app/src/main/res/values/strings.xml | 19 ++- app/src/main/res/values/styles.xml | 39 ++--- .../res/xml-v31/data_extraction_rules.xml | 17 ++ app/src/main/res/xml/file_paths.xml | 5 + app/src/main/res/xml/preferences.xml | 70 ++++---- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 +- 60 files changed, 843 insertions(+), 189 deletions(-) create mode 100644 app/src/main/java/com/verNANDo57/rulebook_educational/app/CustomActivityResult.java delete mode 100644 app/src/main/res/drawable-hdpi/colorpicker_alpha.png delete mode 100644 app/src/main/res/drawable-hdpi/colorpicker_popup_background.9.png delete mode 100644 app/src/main/res/drawable-mdpi/colorpicker_popup_background.9.png delete mode 100644 app/src/main/res/drawable-xhdpi/colorpicker_alpha.png delete mode 100644 app/src/main/res/drawable-xhdpi/colorpicker_popup_background.9.png delete mode 100644 app/src/main/res/drawable-xxhdpi/colorpicker_alpha.png delete mode 100644 app/src/main/res/drawable-xxhdpi/colorpicker_popup_background.9.png delete mode 100644 app/src/main/res/drawable/app_bottomappbar_icon.xml create mode 100644 app/src/main/res/drawable/app_delete_forever.xml create mode 100644 app/src/main/res/drawable/app_sdcard.xml create mode 100644 app/src/main/res/drawable/app_share.xml create mode 100644 app/src/main/res/drawable/ic_actionmenu.xml rename app/src/main/res/drawable/{ic_home_black.xml => ic_home.xml} (100%) rename app/src/main/res/drawable/{ic_save_icon.xml => ic_save_toolbar.xml} (100%) rename app/src/main/res/drawable/{ic_settings_black.xml => ic_settings_toolbar.xml} (100%) create mode 100644 app/src/main/res/drawable/ic_share.xml rename app/src/main/res/{font => font-v26}/app_rulebook_productsans_fontfamily.xml (96%) rename app/src/main/res/{font => font-v26}/productsans_bold.ttf (100%) rename app/src/main/res/{font => font-v26}/productsans_bolditalic.ttf (100%) rename app/src/main/res/{font => font-v26}/productsans_italic.ttf (100%) rename app/src/main/res/{font => font-v26}/productsans_medium.ttf (100%) rename app/src/main/res/{font => font-v26}/productsans_mediumitalic.ttf (100%) rename app/src/main/res/{font => font-v26}/productsans_regular.ttf (100%) create mode 100644 app/src/main/res/values-night-v23/styles.xml create mode 100644 app/src/main/res/values-night-v31/styles.xml create mode 100644 app/src/main/res/values-v31/styles.xml create mode 100644 app/src/main/res/values/arrays.xml create mode 100644 app/src/main/res/xml-v31/data_extraction_rules.xml create mode 100644 app/src/main/res/xml/file_paths.xml diff --git a/app/build.gradle b/app/build.gradle index 7f0773d..05fc98f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "com.verNANDo57.rulebook_educational" minSdkVersion 22 targetSdk 32 - versionCode 115 - versionName '1.1.5' + versionCode 116 + versionName '1.1.6' multiDexEnabled true } @@ -46,14 +46,13 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.4.1' - implementation 'com.google.android.material:material:1.6.0' + implementation 'androidx.appcompat:appcompat:1.5.0' + implementation 'com.google.android.material:material:1.6.1' implementation 'androidx.preference:preference-ktx:1.2.0' implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.3' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21' - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21' + implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1" } repositories { mavenCentral() diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 96e99da..aa27a16 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -18,8 +18,19 @@ android:fullBackupContent="true" android:supportsRtl="true" android:requestLegacyExternalStorage="true" - tools:targetApi="q" - android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|navigation"> + tools:targetApi="s" + android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|navigation" + android:dataExtractionRules="@xml/data_extraction_rules"> + + + + = 30) { //Check if storage permission already granted if (!Environment.isExternalStorageManager()) { @@ -136,7 +136,7 @@ public void checkPermission() { builder.setTitle(getString(R.string.app_warning)); builder.setMessage(getString(R.string.app_storageAccess_warning)); builder.setIcon(R.drawable.ic_warning); - builder.setPositiveButton(getString(R.string.yes), new DialogInterface.OnClickListener(){ + builder.setPositiveButton(getString(R.string.yes), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { //GoToSettings Intent @@ -154,7 +154,7 @@ public void onClick(DialogInterface dialog, int which) { alert.show(); } //Otherwise... - //Check if android version is Android 10 or lower + // Check if android version is Android 10 or lower } else if (Build.VERSION.SDK_INT >= 23) { //Check if storage permission already granted if (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED) { @@ -208,4 +208,4 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis } } } -} +} \ No newline at end of file diff --git a/app/src/main/java/com/verNANDo57/rulebook_educational/app/CustomActivityResult.java b/app/src/main/java/com/verNANDo57/rulebook_educational/app/CustomActivityResult.java new file mode 100644 index 0000000..64d91f0 --- /dev/null +++ b/app/src/main/java/com/verNANDo57/rulebook_educational/app/CustomActivityResult.java @@ -0,0 +1,96 @@ +/* + * Author: VerNANDo57 + */ + +package com.verNANDo57.rulebook_educational.app; + +import android.content.Intent; + +import androidx.activity.result.ActivityResult; +import androidx.activity.result.ActivityResultCaller; +import androidx.activity.result.ActivityResultLauncher; +import androidx.activity.result.contract.ActivityResultContract; +import androidx.activity.result.contract.ActivityResultContracts; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +public class CustomActivityResult { + /** + * Register activity result using a {@link ActivityResultContract} and an in-place activity result callback like + * the default approach. You can still customise callback using {@link #launch(Object, OnActivityResult)}. + */ + @NonNull + public static CustomActivityResult registerForActivityResult( + @NonNull ActivityResultCaller caller, + @NonNull ActivityResultContract contract, + @Nullable OnActivityResult onActivityResult) { + return new CustomActivityResult<>(caller, contract, onActivityResult); + } + + /** + * Same as {@link #registerForActivityResult(ActivityResultCaller, ActivityResultContract, OnActivityResult)} except + * the last argument is set to {@code null}. + */ + @NonNull + public static CustomActivityResult registerForActivityResult( + @NonNull ActivityResultCaller caller, + @NonNull ActivityResultContract contract) { + return registerForActivityResult(caller, contract, null); + } + + /** + * Specialised method for launching new activities. + */ + @NonNull + public static CustomActivityResult registerActivityForResult( + @NonNull ActivityResultCaller caller) { + return registerForActivityResult(caller, new ActivityResultContracts.StartActivityForResult()); + } + + /** + * Callback interface + */ + public interface OnActivityResult { + /** + * Called after receiving a result from the target activity + */ + void onActivityResult(O result); + } + + private final ActivityResultLauncher launcher; + @Nullable + private OnActivityResult onActivityResult; + + private CustomActivityResult(@NonNull ActivityResultCaller caller, + @NonNull ActivityResultContract contract, + @Nullable OnActivityResult onActivityResult) { + this.onActivityResult = onActivityResult; + this.launcher = caller.registerForActivityResult(contract, this::callOnActivityResult); + } + + public void setOnActivityResult(@Nullable OnActivityResult onActivityResult) { + this.onActivityResult = onActivityResult; + } + + /** + * Launch activity, same as {@link ActivityResultLauncher#launch(Object)} except that it allows a callback + * executed after receiving a result from the target activity. + */ + public void launch(Input input, @Nullable OnActivityResult onActivityResult) { + if (onActivityResult != null) { + this.onActivityResult = onActivityResult; + } + launcher.launch(input); + } + + /** + * Same as {@link #launch(Object, OnActivityResult)} with last parameter set to {@code null}. + */ + public void launch(Input input) { + launch(input, this.onActivityResult); + } + + private void callOnActivityResult(Result result) { + if (onActivityResult != null) onActivityResult.onActivityResult(result); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/verNANDo57/rulebook_educational/bookmarks/AppBookmarkUtils.java b/app/src/main/java/com/verNANDo57/rulebook_educational/bookmarks/AppBookmarkUtils.java index 791d36f..ff1f96f 100644 --- a/app/src/main/java/com/verNANDo57/rulebook_educational/bookmarks/AppBookmarkUtils.java +++ b/app/src/main/java/com/verNANDo57/rulebook_educational/bookmarks/AppBookmarkUtils.java @@ -217,4 +217,4 @@ public static void undoBookmarkDeletion(Context context) { Log.e(LOG_TAG, context.getResources().getString(R.string.app_error_file_rename)); } } -} +} \ No newline at end of file diff --git a/app/src/main/java/com/verNANDo57/rulebook_educational/preferences/AppSettingsFragment.java b/app/src/main/java/com/verNANDo57/rulebook_educational/preferences/AppSettingsFragment.java index aef80eb..ef7cce9 100755 --- a/app/src/main/java/com/verNANDo57/rulebook_educational/preferences/AppSettingsFragment.java +++ b/app/src/main/java/com/verNANDo57/rulebook_educational/preferences/AppSettingsFragment.java @@ -7,38 +7,37 @@ import android.content.DialogInterface; import android.os.Bundle; +import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.content.res.AppCompatResources; +import androidx.core.content.ContextCompat; import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; -import androidx.preference.SwitchPreferenceCompat; import com.verNANDo57.rulebook_educational.extradata.R; +import com.verNANDo57.rulebook_educational.rules.Constants; +import com.verNANDo57.rulebook_educational.utils.AppUtils; + +import java.io.File; public class AppSettingsFragment extends PreferenceFragmentCompat { - RulebookApplicationSharedPreferences preferences; + private RulebookApplicationSharedPreferences preferences; public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { preferences = new RulebookApplicationSharedPreferences(requireContext()); setPreferencesFromResource(R.xml.preferences, rootKey); - //Interface - androidx.preference.Preference darktheme_switch = findPreference(PreferenceKeys.DARK_THEME_PREF); - assert darktheme_switch != null; - darktheme_switch.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + // Interface + androidx.preference.Preference darktheme_switch_pref = findPreference(PreferenceKeys.DARK_THEME_PREF); + assert darktheme_switch_pref != null; + darktheme_switch_pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override - public boolean onPreferenceClick(Preference preference) { + public boolean onPreferenceClick(@NonNull Preference preference) { // setup the alert builder AlertDialog.Builder builder = new AlertDialog.Builder(requireContext()); builder.setTitle(getString(R.string.app_darkTheme_switch_summary)); - // add a list - String[] options = { - getString(R.string.app_darkTheme_mode_no), - getString(R.string.app_darkTheme_mode_yes), - getString(R.string.app_darkTheme_mode_followSystem), - getString(R.string.app_darkTheme_mode_battery)}; int checkedItem = 0; // Dark mode: NO if (preferences.loadRulebookDarkModeBooleanState() == AppCompatDelegate.MODE_NIGHT_YES) { @@ -50,7 +49,7 @@ public boolean onPreferenceClick(Preference preference) { } //Pass the array list in Alert dialog - builder.setSingleChoiceItems(options, checkedItem, new DialogInterface.OnClickListener() { + builder.setSingleChoiceItems(getResources().getStringArray(R.array.darkmode_modes), checkedItem, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { switch (which) { @@ -86,25 +85,65 @@ public void onClick(DialogInterface dialogInterface, int i) { builder.setIcon(AppCompatResources.getDrawable(requireContext(), R.drawable.app_themeengine_icon)); builder.create(); builder.show(); - return true; + return false; } }); - androidx.preference.SwitchPreferenceCompat statusbar_enable = (SwitchPreferenceCompat) findPreference(PreferenceKeys.STATUSBAR_PREF); - assert statusbar_enable != null; - statusbar_enable.setChecked(preferences.loadRulebookStatusBarBooleanState()); - statusbar_enable.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { + androidx.preference.SwitchPreferenceCompat statusbar_enable_pref = findPreference(PreferenceKeys.STATUSBAR_PREF); + assert statusbar_enable_pref != null; + statusbar_enable_pref.setChecked(preferences.loadRulebookStatusBarBooleanState()); + statusbar_enable_pref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override - public boolean onPreferenceChange(Preference preference, Object newValue) { - if (newValue.toString().equals("true")){ - preferences.setRulebookStatusBarBooleanState(true); - } else { - preferences.setRulebookStatusBarBooleanState(false); - } - return true; + public boolean onPreferenceChange(@NonNull Preference preference, Object newValue) { + preferences.setRulebookStatusBarBooleanState(newValue.toString().equals("true")); + return false; } }); - androidx.preference.Preference noticePreference = findPreference(PreferenceKeys.NOTICE_PREF); + // Functionality + androidx.preference.SwitchPreferenceCompat use_sdcard_pref = findPreference(PreferenceKeys.USE_SDCARD_PREF); + assert use_sdcard_pref != null; + if (!AppUtils.checkIfSDCardExists()) { + use_sdcard_pref.setEnabled(false); + preferences.setRulebookUseSDCardBooleanState(false); + } + use_sdcard_pref.setChecked(preferences.loadRulebookUseSDCardBooleanState()); + use_sdcard_pref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { + @Override + public boolean onPreferenceChange(@NonNull Preference preference, Object newValue) { + preferences.setRulebookUseSDCardBooleanState(newValue.toString().equals("true")); + return false; + } + }); + + androidx.preference.Preference delete_all_data = findPreference(PreferenceKeys.DELETE_ALL_DATA); + assert delete_all_data != null; + delete_all_data.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(@NonNull Preference preference) { + androidx.appcompat.app.AlertDialog.Builder builder = new androidx.appcompat.app.AlertDialog.Builder(requireContext()); + builder.setTitle(getString(R.string.app_warning)); + builder.setIcon(ContextCompat.getDrawable(requireContext(), R.drawable.app_delete_forever)); + builder.setMessage(getString(R.string.are_you_sure)); + builder.setPositiveButton(getString(R.string.yes), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + AppUtils.removeFolderRecursive(new File(AppUtils.getStorageAbsolutePath(requireContext(), false) + Constants.RULEBOOK_APP_DIRECTORY)); + if (AppUtils.checkIfSDCardExists()) { + AppUtils.removeFolderRecursive(new File(AppUtils.getStorageAbsolutePath(requireContext(), true) + Constants.RULEBOOK_APP_DIRECTORY)); + } + } + }); + builder.setNegativeButton(getString(R.string.no), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.cancel(); + } + }); + androidx.appcompat.app.AlertDialog alert = builder.create(); + alert.show(); + return false; + } + }); } } diff --git a/app/src/main/java/com/verNANDo57/rulebook_educational/preferences/PreferenceKeys.java b/app/src/main/java/com/verNANDo57/rulebook_educational/preferences/PreferenceKeys.java index 71303a0..c5fc642 100644 --- a/app/src/main/java/com/verNANDo57/rulebook_educational/preferences/PreferenceKeys.java +++ b/app/src/main/java/com/verNANDo57/rulebook_educational/preferences/PreferenceKeys.java @@ -5,7 +5,9 @@ package com.verNANDo57.rulebook_educational.preferences; public interface PreferenceKeys { - String DARK_THEME_PREF = "darktheme_switch"; - String STATUSBAR_PREF = "statusbar_enable"; - String NOTICE_PREF = "app_reboot_from_prefs"; + String DARK_THEME_PREF = "darktheme_switch_pref"; + String STATUSBAR_PREF = "statusbar_enable_pref"; + String NOTICE_PREF = "notice_pref"; + String USE_SDCARD_PREF = "use_sdcard_pref"; + String DELETE_ALL_DATA = "delete_all_data"; } diff --git a/app/src/main/java/com/verNANDo57/rulebook_educational/preferences/RulebookApplicationSharedPreferences.java b/app/src/main/java/com/verNANDo57/rulebook_educational/preferences/RulebookApplicationSharedPreferences.java index 78d5350..5275927 100644 --- a/app/src/main/java/com/verNANDo57/rulebook_educational/preferences/RulebookApplicationSharedPreferences.java +++ b/app/src/main/java/com/verNANDo57/rulebook_educational/preferences/RulebookApplicationSharedPreferences.java @@ -10,12 +10,13 @@ import androidx.appcompat.app.AppCompatDelegate; public class RulebookApplicationSharedPreferences { - SharedPreferences RulebookSharedPreferences; + private final SharedPreferences RulebookSharedPreferences; - public static String PREFS_FILE_NAME = "rulebookprefs"; - public static String DARK_MODE = "dark_mode"; - public static String STATUS_BAR_STATE_BOOLEAN = "status_bar"; - public static String RULEBOOK_LAUNCHED_FOR_THE_FIRST_TIME_STATE_BOOLEAN = "launched_for_the_first_time"; + private static final String PREFS_FILE_NAME = "rulebookprefs"; + private static final String DARK_MODE = "dark_mode"; + private static final String STATUS_BAR_STATE_BOOLEAN = "status_bar"; + private static final String RULEBOOK_LAUNCHED_FOR_THE_FIRST_TIME_STATE_BOOLEAN = "launched_for_the_first_time"; + private static final String USE_SDCARD = "use_sdcard"; public RulebookApplicationSharedPreferences(Context context) { RulebookSharedPreferences = context.getSharedPreferences(PREFS_FILE_NAME, Context.MODE_PRIVATE); @@ -37,6 +38,11 @@ public void setRulebookIsLaunchedForTheFirstTimeBooleanState(Boolean state){ editor.putBoolean(RULEBOOK_LAUNCHED_FOR_THE_FIRST_TIME_STATE_BOOLEAN, state); editor.apply(); } + public void setRulebookUseSDCardBooleanState(Boolean state){ + SharedPreferences.Editor editor= RulebookSharedPreferences.edit(); + editor.putBoolean(USE_SDCARD, state); + editor.apply(); + } //These methods will load public int loadRulebookDarkModeBooleanState (){ @@ -48,4 +54,7 @@ public Boolean loadRulebookStatusBarBooleanState (){ public Boolean loadRulebookIsLaunchedForTheFirstTimeBooleanState (){ return RulebookSharedPreferences.getBoolean(RULEBOOK_LAUNCHED_FOR_THE_FIRST_TIME_STATE_BOOLEAN, true); } + public Boolean loadRulebookUseSDCardBooleanState (){ + return RulebookSharedPreferences.getBoolean(USE_SDCARD, false); + } } diff --git a/app/src/main/java/com/verNANDo57/rulebook_educational/rules/AppBaseScrollableActivity.java b/app/src/main/java/com/verNANDo57/rulebook_educational/rules/AppBaseScrollableActivity.java index c4e0b9a..aff2290 100644 --- a/app/src/main/java/com/verNANDo57/rulebook_educational/rules/AppBaseScrollableActivity.java +++ b/app/src/main/java/com/verNANDo57/rulebook_educational/rules/AppBaseScrollableActivity.java @@ -6,7 +6,10 @@ import static com.verNANDo57.rulebook_educational.utils.AppUtils.LOG_TAG; +import android.content.Context; +import android.content.DialogInterface; import android.content.Intent; +import android.graphics.Bitmap; import android.os.Bundle; import android.util.Log; import android.view.Menu; @@ -20,10 +23,14 @@ import android.widget.RelativeLayout; import android.widget.TextView; +import androidx.activity.result.ActivityResult; +import androidx.appcompat.app.AlertDialog; import androidx.appcompat.content.res.AppCompatResources; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.core.app.ShareCompat; import androidx.core.content.ContextCompat; +import androidx.core.content.FileProvider; import androidx.core.widget.NestedScrollView; import com.google.android.material.appbar.AppBarLayout; @@ -31,22 +38,30 @@ import com.google.android.material.navigation.NavigationView; import com.google.android.material.snackbar.Snackbar; import com.verNANDo57.rulebook_educational.BottomNavAmongLessonsFragment; +import com.verNANDo57.rulebook_educational.app.CustomActivityResult; import com.verNANDo57.rulebook_educational.app.CustomThemeEngineAppCompatActivity; import com.verNANDo57.rulebook_educational.bookmarks.AppBookmarkUtils; import com.verNANDo57.rulebook_educational.extradata.R; import com.verNANDo57.rulebook_educational.markwon.Markwon; +import com.verNANDo57.rulebook_educational.preferences.RulebookApplicationSharedPreferences; import com.verNANDo57.rulebook_educational.utils.AppUtils; import org.jetbrains.annotations.NotNull; import org.json.JSONException; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; public class AppBaseScrollableActivity extends CustomThemeEngineAppCompatActivity { + private Context context; private CoordinatorLayout mRootLayout; private RelativeLayout app_basescrollableactivity_toolbar_container; private RelativeLayout app_basescrollableactivity_search_container; + private NestedScrollView app_scrollableactivity_content_scrollview; private AppBarLayout appbar; private Animation fade_in; @@ -57,14 +72,20 @@ public class AppBaseScrollableActivity extends CustomThemeEngineAppCompatActivit private String inputFileDir; private String exportFileDir; + private TextView app_scrollableactivity_content_text; private TextView app_basescrollableactivity_title; private TextView app_basescrollableactivity_summary; private Intent sourceIntent; + protected final CustomActivityResult activityLauncher = CustomActivityResult.registerActivityForResult(this); + + private RulebookApplicationSharedPreferences preferences; + public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + preferences = new RulebookApplicationSharedPreferences(this); sourceIntent = getIntent(); fade_in = AnimationUtils.loadAnimation(this, R.anim.app_fade_in); @@ -73,11 +94,12 @@ public void onCreate(Bundle savedInstanceState) { setContentView(R.layout.app_scrollable_activity); mRootLayout = findViewById(R.id.scrollableactivity_root); + context = mRootLayout.getContext(); ImageView app_basescrollableactivity_icon = findViewById(R.id.app_scrollableactivity_in_scrollableactivity_icon); app_basescrollableactivity_title = findViewById(R.id.app_scrollableactivity_in_scrollableactivity_title); app_basescrollableactivity_summary = findViewById(R.id.app_scrollableactivity_in_scrollableactivity_summary); - TextView app_scrollableactivity_content_in_mainrules_text = findViewById(R.id.app_scrollableactivity_content_everywhere_text); + app_scrollableactivity_content_text = findViewById(R.id.app_scrollableactivity_content_text); app_basescrollableactivity_toolbar_container = findViewById(R.id.app_scrollableactivity_in_scrollableactivity_toolbarlayout_container); app_basescrollableactivity_search_container = findViewById(R.id.app_scrollableactivity_everywhere_toolbarlayout_search_container); @@ -117,7 +139,7 @@ public void onClick(View v) { CollapsingToolbarLayout toolBarLayout = findViewById(R.id.toolbar_layout_in_scrollableactivity); toolBarLayout.setTitle(" "); //should be a space, otherwise the trick will not work appbar = findViewById(R.id.app_bar_in_scrollableactivity); - NestedScrollView app_scrollableactivity_content_scrollview = findViewById(R.id.app_scrollableactivity_content_scrollview); + app_scrollableactivity_content_scrollview = findViewById(R.id.app_scrollableactivity_content_scrollview); EditText app_wordsearch_edittext = findViewById(R.id.app_wordsearch_edittext); Button searchword_button = findViewById(R.id.searchword_button); @@ -126,16 +148,16 @@ public void onClick(View v) { try { if(sourceIntent.getStringExtra(AppUtils.EXTRA_DATA_KEY).contains("ortho_")) { inputStream = getAssets().open("mainrules/orthography/" + sourceIntent.getStringExtra(AppUtils.EXTRA_DATA_KEY) + Constants.FILE_FORMAT); - markwon.setMarkdown(app_scrollableactivity_content_in_mainrules_text, AppUtils.convertStreamToString(inputStream)); + markwon.setMarkdown(app_scrollableactivity_content_text, AppUtils.convertStreamToString(inputStream)); } else if(sourceIntent.getStringExtra(AppUtils.EXTRA_DATA_KEY).contains("punct_")){ inputStream = getAssets().open("mainrules/punctuation/" + sourceIntent.getStringExtra(AppUtils.EXTRA_DATA_KEY) + Constants.FILE_FORMAT); - markwon.setMarkdown(app_scrollableactivity_content_in_mainrules_text, AppUtils.convertStreamToString(inputStream)); + markwon.setMarkdown(app_scrollableactivity_content_text, AppUtils.convertStreamToString(inputStream)); } else if (sourceIntent.getStringExtra(AppUtils.EXTRA_DATA_KEY).contains("dict_")) { inputStream = getAssets().open("dictionaries/" + sourceIntent.getStringExtra(AppUtils.EXTRA_DATA_KEY) + Constants.FILE_FORMAT); - markwon.setMarkdown(app_scrollableactivity_content_in_mainrules_text, AppUtils.convertStreamToString(inputStream)); + markwon.setMarkdown(app_scrollableactivity_content_text, AppUtils.convertStreamToString(inputStream)); } else { inputStream = getAssets().open("analyze_methods/" + sourceIntent.getStringExtra(AppUtils.EXTRA_DATA_KEY) + Constants.FILE_FORMAT); - markwon.setMarkdown(app_scrollableactivity_content_in_mainrules_text, AppUtils.convertStreamToString(inputStream)); + markwon.setMarkdown(app_scrollableactivity_content_text, AppUtils.convertStreamToString(inputStream)); } } catch (IOException e) { Snackbar.make(mRootLayout, getString(R.string.error_while_reading_a_file), Snackbar.LENGTH_LONG).show(); @@ -145,20 +167,25 @@ public void onClick(View v) { searchword_button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - String criteria = app_wordsearch_edittext.getText().toString(); - String fullText = app_scrollableactivity_content_in_mainrules_text.getText().toString(); + String criteria = app_wordsearch_edittext.getText().toString().trim(); + String fullText = app_scrollableactivity_content_text.getText().toString(); - AppUtils.resetHighLightedText(app_scrollableactivity_content_in_mainrules_text, fullText); + AppUtils.resetHighLightedText(context, app_scrollableactivity_content_text, fullText); - if(criteria.equals(" ") | criteria.contains(" ") | criteria.isEmpty()){ - Snackbar.make(mRootLayout, getString(R.string.app_edittext_is_empty), Snackbar.LENGTH_LONG).show(); + // If EditText is empty... + if(criteria.isEmpty()) { + // If so... + Snackbar.make(findViewById(android.R.id.content), getString(R.string.app_edittext_is_empty), Snackbar.LENGTH_LONG).show(); } else { + // If not, start searching... if (fullText.contains(criteria)) { - int indexOfCriteria = fullText.indexOf(criteria); - int lineNumber = app_scrollableactivity_content_in_mainrules_text.getLayout().getLineForOffset(indexOfCriteria); - AppUtils.setHighLightedText(app_scrollableactivity_content_in_mainrules_text, criteria); - - app_scrollableactivity_content_scrollview.scrollTo(0, app_scrollableactivity_content_in_mainrules_text.getLayout().getLineTop(lineNumber)); + // Highlight text + AppUtils.setHighLightedText(context, app_scrollableactivity_content_text, criteria); + // Scroll to it's position + app_scrollableactivity_content_scrollview.scrollTo(0, app_scrollableactivity_content_text.getLayout().getLineTop(app_scrollableactivity_content_text.getLayout().getLineForOffset(fullText.indexOf(criteria)))); + } else { + // If nothing was found... + Snackbar.make(mRootLayout, getString(R.string.app_search_nothing_found), Snackbar.LENGTH_LONG).show(); } } } @@ -251,6 +278,41 @@ public boolean onOptionsItemSelected(MenuItem item) { e.printStackTrace(); } } + } else if (id == R.id.share) { + AlertDialog.Builder builder = new AlertDialog.Builder(context); + builder.setTitle(getResources().getString(R.string.app_share)); + builder.setIcon(ContextCompat.getDrawable(this, R.drawable.app_share)); + builder.setItems(getResources().getStringArray(R.array.share_modes), new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + // The 'which' argument contains the index position + // of the selected item + switch (which) { + case 0: + try { + shareScreenshot(); + } catch (IOException e) { + Log.e(LOG_TAG, getResources().getString(R.string.app_error_occurred)); + e.printStackTrace(); + } + break; + case 1: + try { + shareFile(); + } catch (IOException e) { + Log.e(LOG_TAG, getResources().getString(R.string.app_error_occurred)); + e.printStackTrace(); + } + break; + } + } + }); + builder.setNeutralButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + dialogInterface.cancel(); + } + }); + builder.create().show(); } else if (id == R.id.save_rule) { AppUtils.copyFileFromAssets( getApplicationContext(), @@ -258,8 +320,72 @@ public boolean onOptionsItemSelected(MenuItem item) { inputFileDir, sourceIntent.getStringExtra(AppUtils.EXTRA_DATA_KEY) + Constants.FILE_FORMAT, exportFileDir, - app_basescrollableactivity_title.getText() + Constants.FILE_EXPORT_FORMAT); + app_basescrollableactivity_title.getText() + Constants.FILE_EXPORT_FORMAT, + preferences.loadRulebookUseSDCardBooleanState()); } return super.onOptionsItemSelected(item); } + + private void shareScreenshot() throws IOException { + // Get bitmap & compress + ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + AppUtils.getBitmapFromView(context, app_scrollableactivity_content_text, app_scrollableactivity_content_text.getHeight(), app_scrollableactivity_content_text.getWidth()).compress(Bitmap.CompressFormat.JPEG, 100, bytes); + + // Create screenshot file + File screenshotFile = new File(getApplicationContext().getFilesDir().getAbsolutePath(), "tmp_screenshot.jpg"); + screenshotFile.createNewFile(); + + // Write bitmap + FileOutputStream fileOutputStream = new FileOutputStream(screenshotFile); + fileOutputStream.write(bytes.toByteArray()); + + // Close FileOutputStream + fileOutputStream.flush(); + fileOutputStream.close(); + + // Share image + Intent sharingIntent = new ShareCompat.IntentBuilder(getApplicationContext()) + .setType("image/jpeg") + .setStream(FileProvider.getUriForFile(this, "com.verNANDo57.rulebook_educational.fileprovider", screenshotFile)) + .setChooserTitle(getResources().getString(R.string.app_share)) + .createChooserIntent() + .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + activityLauncher.launch(sharingIntent, result -> { + screenshotFile.getAbsoluteFile().delete(); + }); + } + + private void shareFile() throws IOException { + File exportRuleFile = new File(getApplicationContext().getFilesDir().getAbsolutePath(), app_basescrollableactivity_title.getText() + Constants.FILE_EXPORT_FORMAT); + + // Copy the file which we're gonna share to apllication data folder (/data/data/*) + if (!exportRuleFile.exists()) { + exportRuleFile.createNewFile(); + + InputStream in; + OutputStream out; + in = context.getAssets().open(inputFileDir + sourceIntent.getStringExtra(AppUtils.EXTRA_DATA_KEY) + Constants.FILE_FORMAT); + out = new FileOutputStream(exportRuleFile); + + byte[] buffer = new byte[1024]; + int read; + while ((read = in.read(buffer)) != -1) { + out.write(buffer, 0, read); + } + + out.flush(); + out.close(); + } + + // Share file + Intent sharingIntent = new ShareCompat.IntentBuilder(getApplicationContext()) + .setType("text/plain") + .setStream(FileProvider.getUriForFile(this, "com.verNANDo57.rulebook_educational.fileprovider", exportRuleFile)) + .setChooserTitle(getResources().getString(R.string.app_share)) + .createChooserIntent() + .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + activityLauncher.launch(sharingIntent, result -> { + exportRuleFile.getAbsoluteFile().delete(); + }); + } } diff --git a/app/src/main/java/com/verNANDo57/rulebook_educational/utils/AppUtils.java b/app/src/main/java/com/verNANDo57/rulebook_educational/utils/AppUtils.java index b6edd42..d4030d2 100644 --- a/app/src/main/java/com/verNANDo57/rulebook_educational/utils/AppUtils.java +++ b/app/src/main/java/com/verNANDo57/rulebook_educational/utils/AppUtils.java @@ -8,10 +8,14 @@ import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.res.Configuration; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.drawable.Drawable; import android.os.Environment; import android.text.Spannable; import android.text.SpannableString; import android.text.style.BackgroundColorSpan; +import android.text.style.ForegroundColorSpan; import android.util.DisplayMetrics; import android.util.Log; import android.util.TypedValue; @@ -36,6 +40,7 @@ import java.io.OutputStream; import java.io.RandomAccessFile; import java.nio.channels.FileChannel; +import java.util.Objects; public class AppUtils { @@ -50,19 +55,19 @@ public class AppUtils { public static String EXTRA_DATA_TITLE = "rule_title"; public static String EXTRA_DATA_SUMMARY = "rule_summary"; - //Thanks to this method, we can read a text file + // Thanks to this function, we can read a text file public static String convertStreamToString(java.io.InputStream is) { java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A"); return s.hasNext() ? s.next() : ""; } /** - * use this method to highlight a text in TextView + * Use this function to highlight a text in TextView * * @param tv TextView or Edittext or Button (or derived from TextView) * @param textToHighlight Text to highlight */ - public static void setHighLightedText(TextView tv, String textToHighlight) { + public static void setHighLightedText(Context context, TextView tv, String textToHighlight) { String tvt = tv.getText().toString(); int ofe = tvt.indexOf(textToHighlight); Spannable wordToSpan = new SpannableString(tv.getText()); @@ -71,14 +76,23 @@ public static void setHighLightedText(TextView tv, String textToHighlight) { if (ofe == -1) break; else { - // set color here - wordToSpan.setSpan(new BackgroundColorSpan(0xFFFFFF00), ofe, ofe + textToHighlight.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + // Set background color + wordToSpan.setSpan(new BackgroundColorSpan(context.getResources().getColor(R.color.app_text)), ofe, ofe + textToHighlight.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + // Set foreground color + wordToSpan.setSpan(new ForegroundColorSpan(context.getResources().getColor(R.color.app_custom_background)), ofe, ofe + textToHighlight.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + // Apply changes tv.setText(wordToSpan, TextView.BufferType.SPANNABLE); } } } - public static void resetHighLightedText(TextView tv, String textToResetColor) { + /** + * Use this function to reset text color in TextView + * + * @param tv TextView or Edittext or Button (or derived from TextView) + * @param textToResetColor Text to reset + */ + public static void resetHighLightedText(Context context, TextView tv, String textToResetColor) { String tvt = tv.getText().toString(); int ofe = tvt.indexOf(textToResetColor); Spannable wordToSpan = new SpannableString(tv.getText()); @@ -87,8 +101,11 @@ public static void resetHighLightedText(TextView tv, String textToResetColor) { if (ofe == -1) break; else { - // set color here + // Reset background color wordToSpan.setSpan(new BackgroundColorSpan(0), ofe, ofe + textToResetColor.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + // Reset foreground color + wordToSpan.setSpan(new ForegroundColorSpan(context.getResources().getColor(R.color.app_text)), ofe, ofe + textToResetColor.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + // Apply changes tv.setText(wordToSpan, TextView.BufferType.SPANNABLE); } } @@ -116,12 +133,12 @@ public static void copyFileUsingNIO(File sourceFile, File destinationFile) throw } } - public static void copyFileFromAssets(Context context, View rootView, String inputFileDir, String inputFile, String outputFileDir, String outputFile) { + public static void copyFileFromAssets(Context context, View rootView, String inputFileDir, String inputFile, String outputFileDir, String outputFile, boolean useSDCard) { try { // Create output dir if needed - new File(Environment.getExternalStorageDirectory().getAbsolutePath() + outputFileDir).mkdirs(); + new File(getStorageAbsolutePath(context, useSDCard) + outputFileDir).mkdirs(); // Initialize output file - File output = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + outputFileDir + outputFile); + File output = new File(getStorageAbsolutePath(context, useSDCard) + outputFileDir + outputFile); if (!output.exists()) { InputStream in; OutputStream out; @@ -134,9 +151,12 @@ public static void copyFileFromAssets(Context context, View rootView, String inp out.write(buffer, 0, read); } - Snackbar.make(rootView, context.getString(R.string.app_saved) + ":" + outputFileDir + outputFile, Snackbar.LENGTH_LONG).show(); + Snackbar.make(rootView, context.getString(R.string.app_saved) + ":" + output.getAbsolutePath(), Snackbar.LENGTH_LONG).show(); + + out.flush(); + out.close(); } else { - Snackbar.make(rootView, context.getString(R.string.app_saved_already) + ":" + outputFileDir + outputFile, Snackbar.LENGTH_LONG).show(); + Snackbar.make(rootView, context.getString(R.string.app_saved_already) + ":" + output.getAbsolutePath(), Snackbar.LENGTH_LONG).show(); } } catch (IOException e) { e.printStackTrace(); @@ -145,11 +165,53 @@ public static void copyFileFromAssets(Context context, View rootView, String inp } } - public static int getIconWarning() { - return R.drawable.ic_warning; + /* Using this function we can get storage absolute path */ + public static String getStorageAbsolutePath(Context context, boolean useSDCard) { + // Works on API 24+ + File[] dirs = context.getExternalFilesDirs(null); + StringBuilder outputStorage; + int slashCount; + + // Firstly, check if SDCard exist, to avoid issues + if (checkIfSDCardExists() && useSDCard) { + // Use SDCard if user wants to + outputStorage = new StringBuilder(dirs[1].getAbsolutePath()); + slashCount = 2; + } else { + outputStorage = new StringBuilder(dirs[0].getAbsolutePath()); + slashCount = 3; + } + + // Process + int charsCounter = outputStorage.length(); + int slashCounter = getCharCount(outputStorage, '/'); + + for (int i=1;slashCounter!=slashCount;i++) { + if(outputStorage.charAt(charsCounter - i) == '/') { + slashCounter = slashCounter - 1; + } + outputStorage.deleteCharAt(charsCounter-i); + } + + return outputStorage.toString(); + } + + /* Using this function we can check, if SDCard is inserted */ + public static boolean checkIfSDCardExists() { + return Environment.isExternalStorageRemovable() && Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED); + } + + /* Using this function we can remove all files inside one folder */ + public static void removeFolderRecursive(File dir) { + if (dir.exists() && dir.isDirectory()) { + for (File child : Objects.requireNonNull(dir.listFiles())) { + removeFolderRecursive(child); + } + } + dir.delete(); } - /* Using these methods we can remove last line of any text file */ + /* Using these functions we can remove last line of any text file */ public static void removeLastLine(String name) throws IOException { RandomAccessFile f = new RandomAccessFile(name, "rw"); long length = f.length() - 1; @@ -180,17 +242,18 @@ public static void removeLastLine(File file) throws IOException { f.close(); } - /* This method uses BufferedReader to read line by line and increases the count. */ + /* This function uses BufferedReader to read line by line and increases the count. */ public static long countLineBufferedReader(File fileName) throws IOException { long lines = 0; BufferedReader reader = new BufferedReader(new FileReader(fileName)); while (reader.readLine() != null) { lines++; } + reader.close(); return lines; } - /* Using this method we can count occurrences of a char in a string */ + /* Using these functions we can count occurrences of a char in a string */ public static int getCharCount(String text, char someChar) { int count = 0; @@ -202,8 +265,19 @@ public static int getCharCount(String text, char someChar) { return count; } + public static int getCharCount(StringBuilder stringBuilder, char someChar) { + int count = 0; + + for (int i = 0; i < stringBuilder.length(); i++) { + if (stringBuilder.charAt(i) == someChar) { + count++; + } + } + return count; + } + /** - * U can use this method to set animation to any view + * U can use this function to set animation to any view * firstly, u need to define your view, then animator_mode, then [Float] move value (optional) */ public static int TRANSLATE_DIRECTION_RIGHT = 1; @@ -280,7 +354,7 @@ public static float dpToPx(Context context, int dp) { } /** - * This simple method have been created for fetching app's info (VerisionName or VersionCode). + * This simple function have been created for fetching app's info (VerisionName or VersionCode). * It returns String, so his return value can be used instead of any string which defined in strings.xml and etc. * * For Example: @@ -318,7 +392,7 @@ public static String getApplicationVersionInfo(Context context, int info_mode) { /** * @param context * - * Using this method we can find out which theme is being used. + * Using this function we can find out which theme is being used. * This method is needed because of DayNight engine. * Since user can use FOLLOW_SYSTEM or AUTO_BATTERY option, we can't just use AppCompatDelegate to find out which theme is being used. * @@ -345,4 +419,26 @@ public static int calculateNumberOfColumns(Context context, float columnWidthDp) float screenWidthDp = displayMetrics.widthPixels / displayMetrics.density; return (int) (screenWidthDp / columnWidthDp + 0.5); } + + /** + * Using this function we can take full screenshot of view (using bitmap) + * @param context - Context + * @param height - height of view + * @param width - width of view + * @param view - view we want take a screenshot of + * + * @return the bmp file + */ + public static Bitmap getBitmapFromView(Context context, View view, int height, int width) { + Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(bitmap); + Drawable bgDrawable = view.getBackground(); + if (bgDrawable != null) { + bgDrawable.draw(canvas); + } else { + canvas.drawColor(context.getResources().getColor(R.color.app_custom_background)); + } + view.draw(canvas); + return bitmap; + } } diff --git a/app/src/main/java/com/verNANDo57/rulebook_educational/utils/ColorUtils.java b/app/src/main/java/com/verNANDo57/rulebook_educational/utils/ColorUtils.java index 6a943f5..8bcea1e 100644 --- a/app/src/main/java/com/verNANDo57/rulebook_educational/utils/ColorUtils.java +++ b/app/src/main/java/com/verNANDo57/rulebook_educational/utils/ColorUtils.java @@ -215,7 +215,7 @@ public static float[] createColorMatrixFromHex(@NonNull String hex) { hex = hex.substring(1); } - float a = Float.parseFloat(new DecimalFormat("#.##").format(Integer.parseInt(hex.substring(0, 2), 16) / 255.0f)); // Alpha (Transparency in percents) [First Two + float a = Float.parseFloat(new DecimalFormat("#.##").format(Integer.parseInt(hex.substring(0, 2), 16) / 255.0f)); // Alpha (Transparency in percents) float r = Float.parseFloat(new DecimalFormat("#.##").format(Integer.parseInt(hex.substring(2, 4), 16) / 255.0f)); // Red float g = Float.parseFloat(new DecimalFormat("#.##").format(Integer.parseInt(hex.substring(4, 6), 16) / 255.0f)); // Green float b = Float.parseFloat(new DecimalFormat("#.##").format(Integer.parseInt(hex.substring(6, 8), 16) / 255.0f)); // Blue diff --git a/app/src/main/res/drawable-hdpi/colorpicker_alpha.png b/app/src/main/res/drawable-hdpi/colorpicker_alpha.png deleted file mode 100644 index e3fe9c850eff429f3843a22979d299d5ed97fb19..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 81 zcmeAS@N?(olHy`uVBq!ia0vp^0wBx*Bp9q_EZ7UABs^UlLn;`P|D0!Fe7@j|1LvI9 dE(!iM3=HuJa)n0yuFpVfJzf1=);T3K0RXz#6omi) diff --git a/app/src/main/res/drawable-hdpi/colorpicker_popup_background.9.png b/app/src/main/res/drawable-hdpi/colorpicker_popup_background.9.png deleted file mode 100644 index f2149f982b2ad9a3eaf70734d5cde1d678679d7c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1204 zcmV;l1WWsgP)*xD^TD}Zz!jn*K#&Hfubt}=9^v*}ltu(|&k2PPjtEwOGt&p>o?ZoM zk4S3}a{h$1IU*n@K1g5t45#k}o)AYYL?1Ep5V4R=L5|q!nnLMjRD`wWiP57F zo(M;$k$hkgNX5vkqGk~)!jz7ubZ(OC-m&MRdVzIGB>fD)Z{*&A$4LEelw#yh7Mb~= z3A0G&04@Q%0q`Ec2LK;$Z*Skm7%^JeZfdY`zvOkD1;4BRZ5szp5Nawche z03pWsb;Ia+u?Qi2!aTO`FKrjFVmoLNoEs)A zQ54r18SLl|<{BFIpK? z#)LUCT6IZ;wG(3;bDq9qvr@gxDe55(n905e@C(2lfS&+<0QjEn`Ie4< zq-%HSUM;aX0*Ki=bi$T(O_?>M_8Mi5g2M4w_u+eh@}Vncp40lTJJhYhoiDsOf>7T^ z5q9ZEbQd4rHfKm#a`zJD@Gwm%{9>~tVO6u6BcXO zRH@Jb)^;AOmGD>xw!5Hf388PoXsD`__;_`z6r|RG+&yIo_H6K1+rW645hz`Xic$Mq z6Cuh6_eB-^!}i5IKES>=W~&yo?**O^cC~yo{iZw)E#g7Rp5EAfYWzj!Ec^lVPuNB4 S!XO*~0000ku`7t diff --git a/app/src/main/res/drawable-mdpi/colorpicker_popup_background.9.png b/app/src/main/res/drawable-mdpi/colorpicker_popup_background.9.png deleted file mode 100644 index f42bff1f2760bace35ee8038bef6c0f22d972568..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 747 zcmV!1&^0008ANklTsJ-7`RhA;6K2?Y>s{!rqhg&Isud zQ6Qip5#b8oK|Q2cqpwP~-(`dhg@zdW6y?UqvJQ0;aaG$z$$Gtq8xhJIw6Seiq9qW~ zl9N#r5tf9Gpr`C1k#HsG?jiRG?fxzB3^d;RpVR3-J)CpjNCb4G@bE;THMdhpkh{N$ z^3w4_2oakzdO1QT5A6+`c!ALpyAW(io}k0$25qDcizh-@yu@wk_zb)gyh8GY*qh~u zAtJVq(|0n64QJp)A<>tTrOgqW$<>@58$u{Z_0#1a7$-u!Vl6~mNOomJl!h+r6>CVA zVn>k#$ceD6v@p1ISWn0rK_S8}=#$q%M2Udg@sLMYc?}q~%@Wb;wpNVH&Sqf24lhfG zw#C}%p^h@odHr*ixcTly-D2M2Ia#GDA?Nq4*5kEu1C3j6*3 zJE5&UlkDn+hzFb;xqe%{1-<~Uz*oY|@fx>JaeYJRJZq^eo-|7wfj8iH+}?p-QT`Lx zPed>A;9GMc?GfjAfg{0aoj|o*%PWDBZer7sV2gN#UIX&>SwH9N;*SpmV}+ diff --git a/app/src/main/res/drawable-xhdpi/colorpicker_popup_background.9.png b/app/src/main/res/drawable-xhdpi/colorpicker_popup_background.9.png deleted file mode 100644 index e10daaaad92b443ee8d0be14c201ae005b0bf5bc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1738 zcmV;*1~vJKP)Dhbd8>ow;mdgGOTmo`{eG!^H(ph$!X<2S)l zk9)_a_Ma*uqm_)`21`TZoI65DgaQd70yGoHyc<5*bc*VvQgCjb`! zJ_Gmy;Aa4r0KNhEdUJF0OWU@{_VMlZ_VycqubnL}JKKEeY<1Du?hJjW^*Uf%%KbGK zu8=SThpLepZoq7o5xX7UT3XEG7Y+v?DGLd+vc1;kbDi5<7m=c^J72#N5icl&t0X+$H85+{d|BVDp1eK)3GEgFDy+Lg`D@ITf zup$^4(ls0h%r$UxB$mgTmQxS@TpaTBQHhW- z!t$_s5EG#^Cd9n}!z(OBieO|&EDwIdTT%qZAYiO{*1+2y8B!6JhgA|I5*R{dsHqG_ zu>!9rmcZs z&dE%;Z60C7PZV_! z3P0l1!K)XKkB^sES6A!n>+8SY=iYdiEaq@&mC z0KlK#^Xh2Wy1ggC-j#3x;8WK=cVA@t?L7W0lSf~oaq4k~PE+Hl?Pg3f@b|9$*R>UZ ze*pa3HQR6J@n`LN?AF^B^#2+hOK{5J1&MZp_C=r26M&l$fyq!k-u{HZuGjmG*Vr4D z&ws|=_^beIXpIxX%%K!40^|IYZ_;jVgYk%F{-d@i6Cu%~L}EY{U^Vb+2RewA z{~)^&o<6U0Au>J~LgNHBrmBK9Q-_i&ctybxUWm{FZ8Ma1C4tSVH6m;<9HqoT4*Rvp zC8TQ@V=5lop*Q#jV@23tNT8_X3|)_0gDsgwRv(o98@h;2sb7fuS8YC17_Dy?-%@u!omIYAR`+%(hhtG;=5#pHU)$rjI&0 zwh7KN!&@M!O5l;;)XAW-tz_VytpTB?j+!-8J$Ndmj~XwSi?IFt<}M`xXA-4pSV@FE zlnCC_L?(hqh=>GyU0r{{fCx^&Xy9OxZ&YvEni+kH1gA~_MfAJs@2gpbF1>=1D#Cye zHLiiP2Vk6n*fGv3ycadRdJ@J7KuO>=?eS4l;~(T2^ybVpSkLA!GPRg`K|`uR9X#WC zWbjl%?c$}3E^4v{1J?@Fs7weo{7SBoYEVYhgS{-kD;PyeFfVJ6IDv0WZ`SMGN|I7` zkVNp|`Ehm2k+D4$@JKMSX%o?;@eLJ4{E_ch7m!4lMikJg;dx)_Sn2wV!Z diff --git a/app/src/main/res/drawable-xxhdpi/colorpicker_alpha.png b/app/src/main/res/drawable-xxhdpi/colorpicker_alpha.png deleted file mode 100644 index c81fc262365b18fc96c662c9e42335e4dd702023..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 101 zcmeAS@N?(olHy`uVBq!ia0vp^av;nBBpBqPKh^;$9Zwg>kP61+Kj#~m&M6j4NP0}M xvwm=C@uhUh01=7B8gd*j178-exa6kd$;{wWW+_@}eWDSh-_zC4Wt~$(69COt96|s9 diff --git a/app/src/main/res/drawable-xxhdpi/colorpicker_popup_background.9.png b/app/src/main/res/drawable-xxhdpi/colorpicker_popup_background.9.png deleted file mode 100644 index 4f4b0e1b3831282739befc10baf4c69bb82b60ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2972 zcmV;N3uE+&P) zy^h?<5rq#q`;%EK7_uY5fE-){wgD&i74{wUHhvg|dI3SP6xf;IzzcYl$cbSCt4y+X zcE-U@&D7LXbyt&I4c9s!K#*+ybkC|zS5-Gfb~rBUBiB#nMR)855c0#a2G;$t8$rk% zpb!WFg+K@Z3V{#+6apatCFH(jN!o_#hFqF-^17` zsK>=r23-1gpQMhlhBfs1(seZUAA^zs4>j&V*R6r|5Tk3o#-3l>f2ekl@559^T-%?l z9j!vhp4%n1OZWB8qtQQZJfqAS`Z}@QTDLtREriT@p3z4}UK7YvUW3eojL~~W9$nWe zh~ha}A=J*X#$7W0nlQ57fWnwJ84sY#N`{{mMNJUl@inlnjT&W=+L8dQ@pr-bQF+u3 z3Sr)~cz`v^-k>w*+45T5LRUDJ?(L)Ul2KbvP&xGSPniemSY2(s%IL3nF2FIqw&YtTLRLmw>weNAuHa=!Hd+B*~(lOx!;-}d@F_Km*3 zzP|q5^XJb$oSdB8bX}K@-^h=}a=EC>nG#JzFrWnEZjMwejr2fg6SiU9CMvDmEp ztE;P@C<4;T#l^*6udc3s!mdLVo3c>|a2S;|QS%7864{S(fdw290O-Gd{d#+Te*Ul4 z#u4)E+qYkxpP!#$-y_^%=K=0;=ox_h+(OE{Q7j+uvSO8d@ot^zVQ4b*p zoSvTk2OB#=*)v!V;n{6S>pVg<1Zo?&6#;-n*L5rJhJ@7E*v<*=d;SuVP)ouLG$hO? zIGm+BXiH&j#h|@{UI-b3XG1bdB-?uUG+Kw0JVI%tC=!764vR`1gk;b*^jjH-Eoz2n*ckKjG-Q1b)~jmT6iP@W&q z&moBjgj9Hx>8)!MYEjZG9)Ut2V-Xv&MlZvqo;}(yX;hBj?T53+@Vx>-B5Z2GL{qU z+mt-T;Mt#DQe=e?iX1`iQwo&`8AB-)(oaSoEk}@h z*oHAQB2(gpMj0^xBRzt56K}hgJnKdhGL$Ids2P4_vu*`7yt#vD+shFs1Tq%SraS?7 z+dyFawt^u<@mMs+K*$(sa|MI)0$agYywJ!toRBftj@1i|M$wuq>qbRN)N6VKG6i;c zG|EvuVN5c78s!J}cqwV7M<8P<*;bSUHwmIOSuRyj$`c3~L+x3jY=>Q}z>@93qY9(U zoscoqY^%lI4$f=st-Xp$jiMOH6qM{Kvau$+8=5S86?utFbAt$R$l6vEDpjdHeOlVr z<)wyF2xKfnZ7iKDOqs}LGI>IV5)H~s0!MTR0fj&afN6zLdj~xsV~AetH3<*l5hiUQ zA%+LBuaXe5y}Nz;m|as8WGq8%EFGa_J%aavg{YEfO~_EPw&j(l?5{O6iaymD#c%Wo zWC}|56xmpl-FZUD-k{bfihxW>&9++X?cltON2pa;dONZHrWGMW@xGYp<%ijr-W@`ZG+Ff>`ts8bqEk3hzvzpo6$9kAE=rjzBd&ue&U)eWadAY;+? z6@6fQ6hkM}N=mfCSbh2Og%976L2PWtcC59fnbu@E%G?i(UoY3!*B3(?N65#IAD_ap zDfl6IG^#W>S&p)C?|78RY+cy<_wWBuYX~78@7}%pJ^XMelQc&*dqC-b_|#tYE?>-C z065)jpQ`0dE$46Ey!prF<>lWpKb{Z(c>DJ4A1^O2e+%Hh0KTc^RxQiT`fjtm+-%?B zUM#YeZ`XKYRA{S8 z?w@(*B{@EseDTgKV%WN8Ut-tmTQ6X}!L7O8-e0_d9nstq#Tra?o7E=n0)0> z|KP=D-J2iYZyJumef1wPdN;nko*W;s2^-66yO8w~`{9f%x8}Gt>RPDdjT}`+l(HZC zD<#Lh^Mj?q;zhIwmYaKZ&OPPY1@?vHg<$#~WFFYgG3yn)MTU%V{N z6<{X_?FAN_A0r05bnXdtpKMs9N4qG7d7uq0@(7*~WRdVjhe%o|)}z?_kD616grLJA zyRFZ$jk(*LYxg}7==(^1pu;LF1nmv@nwa_G4X1lTupyFc+kC->MmEffW|%YETWUFi zjo~}>!#cI@Oqmt{5WgaRg`EJzBj}`Dk4{-3Ah;(v4&H>8_sESEf=!&gJfS2A8zyT6x z^rAgMlo&?|GV_D^;`P2>;#^9gqxlAVPLwo9!>L7DJc8cVm5NbE-oP78(D{JuOE{JB z1QfzNsf9<8XNcwpte3Foc=z(Wz=Mn$*)lB#S?lX{!*mF=LYx$P&lK5^h+>!*kpX&% zb4d(Q$YhV%Yi%2v!lRbZNdGv&8$Hru=*@L{@r=LZ38J|J3Sk~ZJ#gd|A~9GG;VqsA z7!(o-o)B~>WPg;NOVG2-Iy{n|Ute#9(qrF?NW$DA0t#TB)I5VH2EZ4A^%P!CphcnU zvh{jx+|ue1bXa5)X4%#rVU2x{VXxI8kQM`QC<5jOkAo;Au}0~MpynmKa7c^53L;JG zW7yVHc*bo#1k^cRZUG!7%T@q1{>MqCm#zuI+xJ8e_53M8lng7HDfU7YFR8UlE%eD4 zKLznPh{7XTd!nf25zzwd3&N|zYnv`uw+KO(d1A1}+b6a?;~yFdQ5?si*5kH>N|AAw z!XMk~mqg%}4H1Ga&xm2nzE@wZZDbxqp1__{3z=H>;T*5EO$v%a0CHlm=Vc7MROZ!7 z5j;LTG1&dckV|FJIo`U|CS5pK2>Mvbc(cY{ONdLtAoHUdm!m9(s60xDy>+HtQdkuN zkdMu4y?G|=$%r7+CURU-u{r8SoJo2!0w^Be3SpfbVj2pqmW<&+jT1lzbpHcHc3(z5 SgQkT50000uuu diff --git a/app/src/main/res/drawable/app_bottomappbar_icon.xml b/app/src/main/res/drawable/app_bottomappbar_icon.xml deleted file mode 100644 index d80d0a4..0000000 --- a/app/src/main/res/drawable/app_bottomappbar_icon.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/app_delete_forever.xml b/app/src/main/res/drawable/app_delete_forever.xml new file mode 100644 index 0000000..de0e0ad --- /dev/null +++ b/app/src/main/res/drawable/app_delete_forever.xml @@ -0,0 +1,10 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/app_sdcard.xml b/app/src/main/res/drawable/app_sdcard.xml new file mode 100644 index 0000000..030f70d --- /dev/null +++ b/app/src/main/res/drawable/app_sdcard.xml @@ -0,0 +1,10 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/app_share.xml b/app/src/main/res/drawable/app_share.xml new file mode 100644 index 0000000..319d503 --- /dev/null +++ b/app/src/main/res/drawable/app_share.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_actionmenu.xml b/app/src/main/res/drawable/ic_actionmenu.xml new file mode 100644 index 0000000..7455542 --- /dev/null +++ b/app/src/main/res/drawable/ic_actionmenu.xml @@ -0,0 +1,10 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_close.xml b/app/src/main/res/drawable/ic_close.xml index 6983e75..6a32fdf 100644 --- a/app/src/main/res/drawable/ic_close.xml +++ b/app/src/main/res/drawable/ic_close.xml @@ -3,7 +3,7 @@ android:height="48dp" android:viewportWidth="192" android:viewportHeight="192"> - + diff --git a/app/src/main/res/drawable/ic_home_black.xml b/app/src/main/res/drawable/ic_home.xml similarity index 100% rename from app/src/main/res/drawable/ic_home_black.xml rename to app/src/main/res/drawable/ic_home.xml diff --git a/app/src/main/res/drawable/ic_refresh.xml b/app/src/main/res/drawable/ic_refresh.xml index 0d2b744..26aaf67 100644 --- a/app/src/main/res/drawable/ic_refresh.xml +++ b/app/src/main/res/drawable/ic_refresh.xml @@ -1,9 +1,9 @@ - + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_save_icon.xml b/app/src/main/res/drawable/ic_save_toolbar.xml similarity index 100% rename from app/src/main/res/drawable/ic_save_icon.xml rename to app/src/main/res/drawable/ic_save_toolbar.xml diff --git a/app/src/main/res/drawable/ic_searchword.xml b/app/src/main/res/drawable/ic_searchword.xml index ff5d56d..156c190 100644 --- a/app/src/main/res/drawable/ic_searchword.xml +++ b/app/src/main/res/drawable/ic_searchword.xml @@ -6,4 +6,4 @@ - + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_settings_black.xml b/app/src/main/res/drawable/ic_settings_toolbar.xml similarity index 100% rename from app/src/main/res/drawable/ic_settings_black.xml rename to app/src/main/res/drawable/ic_settings_toolbar.xml diff --git a/app/src/main/res/drawable/ic_share.xml b/app/src/main/res/drawable/ic_share.xml new file mode 100644 index 0000000..83d671f --- /dev/null +++ b/app/src/main/res/drawable/ic_share.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_warning.xml b/app/src/main/res/drawable/ic_warning.xml index be3671e..d9c4779 100644 --- a/app/src/main/res/drawable/ic_warning.xml +++ b/app/src/main/res/drawable/ic_warning.xml @@ -1,4 +1,5 @@ - - \ No newline at end of file diff --git a/app/src/main/res/font/productsans_bold.ttf b/app/src/main/res/font-v26/productsans_bold.ttf similarity index 100% rename from app/src/main/res/font/productsans_bold.ttf rename to app/src/main/res/font-v26/productsans_bold.ttf diff --git a/app/src/main/res/font/productsans_bolditalic.ttf b/app/src/main/res/font-v26/productsans_bolditalic.ttf similarity index 100% rename from app/src/main/res/font/productsans_bolditalic.ttf rename to app/src/main/res/font-v26/productsans_bolditalic.ttf diff --git a/app/src/main/res/font/productsans_italic.ttf b/app/src/main/res/font-v26/productsans_italic.ttf similarity index 100% rename from app/src/main/res/font/productsans_italic.ttf rename to app/src/main/res/font-v26/productsans_italic.ttf diff --git a/app/src/main/res/font/productsans_medium.ttf b/app/src/main/res/font-v26/productsans_medium.ttf similarity index 100% rename from app/src/main/res/font/productsans_medium.ttf rename to app/src/main/res/font-v26/productsans_medium.ttf diff --git a/app/src/main/res/font/productsans_mediumitalic.ttf b/app/src/main/res/font-v26/productsans_mediumitalic.ttf similarity index 100% rename from app/src/main/res/font/productsans_mediumitalic.ttf rename to app/src/main/res/font-v26/productsans_mediumitalic.ttf diff --git a/app/src/main/res/font/productsans_regular.ttf b/app/src/main/res/font-v26/productsans_regular.ttf similarity index 100% rename from app/src/main/res/font/productsans_regular.ttf rename to app/src/main/res/font-v26/productsans_regular.ttf diff --git a/app/src/main/res/layout/app_bottomappbar_about.xml b/app/src/main/res/layout/app_bottomappbar_about.xml index 2497ef5..0221373 100755 --- a/app/src/main/res/layout/app_bottomappbar_about.xml +++ b/app/src/main/res/layout/app_bottomappbar_about.xml @@ -26,6 +26,6 @@ android:layout_height="wrap_content" app:layout_anchor="@id/bar_in_about" app:layout_insetEdge="none" - app:srcCompat="@drawable/ic_home_black" /> + app:srcCompat="@drawable/ic_home" /> \ No newline at end of file diff --git a/app/src/main/res/layout/app_bottomappbar_analyze_methods.xml b/app/src/main/res/layout/app_bottomappbar_analyze_methods.xml index e652891..cd611f4 100644 --- a/app/src/main/res/layout/app_bottomappbar_analyze_methods.xml +++ b/app/src/main/res/layout/app_bottomappbar_analyze_methods.xml @@ -26,6 +26,6 @@ android:layout_height="wrap_content" app:layout_insetEdge="right" app:layout_anchor="@id/bar_in_analyze_methods" - app:srcCompat="@drawable/ic_home_black"/> + app:srcCompat="@drawable/ic_home"/> \ No newline at end of file diff --git a/app/src/main/res/layout/app_scrollable_activity.xml b/app/src/main/res/layout/app_scrollable_activity.xml index 0640a57..4ea523f 100644 --- a/app/src/main/res/layout/app_scrollable_activity.xml +++ b/app/src/main/res/layout/app_scrollable_activity.xml @@ -12,8 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:fitsSystemWindows="true" - android:background="@drawable/app_collapsing_toolbar" - android:theme="@style/AppTheme.AppBarOverlay"> + android:background="@drawable/app_collapsing_toolbar"> - diff --git a/app/src/main/res/menu/app_menu.xml b/app/src/main/res/menu/app_menu.xml index 1bc5621..9ffd69d 100755 --- a/app/src/main/res/menu/app_menu.xml +++ b/app/src/main/res/menu/app_menu.xml @@ -4,7 +4,7 @@ android:layout_gravity="start"> diff --git a/app/src/main/res/menu/app_scrollableactivity_menu.xml b/app/src/main/res/menu/app_scrollableactivity_menu.xml index 0e232bf..0ffc948 100644 --- a/app/src/main/res/menu/app_scrollableactivity_menu.xml +++ b/app/src/main/res/menu/app_scrollableactivity_menu.xml @@ -17,10 +17,17 @@ app:showAsAction="ifRoom"> + + + - + \ No newline at end of file diff --git a/app/src/main/res/values-night-v23/styles.xml b/app/src/main/res/values-night-v23/styles.xml new file mode 100644 index 0000000..288a634 --- /dev/null +++ b/app/src/main/res/values-night-v23/styles.xml @@ -0,0 +1,43 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values-night-v31/styles.xml b/app/src/main/res/values-night-v31/styles.xml new file mode 100644 index 0000000..7c5225d --- /dev/null +++ b/app/src/main/res/values-night-v31/styles.xml @@ -0,0 +1,43 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml index 023088a..07b9994 100644 --- a/app/src/main/res/values-night/styles.xml +++ b/app/src/main/res/values-night/styles.xml @@ -17,14 +17,14 @@ false true @style/AppBarBottomSheetDialogStyle - @font/app_rulebook_productsans_fontfamily + @font/app_rulebook_productsans_fontfamily + @font/app_rulebook_productsans_fontfamily @font/app_rulebook_productsans_fontfamily @style/SnackBar @style/SnackBarButton @style/SnackBarTextViewStyle - @style/AppTheme.PopupOverlay + @style/AppTheme.PopupOverlay @color/app_custom_background - false @style/AppTheme.PopupOverlay @color/app_custom_background @style/AppImageButtonStyle @@ -34,14 +34,10 @@ @style/AppRadioButtonStyle @style/AppToolbarStyle @style/AppToolbarStyle - @style/AppWebViewStyleDarkTheme + @style/AppWebViewStyle @style/NavigationViewStyle @color/colorAccent - - - - diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml index 6646c15..0841908 100644 --- a/app/src/main/res/values-v21/styles.xml +++ b/app/src/main/res/values-v21/styles.xml @@ -1,9 +1,10 @@ - \ No newline at end of file diff --git a/app/src/main/res/values-v23/styles.xml b/app/src/main/res/values-v23/styles.xml index af16d04..fabd5fd 100644 --- a/app/src/main/res/values-v23/styles.xml +++ b/app/src/main/res/values-v23/styles.xml @@ -1,5 +1,46 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values-v31/styles.xml b/app/src/main/res/values-v31/styles.xml new file mode 100644 index 0000000..abf494e --- /dev/null +++ b/app/src/main/res/values-v31/styles.xml @@ -0,0 +1,44 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml new file mode 100644 index 0000000..0186d7a --- /dev/null +++ b/app/src/main/res/values/arrays.xml @@ -0,0 +1,14 @@ + + + + @string/app_darkTheme_mode_no + @string/app_darkTheme_mode_yes + @string/app_darkTheme_mode_followSystem + @string/app_darkTheme_mode_battery + + + + @string/app_share_image + @string/app_share_file + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b157898..0c93c51 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -13,7 +13,7 @@ Rulebook: Виды разборов Rulebook: Словари - + silvenation@gmail.com Оценка пользователя-- /5.0 звёзд @@ -34,7 +34,7 @@ Серийный номер: Версия Андроида: Разрешение экрана: - + пусто @@ -63,11 +63,19 @@ Строка состояния Не скрывать строку состояния + + Использовать карту памяти + Сохранять файлы на карте памяти + + Стереть данные приложения + Удалить все сохранённые файлы После введённых изменений для корректного отображения интерфейса может потребоваться перезапуск приложения. Напишите что-нибудь + Не удалось найти + Правила Настройки О приложении @@ -116,9 +124,10 @@ Не удалось переименовать файл Не удалось удалить файл Если вы не дадите приложению доступ к внутренней памяти устройства, то, к сожалению, будет невозможным что-либо сохранять. ¯\_(ツ)_/¯ - + Поделиться + Поделиться картинкой + Поделиться файлом Ярлык недоступен по неизвестной причине - МЕНЮ Основные @@ -346,4 +355,4 @@ Словарь фразеологизмов Орфоэпический словник - + \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 7f449ed..a3f74e4 100755 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -17,15 +17,15 @@ true @style/ThemeListView @style/AppBarBottomSheetDialogStyle - @font/app_rulebook_productsans_fontfamily + @font/app_rulebook_productsans_fontfamily + @font/app_rulebook_productsans_fontfamily @font/app_rulebook_productsans_fontfamily @style/SnackBar @style/SnackBarButton @style/SnackBarTextViewStyle - @style/AppTheme.PopupOverlay + @style/AppTheme.PopupOverlay @color/app_custom_background @style/AppTheme.PopupOverlay - true @color/app_custom_background @style/AppImageButtonStyle @style/AppAlertDialogThemeLight @@ -34,9 +34,10 @@ @style/AppRadioButtonStyle @style/AppToolbarStyle @style/AppToolbarStyle - @style/AppWebViewStyleLightTheme + @style/AppWebViewStyle @style/NavigationViewStyle @color/colorAccent + @style/AppThemeRulebook.ActionButton.OverFlow - @@ -60,6 +61,11 @@ @style/ActionTitleTextStyle @style/ActionSummaryTextStyle + + @@ -216,28 +223,28 @@ - - - - diff --git a/app/src/main/res/xml-v31/data_extraction_rules.xml b/app/src/main/res/xml-v31/data_extraction_rules.xml new file mode 100644 index 0000000..7da4b02 --- /dev/null +++ b/app/src/main/res/xml-v31/data_extraction_rules.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/file_paths.xml b/app/src/main/res/xml/file_paths.xml new file mode 100644 index 0000000..5f515f3 --- /dev/null +++ b/app/src/main/res/xml/file_paths.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index aa26773..539ce9d 100755 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -1,34 +1,44 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/build.gradle b/build.gradle index d17cfdf..86100f7 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.2.0' + classpath 'com.android.tools.build:gradle:7.2.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21" // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d7faaee..944e2c7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Apr 11 14:01:13 GMT+07:00 2022 +#Sat Aug 13 15:18:09 GMT+07:00 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME