H07000223 / FlycoTabLayout

An Android TabLayout Lib
MIT License
11.05k stars 2.42k forks source link

TAB选中项加粗状态有缺陷 #541

Open liyujiang-gzu opened 2 years ago

liyujiang-gzu commented 2 years ago

updateTabStyles()里需要加上mTextBold == TEXT_BOLD_WHEN_SELECT的情况,不然初始化后默认选中项不会加粗:

                if (mTextBold == TEXT_BOLD_BOTH) {
                    tv_tab_title.getPaint().setFakeBoldText(true);
                } else if (mTextBold == TEXT_BOLD_NONE) {
                    tv_tab_title.getPaint().setFakeBoldText(false);
                }
liyujiang-gzu commented 2 years ago

app:tl_textBold="SELECT"的情况下,默认选中的第一项未加粗:

    <com.flyco.tablayout.SlidingTabLayout
        android:id="@+id/department_main_tab"
        android:layout_width="match_parent"
        android:layout_height="@dimen/dp_42"
        app:tl_indicator_color="#FB9B97"
        app:tl_indicator_corner_radius="@dimen/dp_3"
        app:tl_indicator_gravity="BOTTOM"
        app:tl_indicator_height="@dimen/dp_3"
        app:tl_indicator_margin_bottom="@dimen/dp_5"
        app:tl_indicator_width="@dimen/dp_20"
        app:tl_indicator_width_equal_title="true"
        app:tl_tab_padding="@dimen/dp_20"
        app:tl_textBold="SELECT"
        app:tl_textSelectColor="#262525"
        app:tl_textSelectSize="@dimen/sp_14"
        app:tl_textUnselectColor="#999594"
        app:tl_textsize="@dimen/sp_14" />
liyujiang-gzu commented 2 years ago

临时修复效果:implementation 'com.github.liyujiang-gzu:FlycoTabLayout:781b8829a7'

liyujiang-gzu commented 2 years ago

@H07000223 PR #543