資源簡介
Android 日歷+記事本+提醒 源碼

代碼片段和文件信息
package?com.readystatesoftware.viewbadger;
import?android.content.Context;
import?android.content.res.Resources;
import?android.graphics.Color;
import?android.graphics.Typeface;
import?android.graphics.drawable.ShapeDrawable;
import?android.graphics.drawable.shapes.RoundRectShape;
import?android.util.AttributeSet;
import?android.util.TypedValue;
import?android.view.Gravity;
import?android.view.View;
import?android.view.ViewGroup;
import?android.view.ViewGroup.LayoutParams;
import?android.view.ViewParent;
import?android.view.animation.AccelerateInterpolator;
import?android.view.animation.AlphaAnimation;
import?android.view.animation.Animation;
import?android.view.animation.DecelerateInterpolator;
import?android.widget.frameLayout;
import?android.widget.TabWidget;
import?android.widget.TextView;
/**
?*?A?simple?text?label?view?that?can?be?applied?as?a?“badge“?to?any?given?{@link?android.view.View}.?
?*?This?class?is?intended?to?be?instantiated?at?runtime?rather?than?included?in?xml?layouts.
?*?
?*?@author?Jeff?Gilfelt
?*/
public?class?BadgeView?extends?TextView?{
public?static?final?int?POSITION_TOP_LEFT?=?1;
public?static?final?int?POSITION_TOP_RIGHT?=?2;
public?static?final?int?POSITION_BOTTOM_LEFT?=?3;
public?static?final?int?POSITION_BOTTOM_RIGHT?=?4;
public?static?final?int?POSITION_CENTER?=?5;
private?static?final?int?DEFAULT_MARGIN_DIP?=?5;
private?static?final?int?DEFAULT_LR_PADDING_DIP?=?5;
private?static?final?int?DEFAULT_CORNER_RADIUS_DIP?=?8;
private?static?final?int?DEFAULT_POSITION?=?POSITION_TOP_RIGHT;
private?static?final?int?DEFAULT_BADGE_COLOR?=?Color.parseColor(“#CCFF0000“);?//Color.RED;
private?static?final?int?DEFAULT_TEXT_COLOR?=?Color.WHITE;
private?static?Animation?fadeIn;
private?static?Animation?fadeOut;
private?Context?context;
private?View?target;
private?int?badgePosition;
private?int?badgeMarginH;
private?int?badgeMarginV;
private?int?badgeColor;
private?boolean?isShown;
private?ShapeDrawable?badgeBg;
private?int?targetTabIndex;
public?BadgeView(Context?context)?{
this(context?(AttributeSet)?null?android.R.attr.textViewstyle);
}
public?BadgeView(Context?context?AttributeSet?attrs)?{
?this(context?attrs?android.R.attr.textViewstyle);
}
/**
?????*?Constructor?-
?????*?
?????*?create?a?new?BadgeView?instance?attached?to?a?target?{@link?android.view.View}.
?????*
?????*?@param?context?context?for?this?view.
?????*?@param?target?the?View?to?attach?the?badge?to.
?????*/
public?BadgeView(Context?context?View?target)?{
?this(context?null?android.R.attr.textViewstyle?target?0);
}
/**
?????*?Constructor?-
?????*?
?????*?create?a?new?BadgeView?instance?attached?to?a?target?{@link?android.widget.TabWidget}
?????*?tab?at?a?given?index.
?????*
?????*?@param?context?context?for?this?view.
?????*?@param?target?the?TabWidget?to?attach?the?badge?to.
?????*?@param?index?the?position?of?the?tab?within?the?target.
?????*/
public?BadgeView(Context?context?TabWidget?tar
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\
?????文件?????????372??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\.classpath
?????文件??????????39??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\.gitignore
?????文件?????????821??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\.project
?????文件?????????706??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\AndroidManifest.xm
?????文件???????11393??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\LICENSE
?????文件????????1417??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\README.markdown
?????目錄???????????0??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\lib\
?????文件????????7774??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\lib\android-viewbadger.jar
?????文件????????1248??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\proguard.cfg
?????文件?????????360??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\project.properties
?????目錄???????????0??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\res\
?????目錄???????????0??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\res\drawable-hdpi\
?????文件????????3566??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\res\drawable-hdpi\badge_ifaux.9.png
?????文件????????4147??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\res\drawable-hdpi\icon.png
?????目錄???????????0??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\res\drawable-ldpi\
?????文件????????1723??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\res\drawable-ldpi\icon.png
?????目錄???????????0??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\res\drawable-mdpi\
?????文件????????2574??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\res\drawable-mdpi\icon.png
?????目錄???????????0??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\res\layout\
?????文件????????2170??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\res\layout\demos.xm
?????文件????????1204??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\res\layout\main.xm
?????文件????????5374??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\res\layout\tests.xm
?????目錄???????????0??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\res\values\
?????文件?????????125??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\res\values\strings.xm
?????目錄???????????0??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\src\
?????目錄???????????0??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\src\com\
?????目錄???????????0??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\src\com\readystatesoftware\
?????目錄???????????0??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\src\com\readystatesoftware\viewbadger\
?????文件???????11943??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\src\com\readystatesoftware\viewbadger\BadgeView.java
?????目錄???????????0??2012-09-04?18:38??jgilfelt-android-viewbadger-9e5d8f2\src\viewbadger\
............此處省略3個文件信息
評論
共有 條評論