SuperBadge
SuperBadge Android Library : Android Library to display ratings and other information in a beautiful badge!!
# Gradle
**Step 1. ** Add the JitPack repository to your build file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.JP1016:SuperBadge:v1'
}
Maven
Step 1. Add the JitPack repository to your build file
Step 2. Add the dependency
Usage
XML
Java
//Init
SuperBadge sb=findViewById(R.id.badge);
sb.setImage("https://4.bp.blogspot.com/-Nyfdpymc_Lo/VkQw-nJ79mI/AAAAAAAARYg/6o9VeoTvu-I/s1600-r/logo_chrome.png");
sb.setPrimaryText("Google Chrome");
sb.setSecondaryText("Web Browser");
//Callback
sb.setOnBageClickListener(new SuperBadge.OnBadgeClickListener() {
@Override
public void onBadgeClick() {
Toast.makeText(SampleActivity.this, "Clicked on Badge", Toast.LENGTH_SHORT).show();
}
});
Kotlin
//Init
val sb = findViewById<SuperBadge>(R.id.badge)
//Callback
sb.setOnBageClickListener { Toast.makeText(this@SampleActivity, "Clicked on Badge", Toast.LENGTH_SHORT).show() }