Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the background color of dialog same as your #99

Open
Kevin-Luong opened this issue May 15, 2018 · 1 comment
Open

How to change the background color of dialog same as your #99

Kevin-Luong opened this issue May 15, 2018 · 1 comment

Comments

@Kevin-Luong
Copy link

Kevin-Luong commented May 15, 2018

Hi QuadFlask

Your library is great! I'm using it for studying.
I have a question that how to change the background color of the color picker dialog from white (mine) to dark (yours) like pictures below. As I add this library and execute it, it is a just white color for the dialog. I tried to find out how to change, however, I'm still have not found the solution yet. I think the dark color is more beautiful than white.

I hope that you may give me the solution for it.
Thank you,
Kevin.

(Mine)
screenshot_20180515-164510 1

(Your)
screenshot_20180515-164458 1

@Kevin-Luong Kevin-Luong changed the title How to change the background color of dialog same as yours How to change the background color of dialog same as your May 15, 2018
@mousexaker
Copy link

You can use custom theme for dialog like this

<style name="ColorPickerDialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert">
        <item name="android:background">@color/colorPrimaryDark</item>
</style>
ColorPickerDialogBuilder
	.with(context, R.style.ColorPickerDialogTheme)
	.setTitle("Choose color")
	.initialColor(currentBackgroundColor)
	.wheelType(ColorPickerView.WHEEL_TYPE.FLOWER)
	.density(12)
	.setOnColorSelectedListener(new OnColorSelectedListener() {
		@Override
		public void onColorSelected(int selectedColor) {
			toast("onColorSelected: 0x" + Integer.toHexString(selectedColor));
		}
	})
	.setPositiveButton("ok", new ColorPickerClickListener() {
		@Override
		public void onClick(DialogInterface dialog, int selectedColor, Integer[] allColors) {
			changeBackgroundColor(selectedColor);
		}
	})
	.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
		@Override
		public void onClick(DialogInterface dialog, int which) {
		}
	})
	.build()
	.show();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants