summaryrefslogtreecommitdiffstats
path: root/CrespoParts
diff options
context:
space:
mode:
authorKalimochoAz <calimochoazucarado@gmail.com>2012-04-08 05:48:01 +0200
committerKalimochoAz <calimochoazucarado@gmail.com>2012-04-24 23:01:22 +0200
commit632559a6f8538d363f6cc47f453e18b71221c731 (patch)
tree56419d2753c95da2389d65179cd55577d6330d6a /CrespoParts
parent918449c440a392795f47fe33fcef87531801604b (diff)
downloaddevice_samsung_crespo-632559a6f8538d363f6cc47f453e18b71221c731.zip
device_samsung_crespo-632559a6f8538d363f6cc47f453e18b71221c731.tar.gz
device_samsung_crespo-632559a6f8538d363f6cc47f453e18b71221c731.tar.bz2
Set gamma to 0 on the first run
Set values from -100 to 100 to set % now available in kernel Change-Id: Icfb35cb3948af09abfd9fa7c9e6725f339d34fbe
Diffstat (limited to 'CrespoParts')
-rw-r--r--CrespoParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/CrespoParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java b/CrespoParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java
index bfbc62e..a6ec90e 100644
--- a/CrespoParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java
+++ b/CrespoParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java
@@ -54,9 +54,9 @@ public class GammaTuningPreference extends DialogPreference {
private GammaSeekBar mSeekBars[] = new GammaSeekBar[3];
- private static final int MAX_VALUE = 80;
+ private static final int MAX_VALUE = 200;
- private static final int OFFSET_VALUE = 0;
+ private static final int OFFSET_VALUE = 100;
// Track instances to know when to restore original color
// (when the orientation changes, a new dialog is created before the old one
@@ -110,10 +110,20 @@ public class GammaTuningPreference extends DialogPreference {
}
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
+ Boolean bFirstTime = sharedPrefs.getBoolean("FirstTimeGamma", true);
for (String filePath : FILE_PATH) {
String sDefaultValue = Utils.readOneLine(filePath);
int iValue = sharedPrefs.getInt(filePath, Integer.valueOf(sDefaultValue));
- Utils.writeValue(filePath, String.valueOf((long) iValue));
+ if (bFirstTime)
+ Utils.writeValue(filePath, "0");
+ else
+ Utils.writeValue(filePath, String.valueOf((long) iValue));
+ }
+ if (bFirstTime)
+ {
+ SharedPreferences.Editor editor = sharedPrefs.edit();
+ editor.putBoolean("FirstTimeGamma", false);
+ editor.commit();
}
}