ClickNumberPicker


Source link: https://github.com/polok/ClickNumberPicker

ClickNumberPicker

Custom view to pick up a value from a given range using click button or swiping.

Version: 0.1.2

Notice that ClickNumberPicker is a project under development. So far it contains very basic stuff and has some annoying restrictions but after few months of not doing anything with it, I decided to publish and hopefully this will be my motivation to finally improve it.

Welcome to fork and pull request.

Screenshot

Integration

dependencies {

  compile 'com.github.polok:clicknumberpicker:0.1.2' 
}
Using Maven:
<dependency>
  <groupId>com.github.polok</groupId>
  <artifactId>clicknumberpicker</artifactId>
  <version>0.1.2</version> </dependency>

Usage

Add a picker in your xml layout file
 <pl.polak.clicknumberpicker.ClickNumberPickerView

android:layout_width="match_parent"

android:layout_height="wrap_content"

app:picker_corner_radius="10"

app:pickers_background_color="#3F51B5"

app:swipe_enabled="false"

app:value_background_color="#5C6BC0"

app:value_text_color="@android:color/white"/>
Set a listener to be notified when value has changed:
 picker.setClickNumberPickerListener(new ClickNumberPickerListener() {

@Override

public void onValueChange(float previousValue, float currentValue, PickerClickType pickerClickType) {

}

  
}
);
Set picker's current value:
 picker.setPickerValue(69f);
Get picker's current value:
 picker.getValue();

Attributes

There are several attributes you can set:

attr description
value current picker value. Default is 0
min_value Min picker value. Default is 0
max_value Max picker value. Default is 100
step Step value. Default is 1
decimal_number Round value after comma. Default is 2
integer_priority If current value is integer, show it without fraction part. Default is false
value_background_color Value background color
pickers_background_color Pickers background color
swipe_animation Flag to allow swipe animation. Default is false
value_animation_up Flag to turn on or off value change up animation. Default is false
value_animation_down Flag to turn on or off value change down animation. Default is false
animation_value_down_duration Duration of animation down
animation_value_up_duration Duration of animation up
value_text_color Value text color
value_text_size Value text size
value_min_text_size Value text min size for animation down
value_max_text_size Value text max size for animation up
swipe_enabled enable or disable swipe gestures, default is true
value_view_offset Offset value for swiping animation
picker_corner_radius Pickers corner radius
picker_border_stroke_width Pickers border stroke width
picker_border_stroke_color Pickers border stroke color
animation_offset_left_duration Animation offset left duration
animation_offset_right_duration Animation offset right duration
left_picker_layout Left picker layout
right_picker_layout Right picker layout

License

Copyright 2016 Marcin Polak  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. 

Resources

Chateau is a framework for adding (or improving) chat functionality in any Android app. Built in a modular way using MVP and Clean Architecture, it can easily be integrated with your chat backend with only minor changes to the included UI.

A crazy idea about bringing functional programming to Java, in an elegant way.

Android circle buttons.

A simple library for supporting self-signed certificates in Android.

JCVD is a library that helps you using the Awareness API from the Google Play Services.

A view which can add sticker and zoom, drag, delete it.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes