{"id":13607739,"url":"https://github.com/YvesCheung/RollingText","last_synced_at":"2025-04-12T14:31:10.099Z","repository":{"id":37735961,"uuid":"123271070","full_name":"YvesCheung/RollingText","owner":"YvesCheung","description":"Android TextView with rolling animation","archived":false,"fork":false,"pushed_at":"2023-09-05T08:22:38.000Z","size":2603,"stargazers_count":929,"open_issues_count":11,"forks_count":80,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-07T13:37:28.065Z","etag":null,"topics":["animation","number","rollingtextview","scrollingtextview"],"latest_commit_sha":null,"homepage":"","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/YvesCheung.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-28T10:45:12.000Z","updated_at":"2024-11-05T09:21:33.000Z","dependencies_parsed_at":"2024-01-16T23:30:42.096Z","dependency_job_id":"0d42f0bc-0def-479c-a954-7e6e5d7abb9e","html_url":"https://github.com/YvesCheung/RollingText","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YvesCheung%2FRollingText","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YvesCheung%2FRollingText/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YvesCheung%2FRollingText/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YvesCheung%2FRollingText/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YvesCheung","download_url":"https://codeload.github.com/YvesCheung/RollingText/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248581085,"owners_count":21128099,"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":["animation","number","rollingtextview","scrollingtextview"],"created_at":"2024-08-01T19:01:21.155Z","updated_at":"2025-04-12T14:31:08.670Z","avatar_url":"https://github.com/YvesCheung.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# RollingTextView\n\n---\n\n![preview][1]\n\n[![](https://jitpack.io/v/YvesCheung/RollingText.svg)](https://jitpack.io/#YvesCheung/RollingText)\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.yvescheung/RollingText.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.yvescheung%22%20AND%20a:%RollingText%22)\n\n[中文版README](README_CN.md)\n\nFeatures\n========\n\n- easy to use, API is similar to TextView, and the setText method can be animated with up and down rolling\n\n- support XML to set up common properties such as android:textSize/ android:textColor/ android:textStyle\n\n- highly customizable to support animation effects of any single character\n\nAnimation\n========\n\n### Strategy\n\nDifferent rolling effects can be achieved by setting different animation strategies\n\n\u003e The default animation is to roll down when small characters change to large characters, and vice versa.\n\u003e\n\u003e You can also specify that rolling to the same direction\n\u003e\n\u003e The carry animation can be worked from low digit to high digit, not only for decimal. But it can only be used for strings with a length less than 10 to prevent integer from overflow. It can only be used for a sequence of characters containing 0, otherwise the calculation of the carry will be meaningless.\n\n![StrategyCompare][2]\n\n### The order of characters\n\n- The sequence of characters needs to be set up to tell ``RollingTextView`` how to change from the original character to the target character\n- The common sequence of characters can be found in the ``CharOrder`` constant class\n- When multiple orders are added and all are applicable to the target character and the original character, the precedence of the previous setting will be higher\n\n```java\nalphaBetView.addCharOrder(CharOrder.Alphabet);\nalphaBetView.addCharOrder(CharOrder.UpperAlphabet);\nalphaBetView.addCharOrder(CharOrder.Number);\nalphaBetView.addCharOrder(CharOrder.Hex);\nalphaBetView.addCharOrder(CharOrder.Binary);\n```\n\n![charOrderCompare][3]\n\n### Rolling fluency\n\n\u003e The fluency of the animation can be adjusted by passing a ``factor`` parameter. The closer the ``factor`` value is to 0, the rolling will appear to be more hopping. And the closer the ``factor`` value is to 1, the more smooth the rolling is.\n\n![stickyFactor][4]\n\n### other\n\nMore ideas can be implemented on the ``CharOrderStrategy`` interface to customize your own animation effects\n\nDownload\n========\n\n```groovy\nallprojects {\n    repositories {\n        maven { url 'https://jitpack.io' }\n    }\n}\n\ndependencies {  \n    implementation \"com.github.YvesCheung.RollingText:RollingText:x.y.z\"\n}\n```\n    \n\u003e x.y.z replace with [![](https://jitpack.io/v/YvesCheung/RollingText.svg)](https://jitpack.io/#YvesCheung/RollingText)\n\nUsage\n=========\n\n### XML settings\n\n```xml\n\u003ccom.yy.mobile.rollingtextview.RollingTextView\n    android:id=\"@+id/alphaBetView\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    android:text=\"i am text\"\n    android:textSize=\"25sp\" \n    android:textColor=\"#1d1d1d\"\n    android:textStyle=\"bold\"\n    android:gravity=\"center\"\n    android:shadowColor=\"#ff44ffdd\"\n    android:shadowDx=\"10\"\n    android:shadowDy=\"10\"\n    android:shadowRadius=\"10\"/\u003e\n```\n\n### write in java code\n\n```java\nfinal RollingTextView rollingTextView = findViewById(R.id.alphaBetView);\nrollingTextView.setAnimationDuration(2000L);\nrollingTextView.setCharStrategy(Strategy.NormalAnimation);\nrollingTextView.addCharOrder(CharOrder.Alphabet);\nrollingTextView.setAnimationInterpolator(new AccelerateDecelerateInterpolator());\nrollingTextView.addAnimatorListener(new AnimatorListenerAdapter() {\n    @Override\n    public void onAnimationEnd(Animator animation) {\n        //finsih\n    }\n});\nrollingTextView.setText(\"i am a text\");\n```\n\nDebug\n========\n\nUsing [Uinspector](https://github.com/YvesCheung/UInspector), You can debug the properties of `RollingTextView`:\n\n![debug preview](https://raw.githubusercontent.com/YvesCheung/RollingText/master/rollingtextviewinspector/debug.gif)\n\nAdd `Uinspector` to your `build.gradle`:\n\n```groovy\ndependencies {\n    // debugImplementation because Inspector should only run in debug builds.\n    debugImplementation \"com.github.YvesCheung.RollingText:RollingTextInspector:x.y.z\"\n}\n```\n\nLicense\n========\n\n\tCopyright 2018 Yves Cheung\n\t\n   \tLicensed under the Apache License, Version 2.0 (the \"License\");\n   \tyou may not use this file except in compliance with the License.\n   \tYou may obtain a copy of the License at\n\n       \thttp://www.apache.org/licenses/LICENSE-2.0\n\n   \tUnless required by applicable law or agreed to in writing, software\n   \tdistributed under the License is distributed on an \"AS IS\" BASIS,\n   \tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   \tSee the License for the specific language governing permissions and\n   \tlimitations under the License.\n\n\n  [1]: https://raw.githubusercontent.com/YvesCheung/RollingText/master/ezgif.com-optimize.gif\n  [2]: https://raw.githubusercontent.com/YvesCheung/RollingText/master/StrategyCompare.gif\n  [3]: https://raw.githubusercontent.com/YvesCheung/RollingText/master/charOrderCompare.gif\n  [4]: https://raw.githubusercontent.com/YvesCheung/RollingText/master/stickyFactor.gif\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYvesCheung%2FRollingText","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYvesCheung%2FRollingText","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYvesCheung%2FRollingText/lists"}