Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/webtoon/readmoretextview
Text components supporting 'Read more' UX for Android View and Jetpack Compose
https://github.com/webtoon/readmoretextview
android-library android-view jetpack-compose readmore
Last synced: 6 days ago
JSON representation
Text components supporting 'Read more' UX for Android View and Jetpack Compose
- Host: GitHub
- URL: https://github.com/webtoon/readmoretextview
- Owner: webtoon
- License: apache-2.0
- Created: 2022-05-20T06:03:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-22T09:08:29.000Z (about 2 months ago)
- Last Synced: 2025-01-25T08:05:25.946Z (13 days ago)
- Topics: android-library, android-view, jetpack-compose, readmore
- Language: Kotlin
- Homepage: https://webtoon.github.io/ReadMoreTextView/
- Size: 7.13 MB
- Stars: 175
- Watchers: 7
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# ReadMoreTextView
This library provides collapsible Text widgets with 'Read more' and 'Read less' text. (Including [Jetpack Compose][compose])
| **Collapsed** | |
| ------------- | -------------------------------------------- |
| **Expanded** | |## Versions
Each [release](https://github.com/webtoon/ReadMoreTextView/releases) outlines the version of the AppCompat or Compose library it depends on.
### View
AppCompat 1.3 (1.3.x)
AppCompat 1.4 (1.4.x)
AppCompat 1.5 (1.5.x)
AppCompat 1.6 (1.6.x)
AppCompat 1.7 (1.7.x)### Compose
Compose 1.1 (1.1.x)
Compose 1.2 (1.2.x)
Compose 1.3 (1.3.x)
Compose 1.4 (1.4.x)
Compose 1.5 (1.5.x)
Compose 1.6 (1.6.x)
Compose 1.7 (1.7.x)
Compose 1.8 (1.8.x)## Libraries
We are currently releasing various libraries for AppCompat or Compose.
### [ReadMore-View](./readmore-view/)
A library that provides collapsible `TextView` with 'Read more' and 'Read less' text. (for Android View System)### [ReadMore-Foundation](./readmore-foundation/)
A library that provides collapsible `BasicText` with 'Read more' and 'Read less' text. (for [Jetpack Compose][compose])### [ReadMore-Material](./readmore-material/)
A library that provides collapsible `Text` with 'Read more' and 'Read less' text based on Material Theme. (for [Jetpack Compose][compose])### [ReadMore-Material3](./readmore-material3/)
A library that provides collapsible `Text` with 'Read more' and 'Read less' text based on Material3 Theme. (for [Jetpack Compose][compose])## Attributes
This libraries provide the same attributes as much as possible regardless of View or [Compose][compose].
### Attributes for 'Read More'
#### `readMoreMaxLines`
| **2 (default)** | |
| --------------- | ------------------------------------------------------------ |
| **`"1"`** | |#### `readMoreOverflow`
| **Ellipsis (default)** | |
| ---------------------- | ------------------------------------------------------------ |
| **Clip** | |#### `readMoreText`
| **"" (default)** | |
| ----------------- | ------------------------------------------------------------ |
| **`"Read more"`** | |#### `readMoreTextSize`
| **Same with `textSize` (default)** | |
| ---------------------------------- | ------------------------------------------------------------ |
| **`"11sp"`** | |#### `readMoreTextColor`
| **Same with `textColor` (default)** | |
| ----------------------------------- | ------------------------------------------------------------ |
| **`"#FF0000"`** | |#### `readMoreTextStyle`
| **Normal (default)** | |
| -------------------- | ------------------------------------------------------------ |
| **Bold** | |
| **Italic** | |#### `readMoreTextUnderline` (View only)
| **false (default)** | |
| ------------------- | ------------------------------------------------------------ |
| **true** | |#### `readMoreTextDecoration` (Compose only)
| **`null` (default)** | |
|-----------------------| ------------------------------------------------------------ |
| **`TextDecoration.Underline`** | |---
### Attributes for 'Read Less'
#### `readLessText`
| **"" (default)** | |
|-------------------| ------------------------------------------------------------ |
| **`"Read less"`** | |#### `readLessTextSize`
| **Same with `textSize` (default)** | |
| ---------------------------------- | ------------------------------------------------------------ |
| **`"11sp"`** | |#### `readLessTextColor`
| **Same with `textColor` (default)** | |
| ----------------------------------- | ------------------------------------------------------------ |
| **`"#FF0000"`** | |#### `readLessTextStyle`
| **Normal (default)** | |
| -------------------- | ------------------------------------------------------------ |
| **Bold** | |
| **Italic** | |#### `readLessTextUnderline` (View only)
| **false (default)** | |
| ------------------- | ------------------------------------------------------------ |
| **true** | |#### `readLessTextDecoration` (Compose only)
| **`null` (default)** | |
|-----------------------| ------------------------------------------------------------ |
| **`TextDecoration.Underline`** | |---
### Attributes for toggle area
The toggle area is the red box in the following image.
#### `readMoreToggleArea` (View only)
| **all (default)** | |
|-------------------|------------------------------------------------------------|
| **more** | |
| **none** | |#### `toggleArea` (Compose only)
| **All (default)** | |
|-------------------|---------------------------------------------------------------|
| **More** | |## Snapshots
If you want to check the version currently in development, you can use the [snapshot versions](https://s01.oss.sonatype.org/content/repositories/snapshots/com/webtoonscorp/android/).
The snapshot versions are updated on every commit to `main` branch.
```groovy
repositories {
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots' }
}dependencies {
// Check the latest SNAPSHOT version from the link above
classpath 'com.webtoonscorp.android:readmore-view:XXX-SNAPSHOT'
}
```## License
```
Copyright 2022 NAVER WebtoonLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttps://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```[compose]: https://developer.android.com/jetpack/compose