ring shapes for L preview not working

后端 未结 3 1870
忘了有多久
忘了有多久 2020-12-14 11:11

Just testing the new developer preview and noticed that my existing ring drawables are not rendering properly. Instead of a ring it\'s a full circle. Is it a bug or has some

3条回答
  •  攒了一身酷
    2020-12-14 11:37

    Just want to add some references in framework source code to confirm that useLevel is defaulted to true in Android API version < 21 (< 5.0) and defaulted to false in API version >= 21 (>= 5.0) as Christian García previously stated.

    In android-20, file GradientDrawable.java, line 820-835:

    if (shapeType == RING) {
        ....
        st.mUseLevelForShape = a.getBoolean(
                        com.android.internal.R.styleable.GradientDrawable_useLevel, true);
    }
    

    In android-21, file GradientDrawable.java, line 1028-1047:

    if (state.mShape == RING) {
        ....
        state.mUseLevelForShape = a.getBoolean(
                        R.styleable.GradientDrawable_useLevel, state.mUseLevelForShape);
    }
    

提交回复
热议问题