{"id":13390521,"url":"https://github.com/mdgspace/RotatingText","last_synced_at":"2025-03-13T15:32:06.902Z","repository":{"id":54821094,"uuid":"89948584","full_name":"mdgspace/RotatingText","owner":"mdgspace","description":"A periodic text updating library","archived":false,"fork":false,"pushed_at":"2020-07-11T09:31:06.000Z","size":5190,"stargazers_count":1585,"open_issues_count":12,"forks_count":169,"subscribers_count":26,"default_branch":"master","last_synced_at":"2024-07-30T14:17:43.763Z","etag":null,"topics":["android","android-library","textview"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdgspace.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-01T18:02:29.000Z","updated_at":"2024-07-26T17:48:50.000Z","dependencies_parsed_at":"2022-08-14T03:50:34.210Z","dependency_job_id":null,"html_url":"https://github.com/mdgspace/RotatingText","commit_stats":null,"previous_names":["mdg-iitr/rotatingtext","sdsmdg/rotatingtext"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdgspace%2FRotatingText","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdgspace%2FRotatingText/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdgspace%2FRotatingText/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdgspace%2FRotatingText/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdgspace","download_url":"https://codeload.github.com/mdgspace/RotatingText/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221380077,"owners_count":16809015,"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":["android","android-library","textview"],"created_at":"2024-07-30T14:01:07.615Z","updated_at":"2024-10-25T03:30:42.303Z","avatar_url":"https://github.com/mdgspace.png","language":"Java","readme":"\u003cdiv align=\"center\"\u003e\u003cimg src=\"/screens/gif_cover.gif\"/\u003e\u003c/div\u003e\n\n# RotatingText\n[![platform](https://img.shields.io/badge/Platform-Android-yellow.svg?style=flat-square)](https://www.android.com)\n[![API](https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=flat-square)](https://android-arsenal.com/api?level=16s)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)\n[![By-MDG](https://img.shields.io/badge/By-MDG-orange.svg?style=flat-square)](http://mdg.iitr.ac.in)\n\nRotating text is an Android library that can be used to make text switching painless and beautiful, with the use of interpolators, typefaces and more customisations.\n\n# Usage\nJust add the following dependency in your app's `build.gradle`\n```\ndependencies {\n      compile 'com.sdsmdg.harjot:rotatingtext:1.0.2'\n}\n```\n\n## Example Usage 1 (Simple)\n#### XML\n\n```\n\u003ccom.sdsmdg.harjot.rotatingtext.RotatingTextWrapper\n        android:id=\"@+id/custom_switcher\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\" /\u003e\n```\n\n#### Java\n\n```\nRotatingTextWrapper rotatingTextWrapper = (RotatingTextWrapper) findViewById(R.id.custom_switcher);\nrotatingTextWrapper.setSize(35);\n\nRotatable rotatable = new Rotatable(Color.parseColor(\"#FFA036\"), 1000, \"Word\", \"Word01\", \"Word02\");\nrotatable.setSize(35);\nrotatable.setAnimationDuration(500);\n\nrotatingTextWrapper.setContent(\"This is ?\", rotatable);\n```\n\n#### Result\n\u003cimg src=\"/screens/gif_example_1.gif\"/\u003e\n\n## Example Usage 2 (Typeface + Interpolator)\n#### XML\n\n```\n\u003ccom.sdsmdg.harjot.rotatingtext.RotatingTextWrapper\n        android:id=\"@+id/custom_switcher\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\" /\u003e\n```\n\n#### Java\n\n```\nTypeface typeface = Typeface.createFromAsset(getAssets(), \"fonts/Raleway-Light.ttf\");\nTypeface typeface2 = Typeface.createFromAsset(getAssets(), \"fonts/Reckoner_Bold.ttf\");\n\nRotatingTextWrapper rotatingTextWrapper = (RotatingTextWrapper) findViewById(R.id.custom_switcher);\nrotatingTextWrapper.setSize(35);\nrotatingTextWrapper.setTypeface(typeface2);\n\nRotatable rotatable = new Rotatable(Color.parseColor(\"#FFA036\"), 1000, \"Word\", \"Word01\", \"Word02\");\nrotatable.setSize(35);\nrotatable.setAnimationDuration(500);\nrotatable.setTypeface(typeface);\nrotatable.setInterpolator(new BounceInterpolator());\n\nrotatingTextWrapper.setContent(\"This is ?\", rotatable);\n```\n\n#### Result\n\u003cimg src=\"/screens/gif_example_2.gif\"/\u003e\n\n## Example Usage 3 (Multiple Rotatables)\n#### XML\n\n```\n\u003ccom.sdsmdg.harjot.rotatingtext.RotatingTextWrapper\n        android:id=\"@+id/custom_switcher\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\" /\u003e\n```\n\n#### Java\n\n```\nTypeface typeface = Typeface.createFromAsset(getAssets(), \"fonts/Raleway-Light.ttf\");\nTypeface typeface2 = Typeface.createFromAsset(getAssets(), \"fonts/Reckoner_Bold.ttf\");\n\nRotatingTextWrapper rotatingTextWrapper = (RotatingTextWrapper) findViewById(R.id.custom_switcher);\nrotatingTextWrapper.setSize(35);\nrotatingTextWrapper.setTypeface(typeface2);\n\nRotatable rotatable = new Rotatable(Color.parseColor(\"#FFA036\"), 1000, \"Word\", \"Word01\", \"Word02\");\nrotatable.setSize(35);\nrotatable.setTypeface(typeface);\nrotatable.setInterpolator(new AccelerateInterpolator());\nrotatable.setAnimationDuration(500);\n\nRotatable rotatable2 = new Rotatable(Color.parseColor(\"#123456\"), 1000, \"Word03\", \"Word04\", \"Word05\");\nrotatable2.setSize(25);\nrotatable2.setTypeface(typeface);\nrotatable2.setInterpolator(new DecelerateInterpolator());\nrotatable2.setAnimationDuration(500);\n\nrotatingTextWrapper.setContent(\"This is ? and ?\", rotatable, rotatable2);\n```\n\n#### Result\n\u003cimg src=\"/screens/gif_example_3.gif\"/\u003e\n\n# Documentation\n\nRotating text is made of two parts : `RotatingTextWrapper` and `Rotatable`. \u003cbr\u003e\nEach rotatable encapsulates the collection of words that are two be periodically switched and also defines various properties related to these words, like, size, color, animation interpolator etc.\u003cbr\u003e\nEach Rotatable must be a part of a `RotatingTextWrapper`. This defines the actual layout of the text and the positions of the rotating text.\n\nFor eg : `rotatingTextWrapper.setContent(\"This is ?\", rotatble);`. Here the `?` denotes the postion of the `rotatable`.\n\n## RotatingTextWrapper\n|Property         |Function                |Description                             |\n|-----------------|------------------------|----------------------------------------|\n|Content               | setContent(...)                    | Set the actual content. Composed of a String and array of Rotatables. |\n|Typeface              | setTypeface(...)                   | Set the typeface of the non-rotating text                     |\n|Size                  | setSize(...)                       | Set the size of the non-rotating text                         |\n|Pause                 | pause(x)                           | Method to pause the 'x'th rotatable                           |\n|Resume                | resume(x)                          | Method to resume the 'x'th rotatable                          |\n\n## Rotatable\n|Property         |Function                |Description                             |\n|-----------------|------------------------|----------------------------------------|\n|Color                 | setColor(...)                      | Set the color of the rotating text associated with this rotatable     |\n|Size                  | setSize(...)                       | Set the size of the rotating text associated with this rotatable      |\n|Typeface              | setTypeface(...)                   | Set the typeface of the rotating text associated with this rotatable  |\n|Interpolator          | setInterpolator(...)               | Set the animation interpolator used while switching text              |\n|Update Duration       | setUpdateDuration(...)             | Set the interval between switching the words                          |\n|Animation Duration    | setAnimationDuration(...)          | Set the duration of the switching animation                           |\n|Center Align          | setCenter(...)                     |Align the rotating text to center of the textview if set to **true**   |\n\n\n# License\nRotatingText is licensed under `MIT license`. View [license](LICENSE.md).\n","funding_links":[],"categories":["Index `(light-weight pages)`","TextView","Index"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdgspace%2FRotatingText","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdgspace%2FRotatingText","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdgspace%2FRotatingText/lists"}