Skip to content

Add settings ex-/import and Intent selector improvements#28

Merged
devmil merged 5 commits intomasterfrom
feat/improve_intent_selector_and_settings_backup
Dec 29, 2025
Merged

Add settings ex-/import and Intent selector improvements#28
devmil merged 5 commits intomasterfrom
feat/improve_intent_selector_and_settings_backup

Conversation

@devmil
Copy link
Owner

@devmil devmil commented Dec 29, 2025

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

improve Intent selector (multi-select, search)
bump Gradle
Copilot AI review requested due to automatic review settings December 29, 2025 07:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +266 to +269
// 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.
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
// 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.

Copilot uses AI. Check for mistakes.

internal var adapterActivities: IntentSelectorAdapter? = null
internal var adapterShortcuts: IntentSelectorAdapter? = null
private var fabDone: android.support.design.widget.FloatingActionButton? = null
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
android:title="@android:string/search_go"
android:icon="@android:drawable/ic_menu_search"
app:showAsAction="ifRoom|collapseActionView"
app:actionViewClass="android.support.v7.widget.SearchView" />
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
app:actionViewClass="android.support.v7.widget.SearchView" />
app:actionViewClass="androidx.appcompat.widget.SearchView" />

Copilot uses AI. Check for mistakes.
</LinearLayout>
</TabHost>

<android.support.design.widget.FloatingActionButton
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +7
<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>
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<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>

Copilot uses AI. Check for mistakes.
Comment on lines 380 to 400
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)
}
}
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
txt.text = item.displayName
txtActivityName.text = item.activityName

if ((context as IntentSelector).allowMultiSelect && intentType == IntentApplicationEntry.IntentType.Main) {
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
if ((context as IntentSelector).allowMultiSelect && intentType == IntentApplicationEntry.IntentType.Main) {
if ((context as IntentSelector).allowMultiSelect &&
(intentType == IntentApplicationEntry.IntentType.Main ||
intentType == IntentApplicationEntry.IntentType.Launcher)) {

Copilot uses AI. Check for mistakes.
@devmil devmil merged commit 9c294c2 into master Dec 29, 2025
1 check passed
@devmil devmil deleted the feat/improve_intent_selector_and_settings_backup branch December 29, 2025 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UX Inconvenience] Settings Backup and multiple App selection

1 participant