{"id":19943158,"url":"https://github.com/cats-oss/android-tab-animation","last_synced_at":"2025-08-03T19:08:25.583Z","repository":{"id":54227887,"uuid":"209016585","full_name":"cats-oss/android-tab-animation","owner":"cats-oss","description":"Easily create TabLayout.Tab animations that sync with the scrolling progress of ViewPager","archived":false,"fork":false,"pushed_at":"2021-03-02T10:29:02.000Z","size":2225,"stargazers_count":105,"open_issues_count":8,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-03T15:37:57.191Z","etag":null,"topics":["android","animation","tablayout","viewpager","viewpager2"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cats-oss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-17T09:44:22.000Z","updated_at":"2025-03-04T01:56:44.000Z","dependencies_parsed_at":"2022-08-13T09:40:33.092Z","dependency_job_id":null,"html_url":"https://github.com/cats-oss/android-tab-animation","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/cats-oss/android-tab-animation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cats-oss%2Fandroid-tab-animation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cats-oss%2Fandroid-tab-animation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cats-oss%2Fandroid-tab-animation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cats-oss%2Fandroid-tab-animation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cats-oss","download_url":"https://codeload.github.com/cats-oss/android-tab-animation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cats-oss%2Fandroid-tab-animation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268597218,"owners_count":24276004,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["android","animation","tablayout","viewpager","viewpager2"],"created_at":"2024-11-13T00:15:35.258Z","updated_at":"2025-08-03T19:08:25.528Z","avatar_url":"https://github.com/cats-oss.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tab Animation\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Release](https://img.shields.io/maven-central/v/jp.co.cyberagent.android/tab-animation)](https://search.maven.org/artifact/jp.co.cyberagent.android/tab-animation/)\n![CI](https://github.com/cats-oss//android-tab-animation/workflows/Android%20CI/badge.svg)\n\nEasily create `TabLayout.Tab` animations that sync with the scrolling progress of `ViewPager`.\n\n## Features\n\n- Animate Tab when scrolling ViewPager\n- Animate Tab after selected/unselected\n- Support ViewPager and ViewPager2\n- Create animations with DSL\n\n## Demo\n\n|[Tab](sample/src/main/java/jp/co/cyberagent/android/tabanimationsample/TextTabActivity.kt)|[Indicator](sample/src/main/java/jp/co/cyberagent/android/tabanimationsample/IndicatorActivity.kt)|[Bottom Navigation](sample/src/main/java/jp/co/cyberagent/android/tabanimationsample/BottomNavigationActivity.kt)|\n|-|-|-|\n|\u003cimg src=art/demo_tab.gif width=600 /\u003e|\u003cimg src=art/demo_indicator.gif width=600 /\u003e|\u003cimg src=art/demo_bottom_navigation.gif width=600 /\u003e|\n\n## Usage\n\n### Gradle\n\n```gradle\nimplementation 'jp.co.cyberagent.android:tab-animation:x.y.z'\n\n```\n\n### Step 1\n\nCreate animation info for Tab:\n\n```kotlin\nval animationInfo = viewIdAnimationInfo {\n  animateText\u003cFloat\u003e {\n    property(View.SCALE_X)\n    startValue(0.8f)\n    endValue(1f)\n  }\n  animateText\u003cFloat\u003e {\n    property(View.SCALE_Y)\n    startValue(0.8f)\n    endValue(1f)\n  }\n}\n```\n\n### Step 2\n\nLink the TabLayout, ViewPager and animation info:\n\n```kotlin\n// TabLayout extension function\ntabLayout.setupAnimationTabWithViewPager(\n  viewPager,\n  animationInfo,\n  SimpleTab.TEXT\n)\n```\n\n## Advanced Usage\n\n### Custom tab view\n\nProvide the layout file id instead of SimpleTab:\n\n```kotlin\ntabLayout.setupAnimationTabWithViewPager(\n  viewPager,\n  animationInfo,\n  R.layout.my_custom_tab\n) { tab, view, position -\u003e\n  // bind data here\n}\n```\n\n### Custom animate target\n\nSpecify the target id in viewIdAnimationInfo:\n\n```kotlin\nviewIdAnimationInfo {\n  animate\u003cMyView, Float\u003e(R.id.my_view) {\n    ...\n  }\n}\n```\n\n### Custom property\n\n```kotlin\n// Create tint property\nanimateIcon\u003cColorStateList\u003e {\n  property(\n    getter = { ImageViewCompat.getImageTintList(this)!! },\n    setter = { ImageViewCompat.setImageTintList(this, it) }\n  )\n  ...\n}\n```\n\n### Custom evaluator\n\nCurrent support property types:\n- Int (ARGB)\n- Float\n- IntArray\n- FloatArray\n- PointF\n- Rect\n- ColorStateList\n\nYou must specify the evaluator if the property type you want to animate is not listed:\n\n```kotlin\nanimate\u003cMyView, MyType\u003e {\n  evaluator(MyEvaluator)\n  ...\n}\n```\n\n### Specify KeyFrames\n\n```kotlin\nanimateText\u003cFloat\u003e {\n  property(View.ALPHA)\n  startValue(0f)\n  endValue(1f)\n  keyFrame(0.8f, 0.2f)\n}\n```\n\n### Lazy value\n\nAnimation info will be evaluated after the layout of Tab.\nYou can calculate the value based on the view:\n\n```kotlin\nanimateIcon\u003cFloat\u003e {\n  property(View.TRANSLATION_X)\n  startValue { view -\u003e\n    view.width / 2f\n  }\n  endValue { 0f }\n}\n```\n\n## License\n\n    Copyright 2019 CyberAgent, Inc.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcats-oss%2Fandroid-tab-animation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcats-oss%2Fandroid-tab-animation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcats-oss%2Fandroid-tab-animation/lists"}