use of org.awesomeapp.messenger.MainActivity in project Zom-Android by zom.
the class MoreFragment method showColors.
private void showColors() {
final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getActivity());
int selColor = settings.getInt("themeColor", -1);
ColorPickerDialogBuilder.with(getContext()).setTitle("Choose color").initialColor(selColor).wheelType(ColorPickerView.WHEEL_TYPE.FLOWER).density(12).lightnessSliderOnly().setOnColorSelectedListener(new OnColorSelectedListener() {
@Override
public void onColorSelected(int selectedColor) {
}
}).setPositiveButton(getString(R.string.ok), new ColorPickerClickListener() {
@Override
public void onClick(DialogInterface dialog, int selectedColor, Integer[] allColors) {
settings.edit().putInt("themeColor", selectedColor).commit();
/**
* int textColor = getContrastColor(selectedColor);
* int bgColor = getContrastColor(textColor);
*
* settings.edit().putInt("themeColorBg",bgColor).commit();
* settings.edit().putInt("themeColorText",textColor).commit();
*/
MainActivity activity = (MainActivity) getActivity();
activity.applyStyle();
}
}).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}).build().show();
}
Aggregations