GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - iamageo/MagicTabLayout: Jetpack Compose TabLayout library for Android: pass a list of MagicTabItem (title + composable screen) to get a Material TabRow synced with a swipeable HorizontalPager, with animated tab switching, a pager-tracking indicator, configurable tab and indicator colors and initial page. Built with Kotlin and Accompanist Pager; on JitPack.

BranchesTags
Open more actions menu

Latest commit

 

History

55 Commits
55 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.idea
.idea
 
 
app
app
 
 
gradle
gradle
 
 
tablayout
tablayout
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

MagicTabLayout


An efficient TabLayout library implemented in Jetpack Compose 🚀


License API repo size
forks stars

Anatomy

banner_magic_tab_layout

  1. MagicTabLayout
  2. tabIndicatorColor (Optional, default value: blue)
  3. MagicTabItem
  4. MagicTabItem title

Including in your project

Gradle

Add below codes to your root build.gradle file (not your module build.gradle file).

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

And add a dependency code to your module's build.gradle file.

dependencies {
    implementation 'com.github.iamageo:MagicTabLayout:1.0.3'     
}

Basic Usage

Add in you Activity file.

/* 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 Amaral

    Licensed 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 at

       http://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.

About

Jetpack Compose TabLayout library for Android: pass a list of MagicTabItem (title + composable screen) to get a Material TabRow synced with a swipeable HorizontalPager, with animated tab switching, a pager-tracking indicator, configurable tab and indicator colors and initial page. Built with Kotlin and Accompanist Pager; on JitPack.

Topics

accompanistaccompanist-pagerandroidandroid-libraryandroid-uicompose-librarycompose-tab-layouthorizontal-pagerjetpack-composejitpackkotlinkotlin-librarymaterial-designtab-layouttablayouttabrowtabsviewpager

Resources

Readme
Apache-2.0 license
Activity

Stars

8 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.