{"id":13643405,"url":"https://github.com/SumiMakito/AdvancedTextSwitcher","last_synced_at":"2025-04-21T01:32:32.274Z","repository":{"id":29097665,"uuid":"32626947","full_name":"sumimakito/AdvancedTextSwitcher","owner":"sumimakito","description":"Advanced TextSwitcher for faster development.","archived":false,"fork":false,"pushed_at":"2017-06-29T08:21:38.000Z","size":2348,"stargazers_count":245,"open_issues_count":1,"forks_count":36,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-01T01:01:40.265Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/sumimakito.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":"2015-03-21T09:35:32.000Z","updated_at":"2024-08-27T14:43:33.000Z","dependencies_parsed_at":"2022-09-06T00:03:25.297Z","dependency_job_id":null,"html_url":"https://github.com/sumimakito/AdvancedTextSwitcher","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumimakito%2FAdvancedTextSwitcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumimakito%2FAdvancedTextSwitcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumimakito%2FAdvancedTextSwitcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumimakito%2FAdvancedTextSwitcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sumimakito","download_url":"https://codeload.github.com/sumimakito/AdvancedTextSwitcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249982624,"owners_count":21355735,"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:47.002Z","updated_at":"2025-04-21T01:32:30.556Z","avatar_url":"https://github.com/sumimakito.png","language":"Java","readme":"# AdvancedTextSwitcher\n\nAdvanced TextSwitcher for faster development.\n\nJust like the way how Google+ display recent reviews on their cards.\n\n仿照Google+在卡片上滚动显示最新评论的TextSwitcher。\n\n### Preview 预览\n\n![Snapshot](art/snapshot.gif)\n\n[Watch Preview on Youtube](https://youtu.be/6RBXKVVwF7I)\n\n### Add to your project 添加到你的项目\n\nAdd JitPack repository to build.gradle in project root.\n\n在项目根目录下的build.gradle中加入以下内容\n\n```\nallprojects {\n\trepositories {\n\t\t...\n\t\tmaven { url \"https://jitpack.io\" }\n\t}\n}\n```\n\nAdd the dependency to build.gradle in app root.\n\n在应用目录下的build.gradle中加入以下依赖\n\n```\ndependencies {\n        compile 'com.github.SumiMakito:AdvancedTextSwitcher:0.3'\n}\n```\n\nYou can also add this project as a library to your project directly.(NOT recommended)\n\n### Usage 使用说明\n\n##### Import 导入\n\n```java\nimport sumimakito.android.advtextswitcher.*;\n```\n\n##### Add Widget in XML 在XML中加入控件\n\n```xml\n\u003csumimakito.android.advtextswitcher.AdvTextSwitcher\n\t\txmlns:app=\"http://schemas.android.com/apk/res/sumimakito.android.advtextswitcher\"\n\t\tandroid:id=\"@+id/advTextSwitcher\"\n\t\tandroid:textColor=\"#66BCBB\"\n\t\tandroid:layout_width=\"match_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tapp:textSize=\"32sp\"\n\t\tapp:gravity=\"center\"\n\t\tapp:inAnim=\"@android:anim/slide_in_left\"\n\t\tapp:outAnim=\"@android:anim/slide_out_right\" /\u003e\n```\n\n###### Attributes 属性\n\n+ xmlns:app (Don't forget to copy the xmlns:app line.)\n+ android:textColor Text color.\n+ app:textSize Text size.\n+ app:gravity Gravity for each text.(Only support center/left/right, CENTER_VERTICAL is automatically applied.)\n+ app:inAnim/outAnim (Optional) Specify anim resources.\n\n##### Attach AdvTextSwitcher in Java 在Java代码中调用\n\n```java\n    //For example, the String array below contains four recent reviews.\n    String[] texts = {\"Anne: Great!\", \"Cathy: I do not think so.\", \"Jimmy: Cloning your repo...\", \"Aoi: This bug disappeared!\"};\n    advTextSwitcher = (AdvTextSwitcher) findViewById(R.id.advTextSwitcher);\n    //Give them to AdvTextSwitcher\n    advTextSwitcher.setTexts(texts);\n    //Manually switch to the next text in the String array.\n    advTextSwitcher.next();\n    //Switch to the previous one.\n    advTextSwitcher.previous();\n\n    //Auto switch between texts every 5000ms.\n    Switcher switcher = new Switcher(advTextSwitcher, 5000);\n    switcher.start();\n    //Pause\n    switcher.pause();\n    //Or use switcher in only one line...\n    new Switcher().attach(advTextSwitcher).setDuration(5000).start();\n\n    //Want to know which text is clicked?\n    advTextSwitcher.setCallback(new AdvTextSwitcher.Callback(){\n\t\t\t    \t@Override\n\t\t    \t\tpublic void onItemClick(int position)\n\t    \t\t\t{\n\t\t    \t\t    Toast.makeText(MainActivity.this, \"ITEM@\"+position+\" Clicked!\", Toast.LENGTH_SHORT).show();\n\t\t    \t\t}\n    });\n```\n### Donate \u0026amp; Support 捐赠与支持\n\nMakito是一个自由的软件开发者，也是一名在校大学生。\n\n欢迎您去查看我的其他开源项目，同时也欢迎通过打赏支持我一下。感谢\n\n##### 支付宝/AliPay\n\n826257232#qq.com (#请换成@)\n\n\u003cimg src=\"art/aliqr.png\" width=\"230\"\u003e\n\n##### 微信支付\n\n\u003cimg src=\"art/wechat_qr.png\" width=\"230\"\u003e\n\n##### PayPal\n\nsumimakito#hotmail.com (replace # with @)\n\n### Copyright \u0026amp; License 版权信息与授权协议\n\nCopyright \u0026copy; 2014-2015 Sumi Makito\n\nLicensed under Apache License 2.0 License.\n\n```\nCopyright 2014-2015 Sumi Makito\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":[],"categories":["跑马灯"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSumiMakito%2FAdvancedTextSwitcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSumiMakito%2FAdvancedTextSwitcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSumiMakito%2FAdvancedTextSwitcher/lists"}