• Stars
    star
    796
  • Rank 57,222 (Top 2 %)
  • Language
    Java
  • Created over 8 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

custom widget--srcoll number

Scroll Number Widget

中文 | English

A SimpleGracefulEasy-to-Use Scroll Number Widget!

Don't forget give me a star :)

Feature

  • Just need to call setNumber() could be performed.
  • You can dynamically customize number's colors、size、range、font...

image

Dependency

There are two ways:

  • clone this project, and use as dependency
  • just add following code to you build.gradle:
compile 'top.wuhaojie:scrollnumber:1.0.0'

Usage

  • Add this to your layout xml file:
<top.wuhaojie.library.MultiScrollNumber
    android:id="@+id/scroll_number"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"/>
  • Call setNumber() in your java code:
MultiScrollNumber scrollNumber = (MultiScrollNumber) findViewById(R.id.scroll_number);
scrollNumber.setNumber(2048);

Customize

  • Color Call setTextColors(@ColorRes int[] textColors) with a paramiter, a array stores colors from High bit to Low bit.
scrollNumber.setTextColors(new int[]{R.color.blue01, R.color.red01,
                R.color.green01, R.color.purple01});

image

  • Size Just call setTextSize(int textSize) with the size you want to change to, unit is sp .
scrollNumber.setTextSize(64);

image

  • Range Call setNumber(int from, int to) instead of setNumber(int val) to specify a range.
scrollNumber.setNumber(64, 2048);

image

  • Interpolator You could change interpolator with call setInterpolator(Interpolator interpolator).
scrollNumber.setInterpolator(new DecelerateInterpolator());
  • Font Change text font by call setTextFont(fileName), before this you should copy the font file to assets/ directory.
scrollNumber.setTextFont("myfont.ttf");
  • Animation Velocity Call scrollNumber.setScrollVelocity(v) to set the animation velocity, number in range of 0 ~ 1000.
scrollNumber.setScrollVelocity(30);

image

Xml

Meaning Attribute
from a number primary_number
to a number target_number
number size number_size

Update Log

  • add font change option on 22/7/2016.
  • support double or float number, setNumber(double num) 15/7/2017

License

The MIT License (MIT)

Copyright (c) 2015 WuHaojie

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

More Repositories

1

BluetoothHelper

Bluetooth Helper Library.—-蓝牙操作库
Java
1,320
star
2

AutoInstaller

应用自动静默更新安装库.
Java
1,064
star
3

WeekToDo

《番茄周》软件开源项目
Java
269
star
4

NetView

自定义控件——蜘网图(雷达图)控件
Java
34
star
5

White

“白噪声”软件开源项目.
Java
31
star
6

GraphView

自定义控件——天气温度折线图
Java
29
star
7

StringExtractor

🚀One Key to Extract String Resource
Java
18
star
8

SmartHouse_Android

单片机课程实践——智能家居系统(安卓端)
Java
9
star
9

LoginSystem_Client

登录注册系统(桌面客户端)——Java课程实践
Java
7
star
10

WaterBubble

自定义控件——水波纹特效
Java
6
star
11

Awesome-Widgets

some simple ui widgets for android developer
Java
5
star
12

ZhihuDaily

仿知乎日报应用.
Java
4
star
13

Light

安卓手电筒应用
Java
4
star
14

WiFi_Tool

安卓WiFi密码查看器
Java
3
star
15

WeatherStation

课程实践——气象站 App
Java
3
star
16

AndroidApplication

This is a repository contains some interesting libraries, app codes, demos...(包含个人收藏的库,应用源码,以及小案例...)
Java
3
star
17

LoginSystem_Server

登录注册系统(Web服务端)——Java课程实践
Java
2
star
18

ControlPCServiceDemo

手机控制局域网内的电脑——电脑端
Java
2
star
19

MqttLib

Mqtt 通信封装库.
Java
2
star
20

AndroidApp

This is a repository backup for AndroidApplication repository.
Java
2
star
21

IndoorMapDemo

use mappwidget implements indoor map
Java
2
star
22

LoginProjectClient

B/S模式登录注册注销(Android客户端)
Java
2
star
23

CountDownButton

自定义控件——验证码倒计时按钮.
Java
2
star
24

ControlPCDemo

手机控制局域网内的电脑——安卓端
Java
2
star
25

Python

my python demos
Python
1
star
26

PingTopDemo

Java
1
star
27

TrackClient

航迹分析管理项目_客户端
Java
1
star
28

MultiSwitchButton

a view implements a switch button with multi choice.
Java
1
star
29

BTChat

蓝牙聊天Demo
Java
1
star
30

a-voyager.github.io

Repository for personal website.
HTML
1
star
31

Awesome-Python

闲暇时光写的一些有趣的 Python 小玩具.
Python
1
star
32

EnvMonitorSystem

智能家居环境监测系统(java上位机软件)——Java课程实践
Java
1
star
33

StepCounter

计步器
Java
1
star
34

MySqlDemo

JAVA链接MySQL数据库Demo
Java
1
star
35

SmartHouse_Server

单片机课程实践——智能家居系统(服务器端)
Java
1
star
36

RxDemo

时下流行火热的框架使用方法案例集合.
Java
1
star
37

MenuDemo

仿天天动听滑动菜单
Java
1
star