This library was made from existing PageStepIndicator library but with lots of improvement.
- support multiline text
- add fonts
- place text on top or bottom of step indicator
- make titles clickable or static
- hide/show secondary texts
- Add
StepView
to your app.
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency
dependencies {
implementation 'com.github.tatocaster:StepView:1.0.0'
}
- Add
StepView
to your layout. E.g:
<me.tatocaster.stepview.StepView
app:svStepCount="3"
app:svClickableTitle="true"
app:svTextBottom="false"
app:svTitleTextSize="15sp"
app:svTitles="@array/stepview_titles"
app:svStrokeAlpha="255"
app:svRadius="15dp"
app:svCurrentStepColor="@android:color/holo_red_dark"
app:svTextColor="@android:color/white"
app:svStepColor="@android:color/holo_purple"
android:id="@+id/stepView"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
-
Setup a pager adapter by extending
FragmentStatePagerAdapter
orFragmentPagerAdapter
. -
Add the adapter to your viewpager and pass it to
StepView
by calling a handy methodsetupWithViewPager(ViewPager)
.
That's all. You can customize it the way you want.
svStepColor
Color of the step indicatorsvCurrentStepColor
Color of the current stepsvBackgroundColor
Background color of the step indicatorsvTextColor
Background color of the step indicatorsvSecondaryTextColor
Background color of the step indicatorsvRadius
Radius of the step indicatorsvStrokeWidth
Stroke Width of a current stepsvStepCount
Size of step (With out ViewPager)svTitles
Titles of pagessvActiveTitleColor
Current color of page's titlesvInActiveTitleColor
Color of your previous or future page's titlesvTitleTextSize
Size of your page's titlesvLineHeight
Height of indicator linesvStrokeAlpha
Opacity of current stroke(255 means the color is solid)svTextTypeFace
Set a font typefacesvTextBottom
Places text on top or below of step indicatorsvClickableTitle
Make titles clickablesvSecondaryTextEnabled
Make secondary text in step indicator visible
- Fork and clone locally
- Create a topic specific branch. Add some nice feature.
- Send a Pull Request to spread the fun!
MIT License
Copyright (c) 2019 Merab Tato Kutalia
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.