All Projects → rubygarage → Emotion Rating View

rubygarage / Emotion Rating View

Licence: apache-2.0
A library for animated rating view in Android apps.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Emotion Rating View

Swipetransition
Allows trendy transitions using swipe gesture such as "swipe back anywhere".
Stars: ✭ 272 (-9.03%)
Mutual labels:  transition
Plotsquared
PlotSquared - Reinventing the plotworld
Stars: ✭ 284 (-5.02%)
Mutual labels:  gradle
Xhttp2
💪A powerful network request library, encapsulated using the RxJava2 + Retrofit2 + OKHttp combination.(一个功能强悍的网络请求库,使用RxJava2 + Retrofit2 + OKHttp组合进行封装)
Stars: ✭ 292 (-2.34%)
Mutual labels:  gradle
Kotlin Examples
Various examples for Kotlin
Stars: ✭ 3,014 (+908.03%)
Mutual labels:  gradle
Gradle Multi Project Example
Gradle 多项目管理示例
Stars: ✭ 283 (-5.35%)
Mutual labels:  gradle
Gittoolbox
GitToolBox IntelliJ plugin
Stars: ✭ 284 (-5.02%)
Mutual labels:  gradle
Androidonboarder
A simple way to make a beauty onboarding experience (app intro or welcome screen) for your users.
Stars: ✭ 269 (-10.03%)
Mutual labels:  gradle
Tltransitions
快速实现控制器的转场和View的快速popover显示,并支持自定义动画、手势退场
Stars: ✭ 296 (-1%)
Mutual labels:  transition
Gradle Docker Compose Plugin
Simplifies usage of Docker Compose for integration testing in Gradle environment.
Stars: ✭ 284 (-5.02%)
Mutual labels:  gradle
Javapackager
📦 Gradle/Maven plugin to package Java applications as native Windows, Mac OS X, or GNU/Linux executables and create installers for them.
Stars: ✭ 285 (-4.68%)
Mutual labels:  gradle
Gradle Unused Resources Remover Plugin
Gradle Plugin that removes unused resources in Android projects.
Stars: ✭ 282 (-5.69%)
Mutual labels:  gradle
Gradle Code Quality Tools Plugin
Gradle plugin that generates ErrorProne, Findbugs, Checkstyle, PMD, CPD, Lint, Detekt & Ktlint Tasks for every subproject.
Stars: ✭ 282 (-5.69%)
Mutual labels:  gradle
React Css Transition Replace
A React component to animate replacing one element with another.
Stars: ✭ 288 (-3.68%)
Mutual labels:  transition
Android Camera2 Secret Picture Taker
Take pictures 📷 secretly (without preview or launching device's camera app) using Android CAMERA2 API
Stars: ✭ 275 (-8.03%)
Mutual labels:  gradle
Atom
Java course materials
Stars: ✭ 293 (-2.01%)
Mutual labels:  gradle
Gradle Aws Plugin
Gradle plugin to manage Amazon Web Services
Stars: ✭ 269 (-10.03%)
Mutual labels:  gradle
Viewpagertransition
viewpager with parallax pages, together with vertical sliding (or click) and activity transition
Stars: ✭ 3,017 (+909.03%)
Mutual labels:  transition
The Pit Of The Android Studio
👍 👍 👏 🌟 ⭐️ ⭐️ Everything about the Android Studio and Intellij IDEAfor example:Install,common problems and solutions,each libraries for android and androidx library,code and peoject templates,etc.全面总结Android Studio以及Intellij IDEA的填坑指南,详解AS版本号、Gradle版本、BuildTools三者的对照关系,AS模板配置,gradle插件,Android自带注解库详解,support详解等干货。
Stars: ✭ 296 (-1%)
Mutual labels:  gradle
Crazydaily
[开源项目] 一款程序员日常放松的App,基于Material Design + MVP-Clean + Weex + Flutter + RxJava2 + Retrofit + Dagger2 + Glide + Okhttp + MTRVA + BRVAH + 炫酷控件 + 炫酷动画
Stars: ✭ 294 (-1.67%)
Mutual labels:  transition
Gradle Ssh Plugin
Gradle SSH Plugin
Stars: ✭ 289 (-3.34%)
Mutual labels:  gradle

EmotionRatingView

Version API License

About

EmotionRatingApp is a library for Android apps demonstrating emotional response based on selected rating.

Inspiration

EmotionRatingView was inspired by a UI/UX Demo by Adip Nayak

Demo

Description

EmotionRatingView library contains EmotionView, RatingView, and GradientBackgroundView.

EmotionView - Displays an animated face that responds to a rating change.
RatingView - Displays rating bar with animated grades.
GradientBackgroundView - Displays a smoothly changing background with a gradient that responds to the rating change.

Library Usage

Add JitPack repository to your build.gradle file

allprojects {
	repositories {
	     ...
	     maven { url 'https://jitpack.io' }
	}
}

Add the Dependency

dependencies {
    implementation com.github.rubygarage:emotion-rating-view:v1.0.1
}

Note that starting from 1.0.1, the library is expected to use with AndroidX. Please migrate to AndroidX if you use 1.0.1 or above.

Please use 1.0.0 if you haven't migrated to AndroidX.

Add EmotionRatingView library to your layout. You can also use all views separately.

    <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        
        <com.dm.emotionrating.library.GradientBackgroundView
                android:id="@+id/gradientBackgroundView"
                android:layout_width="0dp"
                android:layout_height="0dp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />
                
        <com.dm.emotionrating.library.EmotionView
                android:id="@+id/emotionView"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginBottom="8dp"
                android:layout_marginEnd="48dp"
                android:layout_marginLeft="48dp"
                android:layout_marginRight="48dp"
                android:layout_marginStart="48dp"
                android:layout_marginTop="8dp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />
                
        <com.dm.emotionrating.library.RatingView
                android:id="@+id/ratingView"
                android:layout_width="wrap_content"
                android:layout_height="40dp"
                android:layout_marginEnd="8dp"
                android:layout_marginLeft="8dp"
                android:layout_marginRight="8dp"
                android:layout_marginStart="8dp"
                android:layout_marginTop="16dp"
                android:padding="5dp"
                app:gap="5dp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/emotionView" />
                
    </androidx.constraintlayout.widget.ConstraintLayout>

Add to your Activity.

ratingView.setRatingChangeListener { previousRating, newRating ->
            emotionView.setRating(previousRating, newRating)
            gradientBackgroundView.changeBackground(previousRating, newRating)
        }

Set RatingChangeListener to get notified when rating changed.

ratingView.setRatingChangeListener { previousRating, newRating ->
            ...
        }

Set rating for all views from 0 to 5. The default rating is 0.

ratingView.setRating(rating)
 
emotionView.setRating(previousRating, newRating)
 
gradientBackgroundView.changeBackground(previousRating, newRating)

You can also see the example to get better understanding.

Customization

RatingView

Property Description
android:layout_height Changes the height of grades
android:background Changes the background of the RatingView
app:gap Changes the distance between grades

To change the color of the face and grades, you can override the attributes in your theme.

<style name="YourCustomThemeTheme">
    ...
    <item name="faceColor">@color/colorWhite</item>
    <item name="gradeColor">@color/orange</item>
</style>

To change the gradient color set, you can override the attributes in the GradientBackgroundView or in your theme.

<style name="YourCustomThemeTheme">
    ...
    <item name="zeroGradeGradientColors">@array/garageZeroGradeGradientColors</item>
    <item name="oneGradeGradientColors">@array/garageOneGradeGradientColors</item>
    <item name="twoGradeGradientColors">@array/garageTwoGradeGradientColors</item>
    <item name="threeGradeGradientColors">@array/garageThreeGradeGradientColors</item>
    <item name="fourGradeGradientColors">@array/garageFourGradeGradientColors</item>
    <item name="fiveGradeGradientColors">@array/garageFiveGradeGradientColors</item>
</style>

Also, you have to define the arrays of colors that you want to use. There must be at least two colors in one set.

<integer-array name="garageZeroGradeGradientColors">
   <item>@color/thirdGradientColor</item>
   <item>@color/thirdGradientColor</item>
</integer-array>
    
<integer-array name="garageOneGradeGradientColors">
   <item>@color/fifthGradientColor</item>
   <item>@color/fifthGradientColor</item>
</integer-array>
    
<integer-array name="garageTwoGradeGradientColors">
   <item>@color/fifthGradientColor</item>
   <item>@color/fourthGradientColor</item>
   <item>@color/thirdGradientColor</item>
   <item>@color/secondGradientColor</item>
</integer-array>
    
<integer-array name="garageThreeGradeGradientColors">
    <item>@color/fourthGradientColor</item>
    <item>@color/thirdGradientColor</item>
    <item>@color/secondGradientColor</item>
    <item>@color/firstGradientColor</item>
</integer-array>
    
<integer-array name="garageFourGradeGradientColors">
    <item>@color/thirdGradientColor</item>
    <item>@color/firstGradientColor</item>
</integer-array>
    
<integer-array name="garageFiveGradeGradientColors">
    <item>@color/secondGradientColor</item>
    <item>@color/firstGradientColor</item>
    <item>@color/firstGradientColor</item>
</integer-array>

Requirements

  • Android 4.1 (API 16) - a minimum supported version
  • Android Studio for application build
  • Gradle to install all the dependencies

License

EmotionRatingView is licensed under the Apache 2.0 license


RubyGarage Logo

RubyGarage is a leading software development and consulting company in Eastern Europe. Our main expertise includes Ruby and Ruby on Rails, but we successfully employ other technologies to deliver the best results to our clients. Check out our portfolio for even more exciting works!

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