summaryrefslogtreecommitdiffstats
path: root/GNexusParts
diff options
context:
space:
mode:
authorMarkus Reumueller <reumuellermarkus@gmail.com>2012-12-08 18:07:30 +0100
committerRobert Burns <burnsra@gmail.com>2012-12-13 16:31:52 -0500
commit8d0aaa3342810ea2fce3fb432b60ce745a6e4d9e (patch)
tree1748c89680f17a52e17dc8bf80e9eef331460d14 /GNexusParts
parent0d53a7c1e173de9c5d19feca3c70c5d3099fa3d5 (diff)
downloaddevice_samsung_tuna-8d0aaa3342810ea2fce3fb432b60ce745a6e4d9e.zip
device_samsung_tuna-8d0aaa3342810ea2fce3fb432b60ce745a6e4d9e.tar.gz
device_samsung_tuna-8d0aaa3342810ea2fce3fb432b60ce745a6e4d9e.tar.bz2
Bugfix --> presets are not restored after reboot
Some cleanups German Translation PatchSet2: derp... Change-Id: Ic85b340ea67b1c5e1b80bc62e40238bc6fde5eff
Diffstat (limited to 'GNexusParts')
-rwxr-xr-xGNexusParts/res/layout/preference_colorgamma_presets.xml7
-rw-r--r--GNexusParts/res/layout/preference_dialog_color_tuning.xml5
-rw-r--r--GNexusParts/res/values-de/arrays.xml7
-rw-r--r--GNexusParts/res/values-de/strings.xml16
-rw-r--r--GNexusParts/src/com/cyanogenmod/settings/device/ColorHackPresets.java61
-rw-r--r--GNexusParts/src/com/cyanogenmod/settings/device/ColorTuningPreference.java36
-rw-r--r--GNexusParts/src/com/cyanogenmod/settings/device/DevicePreferenceActivity.java23
-rw-r--r--GNexusParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java16
-rw-r--r--GNexusParts/src/com/cyanogenmod/settings/device/VibratorTuningPreference.java23
9 files changed, 99 insertions, 95 deletions
diff --git a/GNexusParts/res/layout/preference_colorgamma_presets.xml b/GNexusParts/res/layout/preference_colorgamma_presets.xml
index af85740..e99dfba 100755
--- a/GNexusParts/res/layout/preference_colorgamma_presets.xml
+++ b/GNexusParts/res/layout/preference_colorgamma_presets.xml
@@ -117,15 +117,16 @@
android:layout_width="320dp"
android:layout_height="wrap_content"
android:layout_weight="1"
+ android:gravity="center"
android:layout_below="@+id/linearLayout2" >
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="10dip"
- android:text="@string/credits_presets"
- android:textSize="12dp"/>
+ android:gravity="center"
+ android:text="@string/credits_presets"
+ android:textSize="15dp"/>
</LinearLayout>
diff --git a/GNexusParts/res/layout/preference_dialog_color_tuning.xml b/GNexusParts/res/layout/preference_dialog_color_tuning.xml
index 51883d1..b49b505 100644
--- a/GNexusParts/res/layout/preference_dialog_color_tuning.xml
+++ b/GNexusParts/res/layout/preference_dialog_color_tuning.xml
@@ -126,15 +126,16 @@
android:layout_width="320dp"
android:layout_height="wrap_content"
android:layout_weight="1"
+ android:gravity="center"
android:layout_below="@+id/linearLayout1">
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="10dip"
+ android:gravity="center"
android:text="@string/color_warning"
- android:textSize="12dp"/>
+ android:textSize="15dp"/>
</LinearLayout>
diff --git a/GNexusParts/res/values-de/arrays.xml b/GNexusParts/res/values-de/arrays.xml
new file mode 100644
index 0000000..69b405e
--- /dev/null
+++ b/GNexusParts/res/values-de/arrays.xml
@@ -0,0 +1,7 @@
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="gpu_overclock_entries">
+ <item>307,2 MHz (Standard)</item>
+ <item>384,0 MHz</item>
+ <item>512,0 MHz</item>
+ </string-array>
+</resources>
diff --git a/GNexusParts/res/values-de/strings.xml b/GNexusParts/res/values-de/strings.xml
index 89d6fc3..e42198c 100644
--- a/GNexusParts/res/values-de/strings.xml
+++ b/GNexusParts/res/values-de/strings.xml
@@ -2,6 +2,7 @@
<resources>
<string name="app_name">Galaxy Nexus Einstellungen</string>
+ <string name="category_display_title">Anzeige</string>
<string name="color_tuning_title_head">Farbmultiplikator</string>
<string name="color_tuning_summary_head">Farbmultiplikator einstellen</string>
<string name="gamma_tuning_title_head">Gammakorrektur</string>
@@ -18,6 +19,16 @@
<string name="color2_title">CM</string>
<string name="color3_title">Natural</string>
<string name="gamma_dss_title">DSS Gammawert</string>
+ <string name="color_warning">Werte höher als 200 sind nicht ratsam</string>
+
+
+ <string name="category_hardware_title">Hardware</string>
+ <string name="vibrator_tuning_title_head">Vibration</string>
+ <string name="vibrator_tuning_summary_head">Ändert die Grundeinstellung der Vibrationsintensität</string>
+
+ <string name="vibrator_title">Vibration %</string>
+ <string name="vibrator_default_title">Standard</string>
+ <string name="vibrator_test_title">Test</string>
<string name="preset1_default_title">Standard</string>
<string name="preset2_default_title">Maximal</string>
@@ -25,10 +36,13 @@
<string name="preset4_default_title">Warm</string>
<string name="preset5_default_title">Kalt</string>
<string name="preset6_default_title">Natürlich</string>
- <string name="credits_presets">Dank an: ale.landra91 cpaixao provolinoo</string>
+ <string name="credits_presets">Dank an: ale.landra91, cpaixao, provolinoo</string>
<string name="category_radio_title">Mobilfunk</string>
<string name="hspa_title_head">HSPA</string>
<string name="hspa_summary_head">HSDPA/HSUPA aktivieren</string>
+ <string name="category_gpu_title">GRAFIK</string>
+ <string name="gpu_overclock_title">GPU Taktfrequenz</string>
+
</resources>
diff --git a/GNexusParts/src/com/cyanogenmod/settings/device/ColorHackPresets.java b/GNexusParts/src/com/cyanogenmod/settings/device/ColorHackPresets.java
index 94a638d..8a260c5 100644
--- a/GNexusParts/src/com/cyanogenmod/settings/device/ColorHackPresets.java
+++ b/GNexusParts/src/com/cyanogenmod/settings/device/ColorHackPresets.java
@@ -24,13 +24,14 @@ import android.preference.PreferenceManager;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
-import android.widget.TextView;
import android.widget.Button;
import android.util.Log;
+
+
/**
- * Special preference type that allows configuration of both the ring volume and
- * notification volume.
+ * Special preference type that allows to set a pre-configuration of Color and Gamma
+ * Value on Nexus Devices.
*/
public class ColorHackPresets extends DialogPreference implements OnClickListener {
@@ -49,13 +50,9 @@ public class ColorHackPresets extends DialogPreference implements OnClickListene
"/sys/class/misc/samoled_color/blue_multiplier"
};
- // Track instances to know when to restore original color
- // (when the orientation changes, a new dialog is created before the old one
- // is destroyed)
- private static int sInstances = 0;
-
// Align MAX_VALUE with Voodoo Control settings
private static final int MAX_VALUE = 2000000000;
+
public ColorHackPresets(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -66,9 +63,6 @@ public class ColorHackPresets extends DialogPreference implements OnClickListene
@Override
protected void onBindDialogView(View view) {
super.onBindDialogView(view);
-
- sInstances++;
-
SetupButtonClickListeners(view);
}
@@ -90,26 +84,13 @@ public class ColorHackPresets extends DialogPreference implements OnClickListene
protected void onDialogClosed(boolean positiveResult) {
super.onDialogClosed(positiveResult);
- sInstances--;
-
- }
-
- /**
- * Restore screen color tuning from SharedPreferences. (Write to kernel.)
- *
- * @param context The context to read the SharedPreferences from
- */
- public static void restore(Context context) {
- if (!isSupported()) {
- return;
- }
-
}
+
/**
- * Check whether the running kernel supports color tuning or not.
+ * Check whether the running kernel supports color/gamma tuning or not.
*
- * @return Whether color tuning is supported or not
+ * @return Whether color/gamma tuning is supported or not
*/
public static boolean isSupported() {
boolean supported = true;
@@ -123,7 +104,6 @@ public class ColorHackPresets extends DialogPreference implements OnClickListene
supported = false;
}
}
-
return supported;
}
@@ -146,20 +126,39 @@ public class ColorHackPresets extends DialogPreference implements OnClickListene
break;
case R.id.btnPreset6:
Preset6();
- break;
+ break;
}
}
+
private void WriteMultiplier(Double fValue , int iPos) {
int iValue = (int) ((double) MAX_VALUE * fValue);
+ int iValue2;
Utils.writeColor(FILE_PATH_MULTI[iPos], iValue);
- Log.i(TAG,"KalimAz: Multiplier: " + iPos+ " Value " + iValue );
+
+ SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
+ iValue2 = sharedPrefs.getInt(FILE_PATH_MULTI[iPos], iValue);
+ //storing to SharedPreferences because of reloaded @ startup
+ Editor editor = getEditor();
+ editor.putInt(FILE_PATH_MULTI[iPos], iValue);
+ editor.commit();
+ Log.d(TAG, "Changing ColorMultiplier " +iPos+ " from:" +iValue2+ " to: " +iValue);
}
+
private void WriteGamma(int iValue , int iPos) {
+ int iValue2;
Utils.writeValue(FILE_PATH_GAMMA[iPos], String.valueOf((long) iValue));
- Log.i(TAG,"KalimAz: Gamma: " + iPos+ " Value " + iValue );
+
+ SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
+ iValue2 = sharedPrefs.getInt(FILE_PATH_GAMMA[iPos], iValue);
+ //storing to SharedPreferences because of reloaded @ startup
+ Editor editor = getEditor();
+ editor.putInt(FILE_PATH_GAMMA[iPos], iValue);
+ editor.commit();
+ Log.d(TAG, "Changing GammaValue " +iPos+ " from:" +iValue2+ " to: " +iValue);
}
+
private void Preset1() {
WriteMultiplier(0.5, 0);
diff --git a/GNexusParts/src/com/cyanogenmod/settings/device/ColorTuningPreference.java b/GNexusParts/src/com/cyanogenmod/settings/device/ColorTuningPreference.java
index 25cbeb7..a24ea00 100644
--- a/GNexusParts/src/com/cyanogenmod/settings/device/ColorTuningPreference.java
+++ b/GNexusParts/src/com/cyanogenmod/settings/device/ColorTuningPreference.java
@@ -30,8 +30,8 @@ import android.util.Log;
import android.widget.Button;
/**
- * Special preference type that allows configuration of both the ring volume and
- * notification volume.
+ * Special preference type that allows configuration of Color settings on Nexus
+ * Devices
*/
public class ColorTuningPreference extends DialogPreference implements OnClickListener {
@@ -67,7 +67,7 @@ public class ColorTuningPreference extends DialogPreference implements OnClickLi
public ColorTuningPreference(Context context, AttributeSet attrs) {
super(context, attrs);
-
+
setDialogLayoutResource(R.layout.preference_dialog_color_tuning);
}
@@ -112,7 +112,7 @@ public class ColorTuningPreference extends DialogPreference implements OnClickLi
}
/**
- * Restore screen color tuning from SharedPreferences. (Write to kernel.)
+ * Restore color tuning from SharedPreferences. (Write to kernel.)
*
* @param context The context to read the SharedPreferences from
*/
@@ -120,26 +120,28 @@ public class ColorTuningPreference extends DialogPreference implements OnClickLi
if (!isSupported()) {
return;
}
-
- int iValue, iValue2;
+
+ int iValue;
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
+ Boolean bFirstTime = sharedPrefs.getBoolean("FirstTimeColor", true);
for (String filePath : FILE_PATH) {
String sDefaultValue = Utils.readOneLine(filePath);
- Log.d(TAG,"INIT: " + sDefaultValue);
- try {
- iValue2 = Integer.parseInt(sDefaultValue);
- } catch (NumberFormatException e) {
- iValue2 = MAX_VALUE;
+ iValue = sharedPrefs.getInt(filePath, Integer.valueOf(sDefaultValue));
+ if (bFirstTime){
+ Utils.writeColor(filePath, MAX_VALUE);
+ Log.d(TAG, "restore default value: " +MAX_VALUE+ " File: " + filePath);
}
- try {
- iValue = sharedPrefs.getInt(filePath, iValue2);
+ else{
+ Utils.writeColor(filePath, iValue);
Log.d(TAG, "restore: iValue: " + iValue + " File: " + filePath);
- } catch (NumberFormatException e) {
- iValue = iValue2;
- Log.e(TAG, "restore ERROR: iValue: " + iValue + " File: " + filePath);
}
- Utils.writeColor(filePath, (int) iValue);
+ }
+ if (bFirstTime)
+ {
+ SharedPreferences.Editor editor = sharedPrefs.edit();
+ editor.putBoolean("FirstTimeColor", false);
+ editor.commit();
}
}
diff --git a/GNexusParts/src/com/cyanogenmod/settings/device/DevicePreferenceActivity.java b/GNexusParts/src/com/cyanogenmod/settings/device/DevicePreferenceActivity.java
index 957883b..ca09344 100644
--- a/GNexusParts/src/com/cyanogenmod/settings/device/DevicePreferenceActivity.java
+++ b/GNexusParts/src/com/cyanogenmod/settings/device/DevicePreferenceActivity.java
@@ -16,32 +16,11 @@
package com.cyanogenmod.settings.device;
-import android.app.ActionBar;
-import android.app.ActionBar.Tab;
-import android.app.ActionBar.TabListener;
-import android.app.Activity;
-import android.app.Fragment;
-import android.app.FragmentManager;
-import android.app.FragmentTransaction;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.ServiceConnection;
import android.os.Bundle;
-import android.os.IBinder;
import android.preference.ListPreference;
-import android.preference.PreferenceActivity;
import android.preference.PreferenceFragment;
-import android.preference.PreferenceScreen;
-import android.support.v13.app.FragmentPagerAdapter;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.view.ViewPager;
-import android.view.MenuItem;
-
import com.cyanogenmod.settings.device.R;
-import java.util.ArrayList;
-
public class DevicePreferenceActivity extends PreferenceFragment {
public static final String SHARED_PREFERENCES_BASENAME = "com.cyanogenmod.settings.device";
@@ -78,8 +57,6 @@ public class DevicePreferenceActivity extends PreferenceFragment {
mVibratorTuning = (VibratorTuningPreference) findPreference(KEY_VIBRATOR_TUNING);
mVibratorTuning.setEnabled(VibratorTuningPreference.isSupported());
- PreferenceScreen prefSet = getPreferenceScreen();
-
mGpuOverclock = (ListPreference) findPreference(KEY_GPU_OVERCLOCK);
mGpuOverclock.setEnabled(GpuOverclock.isSupported());
mGpuOverclock.setOnPreferenceChangeListener(new GpuOverclock());
diff --git a/GNexusParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java b/GNexusParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java
index 3c5aef0..b54bc58 100644
--- a/GNexusParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java
+++ b/GNexusParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java
@@ -30,8 +30,8 @@ import android.widget.Button;
import android.util.Log;
/**
- * Special preference type that allows configuration of both the ring volume and
- * notification volume.
+ * Special preference type that allows configuration of Gamma settings on Nexus
+ * Devices
*/
public class GammaTuningPreference extends DialogPreference implements OnClickListener {
@@ -117,7 +117,7 @@ public class GammaTuningPreference extends DialogPreference implements OnClickLi
}
/**
- * Restore screen color tuning from SharedPreferences. (Write to kernel.)
+ * Restore screen gamma tuning from SharedPreferences. (Write to kernel.)
*
* @param context The context to read the SharedPreferences from
*/
@@ -133,10 +133,14 @@ public class GammaTuningPreference extends DialogPreference implements OnClickLi
for (String filePath : FILE_PATH) {
String sDefaultValue = Utils.readOneLine(filePath);
iValue = sharedPrefs.getInt(filePath, Integer.valueOf(sDefaultValue));
- if (bFirstTime)
+ if (bFirstTime){
Utils.writeValue(filePath, "0");
- else
+ Log.d(TAG, "restore default value: 0 File: " + filePath);
+ }
+ else{
Utils.writeValue(filePath, String.valueOf((long) iValue));
+ Log.d(TAG, "restore: iValue: " + iValue + " File: " + filePath);
+ }
}
if (bFirstTime)
{
@@ -185,8 +189,6 @@ public class GammaTuningPreference extends DialogPreference implements OnClickLi
iOffset = offsetValue;
iMax = maxValue;
- SharedPreferences sharedPreferences = getSharedPreferences();
-
// Read original value
if (Utils.fileExists(mFilePath)) {
String sDefaultValue = Utils.readOneLine(mFilePath);
diff --git a/GNexusParts/src/com/cyanogenmod/settings/device/VibratorTuningPreference.java b/GNexusParts/src/com/cyanogenmod/settings/device/VibratorTuningPreference.java
index f8aec17..fce408f 100644
--- a/GNexusParts/src/com/cyanogenmod/settings/device/VibratorTuningPreference.java
+++ b/GNexusParts/src/com/cyanogenmod/settings/device/VibratorTuningPreference.java
@@ -31,12 +31,12 @@ import android.util.Log;
import android.os.Vibrator;
/**
- * Special preference type that allows configuration of both the ring volume and
- * notification volume.
+ * Special preference type that allows configuration of vibrator intensity settings on Nexus
+ * Devices
*/
public class VibratorTuningPreference extends DialogPreference implements OnClickListener {
- private static final String TAG = "vibrator...";
+ private static final String TAG = "VIBRATOR...";
private static final int[] SEEKBAR_ID = new int[] {
R.id.vibrator_seekbar
@@ -110,7 +110,7 @@ public class VibratorTuningPreference extends DialogPreference implements OnClic
}
/**
- * Restore screen color tuning from SharedPreferences. (Write to kernel.)
+ * Restore vibrator tuning from SharedPreferences. (Write to kernel.)
*
* @param context The context to read the SharedPreferences from
*/
@@ -125,13 +125,16 @@ public class VibratorTuningPreference extends DialogPreference implements OnClic
for (String filePath : FILE_PATH) {
String sDefaultValue = Utils.readOneLine(filePath);
int iValue = sharedPrefs.getInt(filePath, Integer.valueOf(sDefaultValue));
- if (bFirstTime)
+ if (bFirstTime){
Utils.writeValue(filePath, "100");
- else
+ Log.d(TAG, "restore default value: 100 File: " + filePath);
+ }
+ else{
Utils.writeValue(filePath, String.valueOf((long) iValue));
+ Log.d(TAG, "restore: iValue: " + iValue + " File: " + filePath);
+ }
}
- if (bFirstTime)
- {
+ if (bFirstTime) {
SharedPreferences.Editor editor = sharedPrefs.edit();
editor.putBoolean("FirstTimevibrator", false);
editor.commit();
@@ -139,7 +142,7 @@ public class VibratorTuningPreference extends DialogPreference implements OnClic
}
/**
- * Check whether the running kernel supports color tuning or not.
+ * Check whether the running kernel supports vibrator tuning or not.
*
* @return Whether color tuning is supported or not
*/
@@ -177,8 +180,6 @@ public class VibratorTuningPreference extends DialogPreference implements OnClic
iOffset = offsetValue;
iMax = maxValue;
- SharedPreferences sharedPreferences = getSharedPreferences();
-
// Read original value
if (Utils.fileExists(mFilePath)) {
String sDefaultValue = Utils.readOneLine(mFilePath);