Permalink
Browse files

Update Gamma tunning to meet with new kernel work on gamma

Change-Id: Ia021ddad5b7c559dea85d4b27bc72c7d37c63b0b
  • Loading branch information...
1 parent 2a3689a commit fa735c78bae900226808a703bcd5b1fca1153032 @KalimochoAz KalimochoAz committed Apr 11, 2012
@@ -80,13 +80,40 @@
android:paddingLeft="20dip"
android:paddingRight="20dip" />
- <ImageView android:src="@drawable/color_tuning_preview"
+ <ImageView android:id="@+id/black_scale_picture"
+ android:src="@drawable/color_tuning_preview"
android:layout_width="match_parent"
android:layout_height="40dip"
android:layout_below="@id/gamma_blue_seekbar"
android:paddingTop="20dip"
android:paddingLeft="20dip"
android:paddingRight="20dip" />
+ <LinearLayout
+ android:id="@+id/linearLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/black_scale_picture" >
+
+ <Button
+ android:id="@+id/btnGammaDefault"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/gamma_default_title" />
+
+ <Button
+ android:id="@+id/btnGammaCM"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/gamma_CM_title" />
+
+ <Button
+ android:id="@+id/btnGammaBright"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/gamma_bright_title" />
+
+ </LinearLayout>
+
</RelativeLayout>
-</ScrollView>
+</ScrollView>
@@ -18,6 +18,9 @@
<string name="color_red_title">Red</string>
<string name="color_green_title">Green</string>
<string name="color_blue_title">Blue</string>
+ <string name="gamma_default_title">Default</string>
+ <string name="gamma_CM_title">CM Sett.</string>
+ <string name="gamma_bright_title">Bright Sett.</string>
<string name="category_touchkey_title">Touch Keys</string>
<string name="touchkey_notification_title_head">Backlight Notifications</string>
@@ -23,14 +23,16 @@
import android.preference.PreferenceManager;
import android.util.AttributeSet;
import android.view.View;
+import android.view.View.OnClickListener;
import android.widget.SeekBar;
import android.widget.TextView;
+import android.widget.Button;
/**
* Special preference type that allows configuration of both the ring volume and
* notification volume.
*/
-public class GammaTuningPreference extends DialogPreference {
+public class GammaTuningPreference extends DialogPreference implements OnClickListener {
private static final String TAG = "GAMMA...";
@@ -80,6 +82,16 @@ protected void onBindDialogView(View view) {
TextView valueDisplay = (TextView) view.findViewById(VALUE_DISPLAY_ID[i]);
mSeekBars[i] = new GammaSeekBar(seekBar, valueDisplay, FILE_PATH[i]);
}
+ SetupButtonClickListeners(view);
+ }
+
+ private void SetupButtonClickListeners(View view) {
+ Button mDefaultButton = (Button)view.findViewById(R.id.btnGammaDefault);
+ Button mCMButton = (Button)view.findViewById(R.id.btnGammaCM);
+ Button mBrightButton = (Button)view.findViewById(R.id.btnGammaBright);
+ mDefaultButton.setOnClickListener(this);
+ mCMButton.setOnClickListener(this);
+ mBrightButton.setOnClickListener(this);
}
@Override
@@ -216,6 +228,43 @@ private void updateValue(int progress) {
mValueDisplay.setText(String.format("%d", (int) progress));
}
+ public void SetNewValue(int iValue) {
+ mOriginal = iValue;
+ reset();
+ }
+
+ }
+
+ public void onClick(View v) {
+ switch(v.getId()){
+ case R.id.btnGammaDefault:
+ SetDefaultSettings();
+ break;
+ case R.id.btnGammaCM:
+ SetCMSettings();
+ break;
+ case R.id.btnGammaBright:
+ SetSBrightSettings();
+ break;
+ }
+ }
+
+ private void SetCMSettings() {
+ mSeekBars[0].SetNewValue(-63);
+ mSeekBars[1].SetNewValue(-59);
+ mSeekBars[2].SetNewValue(-61);
+ }
+
+ private void SetSBrightSettings() {
+ mSeekBars[0].SetNewValue(70);
+ mSeekBars[1].SetNewValue(68);
+ mSeekBars[2].SetNewValue(61);
+ }
+
+ private void SetDefaultSettings() {
+ mSeekBars[0].SetNewValue(0);
+ mSeekBars[1].SetNewValue(0);
+ mSeekBars[2].SetNewValue(0);
}
}

0 comments on commit fa735c7

Please sign in to comment.