LOCAL_PRIVILEGED_MODULE := true
LOCAL_STATIC_JAVA_LIBRARIES := \
+ android-support-v14-preference \
+ android-support-v7-appcompat \
+ android-support-v7-preference \
+ android-support-v7-recyclerview \
org.cyanogenmod.platform.internal
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
+LOCAL_RESOURCE_DIR := \
+ $(LOCAL_PATH)/res \
+ frameworks/support/v14/preference/res \
+ frameworks/support/v7/appcompat/res \
+ frameworks/support/v7/preference/res \
+ frameworks/support/v7/recyclerview/res
+
+LOCAL_AAPT_FLAGS := --auto-add-overlay \
+ --extra-packages android.support.v14.preference:android.support.v7.appcompat:android.support.v7.preference:android.support.v7.recyclerview
+
+ifneq ($(INCREMENTAL_BUILDS),)
+ LOCAL_PROGUARD_ENABLED := disabled
+ LOCAL_JACK_ENABLED := incremental
+endif
+
+include frameworks/base/packages/SettingsLib/common.mk
+
include $(BUILD_PACKAGE)
include $(call all-makefiles-under,$(LOCAL_PATH))
</service>
<activity
- android:name=".TouchscreenGestureSettings"
+ android:name=".SamsungDozeActivity"
android:label="@string/screen_gestures_panel_title"
- android:theme="@android:style/Theme.Material.Settings">
+ android:theme="@style/SamsungDozeSettings">
<intent-filter>
<action android:name="com.android.settings.action.EXTRA_SETTINGS" />
</intent-filter>
-keep class com.cyanogenmod.settings.device.* {
*;
}
+
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keep class ** extends android.support.v14.preference.PreferenceFragment
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2016 The CyanogenMod 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">
+ <style name="SamsungDozeSettings" parent="@android:style/Theme.Material.Settings">
+ <item name="preferenceTheme">@android:style/Theme.Material.Settings</item>
+ </style>
+</resources>
--- /dev/null
+/*
+ * Copyright (c) 2016 The CyanogenMod 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.
+ */
+package com.cyanogenmod.settings.device;
+
+import android.app.Fragment;
+import android.app.FragmentTransaction;
+import android.os.Bundle;
+
+import com.android.settingslib.drawer.SettingsDrawerActivity;
+
+public class SamsungDozeActivity extends SettingsDrawerActivity {
+
+ private static final String TAG = "samsung_doze";
+
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ getFragmentManager().beginTransaction().replace(R.id.content_frame,
+ new TouchscreenGestureSettings(), TAG).commit();
+ }
+}
package com.cyanogenmod.settings.device;
import android.os.Bundle;
-import android.preference.Preference;
-import android.preference.PreferenceActivity;
-import android.preference.SwitchPreference;
+import android.support.v14.preference.PreferenceFragment;
+import android.support.v14.preference.SwitchPreference;
+import android.support.v7.preference.Preference;
import android.provider.Settings;
import org.cyanogenmod.internal.util.ScreenType;
-public class TouchscreenGestureSettings extends PreferenceActivity {
+public class TouchscreenGestureSettings extends PreferenceFragment {
private static final String KEY_AMBIENT_DISPLAY_ENABLE = "ambient_display_enable";
private static final String KEY_HAND_WAVE = "gesture_hand_wave";
private SwitchPreference mProximityWakePreference;
@Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
+ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
addPreferencesFromResource(R.xml.gesture_panel);
boolean dozeEnabled = isDozeEnabled();
mAmbientDisplayPreference =
}
@Override
- protected void onResume() {
+ public void onResume() {
super.onResume();
// If running on a phone, remove padding around the listview
- if (!ScreenType.isTablet(this)) {
+ if (!ScreenType.isTablet(getContext())) {
getListView().setPadding(0, 0, 0, 0);
}
}
private boolean enableDoze(boolean enable) {
- return Settings.Secure.putInt(getContentResolver(),
+ return Settings.Secure.putInt(getContext().getContentResolver(),
Settings.Secure.DOZE_ENABLED, enable ? 1 : 0);
}
private boolean isDozeEnabled() {
- return Settings.Secure.getInt(getContentResolver(),
+ return Settings.Secure.getInt(getContext().getContentResolver(),
Settings.Secure.DOZE_ENABLED, 1) != 0;
}