希望库内的view移植到AppCompat
neo-turak opened this issue · 0 comments
neo-turak commented
XPopup版本
最新版本,或者可以说任何版本。
手机系统和型号
跟手机没关系。SDK 小于23时。
描述你的问题
希望这个库内使用的view替换成对应的AppCompat版本。比如
<TextView
android:id="@+id/tv_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textColor="@color/_xpopup_title_color"
android:textSize="15sp" />
换成
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textColor="@color/_xpopup_title_color"
android:textSize="15sp" />
理由如下:
在小于23版本的机型上,通过Theme设置的字体失效,xpopup也没有提供设置自己的方法。
如果使用了AppCompatTextView会支持通过Theme设置的字体。如果是中文还好,对于阿拉伯语言体系(维语),无法正确的展示文文字。
不仅仅是这个库,谷歌的Material系TabLayout也存在这个问题(内部tabView是TextView和ImageView的组合,不是Appcompat)。
想过提交PR,感觉RTL体系的人员几乎没有。
可以的话下一个版本 用AppCompat系列。感谢XPopup.