QuantityPickerView
A View capable of increasing or decreasing a unit value with a toggle animation.
Version 1.x
- January, 2020 - QuantityPickerView ?
Getting started
Include it into your project, for example, as a Gradle dependency:
implementation 'com.github.guilhe:quantity-picker-view:${LATEST_VERSION}'
Usage
Check out the sample module where you can find a few examples of how to create it by xml
.
Attributes accepted in xml:
<declare-styleable name="QuantityPickerView">
<attr name="min" format="integer" />
<attr name="max" format="integer" />
<attr name="value" format="integer" />
<attr name="textLabelSize" format="dimension" />
<attr name="textLabelFormatter" format="string" />
<attr name="textLabelFont" format="reference" />
<attr name="backgroundColor" format="color" />
<attr name="btnRemove" format="reference" />
<attr name="btnAdd" format="reference" />
<attr name="isOpen" format="boolean" />
<attr name="autoToggle" format="boolean" />
</declare-styleable>
Example:
com.github.guilhe.views.QuantityPickerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:textLabelFont="@font/permanentmarker_regular"
app:textLabelFormatter="%s units."
app:textLabelSize="14sp"/>