All Projects → qwert2603 → VectorIntegerView

qwert2603 / VectorIntegerView

Licence: other
Animated integer on Android. https://habr.com/post/420919/

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to VectorIntegerView

Konfetti
Celebrate more with this lightweight confetti particle system 🎊
Stars: ✭ 2,278 (+13300%)
Mutual labels:  android-ui, android-animation
Ticker
An Android text view with scrolling text change animation
Stars: ✭ 4,194 (+24570.59%)
Mutual labels:  android-ui, android-animation
android-gallery
Shared element transition example with RecyclerView and ViewPager.
Stars: ✭ 38 (+123.53%)
Mutual labels:  android-ui, android-animation
Confetti
An Android particle system library for displaying confetti!
Stars: ✭ 1,194 (+6923.53%)
Mutual labels:  android-ui, android-animation
Vectorifydahome
📱 Minimal app to apply wallpapers from a vast (400+) collection of vector graphics 🙃
Stars: ✭ 119 (+600%)
Mutual labels:  android-ui, vector-graphics
Teammate Android
A Team Management app for creating tournaments and games for various sports
Stars: ✭ 116 (+582.35%)
Mutual labels:  android-ui, android-animation
Audio Visualizer Android
🎵 [Android Library] A light-weight and easy-to-use Audio Visualizer for Android.
Stars: ✭ 581 (+3317.65%)
Mutual labels:  android-ui, android-animation
Wiggle
An Android helper library for delayed scrolling
Stars: ✭ 179 (+952.94%)
Mutual labels:  android-ui, android-animation
Bottomsheet
BottomSheet dialog library for Android
Stars: ✭ 219 (+1188.24%)
Mutual labels:  android-ui, android-animation
andColorPicker
Color picker library for Android
Stars: ✭ 233 (+1270.59%)
Mutual labels:  android-ui
VideoPreLoading
Demo for video PreLoading/ PreCaching using ExoPlayer 2.13.3 in Android.
Stars: ✭ 61 (+258.82%)
Mutual labels:  android-ui
random-users-details
Random Users details in flutter from randomusers api
Stars: ✭ 14 (-17.65%)
Mutual labels:  android-ui
Generative-Art
A selection of generative art scripts written in Python
Stars: ✭ 284 (+1570.59%)
Mutual labels:  vector-graphics
XCPullToLoadMoreListView
XCPullToLoadMoreListView-下拉加载更多ListView控件(仿QQ、微信聊天对话列表控件)
Stars: ✭ 24 (+41.18%)
Mutual labels:  android-ui
TypedTextView
Custom implementation of Android's TextView simulating a keyboard/type-writer.
Stars: ✭ 57 (+235.29%)
Mutual labels:  android-ui
AndroidTabsExample
An Example Android Application with Tabs
Stars: ✭ 17 (+0%)
Mutual labels:  android-ui
android-cuberto-dialog-design
This is an implementation inspired by beautiful design by Cuberto on his Dribble page, which can be found here https://dribbble.com/shots/3206606-Landing-page-wip
Stars: ✭ 15 (-11.76%)
Mutual labels:  android-ui
awesome-android-libraries
😎 A curated list of awesome Android libraries
Stars: ✭ 135 (+694.12%)
Mutual labels:  android-ui
CustomToastLibrary
Android Custom Toast
Stars: ✭ 26 (+52.94%)
Mutual labels:  android-ui
raster-retrace
Image tracing command line utility.
Stars: ✭ 40 (+135.29%)
Mutual labels:  vector-graphics

VectorIntegerView

VectorIntegerView (viv) is custom view to display integers on Android via great animations minSdkVersion 21.

Paths for vector drawables drawables are taken here.

Showcase video

Demo APK

Article on Habr.com

art

Customizing

VectorIntegerView has following XML-attributes:

  • viv_vector_integer initial integer to show (0 by default).
  • viv_digit_color color of integer (black by default).

Other properties may be configured by overriding resourses from library:

(those will be applied to all VectorIntegerView in app, for example see demo-app)

  • @integer/viv_animation_duration defines duration of animation (400ms by default).
  • @dimen/viv_digit_size defines size of one digit (24dp by default).
  • @dimen/viv_digit_translateX applied to all avd-digits, to center them horizontally.
  • @dimen/viv_digit_translateY applied to all avd-digits, to center them vertically.
  • @dimen/viv_digit_strokewidth applied to all avd-digits.
  • @dimen/viv_digit_margin_horizontal applied to all digit-views (-3dp by default). This is needed to make horizontal spaces between digits smaller, because avd-digits are square.

In code

XML

<com.qwert2603.vector_integer_view.VectorIntegerView
    android:id="@+id/vectorIntegerView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="16dp"
    app:viv_digit_color="#ff8000"
    app:viv_vector_integer="14" />

Java / Kotlin

Digit can be set also via code as BigInteger as well as digit color:

final VectorIntegerView vectorIntegerView = findViewById(R.id.vectorIntegerView);
vectorIntegerView.setInteger(
        vectorIntegerView.getInteger().add(BigInteger.ONE),
        /* animated = */ true
);
vectorIntegerView.setDigitColor(getColor(R.color.colorAccent));

Also there is overloaded function that allows set integer as long:

vectorIntegerView.setInteger(1918L, false);

For example see demo-app.

Under the hood

VectorIntegerView is implemented by RecyclerView and each digit is ImageView with <animated-selector> drawable.

Animation are controlled by custom RecyclerView's item animator: DigitItemAnimator.

When animated each digit stays on it's own position. This is done via DiffUtil in DigitAdapter.

Download

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
dependencies {
        implementation 'com.github.qwert2603:VectorIntegerView:x.y.z'
}
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].