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

Shape包下的ViewGroup控件padding处理有问题 #188

Closed
t894924815 opened this issue May 5, 2021 · 2 comments
Closed

Shape包下的ViewGroup控件padding处理有问题 #188

t894924815 opened this issue May 5, 2021 · 2 comments

Comments

@t894924815
Copy link

t894924815 commented May 5, 2021

当第一次调用ShapeLinearLayout内TextView的setText()方法时ShapeLinearlayout会横向或纵向动一下(取决于子view横向或纵向的长度是否是wrap_content的)
ShapeRelativelayout同样会有这个问题, 其他ViewGroup尚未测试, debug了一下猜测应该是ShadowHelper中的setShadowWidthAndContentPadding()中setPadding()未及时生效造成的, 我加在targetView?.post里就没这个问题了

img cut

测试布局:

<com.allen.library.shape.ShapeLinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="11dp"
        android:layout_marginTop="25dp"
        android:layout_marginEnd="11dp"
        android:orientation="vertical"
        app:shadowBottomWidth="6dp"
        android:paddingBottom="6dp"
        android:paddingTop="3dp"
        app:shadowColor="#0c000000"
        app:shadowCornersRadius="10dp"
        app:shadowLeftWidth="5dp"
        app:shadowRightWidth="5dp"
        app:shadowTopWidth="3dp"
        app:showShadow="true">
        <com.allen.library.SuperTextView
            android:id="@+id/supertext"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_gravity="center"
            app:sLeftIconHeight="20dp"
            app:sLeftIconMarginLeft="17dp"
            app:sLeftIconRes="@drawable/ic_user_security"
            app:sLeftIconWidth="20dp"
            app:sLeftTextColor="#1a1a1a"
            app:sLeftTextSize="15sp"
            app:sLeftTextString="左侧文本"
            app:sLeftViewMarginLeft="17dp"
            app:sRightIconMarginRight="16dp"
            app:sRightIconRes="@drawable/ic_list_item_enter"
            app:sShapeSolidColor="#FFFFFF"
            app:sUseShape="true"/>
    </com.allen.library.shape.ShapeLinearLayout>
@t894924815
Copy link
Author

补充:这个问题只在ShapeLinealayout开启sUseShape时也就是启用ShadowHelper时会出现

@lygttpod
Copy link
Owner

已修复 请使用新版V2.4.6

V2.4.6升级日志

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