MCPcopy Index your code
hub / github.com/bingoogolapple/BGABadgeView-Android

github.com/bingoogolapple/BGABadgeView-Android @1.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.2.0 ↗ · + Follow
156 symbols 386 edges 13 files 28 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

:heartpulse:BGABadgeView-Android:heartpulse:

Android Arsenal License Download

中文文档

react-native-bga-badge-view

The demo shows: * The latest message number of weibo at the bottom tab * The VIP badge located in lower-right Corner of User’s Photo in the weibo user list * The new message in the weixin message page * The subscribe message in the weixin message page * User’s round corner photo made by RoundedBitmapDrawable from v4 package * Delete badge by drag and drop

The realization of explosion effect refers to ExplosionField with the modify of only retaining one View,and only refresh the field around of badge

Screenshots

badgeview

Gradle Dependencies

Download

dependencies {
    implementation 'com.github.bingoogolapple.BGABadgeView-Android:api:latestVersion'
    annotationProcessor 'com.github.bingoogolapple.BGABadgeView-Android:compiler:latestVersion'
}

Initialize BGABadge

Add BGABadge annotation to any class, such as newly created class BGABadgeInit

@BGABadge({
        View.class, // ===> cn.bingoogolapple.badgeview.BGABadgeView,If you do not need, please delete this line
        ImageView.class, // ===> cn.bingoogolapple.badgeview.BGABadgeImageView,If you do not need, please delete this line
        TextView.class, // ===> cn.bingoogolapple.badgeview.BGABadgeFloatingTextView,If you do not need, please delete this line
        RadioButton.class, // ===> cn.bingoogolapple.badgeview.BGABadgeRadioButton,If you do not need, please delete this line
        LinearLayout.class, // ===> cn.bingoogolapple.badgeview.BGABadgeLinearLayout,If you do not need, please delete this line
        RelativeLayout.class, // ===> cn.bingoogolapple.badgeview.BGABadgeRelativeLayout,If you do not need, please delete this line
        FloatingActionButton.class, // ===> cn.bingoogolapple.badgeview.BGABadgeFloatingActionButton,If you do not need, please delete this line
        ...
        ...
        ...
})
public class BGABadgeInit {
}

Supported badge style for now

Class name usage scenario
BGABadgeRadioButton Bottom navigation of weibo home page
BGABadgeImageView User’s photo of weibo user list
BGABadgeTextView You can alternatively use BGABadgeCheckedTextView
BGABadgeLinearLayout Message number in the right of item in the list
BGABadgeRelativeLayout Message number in the right of item in the list
BGABadgeFrameLayout Message number in the right of item in the list

Interface/api explain

/**
 * show circle badge
 */
void showCirclePointBadge();

/**
 * show text badge
 *
 * @param badgeText
 */
void showTextBadge(String badgeText);

/**
 * hide badge
 */
void hiddenBadge();

/**
 * show image badge
 *
 * @param bitmap
 */
void showDrawableBadge(Bitmap bitmap);

/**
 * set the delegate to delete the badge by drag and drop
 *
 * @param delegate
 */
void setDragDismissDelegage(BGADragDismissDelegate delegate);

/**
 * Whether show the badge or not
 *
 * @return
 */
boolean isShowBadge();

/**
 * Can it be dragged
 *
 * @return
 */
boolean isDraggable();

/**
 * Whether being dragged
 *
 * @return
 */
boolean isDragging();

The customed attribution

The customed attribution Explain Default value
badge_bgColor Badge background Color.RED
badge_textColor Text color of badge Color.WHITE
badge_textSize Text font size of badge 10sp
badge_verticalMargin The distance in pixels from the top edge of badge’s background to the top edge of the host or from the bottom edge of badge’s bottom to the host’s bottom 4dp
badge_horizontalMargin The distance in pixels from the edge of badge’s background to the left or right edge of the host 4dp
badge_padding Badge’s padding 4dp
badge_gravity Badge’s gravity, it’s layout direction For BGABadgeImageView and BGABadgeRadioButton, upper right.For others, the default is the right side of the vertical center
badge_draggable The badge can be drag or not false
badge_isResumeTravel When the badge is dragged out of path, if it can resume the path in case of put back false
badge_borderWidth Border width of badge 0dp
badge_borderColor Border color of badge Color.WHITE
badge_dragExtra Extra distance of trigger drag event 4dp

About me

Personal homepage email QQ for the BGA funs
bingoogolapple.cn bingoogolapple@gmail.com BGA_CODE_CLUB

Donate

It takes much time and energy to maintain and improve this project. It BGA helps you, you may want to buy me a coffee :).

License

Copyright 2015 bingoogolapple

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Extension points exported contracts — how you extend this code

BGADragDismissDelegate (Interface)
作者:王浩 邮件:bingoogolapple@gmail.com 创建时间:15/7/12 下午6:33 描述:拖动大于BGABadgeViewHelper.mMoveHiddenThreshold后抬起手指徽章消失的代理 [2 implementers]
api/src/main/java/cn/bingoogolapple/badgeview/BGADragDismissDelegate.java
BGABadgeable (Interface)
作者:王浩 邮件:bingoogolapple@gmail.com 创建时间:15/7/6 下午10:42 描述:
api/src/main/java/cn/bingoogolapple/badgeview/BGABadgeable.java

Core symbols most depended-on inside this repo

postInvalidate
called by 20
api/src/main/java/cn/bingoogolapple/badgeview/BGABadgeable.java
dp2px
called by 15
api/src/main/java/cn/bingoogolapple/badgeview/BGABadgeViewUtil.java
getBadgeRectF
called by 11
api/src/main/java/cn/bingoogolapple/badgeview/BGABadgeViewHelper.java
getHeight
called by 11
api/src/main/java/cn/bingoogolapple/badgeview/BGABadgeable.java
getContext
called by 11
api/src/main/java/cn/bingoogolapple/badgeview/BGABadgeable.java
removeSelf
called by 10
api/src/main/java/cn/bingoogolapple/badgeview/BGADragBadgeView.java
showTextBadge
called by 9
api/src/main/java/cn/bingoogolapple/badgeview/BGABadgeable.java
getWidth
called by 9
api/src/main/java/cn/bingoogolapple/badgeview/BGABadgeable.java

Shape

Method 141
Class 12
Interface 2
Enum 1

Languages

Java100%

Modules by API surface

api/src/main/java/cn/bingoogolapple/badgeview/BGABadgeViewHelper.java42 symbols
api/src/main/java/cn/bingoogolapple/badgeview/BGADragBadgeView.java28 symbols
compiler/src/main/java/cn/bingoogolapple/badgeview/compiler/BGABadgeProcessor.java25 symbols
api/src/main/java/cn/bingoogolapple/badgeview/BGABadgeable.java19 symbols
demo/src/main/java/cn/bingoogolapple/badgeview/demo/activity/MainActivity.java10 symbols
api/src/main/java/cn/bingoogolapple/badgeview/BGABadgeViewUtil.java10 symbols
api/src/main/java/cn/bingoogolapple/badgeview/BGAExplosionAnimator.java8 symbols
demo/src/main/java/cn/bingoogolapple/badgeview/demo/util/ToastUtil.java4 symbols
demo/src/main/java/cn/bingoogolapple/badgeview/demo/adapter/MessageAdapter.java4 symbols
demo/src/main/java/cn/bingoogolapple/badgeview/demo/model/MessageModel.java3 symbols
api/src/main/java/cn/bingoogolapple/badgeview/BGADragDismissDelegate.java2 symbols
demo/src/main/java/cn/bingoogolapple/badgeview/demo/util/BGABadgeInit.java1 symbols

For agents

$ claude mcp add BGABadgeView-Android \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact