diff options
author | Joey Rizzoli <joey@lineageos.org> | 2017-11-12 12:40:39 +0100 |
---|---|---|
committer | Arne Coucheron <arco68@gmail.com> | 2018-01-19 00:27:13 +0100 |
commit | c6b85822544de5194cff97d7fe07236f5c7a5b32 (patch) | |
tree | 41e82255f6b126ee57a5f8c272e4aa6ac6d7740a /res | |
parent | 6a4b5ff6292360a34f6a6b33cb51f83d5ce82661 (diff) | |
download | android_packages_apps_Trebuchet-c6b85822544de5194cff97d7fe07236f5c7a5b32.tar.gz android_packages_apps_Trebuchet-c6b85822544de5194cff97d7fe07236f5c7a5b32.tar.bz2 android_packages_apps_Trebuchet-c6b85822544de5194cff97d7fe07236f5c7a5b32.zip |
Trebuchet: icon packs support
Based on the following commits:
* https://github.com/AOSPA/android_packages_apps_Launcher3/commit/cf4bde2098de8beec24a0c88bf2e51e19a9c22b6
* https://github.com/AOSPA/android_packages_apps_Launcher3/commit/8ddafe17ad6adc268ad1a93b7724d8b22028a71b
* https://github.com/AOSPA/android_packages_apps_Launcher3/commit/0940176c3c01a1f87237811f42d05a592b0968b3
With the following additions:
* Support for adaptive icons
* UI changes
* Cleanup and improvements
Change-Id: I877a8b2dd204753179736fa7c1c34444e9b2c849
Signed-off-by: Joey Rizzoli <joey@lineageos.org>
Diffstat (limited to 'res')
-rw-r--r-- | res/drawable/ic_edit_app_no_shadow.xml | 10 | ||||
-rw-r--r-- | res/drawable/ic_icon_change.xml | 30 | ||||
-rw-r--r-- | res/drawable/ic_search.xml | 9 | ||||
-rw-r--r-- | res/layout/all_icons_view.xml | 63 | ||||
-rw-r--r-- | res/layout/all_icons_view_header.xml | 25 | ||||
-rw-r--r-- | res/layout/target_edit_dialog.xml | 48 | ||||
-rw-r--r-- | res/layout/target_edit_dialog_item.xml | 28 | ||||
-rw-r--r-- | res/layout/target_edit_iconpack_chooser.xml | 52 | ||||
-rw-r--r-- | res/menu/icon_picker.xml | 24 | ||||
-rw-r--r-- | res/values-v26/lineageos_colors.xml | 20 | ||||
-rw-r--r-- | res/values/config.xml | 2 | ||||
-rw-r--r-- | res/values/lineage_colors.xml | 26 | ||||
-rw-r--r-- | res/values/lineage_dimens.xml | 23 | ||||
-rw-r--r-- | res/values/lineage_strings.xml | 13 | ||||
-rw-r--r-- | res/values/lineage_styles.xml | 24 | ||||
-rw-r--r-- | res/xml/launcher_preferences.xml | 4 |
16 files changed, 400 insertions, 1 deletions
diff --git a/res/drawable/ic_edit_app_no_shadow.xml b/res/drawable/ic_edit_app_no_shadow.xml new file mode 100644 index 000000000..d713ffdab --- /dev/null +++ b/res/drawable/ic_edit_app_no_shadow.xml @@ -0,0 +1,10 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportHeight="24" + android:viewportWidth="24" + android:tint="?android:attr/textColorPrimary" > + <path + android:fillColor="#FFFFFF" + android:pathData="M7,14c-1.66,0 -3,1.34 -3,3 0,1.31 -1.16,2 -2,2 0.92,1.22 2.49,2 4,2 2.21,0 4,-1.79 4,-4 0,-1.66 -1.34,-3 -3,-3zM20.71,4.63l-1.34,-1.34c-0.39,-0.39 -1.02,-0.39 -1.41,0L9,12.25 11.75,15l8.96,-8.96c0.39,-0.39 0.39,-1.02 0,-1.41z" /> +</vector> diff --git a/res/drawable/ic_icon_change.xml b/res/drawable/ic_icon_change.xml new file mode 100644 index 000000000..6495da6df --- /dev/null +++ b/res/drawable/ic_icon_change.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> + <item + android:start="31dp" + android:top="31dp"> + <shape android:shape="oval"> + <solid android:color="?android:colorAccent" /> + </shape> + </item> + <item + android:start="31dp" + android:top="31dp"> + <vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="16dp" + android:height="16dp" + android:viewportHeight="24" + android:viewportWidth="24"> + + <group + android:scaleX="0.75" + android:scaleY="0.75" + android:translateX="3" + android:translateY="3"> + <path + android:fillColor="#aa000000" + android:pathData="M20.71,4.63L19.37,3.29C19,2.9 18.35,2.9 17.96,3.29L9,12.25L11.75,15L20.71,6.04C21.1,5.65 21.1,5 20.71,4.63M7,14A3,3 0 0,0 4,17C4,18.31 2.84,19 2,19C2.92,20.22 4.5,21 6,21A4,4 0 0,0 10,17A3,3 0 0,0 7,14Z" /> + </group> + </vector> + </item> +</layer-list> diff --git a/res/drawable/ic_search.xml b/res/drawable/ic_search.xml new file mode 100644 index 000000000..affc7ba26 --- /dev/null +++ b/res/drawable/ic_search.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="#FF000000" + android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/> +</vector> diff --git a/res/layout/all_icons_view.xml b/res/layout/all_icons_view.xml new file mode 100644 index 000000000..f6707bc95 --- /dev/null +++ b/res/layout/all_icons_view.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2017 The LineageOS Project + Copyright (C) 2017 Paranoid Android + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <LinearLayout + android:id="@+id/icons_grid_name_header" + android:layout_width="match_parent" + android:layout_height="48dp" + android:background="@color/icon_picker_header_background" + android:elevation="6dp" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingEnd="16dp" + android:paddingStart="16dp"> + + <ImageView + android:id="@+id/icons_grid_name_header_icon" + android:layout_width="32dp" + android:layout_height="32dp" + android:layout_marginEnd="16dp" /> + + <TextView + android:id="@+id/icons_grid_name_header_title" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center_vertical" + android:maxLines="1" + android:textAppearance="@android:style/TextAppearance.Material.Title" + android:textColor="@color/icon_picker_header_foreground" /> + </LinearLayout> + + <ProgressBar + android:id="@+id/icons_grid_progress" + style="?android:attr/progressBarStyle" + android:layout_width="100dp" + android:layout_height="100dp" + android:layout_centerInParent="true" /> + + <android.support.v7.widget.RecyclerView + android:id="@+id/icons_grid" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@id/icons_grid_name_header" + android:layout_centerHorizontal="true" /> +</RelativeLayout> diff --git a/res/layout/all_icons_view_header.xml b/res/layout/all_icons_view_header.xml new file mode 100644 index 000000000..ba15ff2dd --- /dev/null +++ b/res/layout/all_icons_view_header.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2017 The LineageOS Projecy + Copyright (C) 2017 Paranoid Android + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<TextView xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="48dp" + android:paddingStart="24dp" + android:paddingBottom="8dp" + android:paddingTop="16dp" + android:textAppearance="@android:style/TextAppearance.Material.Body2" /> diff --git a/res/layout/target_edit_dialog.xml b/res/layout/target_edit_dialog.xml new file mode 100644 index 000000000..da66a9c2c --- /dev/null +++ b/res/layout/target_edit_dialog.xml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2017 The LineageOS Project + Copyright (C) 2017 Paranoid Android + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="16dp"> + + <ImageView + android:id="@+id/edit_dialog_icon" + android:layout_width="@dimen/app_icon_size" + android:layout_height="@dimen/app_icon_size" + android:layout_gravity="bottom" + android:layout_marginEnd="16dp" + android:background="?android:selectableItemBackground" + android:foreground="@drawable/ic_icon_change" + android:scaleType="fitCenter" + tools:src="@mipmap/ic_launcher_home" /> + + <EditText + android:id="@+id/edit_dialog_title" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical|start" + android:ellipsize="end" + android:labelFor="@id/edit_dialog_icon" + android:maxLines="1" + android:textAlignment="viewStart" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textColor="?android:textColorPrimary" + android:textColorHint="?android:textColorSecondary" + tools:text="Trebuchet" /> +</LinearLayout> diff --git a/res/layout/target_edit_dialog_item.xml b/res/layout/target_edit_dialog_item.xml new file mode 100644 index 000000000..70492b565 --- /dev/null +++ b/res/layout/target_edit_dialog_item.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2017 The LineageOS Project + Copyright (C) 2017 Paranoid Android + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<TextView xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:ellipsize="end" + android:gravity="center_vertical" + android:maxLines="1" + android:minHeight="?android:attr/listPreferredItemHeightSmall" + android:textColor="?android:attr/textColorAlertDialogListItem" + android:textSize="14sp" /> diff --git a/res/layout/target_edit_iconpack_chooser.xml b/res/layout/target_edit_iconpack_chooser.xml new file mode 100644 index 000000000..a7c9fad3d --- /dev/null +++ b/res/layout/target_edit_iconpack_chooser.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2017 The LineageOS Project + Copyright (C) 2017 Paranoid Android + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingBottom="8dp" + android:paddingEnd="16dp" + android:paddingStart="16dp" + android:paddingTop="8dp"> + + <ImageView + android:id="@+id/icon" + android:layout_width="@android:dimen/app_icon_size" + android:layout_height="@android:dimen/app_icon_size" /> + + <TextView + android:id="@+id/title" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:paddingEnd="8dp" + android:paddingStart="8dp" + android:textAppearance="?android:attr/textAppearanceListItemSmall" + android:textColor="?android:attr/textColorAlertDialogListItem" + android:textSize="18sp" /> + + <RadioButton + android:id="@+id/radio" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:clickable="false" + android:duplicateParentState="true" + android:focusable="false" /> +</LinearLayout> diff --git a/res/menu/icon_picker.xml b/res/menu/icon_picker.xml new file mode 100644 index 000000000..93d8506f2 --- /dev/null +++ b/res/menu/icon_picker.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2017 The LineageOS Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item + android:id="@+id/icon_picker_search" + android:showAsAction="ifRoom" + android:title="@string/icon_pack_picker_search" + android:icon="@drawable/ic_search" + android:actionViewClass="android.widget.SearchView" /> +</menu>
\ No newline at end of file diff --git a/res/values-v26/lineageos_colors.xml b/res/values-v26/lineageos_colors.xml new file mode 100644 index 000000000..6eafd11e6 --- /dev/null +++ b/res/values-v26/lineageos_colors.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2017 The LineageOS Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<resources> + <color name="icon_picker_header_background">#eeeeee</color> + <color name="icon_picker_header_foreground">@color/badge_color</color> +</resources>
\ No newline at end of file diff --git a/res/values/config.xml b/res/values/config.xml index d84ad3b15..f87d7a839 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -105,7 +105,7 @@ <string name="app_filter_class" translatable="false"></string> <!-- Name of an icon provider class. --> - <string name="icon_provider_class" translatable="false"></string> + <string name="icon_provider_class" translatable="false">com.android.launcher3.icons.CustomIconsProvider</string> <!-- Name of a drawable factory class. --> <string name="drawable_factory_class" translatable="false"></string> diff --git a/res/values/lineage_colors.xml b/res/values/lineage_colors.xml new file mode 100644 index 000000000..27cc41a82 --- /dev/null +++ b/res/values/lineage_colors.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2017 The LineageOS Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<resources> + <color name="icon_settings_background">#333333</color> + <color name="icon_settings_text">#f5f5f5</color> + + <color name="icon_picker_header_background">#37474f</color> + <color name="icon_picker_header_foreground">#ffffff</color> + + <color name="dialog_background_light">#ffffff</color> + <color name="dialog_background_dark">#424242</color> +</resources>
\ No newline at end of file diff --git a/res/values/lineage_dimens.xml b/res/values/lineage_dimens.xml new file mode 100644 index 000000000..89d39c6e6 --- /dev/null +++ b/res/values/lineage_dimens.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2017 The LineageOS Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<resources> + <dimen name="app_icon_size">62dp</dimen> + <dimen name="icon_pack_icon_size">48dp</dimen> + <dimen name="icon_pack_vertical_margin">8dp</dimen> + <dimen name="edit_dialog_min_width">200dp</dimen> + <dimen name="grid_item_spacing">16dp</dimen> +</resources>
\ No newline at end of file diff --git a/res/values/lineage_strings.xml b/res/values/lineage_strings.xml index af71c9f64..8f8ac099c 100644 --- a/res/values/lineage_strings.xml +++ b/res/values/lineage_strings.xml @@ -40,4 +40,17 @@ <!-- Hide labels --> <string name="desktop_show_labels">Show icon labels on desktop</string> <string name="drawer_show_labels">Show icon labels in drawer</string> + + <!-- Custom icons --> + <string name="app_edit_drop_target_label">Edit</string> + <string name="icon_pack_title">Icon pack</string> + <string name="icon_pack_picker">Select icon</string> + <string name="icon_pack_picker_search">Search icon</string> + <string name="icon_pack_suggestions">Suggestions</string> + <string name="icon_pack_all_icons">All icons</string> + <string name="icon_pack_reset">Reset</string> + <string name="icon_pack_system">System (Default)</string> + + <!-- Default icon pack package name. Override to set a default icon pack, use "Default" to use system icons --> + <string name="icon_pack_default" translatable="false">Default</string> </resources> diff --git a/res/values/lineage_styles.xml b/res/values/lineage_styles.xml new file mode 100644 index 000000000..330f235ff --- /dev/null +++ b/res/values/lineage_styles.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2017 The LineageOS Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<resources> + <style name="ChooseIconTheme" parent="android:style/Theme.DeviceDefault.Settings"> + <item name="android:colorBackground">@color/icon_settings_background</item> + </style> + + <style name="TextAppearance.Switch" parent="@android:style/TextAppearance.Material.Title" /> + +</resources>
\ No newline at end of file diff --git a/res/xml/launcher_preferences.xml b/res/xml/launcher_preferences.xml index f4663935d..22bd3e514 100644 --- a/res/xml/launcher_preferences.xml +++ b/res/xml/launcher_preferences.xml @@ -83,4 +83,8 @@ android:title="@string/drawer_show_labels" android:defaultValue="true" android:persistent="true" /> + + <Preference + android:key="pref_icon_pack" + android:title="@string/icon_pack_title" /> </PreferenceScreen> |