Add back DSLV / ActionListViewSettings

Contains updates by Griffin Millender <griffinn.millender@gmail.com> and
the SlimROMs team

AICPfy:
- make it play better with themes
- bring it to Oreo
- Update SettingsActivity to forward extras from PreferenceScreen to the new fragment
  (allows using DSLV from xml)

Change-Id: I7514cdfa3603ed6e24deeb251875a716a52a02b1
This commit is contained in:
Lars Greiss
2017-10-14 12:40:52 +02:00
committed by Hung Phan
parent 7a81100ef2
commit 316b875415
15 changed files with 5385 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="36dp"
android:height="36dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="?android:attr/textColorSecondary"
android:pathData="M20 9H4v2h16V9zM4 15h16v-2H4v2z" />
</vector>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="?android:attr/textColorPrimary"
android:pathData="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
<path
android:pathData="M0 0h24v24H0z" />
</vector>

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 Slimroms
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.
-->
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingTop="8dip"
android:paddingBottom="8dip" >
<ImageView
android:id="@id/drag_handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/dslv_ic_grabber"
android:layout_marginEnd="8dip"
android:layout_gravity="center_vertical"
android:scaleType="centerInside"
android:contentDescription="@null" />
<LinearLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_gravity="fill_horizontal|center_vertical"
android:orientation="vertical"
android:paddingRight="5dp">
<TextView
android:id="@+id/click_action_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="fill_horizontal"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textAlignment="viewStart" />
<TextView
android:id="@+id/longpress_action_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="fill_horizontal"
android:layout_marginTop="2dip"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textAlignment="viewStart" />
</LinearLayout>
<ImageView
android:id="@+id/icon"
android:layout_width="36dip"
android:layout_height="36dip"
android:layout_marginEnd="8dip"
android:layout_gravity="center_vertical"
android:scaleType="centerInside"
android:contentDescription="@null" />
</GridLayout>

View File

@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 Slimroms
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:settings="http://schemas.android.com/apk/res/com.android.settings"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</LinearLayout>
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:visibility="gone"
android:background="?android:attr/listDivider"/>
<TextView
android:id="@+id/disable_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dip"
android:layout_gravity="center"
android:gravity="center_horizontal"
android:text="@string/shortcut_action_disable_message"
android:textAppearance="?android:attr/textAppearanceMedium"
android:visibility="gone" />
<com.blissroms.blissify.preferences.dslv.DragSortListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:paddingLeft="0dp"
android:layout_margin="0dp"
android:dividerHeight="1dp"
settings:dragEnabled="true"
settings:collapsedHeight="2dp"
settings:dragScrollStart="0.33"
settings:maxDragScrollSpeed="0.5"
settings:floatAlpha="0.6"
settings:slideShuffleSpeed="0.3"
settings:trackDragSort="false"
settings:useDefaultController="true"
settings:dragHandleId="@id/drag_handle"
settings:sortEnabled="true"
settings:removeEnabled="true"
settings:dragStartMode="onMove"
settings:removeMode="flingRemove"
settings:floatBackgroundColor="?android:attr/colorBackgroundFloating" />
</LinearLayout>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Slim lockscreen shortcuts -->
<string name="shortcut_action_none">Không</string>
<string name="shortcut_action_longpress">Nhấn giữ:</string>
<string name="shortcut_action_select_action_longpress">Chọn một hành động khi chạm giữ:</string>
<string name="shortcut_action_select_action">Chọn hành động:</string>
<string name="shortcut_action_select_action_newaction">Chọn hành động mới:</string>
<string name="shortcut_action_reset">Thiết lập lại</string>
<string name="shortcut_action_add">Thêm</string>
<string name="shortcut_action_max">Đã đạt tới kích thước tối đa mục</string>
<string name="shortcut_action_warning">Khuyến cáo</string>
<string name="shortcut_action_warning_message">Không thể xóa mục sau cùng</string>
<string name="shortcut_action_disable_message">Đã tắt\nThêm một mục để kích hoạt tính năng này</string>
<string name="shortcut_image_not_valid">Các ứng dụng đã chọn không trả về một biểu tượng hợp lệ hoặc không hỗ trợ hình ảnh cắt xén. Hãy sử dụng một ứng dụng.</string>
<string name="shortcut_duplicate_entry">Các hành động đã chọn không thể được thêm vào hai lần</string>
<string name="shortcut_action_help_shortcut">phím tắt</string>
<string name="shortcut_action_help_button">phím</string>
<string name="shortcut_action_help_app">ứng dụng</string>
<string name="shortcut_action_help_icon">, trong khi lựa chọn biểu tượng sẽ hiện tùy chọn</string>
<string name="shortcut_action_help_main">Để thêm một %1$s, hãy chọn biểu tượng Thêm. Một khi một %1$s được thêm, chọn hàng sẽ thay đổi đối tượng%2$s\n\nĐể gỡ bỏ một %1$s, vuốt theo chiều ngang sang trái hoặc phảii. Để gọi lại một %1$s trong danh sách bằng cách kéo theo chiều dọc neo bên trái.\n\nĐể xóa hoặc thiết lập lại về mặc định, chọn biểu tượng Thiết lập lại.</string>
<string name="shortcut_action_help_delete_last_entry">Loại bỏ mọi %1$s trong danh sách sẽ tắt tính năng hoàn toàn.</string>
<string name="shortcut_action_help_pie_second_layer_delete_last_entry">Loại bỏ mọi %1$s trong danh sách sẽ tắt tính năng hoàn toàn.</string>
<string name="shortcuts_applications">Ứng dụng</string>
<string name="shortcuts_select_custom_app_title">Chọn ứng dụng tùy chỉnh</string>
<string name="shortcuts_icon_picker_type">Chọn loại biểu tượng:</string>
<string name="shortcuts_icon_default">Mặc định</string>
<string name="shortcuts_icon_custom">Bộ sưu tập</string>
<string name="reset_message">Đặt lại tất cả các mục về mặc định?</string>
<string name="help">Trợ giúp</string>
<string name="shortcut_action_app">Tuỳ chỉnh ứng dụng</string>
<string name="shortcut_action_home">Trang chủ</string>
<string name="shortcut_action_back">Quay lại</string>
<string name="shortcut_action_menu">Menu</string>
<string name="shortcut_action_ime">Mở trình chuyển đổi bàn phím</string>
<string name="shortcut_action_power_menu">Trình đơn nguồn</string>
<string name="shortcut_action_recent">Gần đây</string>
<string name="shortcut_action_power">Tắt màn hình</string>
<string name="shortcut_action_search">Tìm kiếm trong ứng dụng</string>
</resources>

152
res/values/dslv_arrays.xml Normal file
View File

@@ -0,0 +1,152 @@
<resources>
<!-- Icon type for DSLV. -->
<string-array name="icon_types">
<item>@string/shortcuts_icon_default</item>
<!--
<item>@string/shortcuts_icon_presets</item>
-->
<item>@string/shortcuts_icon_custom</item>
</string-array>
<string-array name="shortcut_icon_picker_labels">
<!--
<item>@string/shortcuts_icon_picker_alarm</item>
<item>@string/shortcuts_icon_picker_andy</item>
<item>@string/shortcuts_icon_picker_battery</item>
<item>@string/shortcuts_icon_picker_browser</item>
<item>@string/shortcuts_icon_picker_calendar</item>
<item>@string/shortcuts_icon_picker_camera</item>
<item>@string/shortcuts_icon_picker_cloud</item>
<item>@string/shortcuts_icon_picker_contact</item>
<item>@string/shortcuts_icon_picker_directdial</item>
<item>@string/shortcuts_icon_picker_directmessage</item>
<item>@string/shortcuts_icon_picker_drive</item>
<item>@string/shortcuts_icon_picker_dropbox</item>
<item>@string/shortcuts_icon_picker_email</item>
<item>@string/shortcuts_icon_picker_email2</item>
<item>@string/shortcuts_icon_picker_evernote</item>
<item>@string/shortcuts_icon_picker_facebook</item>
<item>@string/shortcuts_icon_picker_favorite</item>
<item>@string/shortcuts_icon_picker_file_browser</item>
<item>@string/shortcuts_icon_picker_file_browser2</item>
<item>@string/shortcuts_icon_picker_fitness</item>
<item>@string/shortcuts_icon_picker_gallery</item>
<item>@string/shortcuts_icon_picker_gears</item>
<item>@string/shortcuts_icon_picker_google_small</item>
<item>@string/shortcuts_icon_picker_gplus</item>
<item>@string/shortcuts_icon_picker_gtalk</item>
<item>@string/shortcuts_icon_picker_help</item>
<item>@string/shortcuts_icon_picker_joystick</item>
<item>@string/shortcuts_icon_picker_key</item>
<item>@string/shortcuts_icon_picker_laptop</item>
<item>@string/shortcuts_icon_picker_luggage</item>
<item>@string/shortcuts_icon_picker_maps</item>
<item>@string/shortcuts_icon_picker_market</item>
<item>@string/shortcuts_icon_picker_movie</item>
<item>@string/shortcuts_icon_picker_music</item>
<item>@string/shortcuts_icon_picker_nav</item>
<item>@string/shortcuts_icon_picker_notes</item>
<item>@string/shortcuts_icon_picker_package</item>
<item>@string/shortcuts_icon_picker_phone</item>
<item>@string/shortcuts_icon_picker_pinterest</item>
<item>@string/shortcuts_icon_picker_play</item>
<item>@string/shortcuts_icon_picker_pocket</item>
<item>@string/shortcuts_icon_picker_quicksettings</item>
<item>@string/shortcuts_icon_picker_rss</item>
<item>@string/shortcuts_icon_picker_sdcard</item>
<item>@string/shortcuts_icon_picker_search</item>
<item>@string/shortcuts_icon_picker_sms</item>
<item>@string/shortcuts_icon_picker_tasks</item>
<item>@string/shortcuts_icon_picker_terminal</item>
<item>@string/shortcuts_icon_picker_transit</item>
<item>@string/shortcuts_icon_picker_tv</item>
<item>@string/shortcuts_icon_picker_twitter</item>
<item>@string/shortcuts_icon_picker_unlock</item>
-->
</string-array>
<string-array name="shortcut_icon_picker_icons" translatable="false">
<!--
<item>@*android:drawable/ic_shortcut_alarm</item>
<item>@*android:drawable/ic_shortcut_andy</item>
<item>@*android:drawable/ic_shortcut_battery</item>
<item>@*android:drawable/ic_shortcut_browser</item>
<item>@*android:drawable/ic_shortcut_calendar</item>
<item>@*android:drawable/ic_shortcut_camera</item>
<item>@*android:drawable/ic_shortcut_cloud</item>
<item>@*android:drawable/ic_shortcut_contact</item>
<item>@*android:drawable/ic_shortcut_directdial</item>
<item>@*android:drawable/ic_shortcut_directmessage</item>
<item>@*android:drawable/ic_shortcut_drive</item>
<item>@*android:drawable/ic_shortcut_dropbox</item>
<item>@*android:drawable/ic_shortcut_email</item>
<item>@*android:drawable/ic_shortcut_email2</item>
<item>@*android:drawable/ic_shortcut_evernote</item>
<item>@*android:drawable/ic_shortcut_facebook</item>
<item>@*android:drawable/ic_shortcut_favorite</item>
<item>@*android:drawable/ic_shortcut_file_browser</item>
<item>@*android:drawable/ic_shortcut_file_browser2</item>
<item>@*android:drawable/ic_shortcut_fitness</item>
<item>@*android:drawable/ic_shortcut_gallery</item>
<item>@*android:drawable/ic_shortcut_gear</item>
<item>@*android:drawable/ic_shortcut_google_small</item>
<item>@*android:drawable/ic_shortcut_gplus</item>
<item>@*android:drawable/ic_shortcut_gtalk</item>
<item>@*android:drawable/ic_shortcut_help</item>
<item>@*android:drawable/ic_shortcut_joystick</item>
<item>@*android:drawable/ic_shortcut_key</item>
<item>@*android:drawable/ic_shortcut_laptop</item>
<item>@*android:drawable/ic_shortcut_luggage</item>
<item>@*android:drawable/ic_shortcut_maps</item>
<item>@*android:drawable/ic_shortcut_market</item>
<item>@*android:drawable/ic_shortcut_movie</item>
<item>@*android:drawable/ic_shortcut_music</item>
<item>@*android:drawable/ic_shortcut_nav</item>
<item>@*android:drawable/ic_shortcut_notes</item>
<item>@*android:drawable/ic_shortcut_package</item>
<item>@*android:drawable/ic_shortcut_phone</item>
<item>@*android:drawable/ic_shortcut_pinterest</item>
<item>@*android:drawable/ic_shortcut_play</item>
<item>@*android:drawable/ic_shortcut_pocket</item>
<item>@*android:drawable/ic_shortcut_quicksettings</item>
<item>@*android:drawable/ic_shortcut_rss</item>
<item>@*android:drawable/ic_shortcut_sdcard</item>
<item>@*android:drawable/ic_shortcut_search</item>
<item>@*android:drawable/ic_shortcut_sms</item>
<item>@*android:drawable/ic_shortcut_tasks</item>
<item>@*android:drawable/ic_shortcut_terminal</item>
<item>@*android:drawable/ic_shortcut_transit</item>
<item>@*android:drawable/ic_shortcut_tv</item>
<item>@*android:drawable/ic_shortcut_twitter</item>
<item>@*android:drawable/ic_shortcut_unlock</item>
-->
</string-array>
<string-array name="shortcut_action_entries">
<item>@string/shortcut_action_back</item>-
<item>@string/shortcut_action_app</item>-
<item>@string/shortcut_action_home</item>-
<item>@string/shortcut_action_menu</item>
<item>@string/shortcut_action_ime</item>
<item>@string/shortcut_action_power_menu</item>
<item>@string/shortcut_action_recent</item>
<item>@string/shortcut_action_power</item>
<item>@string/shortcut_action_search</item>
<item>@string/shortcut_action_none</item>
</string-array>
<string-array name="shortcut_action_values" translatable="false">
<item>**back**</item>
<item>**app**</item>
<item>**home**</item>
<item>**menu_big**</item>
<item>**ime**</item>
<item>**power_menu**</item>
<item>**recents**</item>
<item>**power**</item>
<item>**search**</item>
<item>**null**</item>
</string-array>
</resources>

32
res/values/dslv_attrs.xml Normal file
View File

@@ -0,0 +1,32 @@
<resources>
<!-- For DSLV -->
<declare-styleable name="DragSortListView">
<attr name="collapsedHeight" format="dimension" />
<attr name="dragScrollStart" format="float" />
<attr name="maxDragScrollSpeed" format="float" />
<attr name="floatBackgroundColor" format="color" />
<attr name="removeMode">
<enum name="clickRemove" value="0" />
<enum name="flingRemove" value="1" />
</attr>
<attr name="trackDragSort" format="boolean"/>
<attr name="floatAlpha" format="float"/>
<attr name="slideShuffleSpeed" format="float"/>
<attr name="removeAnimationDuration" format="integer"/>
<attr name="dropAnimationDuration" format="integer"/>
<attr name="dragEnabled" format="boolean" />
<attr name="sortEnabled" format="boolean" />
<attr name="removeEnabled" format="boolean" />
<attr name="dragStartMode">
<enum name="onDown" value="0" />
<enum name="onMove" value="1" />
<enum name="onLongPress" value="2"/>
</attr>
<attr name="dragHandleId" format="integer" />
<attr name="flingHandleId" format="integer" />
<attr name="clickRemoveId" format="integer" />
<attr name="useDefaultController" format="boolean" />
</declare-styleable>
</resources>

21
res/values/dslv_ids.xml Normal file
View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 2014, The Android Open Source 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>
<item type="id" name="drag_handle" />
</resources>

View File

@@ -0,0 +1,42 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<!-- Slim lockscreen shortcuts -->
<string name="shortcut_action_none">None</string>
<string name="shortcut_action_longpress">Longpress:</string>
<string name="shortcut_action_select_action_longpress">Choose longpress action:</string>
<string name="shortcut_action_select_action">Choose action:</string>
<string name="shortcut_action_select_action_newaction">Choose new action:</string>
<string name="shortcut_action_reset">Reset</string>
<string name="shortcut_action_add">Add</string>
<string name="shortcut_action_max">Maximum entries size has been reached</string>
<string name="shortcut_action_warning">Warning</string>
<string name="shortcut_action_warning_message">It is not possible to delete last entry</string>
<string name="shortcut_action_disable_message">Disabled\nAdd an entry to enable this feature</string>
<string name="shortcut_image_not_valid">The chosen app did not return a valid icon or does not support image cropping. Use another app.</string>
<string name="shortcut_duplicate_entry">The chosen action cannot be added twice</string>
<string name="shortcut_action_help_shortcut">shortcut</string>
<string name="shortcut_action_help_button">button</string>
<string name="shortcut_action_help_app">app</string>
<string name="shortcut_action_help_icon">, while selecting the icon will bring up customization options</string>
<string name="shortcut_action_help_main">To add a %1$s, select the Add icon. Once a %1$s is added, selecting the row will change the target%2$s\n\nTo remove a %1$s, swipe the row horizontally left or right. Re-order a %1$s in the list by vertically dragging the anchor on the left.\n\nTo clear or reset to defaults, select the Reset icon.</string>
<string name="shortcut_action_help_delete_last_entry">Removing every %1$s in the list will disable the feature entirely.</string>
<string name="shortcut_action_help_pie_second_layer_delete_last_entry">Removing every %1$s in the list will disable the second pie layer entirely.</string>
<string name="shortcuts_applications">Applications</string>
<string name="shortcuts_select_custom_app_title">Select custom application</string>
<string name="shortcuts_icon_picker_type">Select icon type:</string>
<string name="shortcuts_icon_default">Default</string>
<string name="shortcuts_icon_custom">Gallery</string>
<string name="reset_message">Reset all entries to default?</string>
<string name="help">Help</string>
<string name="shortcut_action_app">Custom app</string>
<string name="shortcut_action_home">Home</string>
<string name="shortcut_action_back">Back</string>
<string name="shortcut_action_menu">Menu</string>
<string name="shortcut_action_ime">Open IME Switcher</string>
<string name="shortcut_action_power_menu">Power menu</string>
<string name="shortcut_action_recent">Recents</string>
<string name="shortcut_action_power">Screen Off</string>
<string name="shortcut_action_search">Search in app</string>
</resources>