{"id":13643231,"url":"https://github.com/jeasonlzy/AlphaIndicatorView","last_synced_at":"2025-04-21T01:32:09.435Z","repository":{"id":122731091,"uuid":"50578970","full_name":"jeasonlzy/AlphaIndicatorView","owner":"jeasonlzy","description":"仿微信底部tab标签，滑动的时候颜色渐变，使用极其简单，只需要两行代码。","archived":false,"fork":false,"pushed_at":"2016-04-08T15:22:27.000Z","size":3619,"stargazers_count":375,"open_issues_count":5,"forks_count":94,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-09T09:08:34.557Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeasonlzy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-01-28T11:39:25.000Z","updated_at":"2025-03-27T18:45:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"b2801f9d-4f46-43ad-9935-8cc22337aa5d","html_url":"https://github.com/jeasonlzy/AlphaIndicatorView","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeasonlzy%2FAlphaIndicatorView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeasonlzy%2FAlphaIndicatorView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeasonlzy%2FAlphaIndicatorView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeasonlzy%2FAlphaIndicatorView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeasonlzy","download_url":"https://codeload.github.com/jeasonlzy/AlphaIndicatorView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249982579,"owners_count":21355724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:01:44.237Z","updated_at":"2025-04-21T01:32:08.422Z","avatar_url":"https://github.com/jeasonlzy.png","language":"Java","funding_links":[],"categories":["TabBar"],"sub_categories":[],"readme":"# AlphaIndicatorView\n### 仿微信底部tab标签，滑动的时候颜色渐变，使用极其简单，只需要两行代码。\n\n欢迎大家下载体验本项目，如果使用过程中遇到什么问题，欢迎反馈。\n\n### 联系方式\n * 邮箱地址： liaojeason@126.com\n * QQ群： 489873144 （建议使用QQ群，邮箱使用较少，可能看的不及时）\n * 本群刚建立，旨在为使用我的github项目的人提供方便，如果遇到问题欢迎在群里提问。个人能力也有限，希望一起学习一起进步。\n\n\n## 演示\n ![image](https://github.com/jeasonlzy0216/AlphaIndicatorView/blob/master/screenshots/demo1.gif)![image](https://github.com/jeasonlzy0216/AlphaIndicatorView/blob/master/screenshots/demo2.png)![image](https://github.com/jeasonlzy0216/AlphaIndicatorView/blob/master/screenshots/demo3.png)\n\n## 1.用法\n该项目和我github上其他的view相关的项目已经一起打包上传到jCenter仓库中（源码地址 [https://github.com/jeasonlzy0216/ViewCore](https://github.com/jeasonlzy0216/ViewCore) ），使用的时候可以直接使用compile依赖，用法如下\n```java\n\tcompile 'com.lzy.widget:view-core:0.1.5'\n```\n或者使用\n```java\n    compile project(':alphaview')\n```\n\n## 注意事项\n该项目可以自动判断每一个Tab中的View，是否具有图标和文字，允许出现以下三种情况：\n * 自定义属性只设置了 tabText ，表示只有文字，滑动时文字颜色渐变过度\n * 自定义属性只设置了 tabIconNormal 和 tabIconSelected ，表示只有图标，滑动时图标颜色渐变过度\n * 以上两种都设置了，表示文字和图标同时渐变过度\n\n## 功能和参数含义\n\n\u003ctable\u003e\n  \u003ctdead\u003e\n    \u003ctr\u003e\n      \u003cth align=\"center\"\u003e配置参数\u003c/th\u003e\n      \u003cth align=\"center\"\u003e参数含义\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/tdead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003etabIconNormal\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e未选中的图标\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003etabIconSelected\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e已经选中的图标\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003etabText\u003c/td\u003e\n      \u003ctd align=\"center\"\u003etab标签的文字\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003etabTextSize\u003c/td\u003e\n      \u003ctd align=\"center\"\u003etab标签的文字大小\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003etextColorNormal\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e未选中的文字颜色\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003etextColorSelected\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e已选中的文字颜色\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## 3.代码参考\n### 1.在Activity中做如下初始化，只需要找到控件并且设置ViewPager即可完成。\n```java\n\tprotected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        ViewPager viewPager = (ViewPager) findViewById(R.id.viewPager);\n        viewPager.setAdapter(new MainAdapter(getSupportFragmentManager()));\n        AlphaIndicator alphaIndicator = (AlphaIndicator) findViewById(R.id.alphaIndicator);\n        alphaIndicator.setViewPager(viewPager);\n    }\n```\n### 2.布局文件\n```xml\n\t\u003cLinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n              xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"match_parent\"\n              android:orientation=\"vertical\"\u003e\n\n    \u003candroid.support.v4.view.ViewPager\n        android:id=\"@+id/viewPager\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"0dp\"\n        android:layout_weight=\"1\"/\u003e\n\n    \u003cView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"1px\"\n        android:background=\"#888\"/\u003e\n\n    \u003ccom.lzy.widget.AlphaIndicator\n        android:id=\"@+id/alphaIndicator\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"55dp\"\n        android:orientation=\"horizontal\"\u003e\n\n        \u003ccom.lzy.widget.AlphaView\n            android:layout_width=\"0dp\"\n            android:layout_height=\"match_parent\"\n            android:layout_weight=\"1\"\n            android:padding=\"5dp\"\n            app:av_tabIconNormal=\"@mipmap/home_normal\"\n            app:av_tabIconSelected=\"@mipmap/home_selected\"\n            app:av_tabText=\"微信\"\n            app:av_tabTextSize=\"14sp\"\n            app:av_textColorNormal=\"#999999\"\n            app:av_textColorSelected=\"#46c01b\"/\u003e\n\n        \u003ccom.lzy.widget.AlphaView\n            android:layout_width=\"0dp\"\n            android:layout_height=\"match_parent\"\n            android:layout_weight=\"1\"\n            android:padding=\"5dp\"\n            app:av_tabIconNormal=\"@mipmap/category_normal\"\n            app:av_tabIconSelected=\"@mipmap/category_selected\"\n            app:av_tabText=\"通讯录\"\n            app:av_tabTextSize=\"14sp\"\n            app:av_textColorNormal=\"#999999\"\n            app:av_textColorSelected=\"#46c01b\"/\u003e\n\n        \u003ccom.lzy.widget.AlphaView\n            android:layout_width=\"0dp\"\n            android:layout_height=\"match_parent\"\n            android:layout_weight=\"1\"\n            android:padding=\"5dp\"\n            app:av_tabIconNormal=\"@mipmap/service_normal\"\n            app:av_tabIconSelected=\"@mipmap/service_selected\"\n            app:av_tabText=\"发现\"\n            app:av_tabTextSize=\"14sp\"\n            app:av_textColorNormal=\"#999999\"\n            app:av_textColorSelected=\"#46c01b\"/\u003e\n\n        \u003ccom.lzy.widget.AlphaView\n            android:layout_width=\"0dp\"\n            android:layout_height=\"match_parent\"\n            android:layout_weight=\"1\"\n            android:padding=\"5dp\"\n            app:av_tabIconNormal=\"@mipmap/mine_normal\"\n            app:av_tabIconSelected=\"@mipmap/mine_selected\"\n            app:av_tabText=\"我\"\n            app:av_tabTextSize=\"14sp\"\n            app:av_textColorNormal=\"#999999\"\n            app:av_textColorSelected=\"#46c01b\"/\u003e\n    \u003c/com.lzy.widget.AlphaIndicator\u003e\n\u003c/LinearLayout\u003e\n\t\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeasonlzy%2FAlphaIndicatorView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeasonlzy%2FAlphaIndicatorView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeasonlzy%2FAlphaIndicatorView/lists"}