项目作者: elevenetc

项目描述 :
Badge view with animated effect which shows a bitmap or a text
高级语言: Java
项目地址: git://github.com/elevenetc/BadgeView.git
创建时间: 2015-09-01T00:32:32Z
项目社区:https://github.com/elevenetc/BadgeView

开源协议:

下载


BadgeView

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

animation

Usage

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

XML attributes

  1. <attr name="badgeText" format="string"></attr>
  2. <attr name="badgeBitmap" format="reference"></attr>
  3. <attr name="badgeBackgroundColor" format="color"></attr>
  4. <attr name="badgeTextColor" format="color"></attr>
  5. <attr name="badgeTextSize" format="dimension"></attr>
  6. <attr name="badgePadding" format="dimension"></attr>
  7. <attr name="badgeAnimationDuration" format="integer"></attr>

Animations

To show values sequentially use setValues method:

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

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

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

Download

  1. repositories {
  2. maven { url "https://jitpack.io" }
  3. }
  4. //...
  5. dependencies {
  6. //...
  7. compile 'com.github.elevenetc:badgeview:v1.0.0'
  8. }

Licence

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