Implemented #14 and #15: favorite apps and hidden apps

This commit is contained in:
Josia Pietsch 2024-09-23 18:45:20 +02:00
parent e4b1bccf85
commit 662efd4ecb
Signed by: jrpie
GPG key ID: E70B571D66986A2D
19 changed files with 372 additions and 89 deletions

View file

@ -1,5 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#FFFFFF"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="?android:textColor"
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z" />
</vector>

View file

@ -1,5 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M22,9.24l-7.19,-0.62L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21 12,17.27 18.18,21l-1.63,-7.03L22,9.24zM12,15.4l-3.76,2.27 1,-4.28 -3.32,-2.88 4.38,-0.38L12,6.1l1.71,4.04 4.38,0.38 -3.32,2.88 1,4.28L12,15.4z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#FFFFFF"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="?android:textColor"
android:pathData="M22,9.24l-7.19,-0.62L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21 12,17.27 18.18,21l-1.63,-7.03L22,9.24zM12,15.4l-3.76,2.27 1,-4.28 -3.32,-2.88 4.38,-0.38L12,6.1l1.71,4.04 4.38,0.38 -3.32,2.88 1,4.28L12,15.4z" />
</vector>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/baseline_favorite_24" android:state_checked="true" />
<item android:drawable="@drawable/baseline_favorite_border_24" android:state_checked="false" />
</selector>

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/list_apps_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -17,21 +16,41 @@
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_weight="1"
android:fadeScrollbars="false"
android:fastScrollAlwaysVisible="true"
android:fastScrollEnabled="true"
android:scrollbars="vertical">
<!--android:scrollbars="vertical"-->
</androidx.recyclerview.widget.RecyclerView>
<androidx.appcompat.widget.SearchView
android:id="@+id/list_apps_searchview"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8sp"
android:layout_weight="0"
android:iconifiedByDefault="false"
app:iconifiedByDefault="false"
app:queryHint="@string/list_apps_search_hint"
app:searchHintIcon="@drawable/baseline_search_24"
app:searchIcon="@drawable/baseline_search_24" />
android:orientation="horizontal"
android:layout_margin="8dp"
>
<androidx.appcompat.widget.SearchView
android:id="@+id/list_apps_searchview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:iconifiedByDefault="false"
app:iconifiedByDefault="false"
app:queryHint="@string/list_apps_search_hint"
app:searchHintIcon="@drawable/baseline_search_24"
app:searchIcon="@drawable/baseline_search_24" />
<CheckBox
android:id="@+id/list_apps_check_box_favorites"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0"
android:layout_marginEnd="16dp"
android:button="@drawable/checkbox_favorite" />
</LinearLayout>
</LinearLayout>

View file

@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tutorial_finish_container"
android:paddingLeft="32sp"

View file

@ -1,7 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/app_menu_delete"
android:title="@string/list_app_delete" />
<item android:id="@+id/app_menu_info"
android:title="@string/list_app_info" />
<item android:id="@+id/app_menu_favorite"
android:title="@string/list_app_favorite_add" />
<item android:id="@+id/app_menu_hidden"
android:title="@string/list_app_hidden_add" />
<item android:id="@+id/app_menu_delete"
android:title="@string/list_app_delete" />
</menu>

View file

@ -9,7 +9,10 @@
<string name="settings_internal_started_key" translatable="false">internal.started_before</string>
<string name="settings_internal_started_time_key" translatable="false">internal.first_startup</string>
<string name="settings_internal_version_code_key" translatable="false">internal.version_code</string>
<string name="settings_general_choose_home_screen_key" translatable="false">general.select_launcher</string>
<string name="settings_apps_favorites_key" translatable="false">apps.favorites</string>
<string name="settings_apps_hidden_key" translatable="false">apps.hidden</string>
<string name="settings_general_choose_home_screen_key" translatable="false">general.select_launcher</string>
<!--
-
- Settings : Gestures

View file

@ -114,6 +114,9 @@
<string name="settings_launcher_sensitivity">Sensitivity</string>
<string name="settings_launcher_section_apps">Apps</string>
<string name="settings_apps_hidden">Hidden apps</string>
<!--
-
- Settings : Meta
@ -144,6 +147,8 @@
-
-->
<string name="list_title_view">All Apps</string>
<string name="list_title_favorite">Favorite Apps</string>
<string name="list_title_hidden">Hidden Apps</string>
<string name="list_title_pick">Choose App</string>
<string name="list_tab_app">Apps</string>
@ -151,6 +156,10 @@
<string name="list_app_delete">Uninstall</string>
<string name="list_app_info">App Info</string>
<string name="list_app_favorite_add">Add to favorites</string>
<string name="list_app_favorite_remove">Remove from favorites</string>
<string name="list_app_hidden_add">Hide</string>
<string name="list_app_hidden_remove">Show</string>
<string name="list_removed">Removed the selected application</string>
<string name="list_not_removed">Unable to remove application</string>
@ -159,6 +168,7 @@
<string name="list_other_settings">Launcher Settings</string>
<string name="list_other_list">All Applications</string>
<string name="list_other_list_favorites">Favorite Applications</string>
<string name="list_other_volume_up">Music: Louder</string>
<string name="list_other_volume_down">Music: Quieter</string>
<string name="list_other_track_next">Music: Next</string>
@ -195,4 +205,6 @@
<string name="settings">Settings</string>
<string name="ic_menu_alt">More options</string>
<string name="alert_cant_expand_notifications_panel">Error: Can\'t expand status bar.\nThis action is using functionality that is not part of the published Android API. Unfortunately, it does not seem to work on your device.</string>
<string name="snackbar_app_hidden">App hidden. You can make it visible again in settings.</string>
<string name="undo">Undo</string>
</resources>

View file

@ -97,6 +97,17 @@
android:title="@string/settings_enabled_gestures_edge_swipe"/>
</PreferenceCategory>
<PreferenceCategory
android:title="@string/settings_launcher_section_apps"
app:allowDividerAbove="false">
<Preference
android:key="@string/settings_apps_hidden_key"
android:title="@string/settings_apps_hidden"
/>
</PreferenceCategory>
<PreferenceCategory
android:title="@string/settings_launcher_section_display"