Add settings ex-/import and Intent selector improvements#28
Conversation
improve Intent selector (multi-select, search) bump Gradle
There was a problem hiding this comment.
Pull request overview
This PR adds configuration export/import functionality and enhances the Intent selector with search and multi-select capabilities to improve user experience when managing app selections.
- Added JSON-based backup and restore functionality for app/folder configurations
- Implemented search filtering and multi-select mode in the Intent selector
- Upgraded Gradle and Android build tools to newer versions
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| gradle/wrapper/gradle-wrapper.properties | Updated Gradle wrapper to version 8.13 |
| build.gradle | Updated Android Gradle Plugin version |
| app/build.gradle | Added Gson library dependency for JSON serialization |
| app/src/main/res/values/styles.xml | Added NoActionBar theme variant for Intent selector |
| app/src/main/res/values/strings.xml | Added strings for backup/restore UI and multi-select count display |
| app/src/main/res/menu/menu_intent_selector.xml | New menu with search action for filtering apps |
| app/src/main/res/layout/toolbar_appcompat.xml | New AppCompat toolbar layout for Intent selector |
| app/src/main/res/layout/common__intentselectorview.xml | Added FAB for confirming multi-selection, switched to AppCompat toolbar |
| app/src/main/res/layout/common__intentselectoritem.xml | Redesigned item layout with checkbox support for multi-select |
| app/src/main/res/layout/common__intentselectorgroup.xml | Adjusted group header alignment |
| app/src/main/res/drawable/ic_check.xml | New check icon drawable for FAB |
| app/src/main/java/de/devmil/paperlaunch/view/utils/IntentSelector.kt | Migrated to AppCompatActivity, added search filtering, multi-select functionality, and optimized app loading |
| app/src/main/java/de/devmil/paperlaunch/view/fragments/SettingsFragment.kt | Added backup/restore preferences with file picker integration |
| app/src/main/java/de/devmil/paperlaunch/view/fragments/EditFolderFragment.kt | Added support for multi-app selection, reload data on resume |
| app/src/main/java/de/devmil/paperlaunch/storage/DataImporter.kt | New class for importing JSON configuration data |
| app/src/main/java/de/devmil/paperlaunch/storage/DataExporter.kt | New class for exporting configuration to JSON |
| app/src/main/java/de/devmil/paperlaunch/service/LauncherOverlayService.kt | Updated force reload logic to reset config and data before reactivation |
| app/src/main/AndroidManifest.xml | Applied NoActionBar theme to IntentSelector activity |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Keep tabs but maybe hide shortcuts for multiselect if not supported? | ||
| // Assuming shortcuts are not supported in multi-select for now or handled same way? | ||
| // Existing logic launches helper activity for shortcuts. This breaks multi-select flow unless handled. | ||
| // For now, let's just make Multi-Select work for Apps which is the performance killer. |
There was a problem hiding this comment.
These TODO-style comments should either be addressed or removed before merging. They indicate unfinished work regarding shortcut support in multi-select mode and suggest that the implementation is incomplete.
| // Keep tabs but maybe hide shortcuts for multiselect if not supported? | |
| // Assuming shortcuts are not supported in multi-select for now or handled same way? | |
| // Existing logic launches helper activity for shortcuts. This breaks multi-select flow unless handled. | |
| // For now, let's just make Multi-Select work for Apps which is the performance killer. | |
| // In multi-select mode, selection is applied to applications/activities only; | |
| // shortcuts continue to be created and handled individually via the shortcut flow. |
|
|
||
| internal var adapterActivities: IntentSelectorAdapter? = null | ||
| internal var adapterShortcuts: IntentSelectorAdapter? = null | ||
| private var fabDone: android.support.design.widget.FloatingActionButton? = null |
There was a problem hiding this comment.
This code uses the deprecated android.support.design library instead of AndroidX. Modern Android projects should migrate to com.google.android.material.floatingactionbutton.FloatingActionButton for better compatibility and ongoing support.
| android:title="@android:string/search_go" | ||
| android:icon="@android:drawable/ic_menu_search" | ||
| app:showAsAction="ifRoom|collapseActionView" | ||
| app:actionViewClass="android.support.v7.widget.SearchView" /> |
There was a problem hiding this comment.
This code uses the deprecated android.support.v7.widget.SearchView instead of AndroidX. Modern Android projects should migrate to androidx.appcompat.widget.SearchView for better compatibility and ongoing support.
| app:actionViewClass="android.support.v7.widget.SearchView" /> | |
| app:actionViewClass="androidx.appcompat.widget.SearchView" /> |
| </LinearLayout> | ||
| </TabHost> | ||
|
|
||
| <android.support.design.widget.FloatingActionButton |
There was a problem hiding this comment.
This code uses the deprecated android.support.design library instead of AndroidX. Modern Android projects should migrate to com.google.android.material.floatingactionbutton.FloatingActionButton for better compatibility and ongoing support.
| <android.support.design.widget.FloatingActionButton | |
| <com.google.android.material.floatingactionbutton.FloatingActionButton |
| <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:layout_width="match_parent" android:layout_height="wrap_content" | ||
| android:background="@color/theme_primary" | ||
| android:elevation="4dp"> | ||
|
|
||
| </android.support.v7.widget.Toolbar> |
There was a problem hiding this comment.
This code uses the deprecated android.support.v7 library instead of AndroidX. Modern Android projects should migrate to androidx.appcompat.widget.Toolbar for better compatibility and ongoing support.
| <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:layout_width="match_parent" android:layout_height="wrap_content" | |
| android:background="@color/theme_primary" | |
| android:elevation="4dp"> | |
| </android.support.v7.widget.Toolbar> | |
| <androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:layout_width="match_parent" android:layout_height="wrap_content" | |
| android:background="@color/theme_primary" | |
| android:elevation="4dp"> | |
| </androidx.appcompat.widget.Toolbar> |
| fun filter(query: String?) { | ||
| entries.clear() | ||
| if (query.isNullOrEmpty()) { | ||
| entries.addAll(originalEntries) | ||
| } else { | ||
| val q = query.lowercase(Locale.getDefault()) | ||
| for (entry in originalEntries) { | ||
| var matches = false | ||
| if (entry.name.toString().lowercase(Locale.getDefault()).contains(q)) { | ||
| matches = true | ||
| } else { | ||
| val subList = getSubList(entry) | ||
| if (subList.any { it.displayName.lowercase(Locale.getDefault()).contains(q) }) { | ||
| matches = true | ||
| } | ||
| } | ||
|
|
||
| if (matches) { | ||
| entries.add(entry) | ||
| } | ||
| } |
There was a problem hiding this comment.
The filter method calls lowercase() multiple times per search query, which can be inefficient for large lists. Consider caching the lowercase versions of entry names and display names during initialization, or use a more efficient search algorithm to improve performance when filtering hundreds of apps.
| txt.text = item.displayName | ||
| txtActivityName.text = item.activityName | ||
|
|
||
| if ((context as IntentSelector).allowMultiSelect && intentType == IntentApplicationEntry.IntentType.Main) { |
There was a problem hiding this comment.
The checkbox visibility logic only shows checkboxes for IntentType.Main, but launcher activities use IntentType.Launcher. This means the multi-select checkboxes won't appear for launcher activities (the most common app type). The condition should check for both IntentType.Main and IntentType.Launcher to ensure users can multi-select regular apps.
| if ((context as IntentSelector).allowMultiSelect && intentType == IntentApplicationEntry.IntentType.Main) { | |
| if ((context as IntentSelector).allowMultiSelect && | |
| (intentType == IntentApplicationEntry.IntentType.Main || | |
| intentType == IntentApplicationEntry.IntentType.Launcher)) { |
app/src/main/java/de/devmil/paperlaunch/storage/DataImporter.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This PR adds ex- and import for the selected app / folder structure.
Additionally it improves the Intent selection by adding a search functionality and introducing multi-select
Fixes #27 when merged