{"id":13492906,"url":"https://github.com/Blogcat/Android-ExpandableTextView","last_synced_at":"2025-03-28T11:31:02.629Z","repository":{"id":57714952,"uuid":"52160106","full_name":"Blogcat/Android-ExpandableTextView","owner":"Blogcat","description":"An expandable TextView for Android applications","archived":false,"fork":false,"pushed_at":"2020-05-18T03:20:13.000Z","size":2175,"stargazers_count":301,"open_issues_count":24,"forks_count":73,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-31T07:34:04.652Z","etag":null,"topics":["android","android-expandabletextview","android-oreo","expandabletextview","textview"],"latest_commit_sha":null,"homepage":"http://www.blogc.at","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/Blogcat.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-02-20T15:30:09.000Z","updated_at":"2024-06-27T09:28:47.000Z","dependencies_parsed_at":"2022-09-02T22:01:05.441Z","dependency_job_id":null,"html_url":"https://github.com/Blogcat/Android-ExpandableTextView","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blogcat%2FAndroid-ExpandableTextView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blogcat%2FAndroid-ExpandableTextView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blogcat%2FAndroid-ExpandableTextView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blogcat%2FAndroid-ExpandableTextView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blogcat","download_url":"https://codeload.github.com/Blogcat/Android-ExpandableTextView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246020823,"owners_count":20710826,"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-expandabletextview","android-oreo","expandabletextview","textview"],"created_at":"2024-07-31T19:01:10.348Z","updated_at":"2025-03-28T11:31:02.278Z","avatar_url":"https://github.com/Blogcat.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"Android-ExpandableTextView\n==========================\nAn expandable TextView for Android applications (4.1+).\n\n[ ![Download](https://api.bintray.com/packages/blogcat/maven/android-expandabletextview/images/download.svg) ](https://bintray.com/blogcat/maven/android-expandabletextview/_latestVersion)\n\nLatest Changes\n--------------\n- Added support for Android O\n- Added RecyclerView Demo\n\nDemo\n----\nThis repository also contains a demo project.\n\n![Demo](https://raw.githubusercontent.com/Blogcat/Android-ExpandableTextView/master/demo.gif)\n\nAdd dependency\n--------------\nThis library is released in Maven Central and jCenter:\n\n```groovy\n\trepositories {\n\t    mavenCentral()\n\t}\n```\n\nor\n\n```groovy\n\trepositories {\n\t    jcenter()\n\t}\n```\n\nlibrary dependency\n\n```groovy\n\tdependencies {\n\t    compile 'at.blogc:expandabletextview:1.0.5'\n\t}\n```\n\nUsage\n-----\nUsing the ExpandableTextView is very easy, it's just a regular TextView with some extra functionality added to it. By defining the android:maxLines attribute, you can set the default number of lines for the TextView collapsed state. \n\n```xml\n\u003cLinearLayout\n    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    \u003cat.blogc.android.views.ExpandableTextView\n        android:id=\"@+id/expandableTextView\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"@string/lorem_ipsum\"\n        android:maxLines=\"5\"\n        android:ellipsize=\"end\"\n        app:animation_duration=\"750\"/\u003e\n\n\t\u003c!-- Optional parameter animation_duration: sets the duration of the expand animation --\u003e\n\n    \u003cButton\n        android:id=\"@+id/button_toggle\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"@string/expand\"/\u003e\n\n\u003c/LinearLayout\u003e\n```\n\nIn your Activity or Fragment:\n\n```java\nfinal ExpandableTextView expandableTextView = (ExpandableTextView) this.findViewById(R.id.expandableTextView);\nfinal Button buttonToggle = (Button) this.findViewById(R.id.button_toggle);\n\n// set animation duration via code, but preferable in your layout files by using the animation_duration attribute\nexpandableTextView.setAnimationDuration(750L);\n\n // set interpolators for both expanding and collapsing animations\nexpandableTextView.setInterpolator(new OvershootInterpolator());\n\n// or set them separately\nexpandableTextView.setExpandInterpolator(new OvershootInterpolator());\nexpandableTextView.setCollapseInterpolator(new OvershootInterpolator());\n\n// toggle the ExpandableTextView\n    buttonToggle.setOnClickListener(new View.OnClickListener()\n    {\n        @Override\n        public void onClick(final View v)\n        {\n            buttonToggle.setText(expandableTextView.isExpanded() ? R.string.expand : R.string.collapse);\n            expandableTextView.toggle();\n        }\n    });\n\n// but, you can also do the checks yourself\nbuttonToggle.setOnClickListener(new View.OnClickListener()\n{\n    @Override\n    public void onClick(final View v)\n    {\n        if (expandableTextView.isExpanded())\n        {\n            expandableTextView.collapse();\n            buttonToggle.setText(R.string.expand);\n        }\n        else\n        {\n            expandableTextView.expand();\n            buttonToggle.setText(R.string.collapse);\n        }\n    }\n});\n\n// listen for expand / collapse events\nexpandableTextView.setOnExpandListener(new ExpandableTextView.OnExpandListener()\n{\n    @Override\n    public void onExpand(final ExpandableTextView view)\n    {\n        Log.d(TAG, \"ExpandableTextView expanded\");\n    }\n\n    @Override\n    public void onCollapse(final ExpandableTextView view)\n    {\n        Log.d(TAG, \"ExpandableTextView collapsed\");\n    }\n});\n```\n\nLicense\n=======\n\n    Copyright 2016 Cliff Ophalvens (Blogc.at)\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%2FBlogcat%2FAndroid-ExpandableTextView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBlogcat%2FAndroid-ExpandableTextView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBlogcat%2FAndroid-ExpandableTextView/lists"}