# FlycoTabLayout **Repository Path**: HarmonyOS-tpc/FlycoTabLayout ## Basic Information - **Project Name**: FlycoTabLayout - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 4 - **Forks**: 1 - **Created**: 2021-04-01 - **Last Updated**: 2023-04-17 ## Categories & Tags **Categories**: harmony **Tags**: None ## README # FlycoTabLayout #### ## USED: ``` dependencies{ implementation 'io.openharmony.tpc.thirdlib:FlycoTabLayout:1.0.2' } ``` * SlidingTabLayout * new added attribute * new added kinds of indicators * new added unread msg tip * new added method for convenience ```java /** no need to set titles in adapter */ public void setViewPager(ViewPager vp, String[] titles) ``` * CommonTabLayout * support kinds of indicators and indicator animation * support unread msg tip * support icon and icon gravity. * new added method for convenience ```java /** setTabTitle */ public void setTabData(ArrayList tabEntitys) /** support PageSlider refresh itself */ public void setViewPager(PageSlider viewPager) ``` * SegmentTabLayout like CommonTabLayout 接口说明: public void setTabData(ArrayList tabEntitys) 接口功能:添加item 输入参数:items 输出参数:无 返回值:无 public void notifyDataSetChanged() 接口功能:更新数据 输入参数:无 输出参数:无 返回值:无 public void setCurrentTab(int currentTab) 接口功能:选择item 输入参数:item序号 输出参数:无 返回值:无返回值:无 public public void showMsg(int position, int num) 接口功能:显示item提示信息 输入参数:item编号,信息数 输出参数:无 返回值:无 public void showDot(int position) 接口功能:显示提示 输入参数:提示item编号 输出参数:无 返回值:无 public void setMsgMargin(int position, float leftPadding, float bottomPadding) 接口功能:设置提示信息偏移量 输入参数:提示item编号,左偏移,底部偏移 输出参数:无 返回值:无 public void setOnTabSelectListener(OnTabSelectListener listener) 接口功能:设置选择监听 输入参数:监听器 输出参数:无 返回值:无 ## AttrSet |name|format|description| |:---:|:---:|:---:| | tl_indicator_color | color |set indicator color | tl_indicator_height | dimension |set indicator height | tl_indicator_width | dimension |set indicator width | tl_indicator_margin_left | dimension |set indicator margin,invalid when indicator width is greater than 0. | tl_indicator_margin_top | dimension |set indicator margin,invalid when indicator width is greater than 0. | tl_indicator_margin_right | dimension |set indicator margin,invalid when indicator width is greater than 0. | tl_indicator_margin_bottom | dimension |set indicator margin,invalid when indicator width is greater than 0. | tl_indicator_corner_radius | dimension |set indicator corner radius | tl_indicator_gravity | enum |set indicator gravity TOP or BOTTOM. | tl_indicator_style | enum |set indicator style NORMAL or TRIANGLE or BLOCK | tl_underline_color | color |set underline color | tl_underline_height | dimension |set underline height | tl_underline_gravity | enum |set underline gravity TOP or BOTTOM | tl_divider_color | color |set divider color | tl_divider_width | dimension |set divider width | tl_divider_padding |dimension| set divider paddingTop and paddingBottom | tl_tab_padding |dimension| set tab paddingLeft and paddingRight | tl_tab_space_equal |boolean| set tab space equal | tl_tab_width |dimension| set tab width | tl_textsize |dimension| set text size | tl_textSelectColor |color| set text select color | tl_textUnselectColor |color| set text unselect color | tl_textBold |boolean| set text is bold | tl_iconWidth |dimension| set icon width(only for CommonTabLayout) | tl_iconHeight |dimension|set icon height(only for CommonTabLayout) | tl_iconVisible |boolean| set icon is visible(only for CommonTabLayout) | tl_iconGravity |enum| set icon gravity LEFT or TOP or RIGHT or BOTTOM(only for CommonTabLayout) | tl_iconMargin |dimension| set icon margin with text(only for CommonTabLayout) | tl_indicator_anim_enable |boolean| set indicator support animation(only for CommonTabLayout) | tl_indicator_anim_duration |integer| set indicator animation duration(only for CommonTabLayout) | tl_indicator_bounce_enable |boolean| set indicator aniamtion with bounce effect(only for CommonTabLayout) | tl_indicator_width_equal_title |boolean| set indicator width same as text(only for SlidingTabLayout)