From 1ee2f34c122614bc758fa046a02c2d1f5553f8a8 Mon Sep 17 00:00:00 2001 From: Smooth E <71522503+Smooth-E@users.noreply.github.com> Date: Fri, 9 Jun 2023 22:39:41 +0500 Subject: [PATCH] feat: various design improvements (#1023) * refactor: A bunch of (mostly XML) styling * fix(Main Activity): Make use of a dedicated Splash Activity to enable Dynamic coloring in MainActivity * feat(edge-to-edge): Ground work to support edge-to-edge experiences throughout the IDE * fix(edge-to-edge): Manually set bottom padding for fragment containment * feat(edge-to-edge): Allow full activity rebuild on configuration changes for MainActivity. This allows to ship more specific layout changes and is a ground work to support split screen mode. * Bug introduced: templates are not shown in the TemplateListFragment after full activity rebuild * fix: Finish the Splash Activity after launching the Main one * fix(templates): The list of templates no longer disappears after an activity rebuild or a configuration change * fix(templates): Keep OnGlobalLayoutListener attached while the View is alive. This ensures that the last item in template list is always aligned to the start. * feat(design): Custom layout for MainActivity's main fragment in landscape mode * feat(edge-to-edge): Implement edge-to-edge for PreferencesActivity, move InsetUtils outside of the LimitlessIDEActivity. * refactor(IDEPreferencesFragment.kt): Comply with the line-length rule, fix a one-line if statement to follow the general codestyle * refactor(edge-to-edge): Remove PaddingUtils.kt The reasoning behind this is that after `view.setPadding(left, top, right, bottom)` is executed, `view.getPaddingBottom()` (or for any other side) still returns the old value of padding before the view is measured again. Therefore the implementation of PaddingUtils.kt produces an unwanted and unexpected behaviour. * feat(edge-to-edge): Create a BottomInsetHeightDistributor view * fix(templates/design): Use OutlinedButton style for the *Exit* button inside the *New project* wizard's footer * refactor: Comply with AndroidIDE's code style * refactor: Make use of helper methods. Optimize XML * fix(edge-to-edge): Wrong system bar coloring in Dark Mode --- .idea/codeStyles/codeStyleConfig.xml | 2 +- .idea/misc.xml | 1 + app/src/main/AndroidManifest.xml | 11 ++- .../androidide/activities/AboutActivity.java | 4 +- .../androidide/activities/MainActivity.kt | 56 +++++++---- .../activities/PreferencesActivity.java | 50 +++++++--- .../androidide/activities/SplashActivity.kt | 32 ++++++ .../activities/editor/BaseEditorActivity.kt | 6 ++ .../adapters/TemplateListAdapter.kt | 24 ++--- .../com/itsaky/androidide/app/IDEActivity.kt | 7 +- .../itsaky/androidide/app/IDEApplication.kt | 3 +- .../androidide/app/LimitlessIDEActivity.kt | 98 +++++++++++++++++++ .../fragments/IDEPreferencesFragment.kt | 15 ++- .../fragments/TemplateListFragment.kt | 35 ++++--- .../androidide/viewmodel/MainViewModel.kt | 6 +- .../main/res/layout-land/fragment_main.xml | 90 +++++++++++++++++ .../res/layout/activity_crash_handler.xml | 20 ++-- app/src/main/res/layout/activity_editor.xml | 3 +- app/src/main/res/layout/activity_main.xml | 75 ++++++-------- .../main/res/layout/activity_preferences.xml | 31 ++++-- app/src/main/res/layout/activity_terminal.xml | 25 ++--- app/src/main/res/layout/fragment_log.xml | 14 ++- app/src/main/res/layout/fragment_main.xml | 5 +- .../layout/fragment_non_editable_editor.xml | 13 ++- .../res/layout/fragment_template_details.xml | 9 +- .../res/layout/fragment_template_list.xml | 11 ++- .../res/layout/fragment_template_wizard.xml | 9 +- app/src/main/res/layout/fragment_wizard.xml | 5 +- .../main/res/layout/layout_about_items.xml | 4 +- app/src/main/res/layout/layout_banner.xml | 3 +- .../main/res/layout/layout_bottom_action.xml | 9 +- .../main/res/layout/layout_crash_report.xml | 8 +- .../res/layout/layout_create_file_java.xml | 4 +- .../res/layout/layout_diagnostic_group.xml | 4 +- .../res/layout/layout_diagnostic_info.xml | 3 +- .../res/layout/layout_diagnostic_item.xml | 4 +- .../res/layout/layout_editor_bottom_sheet.xml | 11 ++- .../res/layout/layout_editor_file_tree.xml | 4 +- .../main/res/layout/layout_filetree_item.xml | 4 +- .../main/res/layout/layout_loading_wizard.xml | 44 +++++---- .../res/layout/layout_main_action_item.xml | 9 +- .../res/layout/layout_optionssheet_item.xml | 4 +- .../main/res/layout/layout_progress_sheet.xml | 4 +- .../layout/layout_project_not_initialized.xml | 9 +- app/src/main/res/layout/layout_run_task.xml | 9 +- .../res/layout/layout_run_task_dialog.xml | 9 +- .../main/res/layout/layout_run_task_item.xml | 9 +- .../layout/layout_run_tasks_confirmation.xml | 9 +- .../main/res/layout/layout_search_project.xml | 3 +- .../res/layout/layout_search_result_group.xml | 4 +- .../res/layout/layout_search_result_item.xml | 3 +- .../res/layout/layout_simple_icon_text.xml | 10 +- .../main/res/layout/layout_symbol_item.xml | 3 +- .../res/layout/layout_template_list_item.xml | 5 +- .../layout_template_widgetlist_item.xml | 9 +- .../res/layout/layout_text_size_slider.xml | 4 +- app/src/main/res/layout/setup_footer.xml | 6 +- app/src/main/res/layout/wizard_details.xml | 5 +- app/src/main/res/layout/wizard_templates.xml | 5 +- .../ui/BottomInsetHeightDistributor.kt | 63 ++++++++++++ .../com/itsaky/androidide/utils/InsetUtils.kt | 64 ++++++++++++ .../src/main/res/values-night/styles.xml | 8 +- resources/src/main/res/values/arrays.xml | 7 +- resources/src/main/res/values/attrs.xml | 6 +- resources/src/main/res/values/colors.xml | 3 +- .../res/values/ic_launcher_background.xml | 2 +- resources/src/main/res/values/styles.xml | 18 +++- 67 files changed, 786 insertions(+), 266 deletions(-) create mode 100644 app/src/main/java/com/itsaky/androidide/activities/SplashActivity.kt create mode 100644 app/src/main/java/com/itsaky/androidide/app/LimitlessIDEActivity.kt create mode 100644 app/src/main/res/layout-land/fragment_main.xml create mode 100644 common/src/main/java/com/itsaky/androidide/ui/BottomInsetHeightDistributor.kt create mode 100644 common/src/main/java/com/itsaky/androidide/utils/InsetUtils.kt diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml index 7f6a23f53..307554b77 100644 --- a/.idea/codeStyles/codeStyleConfig.xml +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -1,5 +1,5 @@ - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index fbf2e1c26..89dfeefc7 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,3 +1,4 @@ +