colorpicker icon indicating copy to clipboard operation
colorpicker copied to clipboard

Color picker wheel not showing up

Open PasqualePuzio opened this issue 5 years ago • 14 comments

Hello,

in some cases (this affects very few users), the color picker wheel is not showing up (see the screenshot). This is weird as it only happens to a few users, although the initialization code is identical for everyone.

Here's the code AlertDialog colordialog = ColorPickerDialogBuilder .with(LeagueCustomizeShirtActivity.this) .setTitle("Seleziona Colore") .initialColor(0xffffffff) .wheelType(ColorPickerView.WHEEL_TYPE.CIRCLE) .density(10) .showLightnessSlider(true) .showAlphaSlider(false)

and the screenshot

Screenshot_20190718-184816

What could be the reason?

Thanks

PasqualePuzio avatar Jul 19 '19 09:07 PasqualePuzio

The same happened to a user of my app. He uses a Huawei P20 Pro. Unfortunately I can't reproduce that. I use .wheelType(ColorPickerView.WHEEL_TYPE.CIRCLE) as well.

Lars3n95 avatar Aug 08 '19 17:08 Lars3n95

It would be nice to receive an answer from the maintainer of this project

PasqualePuzio avatar Aug 08 '19 20:08 PasqualePuzio

My app users have the same bug. So far was only Samsung devices and Android 9 related. Today a Huawei user complained about the same thing. I'm also interested in some solution on this issue.

Sahistaja avatar Aug 26 '19 16:08 Sahistaja

Latest info about this issue:

"What I discovered on the previous version, and probably explains why some having issue is that if you moved from landscape to portrait the bug appeared. This version works either way round and after switching orientation :)"

Sahistaja avatar Sep 22 '19 09:09 Sahistaja

Latest info about this issue:

"What I discovered on the previous version, and probably explains why some having issue is that if you moved from landscape to portrait the bug appeared. This version works either way round and after switching orientation :)"

@Sahistaja what new version are you refering too ?

YvzDigitalLab avatar Sep 24 '19 13:09 YvzDigitalLab

@YvzDigitalLab, sorry. The "new version" is another library. It's not related to the QuadFlask colorpicker issue.

Sahistaja avatar Sep 24 '19 16:09 Sahistaja

@Sahistaja thanks for your response!

YvzDigitalLab avatar Sep 25 '19 10:09 YvzDigitalLab

Updating to 0.0.15 seems to fix this for me (at least one user says that the color wheel is showing up now). Thanks for the update!

Lars3n95 avatar Jan 04 '20 10:01 Lars3n95

Got this problem. Happens randomly. Any ideas?

Samsung A50. Android 10

eWIiUKL7JL0

UPD: FIXED. Found the cause of the problem. Occurs when trying to set the wrong color (some channel is missing)

ColorPicker code:

<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:cardElevation="12dp"
    app:cardCornerRadius="14dp">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <LinearLayout
            android:gravity="center"
            android:layout_width="match_parent"
            android:layout_height="400dp"
            android:padding="10dp">

            <com.flask.colorpicker.ColorPickerView
                android:id="@+id/color_picker_diagram"
                android:layout_gravity="center"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:alphaSlider="false"
                app:lightnessSlider="true"
                app:lightnessSliderView="@+id/color_picker_brightness"
                app:density="20"
                app:wheelType="FLOWER"/>

        </LinearLayout>

        <com.google.android.material.card.MaterialCardView
            android:id="@+id/color_slider"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:orientation="horizontal"
            app:cardElevation="12dp"
            style="@style/CardAppearance.Corners.Bottom">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingHorizontal="8dp"
                android:paddingVertical="3dp">

                <com.flask.colorpicker.slider.LightnessSlider
                    android:id="@+id/color_picker_brightness"
                    android:nestedScrollingEnabled="false"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"/>

            </LinearLayout>

        </com.google.android.material.card.MaterialCardView>

    </LinearLayout>

</com.google.android.material.card.MaterialCardView>

Including ColorPicker:

<include layout="@layout/ui_color_picker"/>

Java code:

private ColorPickerView colorPicker;
private LightnessSlider colorPickerSlider;

    @SuppressLint("ClickableViewAccessibility")
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.tab_effects, container, false);

        colorPicker                         = view.findViewById(R.id.color_picker_diagram);
        colorPickerSlider                   = view.findViewById(R.id.color_picker_brightness);

        colorPicker.setColor(Color.WHITE, false);

        colorPicker.addOnColorChangedListener(selectedColor -> {
            String hexColor = String.format("#%06X", (0xFFFFFF & selectedColor));
            int red = Color.red(selectedColor);
            int green = Color.green(selectedColor);
            int blue = Color.blue(selectedColor);
            Log.d(TAG, "onColorChanged: " + hexColor + " R:" + red + " G:" + green + " B:" + blue);
            Bundle result = new Bundle();
            if (DeviceControlFragment.canWrite) {
                result.putInt("color", selectedColor);
                getParentFragmentManager().setFragmentResult("getColor", result);
            }
        });

        return view;
    }

ELIX1337 avatar Oct 26 '20 13:10 ELIX1337

And you are using version 0.0.15?

Lars3n95 avatar Oct 28 '20 12:10 Lars3n95

And you are using version 0.0.15?

Yep

ELIX1337 avatar Oct 29 '20 11:10 ELIX1337

Found the possible cause of the bug. It occurs after I try to set the color for wheel

ELIX1337 avatar Nov 09 '20 06:11 ELIX1337

Found the cause of the problem. Occurs when trying to set the wrong color (some channel is missing)

ELIX1337 avatar Nov 10 '20 07:11 ELIX1337