pedromalta/BadgeView


Badge view with animated effect which shows a bitmap or a text

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.pedromalta:badgeview:1.0.1'
	}
	dependencies {
		implementation("com.github.pedromalta:badgeview:1.0.1")
	}
	<dependency>
	    <groupId>com.github.pedromalta</groupId>
	    <artifactId>badgeview</artifactId>
	    <version>1.0.1</version>
	</dependency>

                            
    libraryDependencies += "com.github.pedromalta" % "badgeview" % "1.0.1"
        
        

                            
    :dependencies [[com.github.pedromalta/badgeview "1.0.1"]]
        
        

Readme


BadgeView

Badge view with animated effect which shows a bitmap or a text. FIXED: Null Pointer Exception Bug and Updated Dependencies/Gradle

animation

Usage

<su.levenetc.android.badgeview.BadgeView
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  app:badgeText="Hello!" />
BadgeView badgeView = new BadgeView(this);
badgeView.setValue(R.string.hello);

XML attributes

<attr name="badgeText" format="string"/>
<attr name="badgeBitmap" format="reference"/>
<attr name="badgeBackgroundColor" format="color"/>
<attr name="badgeTextColor" format="color"/>
<attr name="badgeTextSize" format="dimension"/>
<attr name="badgePadding" format="dimension"/>
<attr name="badgeAnimationDuration" format="integer"/>

Animations

To show values sequentially use setValues method:

Bitmap bitmapX;
badgeView.setValues(0, 1, bitmapX, 3, "How are you?");

To define partucular delay for each value use helper class BadgeView.AnimationSet:

new BadgeView.AnimationSet(badgeView)
  .add("Hi!", 1000)
  .add("How are you?", 1200)
  .add("Im fine!", 1500)
  .play();

Download

repositories {
    maven { url "https://jitpack.io" }
}
//...
dependencies {
    //...
    implementation 'com.github.pedromalta:badgeview:1.0.1'
}

Licence

http://www.apache.org/licenses/LICENSE-2.0