skydoves / ColorPickerPreference

🎨 A library that lets you implement ColorPicker, ColorPickerDialog, ColorPickerPreference.
Apache License 2.0
480 stars 51 forks source link

holder.findViewById(R.id.preference_colorBox) must not be null #32

Open luckyzyx opened 2 years ago

luckyzyx commented 2 years ago

Please complete the following information:

Describe the Bug:

        preferenceScreen = preferenceManager.createPreferenceScreen(requireActivity()).apply {
            addPreference(
                ColorPickerPreference(requireActivity()).apply {
                    setTitle("ColorPicker")
                    setSummary("summer")
                    key = "color_picker_test"
                    isIconSpaceReserved = false
                }
            )
        }

Adding Preference after importing will crash when the ColorPickerPreference is displayed, and the crash information preference_colorBox is null.