Give effect for shifting the calculation of numbers from the starting value to the final value.
- build.gradle (Old way)
maven { url 'https://jitpack.io' }
- setting.gradle: dependencyResolutionManagement (New way)
maven { url 'https://jitpack.io' }
implementation 'com.github.eriffanani:CountAnimator:1.0.1'
- Java
CountAnimator anim = new CountAnimator(1000, 0);
anim.doOnUpdate((value, valueStr) -> {
// TODO ACTION
});
anim.start();
- Kotlin
val anim = CountAnimator(1000, 0)
anim.doOnUpdate { value, valueStr ->
myTextView.text = valueStr
}
anim.start()
anim.start();
anim.pause();
anim.resume();
anim.stop();
new CountAnimator("€10.000", "€100");
anim.duration(3); // 3 Seconds
anim.duration(3000L); // 3 Seconds
- Java
anim.doOnEnd(() -> {
// TODO ACTION
});
- Kotlin
anim.doOnEnd {
// TODO ACTION
}
- Decimal
anim.format(CountFormatDecimal("#,###"))
- Currency Use your country code and set fraction digits ex: 2
anim.format(new CountFormatCurrency("EUR"));
anim.format(new CountFormatCurrency("EUR", 2));
This library is still being developed further, please provide feedback if you find a bug. Thank you
Copyright 2022 Mukhammad Erif Fanani
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.