https://github.com/dora4/dview-tabbar
选项卡栏
https://github.com/dora4/dview-tabbar
Last synced: 10 months ago
JSON representation
选项卡栏
- Host: GitHub
- URL: https://github.com/dora4/dview-tabbar
- Owner: dora4
- License: apache-2.0
- Created: 2024-09-19T17:35:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-08T12:34:21.000Z (over 1 year ago)
- Last Synced: 2024-11-08T13:34:58.017Z (over 1 year ago)
- Language: Kotlin
- Size: 68.4 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
dview-tabbar

--------------------------------
#### 卡片

#### Gradle依赖配置
```groovy
// 添加以下代码到项目根目录下的build.gradle
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
// 添加以下代码到app模块的build.gradle
dependencies {
implementation 'com.github.dora4:dview-tabbar:1.1'
}
```
#### 使用控件
```kotlin
binding.tabBar.addTextTab("频道1")
binding.tabBar.addTextTab("频道2")
binding.tabBar.addTextTab("频道3")
binding.tabBar.setOnTabClickListener(object : DoraTabBar.OnTabClickListener {
override fun onTabClick(view: View, position: Int) {
when (position) {
0 -> {
showPage(pageOne)
}
1 -> {
showPage(pageTwo)
}
2 -> {
showPage(pageThree)
}
}
}
})
```
#### 示例代码
https://github.com/dora4/dora_samples