-
Notifications
You must be signed in to change notification settings - Fork 173
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
Exception, not working #116
Comments
It's because it can't accept a string color I think, only int. |
The problem is you must provide it in this format 0xFF9999 otherwise it will throw exception, although the preview will work. Impossible to debug it. I found it out by trial and error. Also no autocompletion in the xml for the custom attributes. |
I had to add app:cpv_showAlphaSlider="true" |
ok it works now, i'm not sure what was the problem. |
<com.jaredrummler.android.colorpicker.ColorPreferenceCompat
app:defaultValue="#FF9999"
app:key="day_speed_color_picker1"
app:summary="Choose your color"
app:title="Dial color for day theme"/>
autovolumefree E FATAL EXCEPTION: main (Ask Gemini)
Process: net.festinger.autovolumefree, PID: 14580
android.view.InflateException: Binary XML file line #19: Error inflating class com.jaredrummler.android.colorpicker.ColorPreferenceCompat
at androidx.preference.PreferenceInflater.createItem(PreferenceInflater.java:253)
at androidx.preference.PreferenceInflater.createItemFromTag(PreferenceInflater.java:281)
at androidx.preference.PreferenceInflater.rInflate(PreferenceInflater.java:349)
at androidx.preference.PreferenceInflater.rInflate(PreferenceInflater.java:351)
at androidx.preference.PreferenceInflater.inflate(PreferenceInflater.java:161)
at androidx.preference.PreferenceInflater.inflate(PreferenceInflater.java:112)
at androidx.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:217)
at androidx.preference.PreferenceFragmentCompat.setPreferencesFromResource(PreferenceFragmentCompat.java:380)
at net.festinger.autovolumefree.SettingsFragment.onCreatePreferences(SettingsFragment.kt:58)
at androidx.preference.PreferenceFragmentCompat.onCreate(PreferenceFragmentCompat.java:161)
at androidx.fragment.app.Fragment.performCreate(Fragment.java:2949)
at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:475)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:278)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8705)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at androidx.preference.PreferenceInflater.createItem(PreferenceInflater.java:246)
at androidx.preference.PreferenceInflater.createItemFromTag(PreferenceInflater.java:281)
at androidx.preference.PreferenceInflater.rInflate(PreferenceInflater.java:349)
at androidx.preference.PreferenceInflater.rInflate(PreferenceInflater.java:351)
at androidx.preference.PreferenceInflater.inflate(PreferenceInflater.java:161)
at androidx.preference.PreferenceInflater.inflate(PreferenceInflater.java:112)
at androidx.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:217)
at androidx.preference.PreferenceFragmentCompat.setPreferencesFromResource(PreferenceFragmentCompat.java:380)
at net.festinger.autovolumefree.SettingsFragment.onCreatePreferences(SettingsFragment.kt:58)
at androidx.preference.PreferenceFragmentCompat.onCreate(PreferenceFragmentCompat.java:161)
at androidx.fragment.app.Fragment.performCreate(Fragment.java:2949)
at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:475)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:278)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8705)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 18 to integer: type=0x3, theme={InheritanceMap=[id=0x7f120163net.festinger.autovolumefree:style/PreferenceThemeOverlay, id=0x7f12011fnet.festinger.autovolumefree:style/BasePreferenceThemeOverlay], Themes=[net.festinger.autovolumefree:style/PreferenceThemeOverlay, not forced, net.festinger.autovolumefree:style/Theme.AutoVolume, forced, net.festinger.autovolumefree:style/Theme.AppCompat.Empty, forced, android:style/Theme.DeviceDefault.Light.DarkActionBar, forced]}
at android.content.res.TypedArray.getInteger(TypedArray.java:652)
at com.jaredrummler.android.colorpicker.ColorPreferenceCompat.onGetDefaultValue(ColorPreferenceCompat.java:142)
at androidx.preference.Preference.(Preference.java:255)
at androidx.preference.Preference.(Preference.java:299)
at androidx.preference.Preference.(Preference.java:314)
at com.jaredrummler.android.colorpicker.ColorPreferenceCompat.(ColorPreferenceCompat.java:36)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at androidx.preference.PreferenceInflater.createItem(PreferenceInflater.java:246)
at androidx.preference.PreferenceInflater.createItemFromTag(PreferenceInflater.java:281)
at androidx.preference.PreferenceInflater.rInflate(PreferenceInflater.java:349)
at androidx.preference.PreferenceInflater.rInflate(PreferenceInflater.java:351)
at androidx.preference.PreferenceInflater.inflate(PreferenceInflater.java:161)
at androidx.preference.PreferenceInflater.inflate(PreferenceInflater.java:112)
at androidx.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:217)
at androidx.preference.PreferenceFragmentCompat.setPreferencesFromResource(PreferenceFragmentCompat.java:380)
at net.festinger.autovolumefree.SettingsFragment.onCreatePreferences(SettingsFragment.kt:58)
at androidx.preference.PreferenceFragmentCompat.onCreate(PreferenceFragmentCompat.java:161)
at androidx.fragment.app.Fragment.performCreate(Fragment.java:2949)
at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:475)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:278)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8705)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
The text was updated successfully, but these errors were encountered: