sdm660-common: Doze: import resources from common devicesettings

This commit is contained in:
Vol Zhdanov 2018-09-16 18:32:42 +00:00 committed by Max Weffers
parent 1bfd98a8f2
commit 0c0f68bde7
No known key found for this signature in database
GPG key ID: 795F73D22FB93FAE
5 changed files with 261 additions and 2 deletions

View file

@ -22,8 +22,7 @@ LOCAL_STATIC_ANDROID_LIBRARIES := \
android-support-v14-preference
LOCAL_RESOURCE_DIR := \
$(LOCAL_PATH)/res \
$(TOP)/packages/resources/devicesettings/res
$(LOCAL_PATH)/res
LOCAL_PROGUARD_FLAG_FILES := proguard.flags

View file

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 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.
-->
<!-- Based off frameworks/base/core/res/res/layout/preference_category_material.xml
except that this supports icon -->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:paddingStart="?android:attr/listPreferredItemPaddingStart" >
<LinearLayout
android:id="@+id/icon_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start|center_vertical"
android:orientation="horizontal">
<com.android.internal.widget.PreferenceImageView
android:id="@android:id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:tint="?android:attr/textColorPrimary"
android:maxWidth="18dp"
android:maxHeight="18dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="56dp"
android:orientation="vertical">
<TextView
android:id="@android:id/title"
android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@android:style/TextAppearance.Material.Body2"
android:textColor="?android:attr/colorAccent"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"/>
<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:attr/textColorSecondary"
android:ellipsize="end"
android:singleLine="true" />
</LinearLayout>
</FrameLayout>

View file

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 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.
-->
<!-- Based off frameworks/base/core/res/res/layout/preference_material.xml
except that this has the negative margin on the image removed. -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:gravity="center_vertical"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:background="?android:attr/selectableItemBackground"
android:clipToPadding="false">
<LinearLayout
android:id="@+id/icon_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="56dp"
android:gravity="start|center_vertical"
android:orientation="horizontal"
android:paddingEnd="12dp"
android:paddingTop="4dp"
android:paddingBottom="4dp">
<com.android.internal.widget.PreferenceImageView
android:id="@android:id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="48dp"
android:maxHeight="48dp"/>
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingTop="12dp"
android:paddingBottom="12dp">
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="24dp"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceListItem"
android:ellipsize="marquee"/>
<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="24dp"
android:layout_below="@android:id/title"
android:layout_alignStart="@android:id/title"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:attr/textColorSecondary"
android:maxLines="10"/>
</RelativeLayout>
<!-- Preference should place its actual preference widget here. -->
<LinearLayout
android:id="@android:id/widget_frame"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="end|center_vertical"
android:paddingStart="16dp"
android:orientation="vertical"/>
</LinearLayout>

View file

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!--
Copyright (C) 2013-2016 The CyanogenMod Project
(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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Label for feature switch [CHAR LIMIT=30] -->
<string name="switch_bar_on">Включено</string>
<!-- Label for feature switch [CHAR LIMIT=30] -->
<string name="switch_bar_off">Выключено</string>
<!-- Device specific settings -->
<string name="device_settings_app_name">Дополнительные настройки</string>
<!-- Ambient Display -->
<string name="ambient_display_title">Индикация событий</string>
<!-- Tilt sensor -->
<string name="tilt_sensor_title">Датчик наклона</string>
<!-- Proximity sensor -->
<string name="proximity_sensor_title">Датчик приближения</string>
<!-- Hand wave gesture -->
<string name="hand_wave_gesture_title">Взмах рукой</string>
<string name="hand_wave_gesture_summary">Проведите ладонью над экраном для просмотра уведомлений</string>
<!-- Pick-up gesture -->
<string name="pick_up_gesture_title">Поднять</string>
<string name="pick_up_gesture_summary">Отображать уведомления при поднятии устройства</string>
<!-- Pocket gesture -->
<string name="pocket_gesture_title">Карман</string>
<string name="pocket_gesture_summary">Отображать уведомления при извлечении устройства из кармана</string>
<!-- Proximity wake -->
<string name="proximity_wake_title">Включение по датчикам</string>
<string name="proximity_wake_enable_summary">Проведите ладонью над экраном, чтобы вывести устройство из режима сна</string>
<!-- Dialog texts -->
<string name="dialog_ok">OK</string>
<!-- Help texts -->
<string name="doze_settings_help_title">Информация</string>
<string name="doze_settings_help_text">Эти функции используют события датчиков для отображения уведомлений. Датчик проверяется только при поступлении нового уведомления, что помогает сэкономить заряд батареи. Можно активировать включение датчика сразу при отключении экрана устройства, однако это может ускорить разряд батареи.</string>
</resources>

View file

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013-2016 The CyanogenMod Project
(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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Label for feature switch [CHAR LIMIT=30] -->
<string name="switch_bar_on">On</string>
<!-- Label for feature switch [CHAR LIMIT=30] -->
<string name="switch_bar_off">Off</string>
<!-- Device specific settings -->
<string name="device_settings_app_name">Advanced settings</string>
<!-- Ambient Display -->
<string name="ambient_display_title">Ambient display</string>
<!-- Tilt sensor -->
<string name="tilt_sensor_title">Tilt sensor</string>
<!-- Proximity sensor -->
<string name="proximity_sensor_title">Proximity sensor</string>
<!-- Hand wave gesture -->
<string name="hand_wave_gesture_title">Hand wave</string>
<string name="hand_wave_gesture_summary">Pulse notifications on hand wave</string>
<!-- Pick-up gesture -->
<string name="pick_up_gesture_title">Pick-up</string>
<string name="pick_up_gesture_summary">Pulse notifications on pick-up</string>
<!-- Pocket gesture -->
<string name="pocket_gesture_title">Pocket</string>
<string name="pocket_gesture_summary">Pulse notifications on removal from pocket</string>
<!-- Proximity wake -->
<string name="proximity_wake_title">Proximity wake</string>
<string name="proximity_wake_enable_summary">Wake device on hand wave</string>
<!-- Dialog texts -->
<string name="dialog_ok">OK</string>
<!-- Help texts -->
<string name="doze_settings_help_title">Help</string>
<string name="doze_settings_help_text">These features use sensor events to launch a doze notification pulse. The chosen sensor is only enabled when the device receives a notification, this helps to reduce battery usage. There is also an option to enable the chosen sensor as soon as the screen turns off, this will cause higher battery usage.</string>
</resources>