mirror of
https://github.com/AdrianKuta/ViewPagerDotsIndicator.git
synced 2025-04-20 07:29:02 +02:00
Updated ReadMe.md
This commit is contained in:
parent
4f72ab42a1
commit
f198d065b8
@ -16,8 +16,7 @@ selected and default dots.
|
|||||||
|
|
||||||
Firstly, we have to add `TabLayout` to our screen layout, and connect it
|
Firstly, we have to add `TabLayout` to our screen layout, and connect it
|
||||||
with `ViewPager`. We can do this in two ways:
|
with `ViewPager`. We can do this in two ways:
|
||||||
|
---
|
||||||
|
|
||||||
#### Nested `TabLayout` in `ViewPager`
|
#### Nested `TabLayout` in `ViewPager`
|
||||||
```xml
|
```xml
|
||||||
<androidx.viewpager.widget.ViewPager
|
<androidx.viewpager.widget.ViewPager
|
||||||
@ -33,7 +32,7 @@ with `ViewPager`. We can do this in two ways:
|
|||||||
|
|
||||||
> In this case `TabLayout` will be automatically connected with
|
> In this case `TabLayout` will be automatically connected with
|
||||||
> `ViewPager`, but `TabLayout` will be next to `ViewPager`, not over it.
|
> `ViewPager`, but `TabLayout` will be next to `ViewPager`, not over it.
|
||||||
|
---
|
||||||
#### Separate `TabLayout`
|
#### Separate `TabLayout`
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
@ -67,7 +66,7 @@ TabLayoutMediator(tabLayout, viewPager2) { tab, position ->
|
|||||||
//Some implementation...
|
//Some implementation...
|
||||||
}.attach()
|
}.attach()
|
||||||
```
|
```
|
||||||
|
---
|
||||||
Once we created our layout, we have to prepare our dots. So we create
|
Once we created our layout, we have to prepare our dots. So we create
|
||||||
three files: `selected_dot.xml`, `default_dot.xml` and
|
three files: `selected_dot.xml`, `default_dot.xml` and
|
||||||
`tab_selector.xml`.
|
`tab_selector.xml`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user