IndicatorDecorator

Additional

Language
Kotlin
Version
0.1.1 (Sep 29, 2019)
Created
Sep 22, 2019
Updated
Sep 29, 2019
Owner
Seokwon Jeong (sangcomz)
Contributor
Seokwon Jeong (sangcomz)
1
Activity
Badge
Generate
Download
Source code
APK file

Commercial

IndicatorDecorator

Indicator decorator is an indicator that can be used in ViewPager2 and RecyclerView.

What's New in 0.1.1? 🎉

  • [Feature] Indicators to overlap. UseisOverlap (#2)
  • [Feature] Indicator background setting method added (#4)

How to Use

Gradle

    dependencies {
        implementation 'xyz.sangcomz:indicatordecorator:0.1.1'
    }

Usage

        viewPager1.addItemDecoration(IndicatorItemDecoration().apply {
            indicatorShape = CircleIndicator().apply {
                colorActive = ContextCompat.getColor(this@MainActivity, R.color.colorPrimaryDark)
            }
        })

attribute

     Attribute Name       Description                                 Default Value  
topOffset Top Offset with Page Item 4DP
bottomOffset Bottom Offset in View 4DP
indicatorItemPadding Padding between indicators 8DP
indicatorShape Indicator shape CircleIndicator
isOverlap Can overlap false
isShowBackground Background visibility false
backgroundColor Background Color WHITE
backgroundCornerRadius Background Corner Radius 8DP
backgroundSideOffset Background side offset 16DP
backgroundTopAndBottomOffset Background top and bottom offset 4DP

Support Indicator Shape

  • CircleIndicator
  • DrawableIndicator
  • SquareIndicator

It can be created by extend IndicatorShape. (It's better if you make a PR)

Result Screen

Project Name Result Screen
Sample

Contribute

Welcome any contributions.

Inspired by

License

Copyright 2019 Jeong Seokwon

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.