Qihoo360 / RePlugin

RePlugin - A flexible, stable, easy-to-use Android Plug-in Framework
Apache License 2.0
7.25k stars 1.52k forks source link

发现一个致命错误 #1042

Closed ANewAnonymous closed 1 year ago

ANewAnonymous commented 2 years ago

问题详细描述 Detailed description of the problem

在插件项目的某个布局中,有两个紧挨着的TextView,将它们其中一个TextView设置textSize大小为16sp,另一个不设置大小,在插件打包和调试过程中显示正常,当作为内置插件提供给宿主app时,未设置字体大小的TextView字体大小变的非常大,使用Layout Insptctor查看结果为22sp。

复现问题步骤 Steps to reproduce the problem

插件调试过程

插件代码及图片

布局代码:
1661743332666

<LinearLayout android:layout_width="match_parent" android:layout_height="@dimen/dp_40" android:layout_marginTop="@dimen/dp_15" android:gravity="center" android:orientation="horizontal">

            <FrameLayout
                android:id="@+id/fl_check"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:contentDescription="TODO" android:src="@mipmap/ic_login_check" />

                <ImageView
                    android:id="@+id/iv_check"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_marginLeft="@dimen/dp_1"
                    android:layout_marginBottom="@dimen/dp_3"
                    android:contentDescription="TODO" android:src="@mipmap/ic_login_check1" />
            </FrameLayout>

            <TextView
                android:layout_marginLeft="@dimen/dp_2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/Privacy_Policy_isRead2" />

            <TextView
                android:id="@+id/tv_Privacy"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text=" Privacy Policy"
                android:textSize="16sp"
                android:textColor="@color/color_444444" />

        </LinearLayout>
插件直接调试显示正常
1661743265151
插件直接调试显示正常,使用Layout Insptctor查看布局字体大小
1661743296138 1661743311450

把插件apk作为内置插件放到宿主包中调试过程

宿主包调试过程

宿主显示效果

1661744899367

宿主直接调试显示不正常,使用Layout Insptctor查看布局字体大小

1661744917516

宿主直接调试显示正常,使用Layout Insptctor查看布局字体大小

1661744930067

其它重要信息 Other important information

replugin-host: replugin-plugin-gradle version:2.3.4 replugin-host-lib version:2.3.4 Android Gradle Plugin Version:3.3.3 Gradle Version:4.10.1

replugin-plugin: replugin-plugin-gradle version:2.3.4 replugin-plugin-lib version:2.3.4 Android Gradle Plugin Version:3.3.3 Gradle Version:4.10.1