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

Crash in AS preview and at runtime while inflating SegmentedGroup #73

Open
mschuh opened this issue Mar 17, 2017 · 1 comment
Open

Crash in AS preview and at runtime while inflating SegmentedGroup #73

mschuh opened this issue Mar 17, 2017 · 1 comment

Comments

@mschuh
Copy link

mschuh commented Mar 17, 2017

Hello.

I tried to use your library in the simplest way possible, i.e. as in the main page example:

<info.hoang8f.android.segmented.SegmentedGroup
            xmlns:segmentedgroup="http://schemas.android.com/apk/res-auto"
            android:id="@+id/segmented2"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:layout_margin="10dp"
            android:orientation="horizontal"
            android:background="@color/backgroundLight"
            segmentedgroup:sc_border_width="2dp"
            segmentedgroup:sc_corner_radius="10dp">

            <RadioButton
                android:id="@+id/button21"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="One"
                style="@style/RadioButton" />

            <RadioButton
                android:id="@+id/button22"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Two"
                style="@style/RadioButton" />
        </info.hoang8f.android.segmented.SegmentedGroup>

This is causing errors in preview and at runtime:

java.lang.ClassCastException: android.graphics.drawable.BitmapDrawable cannot be cast to android.graphics.drawable.GradientDrawable
                                                                                   at info.hoang8f.android.segmented.SegmentedGroup.updateBackground(SegmentedGroup.java:129)
                                                                                   at info.hoang8f.android.segmented.SegmentedGroup.updateBackground(SegmentedGroup.java:98)
                                                                                   at info.hoang8f.android.segmented.SegmentedGroup.onFinishInflate(SegmentedGroup.java:80)
                                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:826)
                                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:821)
                                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:821)
                                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
                                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
                                                                                   at br.skydrones.skydronescapture.view.missionplanner.SettingsFragment.onCreateView(SettingsFragment.java:68)
                                                                                   at android.support.v4.app.Fragment.performCreateView(Fragment.java:2189)
                                                                                   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1299)
                                                                                   at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
                                                                                   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
                                                                                   at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:757)
                                                                                   at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2355)
                                                                                   at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2146)
                                                                                   at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2098)
                                                                                   at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2008)
                                                                                   at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:710)
                                                                                   at android.os.Handler.handleCallback(Handler.java:739)
                                                                                   at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                   at android.os.Looper.loop(Looper.java:145)
                                                                                   at android.app.ActivityThread.main(ActivityThread.java:6126)
                                                                                   at java.lang.reflect.Method.invoke(Native Method)
                                                                                   at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
                                                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

If this is already solved in latest version why it isn't pushed to maven?
By the way, I'm using compile 'info.hoang8f:android-segmented:1.0.6' in my gradle file.

@LunevNF
Copy link

LunevNF commented Jun 19, 2019

Same problem

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