android动画框架翻转,翻转数字动画库,当从一个数字更改为另一个数字时,可以进行生动而灵活的动画翻转...

Flip digit library

Flip digit Library that makes a cool and flexible animation flip when changing from one numbers to another

68747470733a2f2f6a69747061636b2e696f2f762f616c6472656b2f466c69705f44696769742e73766768747470733a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d416e64726f69642d677265656e2e73766768747470733a2f2f696d672e736869656c64732e696f2f62616467652f4150492d32312532422d627269676874677265656e2e7376673f7374796c653d706c6173746963

🔨 Setup

In your build.gradle:

dependencies {

implementation 'com.github.aldrek:Flip_Digit:1.0.1'

}

Usage

Single digit

single.gif

Use this in xml

android:id="@+id/digit"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

app:isFastFlip="true"

app:tintColor="#FF0000"

app:layout_constraintBottom_toBottomOf="parent"

app:layout_constraintEnd_toEndOf="parent"

app:layout_constraintStart_toStartOf="parent"

app:layout_constraintTop_toTopOf="parent"

>

Kotlin

var i = 0

object : CountDownTimer(10000, 1000) {

override fun onTick(millisUntilFinished: Long) {

digit.setDigit(i , true)

i++

}

override fun onFinish() {

}

}.start()

Java

int i = 0;

new CountDownTimer(10000, 1000) {

public void onTick(long millisUntilFinished) {

digit.setDigit(i*2 , true);

}

public void onFinish() {

}

}.start();

Widget digit

widget.gif

Use this in xml

android:id="@+id/flipWidget"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

app:layout_constraintStart_toStartOf="parent"

app:layout_constraintEnd_toEndOf="parent"

app:layout_constraintTop_toTopOf="parent"

app:layout_constraintBottom_toBottomOf="parent"

app:numberOfDigits="6"

app:digitColor="@color/colorAccent"

app:isFastFlipMain="true">

Kotlin

var i = 0

object : CountDownTimer(30000, 1000) {

override fun onTick(millisUntilFinished: Long) {

flipWidget.setValue(i , true)

i++

}

override fun onFinish() {

}

}.start()

Java

flipWidget = this.findViewById(R.id.flipWidget);

int i = 0;

new CountDownTimer(10000, 1000) {

public void onTick(long millisUntilFinished) {

flipWidget.setValue(i*2 , true);

}

public void onFinish() {

}

}.start();

Attributes

Attribute

Description

isFastFlipMain

enable change flip number from one number to another without going thought all the numbers in between for one digit

tintColor

change the background color of digit

numberOfDigits

change the number of digits for the widget

digitColor

change all the background of digits in widget

License

Copyright 2018 aldrek . All rights reserved.

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值