Indicators for a ViewPager
Indicators is a micro framework for creating ViewPager
indicators. Instead
of limited indicator implementations, it provides the means to create new
indicator types without a big effort.
This library works well together with the Android Data Binding Library and Binding Supplies.
All views of Indicators are fully supported in any layout.
<berlin.volders.indicators.PageIndicators
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:viewPager="@{viewPager}">
<berlin.volders.indicators.PageIndicatorView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:indicator="@drawable/indicator"
app:indicatorSpacing="6dp" ></berlin.volders.indicators.PageIndicatorView>
</berlin.volders.indicators.PageIndicators>
PageIndicators
is the parent layout to bind to any ViewPager
. It defines a@ViewPager.DecorView
to be added to a ViewPager
parent directly in XML and
integrates well with the Android Data Binding Library providing everything
needed to create indicators easily.
app:page
app:indicatorsObserver
PageIndicators.Observer
implementationapp:pageObserver
PageIndicators.PageObserver
app:pageCountObserver
PageIndicators.PageObserver
app:pageStateObserver
PageIndicators.PageStateObserver
app:pageScrollObserver
PageIndicators.PageScrollObserver
PageIndicatorView
is an implementation of Indicators to display a simpleDrawable
with a selected state to indicate the current page.
android:fillViewport
app:indicator
app:indicatorSpacing
app:indicatorWidth
app:indicatorHeight
app:pageIndicators
PageNumberView
is a simple TextView
extension to display the current page
and the page count.
app:indicatorTemplate
– The spacing between the indicatorsapp:indicatorFormatLocalized
app:pageIndicators
Add JitPack to your repositories and Indicators to your dependencies
dependencies {
compile "berlin.volders:indicators:$indicatorsVersion"
}
Copyright (C) 2016 volders GmbH with <3 in Berlin
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.