diff options
author | KalimochoAz <calimochoazucarado@gmail.com> | 2012-04-24 23:02:55 +0200 |
---|---|---|
committer | KalimochoAz <calimochoazucarado@gmail.com> | 2012-04-24 23:02:55 +0200 |
commit | bf0c746611b994698a4770fe233ea05ffd2ecd01 (patch) | |
tree | 93191940530cdcbbcb9d6b3b815119cfcecb2a9a /CrespoParts | |
parent | fa735c78bae900226808a703bcd5b1fca1153032 (diff) | |
download | device_samsung_crespo-bf0c746611b994698a4770fe233ea05ffd2ecd01.zip device_samsung_crespo-bf0c746611b994698a4770fe233ea05ffd2ecd01.tar.gz device_samsung_crespo-bf0c746611b994698a4770fe233ea05ffd2ecd01.tar.bz2 |
Added presets for color multipliers
Change-Id: I90e4021569b73394156dd1725222e0774c17e472
Diffstat (limited to 'CrespoParts')
-rw-r--r-- | CrespoParts/res/layout/preference_dialog_color_tuning.xml | 31 | ||||
-rw-r--r-- | CrespoParts/src/com/cyanogenmod/settings/device/ColorTuningPreference.java | 50 |
2 files changed, 78 insertions, 3 deletions
diff --git a/CrespoParts/res/layout/preference_dialog_color_tuning.xml b/CrespoParts/res/layout/preference_dialog_color_tuning.xml index 6154982..068f88c 100644 --- a/CrespoParts/res/layout/preference_dialog_color_tuning.xml +++ b/CrespoParts/res/layout/preference_dialog_color_tuning.xml @@ -80,7 +80,8 @@ android:paddingLeft="20dip" android:paddingRight="20dip" /> - <ImageView android:src="@drawable/color_tuning_preview" + <ImageView android:id="@+id/black_scale_picture_color" + android:src="@drawable/color_tuning_preview" android:layout_width="match_parent" android:layout_height="40dip" android:layout_below="@id/color_blue_seekbar" @@ -88,5 +89,31 @@ 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_color" > + + <Button + android:id="@+id/btnColorDefault" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/color_default_title" /> + + <Button + android:id="@+id/btnColorCM" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/color_CM_title" /> + + <Button + android:id="@+id/btnColorDark" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/color_dark_title" /> + + </LinearLayout> + </RelativeLayout> -</ScrollView>
\ No newline at end of file +</ScrollView> diff --git a/CrespoParts/src/com/cyanogenmod/settings/device/ColorTuningPreference.java b/CrespoParts/src/com/cyanogenmod/settings/device/ColorTuningPreference.java index 085cae7..378fb38 100644 --- a/CrespoParts/src/com/cyanogenmod/settings/device/ColorTuningPreference.java +++ b/CrespoParts/src/com/cyanogenmod/settings/device/ColorTuningPreference.java @@ -23,15 +23,17 @@ import android.preference.DialogPreference; 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.util.Log; +import android.widget.Button; /** * Special preference type that allows configuration of both the ring volume and * notification volume. */ -public class ColorTuningPreference extends DialogPreference { +public class ColorTuningPreference extends DialogPreference implements OnClickListener { private static final String TAG = "COLOR..."; @@ -80,6 +82,16 @@ public class ColorTuningPreference extends DialogPreference { TextView valueDisplay = (TextView) view.findViewById(VALUE_DISPLAY_ID[i]); mSeekBars[i] = new ColorSeekBar(seekBar, valueDisplay, FILE_PATH[i]); } + SetupButtonClickListeners(view); + } + + private void SetupButtonClickListeners(View view) { + Button mDefaultButton = (Button)view.findViewById(R.id.btnColorDefault); + Button mCMButton = (Button)view.findViewById(R.id.btnColorCM); + Button mDarkButton = (Button)view.findViewById(R.id.btnColorDark); + mDefaultButton.setOnClickListener(this); + mCMButton.setOnClickListener(this); + mDarkButton.setOnClickListener(this); } @Override @@ -210,6 +222,42 @@ public class ColorTuningPreference extends DialogPreference { mValueDisplay.setText(String.format("%.10f", (double) progress / MAX_VALUE)); } + public void SetNewValue(int iValue) { + mOriginal = iValue; + reset(); + } + + } + + public void onClick(View v) { + switch(v.getId()){ + case R.id.btnColorDefault: + SetDefaultSettings(); + break; + case R.id.btnColorCM: + SetCMSettings(); + break; + case R.id.btnColorDark: + SetDarkSettings(); + break; + } + } + + private void SetCMSettings() { + mSeekBars[0].SetNewValue(1766478464); + mSeekBars[1].SetNewValue(1766478464); + mSeekBars[2].SetNewValue(1766478464); } + private void SetDarkSettings() { + mSeekBars[0].SetNewValue(877466432); + mSeekBars[1].SetNewValue(877466432); + mSeekBars[2].SetNewValue(877466432); + } + + private void SetDefaultSettings() { + mSeekBars[0].SetNewValue(MAX_VALUE); + mSeekBars[1].SetNewValue(MAX_VALUE); + mSeekBars[2].SetNewValue(MAX_VALUE); + } } |