diff --git a/LineageActions/AndroidManifest.xml b/LineageActions/AndroidManifest.xml index a10645d..77fd28e 100644 --- a/LineageActions/AndroidManifest.xml +++ b/LineageActions/AndroidManifest.xml @@ -22,6 +22,7 @@ android:allowBackup="true" android:label="@string/moto_actions_title" android:icon="@drawable/ic_gesture" + android:summary="@string/moto_actions_summary" android:persistent="true"> diff --git a/LineageActions/res/drawable/ic_settings_gesturess.xml b/LineageActions/res/drawable/ic_settings_gesturess.xml new file mode 100644 index 0000000..0e8d6b4 --- /dev/null +++ b/LineageActions/res/drawable/ic_settings_gesturess.xml @@ -0,0 +1,26 @@ + + + + + + diff --git a/LineageActions/res/drawable/ic_settings_spectrum.xml b/LineageActions/res/drawable/ic_settings_spectrum.xml new file mode 100644 index 0000000..211fe86 --- /dev/null +++ b/LineageActions/res/drawable/ic_settings_spectrum.xml @@ -0,0 +1,31 @@ + + + + diff --git a/LineageActions/res/values/arrays.xml b/LineageActions/res/values/arrays.xml index 186bffc..f301369 100644 --- a/LineageActions/res/values/arrays.xml +++ b/LineageActions/res/values/arrays.xml @@ -92,4 +92,20 @@ "0,4,2,0,-2,-2,4" "2,0,0,-2,-4,0,0" + + + + Balance + Battery + Performance + Gaming + + + + 0 + 2 + 1 + 3 + + diff --git a/LineageActions/res/values/strings.xml b/LineageActions/res/values/strings.xml index f0c0a6a..ba48c1a 100644 --- a/LineageActions/res/values/strings.xml +++ b/LineageActions/res/values/strings.xml @@ -16,7 +16,7 @@ Moto Actions - + extra shit for your moto Device gestures Manage device gestures @@ -145,4 +145,8 @@ Dirac Sound + + Kernel Profile + Choose your kernel profile + Choose your kernel profile diff --git a/LineageActions/res/xml/main_panel.xml b/LineageActions/res/xml/main_panel.xml index b9f2c80..3b5c55b 100644 --- a/LineageActions/res/xml/main_panel.xml +++ b/LineageActions/res/xml/main_panel.xml @@ -22,7 +22,7 @@ android:key="gestures" android:title="@string/device_gestures_title" android:summary="@string/device_gestures_summary" - android:icon="@drawable/ic_settings_gestures"> + android:icon="@drawable/ic_settings_gesturess"> @@ -71,4 +71,17 @@ android:targetClass="org.lineageos.settings.dirac.DiracActivity" /> + + + diff --git a/LineageActions/src/org/lineageos/settings/device/ShitPanelSettings.java b/LineageActions/src/org/lineageos/settings/device/ShitPanelSettings.java new file mode 100644 index 0000000..8e0d6ea --- /dev/null +++ b/LineageActions/src/org/lineageos/settings/device/ShitPanelSettings.java @@ -0,0 +1,81 @@ + +/* + * Copyright (C) 2015 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 org.lineageos.settings; + +import android.app.Activity; +import android.app.AlertDialog; +import android.app.Dialog; +import android.content.res.Resources; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.content.pm.PackageManager.NameNotFoundException; +import android.os.Bundle; +import android.os.SystemProperties; +import android.provider.Settings; +import android.preference.ListPreference; +import android.preference.Preference; +import android.preference.PreferenceActivity; +import android.preference.PreferenceCategory; +import android.preference.Preference.OnPreferenceChangeListener; +import android.preference.Preference.OnPreferenceClickListener; +import android.preference.PreferenceScreen; +import android.preference.SwitchPreference; +import android.preference.TwoStatePreference; +import android.text.TextUtils; +import android.view.MenuItem; +import android.view.View; +import android.widget.AdapterView; +import android.widget.AdapterView.OnItemClickListener; +import android.widget.ListView; +import android.util.Log; + +import org.lineageos.settings.R; + +public class ShitPanelSettings extends PreferenceActivity implements + Preference.OnPreferenceChangeListener { + +private static final String SPECTRUM_KEY = "spectrum"; + private static final String SPECTRUM_SYSTEM_PROPERTY = "persist.spectrum.profile"; + +private ListPreference mSpectrum; + +@Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.main_panel); + + mSpectrum = (ListPreference) findPreference(SPECTRUM_KEY); + if( mSpectrum != null ) { + mSpectrum.setValue(SystemProperties.get(SPECTRUM_SYSTEM_PROPERTY, "0")); + mSpectrum.setOnPreferenceChangeListener(this); + } + } + + @Override + public boolean onPreferenceChange(Preference preference, Object newValue) { + final String key = preference.getKey(); + boolean value; + String strvalue; + if (SPECTRUM_KEY.equals(key)) { + strvalue = (String) newValue; + SystemProperties.set(SPECTRUM_SYSTEM_PROPERTY, strvalue); + return true; + } + return true; + } +}