From 6deaa3b648ca5dc6e36b84a17d05252ed638953b Mon Sep 17 00:00:00 2001 From: Bruno Martins Date: Thu, 28 Dec 2017 02:20:44 +0100 Subject: [PATCH] AdvancedDisplay: Re-integrate into Settings * Apply the default Oreo theme and inherit the layouts from Google for the Settings app, in order to keep UI consistency. * Get rid of SettingsDrawerActivity as it no longer fits in. * Add required appcompat and preference support libraries. * Integrate into display settings category using IA. Change-Id: I8438e0ebec27085df2be4668f8f7170d2010fb20 --- AdvancedDisplay/Android.mk | 7 ++-- AdvancedDisplay/AndroidManifest.xml | 14 +++---- AdvancedDisplay/res/values/dimens.xml | 2 + AdvancedDisplay/res/values/strings.xml | 3 ++ AdvancedDisplay/res/values/styles.xml | 39 ++++++++++++++++++- .../device/AdvancedDisplayActivity.java | 7 ++-- lineage.dependencies | 6 +++ 7 files changed, 62 insertions(+), 16 deletions(-) create mode 100644 lineage.dependencies diff --git a/AdvancedDisplay/Android.mk b/AdvancedDisplay/Android.mk index d972dc4..e0d82fa 100644 --- a/AdvancedDisplay/Android.mk +++ b/AdvancedDisplay/Android.mk @@ -9,16 +9,19 @@ LOCAL_PACKAGE_NAME := AdvancedDisplay LOCAL_CERTIFICATE := platform LOCAL_STATIC_JAVA_LIBRARIES := \ - android-support-v14-preference \ + android-support-v4 \ android-support-v7-appcompat \ android-support-v7-preference \ android-support-v7-recyclerview \ + android-support-v13 \ + android-support-v14-preference \ org.lineageos.platform.internal LOCAL_PROGUARD_FLAG_FILES := proguard.flags LOCAL_RESOURCE_DIR := \ $(LOCAL_PATH)/res \ + $(TOP)/packages/resources/devicesettings/res \ frameworks/support/v14/preference/res \ frameworks/support/v7/appcompat/res \ frameworks/support/v7/preference/res \ @@ -31,8 +34,6 @@ LOCAL_AAPT_FLAGS := \ --extra-packages android.support.v7.preference \ --extra-packages android.support.v7.recyclerview -include frameworks/base/packages/SettingsLib/common.mk - include $(BUILD_PACKAGE) include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/AdvancedDisplay/AndroidManifest.xml b/AdvancedDisplay/AndroidManifest.xml index 241b105..71b93b0 100644 --- a/AdvancedDisplay/AndroidManifest.xml +++ b/AdvancedDisplay/AndroidManifest.xml @@ -6,7 +6,8 @@ + android:label="@string/app_name" + android:theme="@style/Theme.Main"> @@ -16,17 +17,16 @@ + android:label="@string/app_name"> - + android:value="com.android.settings.category.ia.display" /> + diff --git a/AdvancedDisplay/res/values/dimens.xml b/AdvancedDisplay/res/values/dimens.xml index 62f1899..077adea 100644 --- a/AdvancedDisplay/res/values/dimens.xml +++ b/AdvancedDisplay/res/values/dimens.xml @@ -17,4 +17,6 @@ 72dp + + 0dip diff --git a/AdvancedDisplay/res/values/strings.xml b/AdvancedDisplay/res/values/strings.xml index 42cdc6c..89f55a9 100644 --- a/AdvancedDisplay/res/values/strings.xml +++ b/AdvancedDisplay/res/values/strings.xml @@ -26,4 +26,7 @@ Set the mDNIe scenario Negative mode Enable/disable inverted colors + + + diff --git a/AdvancedDisplay/res/values/styles.xml b/AdvancedDisplay/res/values/styles.xml index ee2d0a5..01f8dae 100644 --- a/AdvancedDisplay/res/values/styles.xml +++ b/AdvancedDisplay/res/values/styles.xml @@ -16,7 +16,42 @@ limitations under the License. --> - + + + + + + + + + + + + diff --git a/AdvancedDisplay/src/org/lineageos/settings/device/AdvancedDisplayActivity.java b/AdvancedDisplay/src/org/lineageos/settings/device/AdvancedDisplayActivity.java index 82ce158..92397c3 100644 --- a/AdvancedDisplay/src/org/lineageos/settings/device/AdvancedDisplayActivity.java +++ b/AdvancedDisplay/src/org/lineageos/settings/device/AdvancedDisplayActivity.java @@ -17,15 +17,14 @@ package org.lineageos.settings.device; import android.os.Bundle; +import android.preference.PreferenceActivity; -import com.android.settingslib.drawer.SettingsDrawerActivity; - -public class AdvancedDisplayActivity extends SettingsDrawerActivity { +public class AdvancedDisplayActivity extends PreferenceActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - getFragmentManager().beginTransaction().replace(R.id.content_frame, + getFragmentManager().beginTransaction().replace(android.R.id.content, new AdvancedDisplayFragment()).commit(); } } diff --git a/lineage.dependencies b/lineage.dependencies new file mode 100644 index 0000000..c423969 --- /dev/null +++ b/lineage.dependencies @@ -0,0 +1,6 @@ +[ + { + "repository": "android_packages_resources_devicesettings", + "target_path": "packages/resources/devicesettings" + } +] -- 2.20.1