Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iamageo/magictablayout
An efficient TabLayout implemented in Jetpack Compose 🚀
https://github.com/iamageo/magictablayout
android android-library compose-tab-layout efficient-tab-layout jetpack-compose jitpack jitpack-library kotlin library tab-layout
Last synced: 15 days ago
JSON representation
An efficient TabLayout implemented in Jetpack Compose 🚀
- Host: GitHub
- URL: https://github.com/iamageo/magictablayout
- Owner: iamageo
- License: apache-2.0
- Created: 2022-08-13T16:44:17.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-06T07:35:56.000Z (9 months ago)
- Last Synced: 2024-05-06T08:44:35.802Z (9 months ago)
- Topics: android, android-library, compose-tab-layout, efficient-tab-layout, jetpack-compose, jitpack, jitpack-library, kotlin, library, tab-layout
- Language: Kotlin
- Homepage:
- Size: 146 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
MagicTabLayout
An efficient TabLayout library implemented in Jetpack Compose 🚀
## Anatomy
![banner_magic_tab_layout](https://user-images.githubusercontent.com/26925002/186786657-432fe672-0eb8-4502-af00-e0f2b6dd81eb.png)
1. MagicTabLayout
2. tabIndicatorColor (Optional, default value: blue)
3. MagicTabItem
4. MagicTabItem title## Including in your project
[![](https://jitpack.io/v/iamageo/MagicTabLayout.svg)](https://jitpack.io/#iamageo/MagicTabLayout)### Gradle
Add below codes to your **root** `build.gradle` file (not your module build.gradle file).
```gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
And add a dependency code to your **module**'s `build.gradle` file.
```gradle
dependencies {
implementation 'com.github.iamageo:MagicTabLayout:1.0.3'
}
```## Basic Usage
Add in you Activity file.```kotlin
/* specify your tabs */
val tabs = listOf(
MagicTabItem(title = "Home") { TabItemTest(item = "tab1") },
MagicTabItem(title = "Favorites") { TabItemTest(item = "tab2") },
MagicTabItem(title = "Settings") { TabItemTest(item = "tab3") },
)Column() {
MagicTabLayout(
tabIndicatorColor = Color.Blue,
tabColor = Color.White,
tabList = tabs,
)
}/* in this case TabItemTest contains bellow composable function, but you can pass your functions */
@Composable
fun TabItemTest(item: String) {
Column(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
text = item,
color = Color.Black,
)
}
}
```## License
```
Copyright 2022 Geovani AmaralLicensed 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 athttp://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.```