# AndroidLibrary **Repository Path**: cccss/android-library ## Basic Information - **Project Name**: AndroidLibrary - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-03-28 - **Last Updated**: 2024-03-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # AndroidLibrary #### 介绍 {**以下是 Gitee 平台说明,您可以替换此简介** Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} #### 图片指示器 implementation 'com.github.hackware1993:MagicIndicator:1.6.0' 使用方式: `` //4.创建指示器 `val commonNavigator = CommonNavigator(requireContext()) commonNavigator.isAdjustMode = true val finalPageNum = pageNum commonNavigator.adapter = object : CommonNavigatorAdapter() { override fun getCount(): Int { return finalPageNum } override fun getTitleView(context: Context, index: Int): IPagerTitleView { return DummyPagerTitleView(context) } override fun getIndicator(context: Context): IPagerIndicator { val indicator = LinePagerIndicator(context) indicator.mode = LinePagerIndicator.MODE_EXACTLY indicator.lineHeight = UIUtil.dip2px(context, 6.0).toFloat() //就是指示器的高 indicator.lineWidth = UIUtil.dip2px(context, (35 / finalPageNum).toDouble()).toFloat() //就是指示器的宽度,然后通过页数来评分 indicator.roundRadius = UIUtil.dip2px(context, 3.0).toFloat() indicator.startInterpolator = AccelerateInterpolator() indicator.endInterpolator = DecelerateInterpolator(3f) indicator.setColors(ContextCompat.getColor(context, R.color.text_blue_color)) return indicator } } //5.配置指示器,并和ViewPager产生绑定 topicIndicator.navigator = commonNavigator ViewPagerHelper.bind(topicIndicator, topicViewPager) topicIndicator.visibility = View.VISIBLE` #### tablayout [仓库地址](https://gitee.com/angcyo/DslTabLayout) 1. 布局设置 `` 2. 可以直接代码中直接addView添加title view 3. 设置回调 ` mVb.tabLayout2.configTabLayoutConfig { //选中view的回调 onSelectViewChange = { fromView, selectViewList, reselect, fromUser -> val toView = selectViewList.first() as TextView if (reselect) { //重复选择 } } //选中index的回调 onSelectIndexChange = { fromIndex, selectIndexList, reselect, fromUser -> val toIndex = selectIndexList.first() } }`