QuantityPickerView¶
A View capable of increasing or decreasing a unit value with a toggle animation.
Installation¶
QuantityPickerView is distributed through Maven Central and Jitpack.
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:
<resources>
<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" />
<attr name="rippleEnable" format="boolean" />
<attr name="rippleColor" format="color" />
</resources>
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"/>
Dependencies¶
- com.android.support:support-annotations
- androidx.appcompat:appcompat (for ResourcesCompat.getFont())
Bugs and Feedback¶
For bugs, questions and discussions please use the Github Issues.
LICENSE¶
Copyright © 2020-present, GuilhE.
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.