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

Color picker wheel not showing up #111

Open
PasqualePuzio opened this issue Jul 19, 2019 · 14 comments
Open

Color picker wheel not showing up #111

PasqualePuzio opened this issue Jul 19, 2019 · 14 comments

Comments

@PasqualePuzio
Copy link

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

@Lars3n95
Copy link

Lars3n95 commented Aug 8, 2019

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.

@PasqualePuzio
Copy link
Author

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

@Sahistaja
Copy link

Sahistaja commented Aug 26, 2019

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
Copy link

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 :)"

@YvzDigitalLab
Copy link

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 ?

@Sahistaja
Copy link

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

@YvzDigitalLab
Copy link

@Sahistaja thanks for your response!

@Lars3n95
Copy link

Lars3n95 commented Jan 4, 2020

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!

@ELIX1337
Copy link

ELIX1337 commented Oct 26, 2020

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;
    }

@Lars3n95
Copy link

And you are using version 0.0.15?

@ELIX1337
Copy link

And you are using version 0.0.15?

Yep

@ELIX1337
Copy link

ELIX1337 commented Nov 9, 2020

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

@ELIX1337
Copy link

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

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

6 participants
@Sahistaja @PasqualePuzio @Lars3n95 @YvzDigitalLab @ELIX1337 and others