All Projects → alexzaitsev → Meter Number Picker

alexzaitsev / Meter Number Picker

Licence: apache-2.0
The android library that provides a simple and customizable NumberPicker styled as meter.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Meter Number Picker

SkeletonPlaceholderView
A library for creating dynamic skeleton view
Stars: ✭ 25 (-73.96%)
Mutual labels:  view, custom-view
Custom-Grid-View
Custom Drag and Drop Grid for Home Assistant
Stars: ✭ 103 (+7.29%)
Mutual labels:  view, custom-view
Mkloader
Beautiful and smooth custom loading views
Stars: ✭ 1,377 (+1334.38%)
Mutual labels:  view, custom-view
Creditcardview
💳 CreditCardView is an Android library that allows developers to create the UI which replicates an actual Credit Card.
Stars: ✭ 744 (+675%)
Mutual labels:  view, custom-view
Freepager
ViewPagers library for Android
Stars: ✭ 461 (+380.21%)
Mutual labels:  view, custom-view
auto-fill-edit-text
This custom EditText can suggest and fill text defined before.
Stars: ✭ 26 (-72.92%)
Mutual labels:  view, custom-view
ProgressableImageView
Change your users progress capability with ProgressableImageView
Stars: ✭ 86 (-10.42%)
Mutual labels:  view, custom-view
Uilibrary
平时项目开发中写的自定义Drawable、View和Shape
Stars: ✭ 260 (+170.83%)
Mutual labels:  view, custom-view
Easysignseekbar
本库主要提供一个漂亮而强大的自定义SeekBar,进度变化由提示牌 (sign)展示,具有强大的属性设置,支持设置section(节点)、mark(标记)、track(轨迹)、thumb(拖动块)、progress(进度)、sign(提示框)等功能
Stars: ✭ 629 (+555.21%)
Mutual labels:  view, custom-view
Iconswitch
🍭 Custom Android Switch widget
Stars: ✭ 874 (+810.42%)
Mutual labels:  view, custom-view
Android Circular Progress
Android custom view that loads a circular progress indicator using ImageView or FrameLayout
Stars: ✭ 75 (-21.87%)
Mutual labels:  custom-view
Skyradiusview
自定义view背景四边的圆角
Stars: ✭ 75 (-21.87%)
Mutual labels:  view
Animated Stars Android
Draw animated stars on Android view canvas - written in Kotlin
Stars: ✭ 85 (-11.46%)
Mutual labels:  view
Bannerlayout
Support unlimited picture rotation BannerLayout, the minimum implementation of the code banner
Stars: ✭ 92 (-4.17%)
Mutual labels:  view
Circle Progress View
Animated circular progress view for Android
Stars: ✭ 1,185 (+1134.38%)
Mutual labels:  view
Androidanimationexercise
Android 动画各种实现,包括帧动画、补间动画和属性动画的总结分享
Stars: ✭ 1,254 (+1206.25%)
Mutual labels:  view
Creditsesameringview
Imitation of Ali credit sesame new old ring view.http://www.jianshu.com/p/8486a5baa708
Stars: ✭ 1,181 (+1130.21%)
Mutual labels:  view
Materialchipview
Material Chip view. Can be used as tags for categories, contacts or creating text clouds
Stars: ✭ 1,181 (+1130.21%)
Mutual labels:  view
Cuteloadinglayoutgit
六边形的LoadingView
Stars: ✭ 72 (-25%)
Mutual labels:  view
Hhfloatingview
An easy to use and setup floating view for your app. 🎡
Stars: ✭ 93 (-3.12%)
Mutual labels:  custom-view

Meter Number Picker

The android library that provides a simple and customizable NumberPicker styled as meter. It's based on NumberPicker.

Android Arsenal

Preview

Usage

Make sure you've added maven central to the list of your repositories at the root build.gradle:

repositories {
    mavenCentral()
}

Then add a dependency into your module's build.gradle:

dependencies {
    implementation 'com.alex-zaitsev:meternumberpicker:1.0.5'
}

Content

The library contains 2 views: MeterNumberPicker and MeterView. MeterNumberPicker is a base block for MeterView. On the screenshot above whole view is the MeterView and a single block of it is MeterNumberPicker. They are pretty simple, you can easily create your own meter class based on them.

Usage

Firstly, create a style for your number picker:

<style name="MeterNumberPickerStyle">
    <item name="mnp_min">0</item>
    <item name="mnp_max">9</item>
    <item name="mnp_textColor">@android:color/white</item>
    <item name="mnp_textSize">50sp</item>
    <item name="mnp_paddingHorizontal">5dp</item>
    <item name="mnp_paddingVertical">25dp</item>
</style>

Then, create a style for your meter view and pass the previous style:

<style name="MeterViewStyle">
    <item name="mv_firstColor">@android:color/black</item>
    <item name="mv_numberOfFirst">5</item>
    <item name="mv_numberOfSecond">1</item>
    <item name="mv_pickerStyle">@style/MeterNumberPickerStyle</item>
    <item name="mv_secondColor">@android:color/holo_red_dark</item>
</style>

Almost there! Now create your view and apply the style:

<com.alexzaitsev.meternumberpicker.MeterView
    android:id="@+id/meterView"
    style="@style/MeterViewStyle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>

You can use MeterNumberPicker directly without MeterView wrapper. Look at the MeterView sources to catch more details.
You may also want to check the sample.

Attributes

MeterNumberPicker

attribute name attribute description
mnp_min The min value of this widget.
mnp_max The max value of this widget.
mnp_value The current value of this widget.
mnp_textColor The text color of the numbers.
mnp_textSize The text size of the numbers.
mnp_typeface The typeface of the numbers.
mnp_minWidth The min width of this widget.
mnp_minHeight The min height of this widget.
mnp_paddingHorizontal Internal horizontal padding of this widget (left/right).
mnp_paddingVertical Internal vertical padding of this widget (top/bottom).

MeterView

attribute name attribute description
mv_numberOfFirst Number of the first-placed blocks.
mv_numberOfSecond Number of the second-placed blocks.
mv_firstColor Background color for the first-placed blocks.
mv_secondColor Background color for the second-placed blocks.
mv_pickerStyle The style for the MeterNumberPicker.
mv_enabled Defines whether view reacts on clicks.

License

MeterNumberPicker is under Apache 2.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].