All Projects → vitorhugods → Avatarview

vitorhugods / Avatarview

Licence: apache-2.0
A circular Image View with a lot of perks. Including progress animation and highlight state with borders and gradient color.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Avatarview

Circular Music Progressbar
Beautiful Circular Progress Bar with album art for android
Stars: ✭ 813 (+89.51%)
Mutual labels:  widget, progress-bar, imageview
XCArcProgressView
Android开口圆环比例进度View(高仿猎豹清理大师内存占用比例View)
Stars: ✭ 28 (-93.47%)
Mutual labels:  progress-bar, android-ui, progress-circle
ProgressableImageView
Change your users progress capability with ProgressableImageView
Stars: ✭ 86 (-79.95%)
Mutual labels:  progress-bar, imageview
Circular-Progress-View
A customisable circular progress view for android.
Stars: ✭ 39 (-90.91%)
Mutual labels:  android-ui, progress-circle
ALProgressView
Animated and fully customizable progress view with 2 styles: ring and bar.
Stars: ✭ 72 (-83.22%)
Mutual labels:  progress-bar, progress-circle
Jetquotes
🔖 A Quotes Application built to Demonstrate the Jetpack Compose UI
Stars: ✭ 179 (-58.28%)
Mutual labels:  hacktoberfest, android-ui
Aboutlibraries
AboutLibraries automatically detects all dependencies of a project and collects their information including the license. Optionally visualising it via the provided ui components.
Stars: ✭ 2,777 (+547.32%)
Mutual labels:  hacktoberfest, android-ui
Image-Support
Add badge with counter to ImageView Android.
Stars: ✭ 128 (-70.16%)
Mutual labels:  imageview, android-ui
Progressbar
A really basic thread-safe progress bar for Golang applications
Stars: ✭ 2,212 (+415.62%)
Mutual labels:  hacktoberfest, progress-bar
FloatingView
FloatingView moved by finger supporting OverlaySystem, OverlayActivity, OverlayViewGroup modes
Stars: ✭ 58 (-86.48%)
Mutual labels:  widget, android-ui
mp-progress
专注于小程序圆环形进度条的小工具
Stars: ✭ 72 (-83.22%)
Mutual labels:  progress-bar, progress-circle
Carbon
Material Design implementation for Android 4.0+. Shadows, ripples, vectors, fonts, animations, widgets, rounded corners and more.
Stars: ✭ 2,942 (+585.78%)
Mutual labels:  widget, android-ui
Materialdrawer
The flexible, easy to use, all in one drawer library for your Android project. Now brand new with material 2 design.
Stars: ✭ 11,498 (+2580.19%)
Mutual labels:  hacktoberfest, android-ui
Flutter hooks
React hooks for Flutter. Hooks are a new kind of object that manages a Widget life-cycles. They are used to increase code sharing between widgets and as a complete replacement for StatefulWidget.
Stars: ✭ 1,973 (+359.91%)
Mutual labels:  hacktoberfest, widget
Linearprogressbar
Material Linear Progress Bar for your iOS apps
Stars: ✭ 131 (-69.46%)
Mutual labels:  hacktoberfest, progress-bar
CombineView
View that combines multiple images
Stars: ✭ 27 (-93.71%)
Mutual labels:  widget, imageview
Fastadapter
The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
Stars: ✭ 3,512 (+718.65%)
Mutual labels:  hacktoberfest, android-ui
Edxposedmanager
Companion Android application for EdXposed
Stars: ✭ 1,172 (+173.19%)
Mutual labels:  hacktoberfest, android-ui
Dev Widget
Unofficial Widget/profile card for https://dev.to/
Stars: ✭ 91 (-78.79%)
Mutual labels:  hacktoberfest, widget
react-sweet-progress
A way to quickly add a progress bar to react app 🌈
Stars: ✭ 250 (-41.72%)
Mutual labels:  progress-bar, progress-circle

AvatarView

A circular Image View with a lot of perks. Including progress animation and highlight state with borders and gradient color.

Gradle Codacy Badge Kotlin Kotlin GitHub license Say Thanks!

Built with ❤︎ by Vitor Hugo Schwaab and contributors

Samples

Example 1 Example 1
Example 1 Example 1

Supports initials if no image is provided:

Initials

Thanks to @anoop44

Supports a badge, for "online/offline" status or other use cases:

Badge

Thanks to @p1yu5h

Demo

Watch the video or clone the repo and build the demo app

Importing to Gradle

Make sure you have the JCenter repository.

  • Kotlin DSL build.gradle.kts
dependencies {
    implementation("xyz.schwaab:avvylib:1.2.0")
}
  • Or, Groovy build.gradle
dependencies {
    implementation "xyz.schwaab:avvylib:1.2.0"
}

Known issue with the 1.1.0 version

There's a known problem with the version 1.1.0 available on JCenter. Its aar file is basically empty, causing the class AvatarView to not be found. This was caused by enabling minify by mistake and was fixed right after. Please use the version 1.1.1 and be happy with that.

Usage

Just add this to your XML:

    <xyz.schwaab.avvylib.AvatarView
        android:layout_width="128dp"
        android:layout_height="128dp"
        app:avvy_border_color="@color/grey400"
        app:avvy_border_highlight_color="#ff5900"
        app:avvy_border_highlight_color_end="#bf15bc"
        app:avvy_border_thickness="2dp"
        app:avvy_border_thickness_highlight="3dp"
        app:avvy_distance_to_border="5dp"
        app:avvy_highlighted="true"
        app:avvy_loading_arches="5"
        app:avvy_loading_arches_degree_area="90"/>

Add the name initials as fallback:

        app:avvy_text="Avatar View"                 //will show up as AV
        app:avvy_text_size="42sp"
        app:avvy_text_color="#ccc"

Add the badge if you want:

        app:avvy_show_badge="true"                  //Default = false
        app:avvy_badge_radius="18dp"
        app:avvy_badge_stroke_width="2dp"
        app:avvy_badge_stroke_color="@color/white"
        app:avvy_badge_position="BOTTOM_RIGHT"      //Default value

You can personalize it in Kotlin:

        avatarView.apply {
            isAnimating = false
            borderThickness = 18
            highlightBorderColor = Color.GREEN
            highlightBorderColorEnd = Color.CYAN
            numberOfArches = 0
            totalArchesDegreeArea = 80
            text = "Avatar View"
            showBadge = true
            badgePosition = BadgePosition.TOP_LEFT
        }

Or, in Java:

        avatarView.setAnimating(false);
        avatarView.setBorderThickness(18);
        avatarView.setHighlightBorderColor(Color.GREEN);
        avatarView.setHighlightBorderColorEnd(Color.CYAN);
        avatarView.setNumberOfArches(0);
        avatarView.setTotalArchesDegreeArea(80);

Custom Animations

Example 1

Create an AvatarViewAnimationOrchestrator, passing at least one AvatarViewAnimator.

The setupAnimators are the first running, and they run in reverse when animation is stopping. They should not repead infinitely, so the progressAnimators can start. The progressAnimators can run indefinitely.

You don't need to use both setup and progress, just one is enough. But, by having the setup having a finite duration, and reversible, it allows for a smoother animation stop.

Example:

    val archesExpansion = object: AvatarViewAnimator{
        override val baseAnimator = ValueAnimator.ofFloat(0f, 1f).apply {
            duration = 500L
            interpolator = DecelerateInterpolator()
        }
    
        override fun onValueUpdate(animatorInterface: AvatarView.AnimatorInterface) {
            val animatedValue = baseAnimator.animatedValue as Float
            animatorInterface.updateAnimationState { currentState ->
                currentState.copy(archesExpansionProgress = animatedValue)
            }
        }
    }
    val bouncingRotation = object : AvatarViewAnimator {
        override val baseAnimator = ValueAnimator.ofFloat(0f, 1f).apply {
            repeatCount = ValueAnimator.INFINITE
            duration = 3000L
            interpolator = BounceInterpolator()
        }
    
        override fun onValueUpdate(animatorInterface: AvatarView.AnimatorInterface) {
            val animatedValue = baseAnimator.animatedValue as Float
            animatorInterface.updateAnimationState { currentState ->
                currentState.copy(rotationProgress = animatedValue)
            }
        }
    }

    avatarView.animationOrchestrator = AvatarViewAnimationOrchestrator(archesExpansion, bouncingRotation) 

Check the sample app for the full source code.

Special Thanks

The roundness of the drawables based on Henning Dodenhof's Circle ImageView

Libraries used in the demo app:

License

Copyright 2020 Vitor Hugo D. Schwaab

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.
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].