日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSEventBadge

EventBadge

專注于為中小企業(yè)提供網(wǎng)站設(shè)計制作、成都網(wǎng)站制作服務(wù),電腦端+手機端+微信端的三站合一,更高效的管理,為中小企業(yè)渾南免費做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動了1000多家企業(yè)的穩(wěn)健成長,幫助中小企業(yè)通過網(wǎng)站建設(shè)實現(xiàn)規(guī)模擴充和轉(zhuǎn)變。

java.lang.Object

|---ohos.agp.components.Component

|---|---ohos.agp.components.ComponentContainer

|---|---|---ohos.agp.components.StackLayout

|---|---|---|---ohos.agp.components.EventBadge

public class EventBadge
extends StackLayout

實現(xiàn)事件徽章布局。

布局提供了標(biāo)記新事件的功能。 您不需要將布局與使用事件標(biāo)記的組件相關(guān)聯(lián)。 您只需要設(shè)置布局的顯示位置。

嵌套類摘要

從類 ohos.agp.components.Component 繼承的嵌套類/接口
Component.BindStateChangedListener, Component.CanAcceptScrollListener, Component.ClickedListener, Component.ComponentStateChangedListener, Component.ContourRefreshedListener, Component.DefSpeechEventListener, Component.DoubleClickedListener, Component.DragFeedbackProvider, Component.DraggedListener, Component.DrawTask, Component.EditEventListener, Component.EstimateSizeListener, Component.EstimateSpec, Component.FadeEffectEnum, Component.FocusChangedListener, Component.ForwardHoverListener, Component.ForwardTouchListener, Component.GestureType, Component.HoverEventListener, Component.KeyEventListener, Component.LayoutDirection, Component.LayoutRefreshedListener, Component.LongClickedListener, Component.MeasureSpec, Component.MouseEventListener, Component.MousePointerStyleListener, Component.OnDragListener, Component.RotationEventListener, Component.ScaledListener, Component.ScrolledListener, Component.ShadowDevice, Component.ShadowMode, Component.ShadowSize, Component.SpeechEventListener, Component.TouchEventListener, Component.UnconsumedKeyEventListener, Component.VoiceEvent
從類 ohos.agp.components.ComponentContainer 繼承的嵌套類/接口
ComponentContainer.ArrangeListener
從類 ohos.agp.components.StackLayout 繼承的嵌套類/接口
StackLayout.LayoutConfig

字段摘要

修飾符和類型 字段 描述
static intMODE_NOT_SHOW_COUNT表示不顯示數(shù)字的模式(默認(rèn)模式)。
static intMODE_SHOW_COUNT表示數(shù)字的顯示模式。
從類 ohos.agp.components.Component 繼承的字段
ACCESSIBILITY_ADAPTABLE, ACCESSIBILITY_DISABLE, ACCESSIBILITY_ENABLE, AXIS_X, AXIS_Y, CONTOUR_BACKGROUND, CONTOUR_BORDER, CONTOUR_PADDING_BORDER, DEFAULT_SCALE, DRAG_DOWN, DRAG_HORIZONTAL, DRAG_HORIZONTAL_VERTICAL, DRAG_LEFT, DRAG_RIGHT, DRAG_UP, DRAG_VERTICAL, EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED, EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED_CLEAR, EVENT_TYPE_COMPONENT_CLICKED, EVENT_TYPE_COMPONENT_FOCUSED, EVENT_TYPE_COMPONENT_LONG_CLICKED, EVENT_TYPE_COMPONENT_SCROLLED, EVENT_TYPE_COMPONENT_SELECTED, EVENT_TYPE_COMPONENT_TEXT_UPDATE, EVENT_TYPE_NOTICE, EVENT_TYPE_NOTIFICATION_STATE_UPDATE, EVENT_TYPE_TOAST_SHOW, EVENT_TYPE_WINDOW_STATE_UPDATE, FOCUS_ADAPTABLE, FOCUS_DISABLE, FOCUS_ENABLE, FOCUS_NEXT, FOCUS_PREVIOUS, FOCUS_SIDE_BOTTOM, FOCUS_SIDE_LEFT, FOCUS_SIDE_RIGHT, FOCUS_SIDE_TOP, HIDE, HORIZONTAL, ID_DEFAULT, INHERITED_MODE, INVISIBLE, mBackgroundElement, mCanvasForTaskOverContent, mCanvasForTaskUnderContent, mComponentParent, mContext, mDrawTaskOverContent, mDrawTaskUnderContent, mEstimateSizeListener, mForegroundElement, mForwardHoverListener, mHoverEventListener, mKeyEventListener, mMouseEventListener, mPosition, mRotationEventListener, mShadowElement, mUnconsumedKeyEventListener, OVAL_MODE, OVAL_SCROLL_BAR_MODE, POSITION_X_INDEX, POSITION_Y_INDEX, RECT_MODE, RECT_SCROLL_BAR_MODE, SCROLL_AUTO_STAGE, SCROLL_IDLE_STAGE, SCROLL_NORMAL_STAGE, UNSPECIFIED_SCROLL_BAR_MODE, VERTICAL, VISIBLE
從類 ohos.agp.components.ComponentContainer 繼承的字段
FOCUS_CHILDREN_FIRST, FOCUS_CHILDREN_HIDE, FOCUS_PARENT_FIRST, mArrangeListener

構(gòu)造函數(shù)摘要

構(gòu)造函數(shù) 描述
EventBadge(Context context)用于使用默認(rèn)屬性集和樣式創(chuàng)建 EventBadge 實例的默認(rèn)構(gòu)造函數(shù)。
EventBadge(Context context, AttrSet attrSet)用于在解析 XML 文件后基于指定的屬性集和默認(rèn)樣式創(chuàng)建 EventBadge 實例的構(gòu)造函數(shù)。
EventBadge(Context context, AttrSet attrSet, String styleName)用于在解析 XML 文件后基于指定的屬性集和樣式創(chuàng)建 EventBadge 實例的構(gòu)造函數(shù)。

方法總結(jié)

修飾符和類型 方法 描述
intgetCount()獲取此徽章的當(dāng)前事件數(shù)。
ColorgetCountColor()獲取此徽章上事件計數(shù)的文本顏色。
FontgetCountFont()獲取此徽章上事件計數(shù)的文本字體。
intgetCountSize()獲取此徽章上事件計數(shù)的文本大小。
intgetLeftRightPadding()獲取此徽章上事件計數(shù)的左右填充。
intgetMaxCount()獲取此徽章的最大事件數(shù)。
intgetMode()獲取此徽章上事件計數(shù)的顯示方式。
voidsetCount(int count)設(shè)置此徽章的當(dāng)前事件數(shù)。
voidsetCountColor(Color color)為此徽章上的事件計數(shù)設(shè)置文本顏色。
voidsetCountFont(Font font)為此徽章上的事件計數(shù)設(shè)置文本字體。
voidsetCountSize(int size)設(shè)置此徽章上事件計數(shù)的文本大小。
voidsetLeftRightPadding(int padding)設(shè)置此徽章上事件計數(shù)的左右填充。
voidsetMaxCount(int maxCount)設(shè)置此徽章的最大事件數(shù)。
voidsetMode(int mode)設(shè)置此徽章上事件計數(shù)的顯示模式。
從類 ohos.agp.components.Component 繼承的方法
addDrawTask, addDrawTask, addScrolledListener, announceAccessibility, arrange, bindCornerMark, callOnClick, canScroll, clearFocus, createAnimatorProperty, disableFadeEffect, draw, enableCornerMark, enableFadeEffect, enableSaveState, enableScrollBar, estimateSize, executeDoubleClick, executeLongClick, findFocus, findNextFocusableComponent, findRequestNextFocus, getAccessibility, getAccessibilityDescription, getAlpha, getAltitude, getBackgroundElement, getBaseLine, getBottom, getBoundaryFadeEffectBottomRate, getBoundaryFadeEffectLeftRate, getBoundaryFadeEffectRightRate, getBoundaryFadeEffectTopRate, getCenterZoomFactor, getCentralScrollMode, getClickedListener, getClipEnabled, getComponentDescription, getComponentMinSize, getComponentParent, getComponentPosition, getComponentSize, getComponentStateChangedListener, getComponentTreeObserver, getContentEnable, getContentPosition, getContentPositionX, getContentPositionY, getContext, getContour, getContourRefreshedListener, getCornerMark, getDragAcceptAngle, getDraggedListener, getEditEventListener, getEstimatedHeight, getEstimatedWidth, getFadeEffectBoundaryWidth, getFadeEffectColor, getFocusable, getFocusBorderEnable, getFocusBorderPadding, getFocusBorderRadius, getFocusBorderWidth, getForegroundElement, getForegroundGravity, getForwardHoverListener, getForwardTouchListener, getGesturePriority, getHeight, getHorizontalPadding, getHorizontalPosition, getHoverEventListener, getId, getKeyEventListener, getLayoutConfig, getLayoutDirection, getLayoutDirectionResolved, getLayoutRefreshedListener, getLeft, getLocationOnScreen, getMarginBottom, getMarginLeft, getMarginRight, getMargins, getMarginsLeftAndRight, getMarginsTopAndBottom, getMarginTop, getMatrix, getMinHeight, getMinWidth, getModeResolved, getMouseEventListener, getMousePointerStyleListener, getName, getPadding, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getPivot, getPivotX, getPivotY, getResourceManager, getRight, getRotation, getRotationEventListener, getRotationSensitivity, getScale, getScaledListener, getScaleX, getScaleY, getScrollbarBackgroundColor, getScrollbarColor, getScrollbarFadingDelay, getScrollbarFadingDuration, getScrollBarMode, getScrollbarRadius, getScrollbarRoundRect, getScrollbarStartAngle, getScrollbarSweepAngle, getScrollbarThickness, getScrollState, getScrollValue, getSelfVisibleRect, getShadowColor, getSpeechEventListener, getTag, getTop, getTouchEventListener, getTransitionSymbol, getTranslation, getTranslationX, getTranslationY, getTranslationZ, getUserNextFocus, getVerticalPadding, getVerticalPosition, getVisibility, getVisibleRectOnScreen, getWidth, getWindowVisibleRect, hasFocus, hasFocusedEffect, hasOverlaps, hideFocusBorder, invalidate, isBoundaryFadeEffectEnable, isBoundToWindow, isClickable, isClipToContourEnabled, isComponentDisplayed, isEnabled, isFadeEffected, isFocusable, isFocused, isIdentityMatrix, isLongClickOn, isPressed, isRtl, isSaveStateEnabled, isScrollbarFadingOn, isScrollBarOn, isScrollbarOverlapEnabled, isSelected, isSoundEnable, isTouchFocusable, isVibrationEffectEnabled, notifyAccessibility, onAttributeConfigChanged, onRestoreState, onRtlChanged, onSaveState, performScale, playSound, postLayout, refreshContour, release, removeBindStateChangedListener, removeScrolledListener, requestFocus, requestForceForwardTouchEvent, restoreComponentTreeState, saveComponentTreeState, scrollBy, scrollTo, setAccessibility, setAccessibilityDescription, setAlpha, setAltitude, setBackground, setBindStateChangedListener, setBottom, setBoundaryFadeEffectEnable, setCanAcceptScrollListener, setCenterZoomFactor, setCentralScrollMode, setClickable, setClickedListener, setClipEnabled, setClipToContourEnabled, setComponentDescription, setComponentMinSize, setComponentPosition, setComponentPosition, setComponentSize, setComponentStateChangedListener, setContentEnable, setContentPosition, setContentPositionX, setContentPositionY, setContour, setContourRefreshedListener, setDoubleClickedListener, setDragAcceptAngle, setDraggedListener, setEditEventListener, setEnabled, setEstimatedSize, setEstimateSizeListener, setFadeEffectBoundaryWidth, setFadeEffectColor, setFocusable, setFocusBorderEnable, setFocusBorderPadding, setFocusBorderRadius, setFocusBorderRadius, setFocusBorderWidth, setFocusChangedListener, setFocusedEffect, setForeground, setForegroundGravity, setForwardHoverListener, setForwardTouchListener, setGesturePriority, setHeight, setHorizontalPadding, setHorizontalPosition, setHoverEventListener, setId, setKeyEventListener, setLayoutConfig, setLayoutDirection, setLayoutRefreshedListener, setLeft, setLongClickable, setLongClickedListener, setMarginBottom, setMarginLeft, setMarginRight, setMarginsLeftAndRight, setMarginsTopAndBottom, setMarginTop, setMinHeight, setMinWidth, setMouseEventListener, setMousePointerStyleListener, setName, setOnDragListener, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRelative, setPaddingRight, setPaddingTop, setPivot, setPivot, setPivotX, setPivotY, setPosition, setPositionX, setPositionY, setPressState, setRight, setRotation, setRotationEventListener, setRotationSensitivity, setScale, setScaledListener, setScaleX, setScaleY, setScrollbarBackgroundColor, setScrollbarColor, setScrollbarFadingDelay, setScrollbarFadingDuration, setScrollbarFadingEnabled, setScrollBarMode, setScrollbarOverlapEnabled, setScrollbarRadius, setScrollbarRoundRect, setScrollbarStartAngle, setScrollbarSweepAngle, setScrollbarThickness, setScrolledListener, setSelected, setShadowColor, setShadowStyle, setSoundEnable, setSpeechEventListener, setTag, setTop, setTouchEventListener, setTouchFocusable, setTransitionSymbol, setTranslation, setTranslationX, setTranslationY, setTranslationZ, setUnconsumedKeyEventListener, setUserNextFocus, setVerticalPadding, setVerticalPosition, setVibrationEffectEnabled, setVisibility, setWidth, showFocusBorder, simulateClick, simulateDrag, startDragAndDrop, subscribeVoiceEvents, unsubscribeVoiceEvents
從類 ohos.agp.components.ComponentContainer 繼承的方法
addComponent, addComponent, addComponent, addComponent, addComponent, dispatchRestoreState, dispatchSaveState, findComponentById, findComponentHolderById, getAutoLayout, getChildCount, getChildIndex, getComponentAt, getComponentTransition, getFocusOrder, getLayoutManager, informConfigurationChanged, isClipToChildBoundsEnabled, isClipToPaddingBoundsEnabled, isTouchEventSplitable, moveChildToFront, onDrag, removeAllComponents, removeComponent, removeComponentAt, removeComponentById, removeComponents, setArrangeListener, setAutoLayout, setAutoLayout, setClipToChildBoundsEnabled, setClipToPaddingBoundsEnabled, setComponentTransition, setFocusOrder, setLayoutManager, setTouchEventSplitable
從接口 ohos.agp.components.ComponentParent 繼承的方法
getComponentParent, postLayout
從類 java.lang.Object 繼承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
從類 ohos.agp.components.StackLayout 繼承的方法
createLayoutConfig, verifyLayoutConfig

字段詳細(xì)信息

MODE_NOT_SHOW_COUNT

public static final int MODE_NOT_SHOW_COUNT

表示不顯示數(shù)字的模式(默認(rèn)模式)。

MODE_SHOW_COUNT

public static final int MODE_SHOW_COUNT

表示數(shù)字的顯示模式。

構(gòu)造函數(shù)詳細(xì)信息

EventBadge

public EventBadge(Context context)

用于使用默認(rèn)屬性集和樣式創(chuàng)建 EventBadge 實例的默認(rèn)構(gòu)造函數(shù)。

參數(shù):

參數(shù)名稱 參數(shù)描述
context指示應(yīng)用程序上下文。

EventBadge

public EventBadge(Context context, AttrSet attrSet)

用于在解析 XML 文件后基于指定的屬性集和默認(rèn)樣式創(chuàng)建 EventBadge 實例的構(gòu)造函數(shù)。

參數(shù):

參數(shù)名稱 參數(shù)描述
context指示應(yīng)用程序上下文。
attrSet指示要使用的屬性集。

EventBadge

public EventBadge(Context context, AttrSet attrSet, String styleName)

用于在解析 XML 文件后基于指定的屬性集和樣式創(chuàng)建 EventBadge 實例的構(gòu)造函數(shù)。

參數(shù):

參數(shù)名稱 參數(shù)描述
context指示應(yīng)用程序上下文。
attrSet指示要使用的屬性集。
styleName指示要使用的樣式的名稱。

方法詳情

setCount

public void setCount(int count)

設(shè)置此徽章的當(dāng)前事件數(shù)。

如果指定的值大于最大事件數(shù),您將在最大事件數(shù)后面看到一個加號 (+)。 例如,如果最大事件數(shù)為 10,如果指定值大于 10,您將看到 10+。

參數(shù):

參數(shù)名稱 參數(shù)描述
count指示當(dāng)前事件數(shù)。

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果參數(shù)值小于 0,則拋出此異常。

getCount

public int getCount()

獲取此徽章的當(dāng)前事件數(shù)。

返回:

返回當(dāng)前事件數(shù)。

setMaxCount

public void setMaxCount(int maxCount)

設(shè)置此徽章的最大事件數(shù)。

參數(shù):

參數(shù)名稱 參數(shù)描述
maxCount表示最大事件數(shù)。

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果參數(shù)值小于 0,則拋出此異常。

getMaxCount

public int getMaxCount()

獲取此徽章的最大事件數(shù)。

返回:

返回最大事件數(shù)。

setMode

public void setMode(int mode)

設(shè)置此徽章上事件計數(shù)的顯示模式。

覆蓋:

組件類中的 setMode

參數(shù):

參數(shù)名稱 參數(shù)描述
mode表示顯示模式。 該值可以是 MODE_NOT_SHOW_COUNT 或 MODE_SHOW_COUNT。

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果參數(shù)值不是 MODE_NOT_SHOW_COUNT 或 MODE_SHOW_COUNT,則引發(fā)此異常。

getMode

public int getMode()

獲取此徽章上事件計數(shù)的顯示方式。

覆蓋:

類 Component 中的 getMode

返回:

返回事件計數(shù)的顯示模式。

setCountColor

public void setCountColor(Color color)

為此徽章上的事件計數(shù)設(shè)置文本顏色。

參數(shù):

參數(shù)名稱 參數(shù)描述
color指示要設(shè)置的文本顏色。

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果顏色值為 null,則引發(fā)此異常。

getCountColor

public Color getCountColor()

獲取此徽章上事件計數(shù)的文本顏色。

返回:

返回事件計數(shù)的文本顏色。

setCountFont

public void setCountFont(Font font)

為此徽章上的事件計數(shù)設(shè)置文本字體。

參數(shù):

參數(shù)名稱 參數(shù)描述
font指示要設(shè)置的文本字體。

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果字體值為 null,則引發(fā)此異常。

getCountFont

public Font getCountFont()

獲取此徽章上事件計數(shù)的文本字體。

返回:

返回事件計數(shù)的文本字體。

setCountSize

public void setCountSize(int size)

設(shè)置此徽章上事件計數(shù)的文本大小。

參數(shù):

參數(shù)名稱 參數(shù)描述
size指示要設(shè)置的文本大小。

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果參數(shù)值小于 0,則拋出此異常。

getCountSize

public int getCountSize()

獲取此徽章上事件計數(shù)的文本大小。

返回:

返回事件計數(shù)的文本大小。

setLeftRightPadding

public void setLeftRightPadding(int padding)

設(shè)置此徽章上事件計數(shù)的左右填充。 僅當(dāng)事件計數(shù)是由兩位或更多位組成的數(shù)字時才使用此方法。

參數(shù):

參數(shù)名稱 參數(shù)描述
padding指示要為事件計數(shù)設(shè)置的左右填充。 該值不能為負(fù)數(shù)。

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果參數(shù)值小于 0,則拋出此異常。

getLeftRightPadding

public int getLeftRightPadding()

獲取此徽章上事件計數(shù)的左右填充。

返回:

返回事件計數(shù)的左右填充。


新聞名稱:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSEventBadge
網(wǎng)頁網(wǎng)址:http://www.5511xx.com/article/cdhgcis.html