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

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

新聞中心

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

SlideDrawer

創(chuàng)新互聯(lián)公司 - 雅安移動(dòng)機(jī)房,四川服務(wù)器租用,成都服務(wù)器租用,四川網(wǎng)通托管,綿陽服務(wù)器托管,德陽服務(wù)器托管,遂寧服務(wù)器托管,綿陽服務(wù)器托管,四川云主機(jī),成都云主機(jī),西南云主機(jī),雅安移動(dòng)機(jī)房,西南服務(wù)器托管,四川/成都大帶寬,成都機(jī)柜租用,四川老牌IDC服務(wù)商

java.lang.Object

|---ohos.agp.components.Component

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

|---|---|---ohos.agp.components.SlideDrawer

public class SlideDrawer
extends ComponentContainer

提供 SlideDrawer 項(xiàng)。

此類允許顯示主要組件,同時(shí)隱藏與不同方向(開始、頂部、結(jié)束和底部)相關(guān)的四個(gè)可選組件的集合。 要顯示可選組件,最終用戶需要從相應(yīng)的方向滑動(dòng)。

Since:

5

嵌套類摘要

修飾符和類型 描述
static class SlideDrawer.DisplayMode 枚舉要顯示的可選組件的模式。
static class SlideDrawer.DrawerState 枚舉 SlideDrawer 的可能狀態(tài)。
static class SlideDrawer.LayoutConfig 配置 SlideDrawer 的布局參數(shù),包括寬度、高度、邊距、SlideDirection 和 DisplayMode。
static class SlideDrawer.SlideDirection 枚舉可選組件相對(duì)于主組件的方向。
static interface SlideDrawer.SlideDisable 允許實(shí)時(shí)禁用幻燈片。
static interface SlideDrawer.SlideListener 監(jiān)聽 SlideDrawer 狀態(tài)變化。
從類 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

字段摘要

修飾符和類型 字段 描述
static SlideDrawer.DisplayMode DEFAULT_DISPLAY_MODE 指示 DisplayMode 的默認(rèn)值。
static float DEFAULT_OPEN_THRESHOLD 指示可滑動(dòng)打開可選組件的默認(rèn)百分比值。
從類 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ù) 描述
SlideDrawer(Context context) 用于使用默認(rèn)屬性集和默認(rèn)樣式創(chuàng)建 SlideDrawer 實(shí)例的默認(rèn)構(gòu)造函數(shù)。
SlideDrawer(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的屬性集和默認(rèn)樣式創(chuàng)建 SlideDrawer 實(shí)例的構(gòu)造函數(shù)。
SlideDrawer(Context context, AttrSet attrSet, String styleName) 用于在解析 XML 文件后使用指定的屬性集和指定樣式創(chuàng)建 SlideDrawer 實(shí)例的構(gòu)造函數(shù)。

方法總結(jié)

修飾符和類型 方法 描述
void addSlideDisable(SlideDrawer.SlideDisable callback) 添加允許實(shí)時(shí)禁用幻燈片事件的回調(diào)。
void addSlideListener(SlideDrawer.SlideListener listener) 添加幻燈片偵聽器。
boolean close() 如果當(dāng)前狀態(tài)為 DrawerState#OPEN,則關(guān)閉 SlideDrawer。
boolean close(SlideDrawer.SlideDirection direction) 如果當(dāng)前狀態(tài)為 DrawerState#OPEN 且方向參數(shù)等于 getSlideDirection() 返回的值,則在某個(gè)方向關(guān)閉 SlideDrawer。
boolean closeSmoothly() 如果 SlideDrawer 當(dāng)前狀態(tài)為 DrawerState#OPEN,則平滑關(guān)閉 SlideDrawer。
boolean closeSmoothly(int interval) 如果 SlideDrawer 當(dāng)前狀態(tài)為 DrawerState#OPEN,則平滑關(guān)閉 SlideDrawer。
boolean closeSmoothly(SlideDrawer.SlideDirection direction) 如果當(dāng)前狀態(tài)為 DrawerState#OPEN 且方向參數(shù)等于 getSlideDirection() 返回的值,則在某個(gè)方向平滑關(guān)閉 SlideDrawer。
boolean closeSmoothly(SlideDrawer.SlideDirection direction, int interval) 如果當(dāng)前狀態(tài)為 DrawerState#OPEN 且方向參數(shù)等于 getSlideDirection() 返回的值,則在某個(gè)方向平滑關(guān)閉 SlideDrawer。
ComponentContainer.LayoutConfig createLayoutConfig(Context context, AttrSet attrSet) 使用子組件的屬性集創(chuàng)建布局參數(shù)。
SlideDrawer.DisplayMode[] getDisplayMode() 獲取所有方向的可選組件的顯示模式。
SlideDrawer.DisplayMode getDisplayMode(SlideDrawer.SlideDirection direction) 獲取可選組件在某個(gè)方向上的顯示方式。
float getOpenThreshold() 獲取可以滑動(dòng)打開可選組件的百分比值。
SlideDrawer.SlideDirection getSlideDirection() 獲取當(dāng)前 SlideDrawer 方向。
int getSlideDistance(SlideDrawer.SlideDirection direction) 獲取某個(gè)方向的最大滑動(dòng)距離。
float getSlideDistanceRatio() 獲取當(dāng)前從起始位置的滑動(dòng)百分比。
SlideDrawer.DrawerState getSlideState() 獲取當(dāng)前 SlideDrawer 狀態(tài)。
boolean hasSlideDisables() 檢查是否有任何禁用回調(diào)存儲(chǔ)在 SlideDrawer 中。
boolean hasSlideListeners() 檢查是否有任何偵聽器存儲(chǔ)在 SlideDrawer 中。
boolean isSlideEnabled() 檢查是否啟用了滑動(dòng)手勢。
boolean isTouchForClose() 檢查 SlideDrawer 是否可以通過觸摸關(guān)閉。
boolean open() 如果 SlideDrawer 包含僅用于單向的可選組件,則打開 SlideDrawer)。
boolean open(SlideDrawer.SlideDirection direction) 如果 SlideDrawer 當(dāng)前狀態(tài)為 DrawerState#CLOSE,則朝某個(gè)方向打開 SlideDrawer。
boolean openSmoothly() 如果 SlideDrawer 包含僅用于單向的可選組件,則平滑打開 SlideDrawer)。
boolean openSmoothly(int interval) 如果 SlideDrawer 包含僅用于單向的可選組件,則平滑打開 SlideDrawer)。
boolean openSmoothly(SlideDrawer.SlideDirection direction) 如果 SlideDrawer 當(dāng)前狀態(tài)為 DrawerState#CLOSE,則在某個(gè)方向平滑打開 SlideDrawer。
boolean openSmoothly(SlideDrawer.SlideDirection direction, int interval) 如果 SlideDrawer 當(dāng)前狀態(tài)為 DrawerState#CLOSE,則在某個(gè)方向平滑打開 SlideDrawer。
void removeAllSlideDisables() 刪除所有允許實(shí)時(shí)禁用幻燈片事件的回調(diào)。
void removeAllSlideListeners() 刪除所有幻燈片偵聽器。
void removeComponents(int start, int count) 從組件列表中的指定位置移除所有組件。
void removeSlideDisable(SlideDrawer.SlideDisable callback) 刪除允許實(shí)時(shí)禁用幻燈片事件的回調(diào)。
void removeSlideListener(SlideDrawer.SlideListener listener) 刪除幻燈片偵聽器。
void setDisplayMode(SlideDrawer.DisplayMode mode) 設(shè)置所有可選組件的顯示模式。
void setDisplayMode(SlideDrawer.DisplayMode startMode, SlideDrawer.DisplayMode topMode, SlideDrawer.DisplayMode endMode, SlideDrawer.DisplayMode bottomMode) 為所有方向設(shè)置不同的顯示模式。
void setDisplayMode(SlideDrawer.DisplayMode mode, SlideDrawer.SlideDirection direction) 設(shè)置可選組件從某個(gè)方向的顯示模式。
void setMaximumSlideDistance(int max) 設(shè)置最大滑動(dòng)距離。
void setOpenThreshold(float percent) 設(shè)置可以滑動(dòng)打開可選組件的百分比值。
void setSlideEnabled(boolean isEnabled) 設(shè)置 SlideDrawer 是否可以被用戶滑動(dòng)。
void setTouchForClose(boolean isEnabled) 設(shè)置 SlideDrawer 是否可以通過觸摸關(guān)閉。
boolean toggle() 在 DrawerState#OPEN 和 DrawerState#CLOSE 之間切換 SlideDrawer 狀態(tài)。
boolean toggle(SlideDrawer.SlideDirection direction) 在特定方向上切換 DrawerState#OPEN 和 DrawerState#CLOSE 之間的 SlideDrawer 狀態(tài)。
boolean toggleSmoothly() 在 DrawerState#OPEN 和 DrawerState#CLOSE 之間平滑切換 SlideDrawer 狀態(tài)。
boolean toggleSmoothly(int interval) 在 DrawerState#OPEN 和 DrawerState#CLOSE 之間平滑切換 SlideDrawer 狀態(tài)。
boolean toggleSmoothly(SlideDrawer.SlideDirection direction) DrawerState#OPEN 和 DrawerState#CLOSE 之間的 SlideDrawer 狀態(tài)在某個(gè)方向上平滑切換。
boolean toggleSmoothly(SlideDrawer.SlideDirection direction, int interval) DrawerState#OPEN 和 DrawerState#CLOSE 之間的 SlideDrawer 狀態(tài)在某個(gè)方向上平滑切換。
ComponentContainer.LayoutConfig verifyLayoutConfig(ComponentContainer.LayoutConfig config) 根據(jù)當(dāng)前布局類型驗(yàn)證布局參數(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, getMode, 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, setMode, 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, 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

字段詳細(xì)信息

DEFAULT_DISPLAY_MODE

public static final SlideDrawer.DisplayMode DEFAULT_DISPLAY_MODE

指示 DisplayMode 的默認(rèn)值。

Since:

5

DEFAULT_OPEN_THRESHOLD

public static final float DEFAULT_OPEN_THRESHOLD

指示可滑動(dòng)打開可選組件的默認(rèn)百分比值。

Since:

5

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

SlideDrawer

public SlideDrawer(Context context)

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

參數(shù):

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

Since:

5

SlideDrawer

public SlideDrawer(Context context, AttrSet attrSet)

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

參數(shù):

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

Since:

5

SlideDrawer

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

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

參數(shù):

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

Since:

5

方法詳情

addSlideListener

public void addSlideListener(SlideDrawer.SlideListener listener)

添加幻燈片偵聽器。

參數(shù):

參數(shù)名稱 參數(shù)描述
listener 表示 SlideListener 對(duì)象,不能為空。

Throws:

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

Since:

5

removeSlideListener

public void removeSlideListener(SlideDrawer.SlideListener listener)

刪除幻燈片偵聽器。

您可以使用 removeAllSlideListeners() 刪除所有偵聽器。

參數(shù):

參數(shù)名稱 參數(shù)描述
listener 表示 SlideListener 對(duì)象,不能為空。

Throws:

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

Since:

5

removeAllSlideListeners

public void removeAllSlideListeners()

刪除所有幻燈片偵聽器。

Since:

5

hasSlideListeners

public boolean hasSlideListeners()

檢查是否有任何偵聽器存儲(chǔ)在 SlideDrawer 中。

返回:

如果 SlideDrawer 包含任何偵聽器,則返回 true; 否則返回 false。

Since:

5

addSlideDisable

public void addSlideDisable(SlideDrawer.SlideDisable callback)

添加允許實(shí)時(shí)禁用幻燈片事件的回調(diào)。

參數(shù):

參數(shù)名稱 參數(shù)描述
callback 表示要添加的回調(diào)。 該值不能為空。

Throws:

Throw名稱 Throw描述
IllegalArgumentException 如果回調(diào)值為 null,則引發(fā)此異常。

Since:

5

removeSlideDisable

public void removeSlideDisable(SlideDrawer.SlideDisable callback)

刪除允許實(shí)時(shí)禁用幻燈片事件的回調(diào)。

您可以使用 removeAllSlideDisables() 刪除所有此類回調(diào)。

參數(shù):

參數(shù)名稱 參數(shù)描述
callback 指示要?jiǎng)h除的回調(diào)。 該值不能為空。

Throws:

Throw名稱 Throw描述
IllegalArgumentException 如果回調(diào)值為 null,則引發(fā)此異常。

Since:

5

removeAllSlideDisables

public void removeAllSlideDisables()

刪除所有允許實(shí)時(shí)禁用幻燈片事件的回調(diào)。

Since:

5

hasSlideDisables

public boolean hasSlideDisables()

檢查是否有任何禁用回調(diào)存儲(chǔ)在 SlideDrawer 中。

返回:

如果 SlideDrawer 包含任何禁用回調(diào),則返回 true; 否則返回 false。

Since:

5

setTouchForClose

public void setTouchForClose(boolean isEnabled)

設(shè)置 SlideDrawer 是否可以通過觸摸關(guān)閉。

參數(shù):

參數(shù)名稱 參數(shù)描述
isEnabled 指定 SlideDrawer 是否可以通過觸摸關(guān)閉。

Since:

5

isTouchForClose

public boolean isTouchForClose()

檢查 SlideDrawer 是否可以通過觸摸關(guān)閉。

返回:

如果 SlideDrawer 可以通過觸摸關(guān)閉,則返回 true; 否則返回 false。

Since:

5

setSlideEnabled

public void setSlideEnabled(boolean isEnabled)

設(shè)置 SlideDrawer 是否可以被用戶滑動(dòng)。

參數(shù):

參數(shù)名稱 參數(shù)描述
isEnabled 指定是否啟用滑動(dòng)手勢。

Since:

5

isSlideEnabled

public boolean isSlideEnabled()

檢查是否啟用了滑動(dòng)手勢。

返回:

如果啟用了滑動(dòng)手勢,則返回 true; 否則返回 false。

Since:

5

setOpenThreshold

public void setOpenThreshold(float percent)

設(shè)置可以滑動(dòng)打開可選組件的百分比值。

默認(rèn)百分比值為 DEFAULT_OPEN_THRESHOLD。

參數(shù):

參數(shù)名稱 參數(shù)描述
percent 表示百分比值。

Throws:

Throw名稱 Throw描述
IllegalArgumentException 如果百分比值小于 0.0f 或大于 1.0f,則引發(fā)此異常。

Since:

5

getOpenThreshold

public float getOpenThreshold()

獲取可以滑動(dòng)打開可選組件的百分比值。

默認(rèn)百分比值為 DEFAULT_OPEN_THRESHOLD。

返回:

返回百分比值。

Since:

5

getSlideDistanceRatio

public float getSlideDistanceRatio()

獲取當(dāng)前從起始位置的滑動(dòng)百分比。

返回:

返回滑動(dòng)百分比。

Since:

5

setMaximumSlideDistance

public void setMaximumSlideDistance(int max)

設(shè)置最大滑動(dòng)距離。

參數(shù):

參數(shù)名稱 參數(shù)描述
max 表示最大滑動(dòng)距離。

Throws:

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

Since:

5

getSlideDistance

public int getSlideDistance(SlideDrawer.SlideDirection direction)

獲取某個(gè)方向的最大滑動(dòng)距離。

參數(shù):

參數(shù)名稱 參數(shù)描述
direction 指示方向。

返回:

返回最大滑動(dòng)距離。

Throws:

Throw名稱 Throw描述
IllegalArgumentException 如果方向值為空,則引發(fā)此異常。

Since:

5

getSlideState

public SlideDrawer.DrawerState getSlideState()

獲取當(dāng)前 SlideDrawer 狀態(tài)。 狀態(tài)值可以是 DrawerState#OPEN、DrawerState#MIDDLE 或 DrawerState#CLOSE。

返回:

返回當(dāng)前狀態(tài)。

Since:

5

getSlideDirection

public SlideDrawer.SlideDirection getSlideDirection()

獲取當(dāng)前 SlideDrawer 方向。 該值可以是 SlideDirection#START、SlideDirection#TOP、SlideDirection#END 或 SlideDirection#BOTTOM。 如果當(dāng)前 SlideDrawer 狀態(tài)不是 DrawerState#OPEN,則返回值為 null。

返回:

返回當(dāng)前的 SlideDirection 或 null。

Since:

5

setDisplayMode

public void setDisplayMode(SlideDrawer.DisplayMode mode)

設(shè)置所有可選組件的顯示模式。 模式可以是 DisplayMode#NO_ANIMATION 或 DisplayMode#WITH_ANIMATION。

默認(rèn)模式為 DEFAULT_DISPLAY_MODE。

如果您希望僅為指定方向設(shè)置顯示模式,可以使用 setDisplayMode(ohos.agp.components.SlideDrawer.DisplayMode,ohos.agp.components.SlideDrawer.SlideDirection) 方法。

您可以使用 setDisplayMode(ohos.agp.components.SlideDrawer.DisplayMode,ohos.agp.components.SlideDrawer.DisplayMode,ohos.agp.components.SlideDrawer.DisplayMode,ohos.agp.components.SlideDrawer.DisplayMode) 方法設(shè)置不同的 一次調(diào)用中所有四個(gè)方向的值。

不建議同時(shí)使用 DisplayMode#NO_ANIMATION 和 padding。

參數(shù):

參數(shù)名稱 參數(shù)描述
mode 表示顯示模式。

Throws:

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

Since:

5

setDisplayMode

public void setDisplayMode(SlideDrawer.DisplayMode mode, SlideDrawer.SlideDirection direction)

設(shè)置可選組件從某個(gè)方向的顯示模式。 模式可以是 DisplayMode#NO_ANIMATION 或 DisplayMode#WITH_ANIMATION。

默認(rèn)模式為 DEFAULT_DISPLAY_MODE。

您可以使用 setDisplayMode(ohos.agp.components.SlideDrawer.DisplayMode,ohos.agp.components.SlideDrawer.DisplayMode,ohos.agp.components.SlideDrawer.DisplayMode,ohos.agp.components.SlideDrawer.DisplayMode) 方法設(shè)置不同的 一次調(diào)用中所有四個(gè)方向的值。

您可以使用 setDisplayMode(ohos.agp.components.SlideDrawer.DisplayMode) 方法為所有方向設(shè)置指定的顯示模式。

不建議同時(shí)使用 DisplayMode#NO_ANIMATION 和 padding。

參數(shù):

參數(shù)名稱 參數(shù)描述
mode 表示顯示模式。
direction 指示方向。

Throws:

Throw名稱 Throw描述
IllegalArgumentException 如果方向或模式值為 null,則引發(fā)此異常。

Since:

5

setDisplayMode

public void setDisplayMode(SlideDrawer.DisplayMode startMode, SlideDrawer.DisplayMode topMode, SlideDrawer.DisplayMode endMode, SlideDrawer.DisplayMode bottomMode)

為所有方向設(shè)置不同的顯示模式。 模式可以是 DisplayMode#NO_ANIMATION 或 DisplayMode#WITH_ANIMATION。

默認(rèn)模式為 DEFAULT_DISPLAY_MODE。

如果您希望僅為指定方向設(shè)置顯示模式,可以使用 setDisplayMode(ohos.agp.components.SlideDrawer.DisplayMode,ohos.agp.components.SlideDrawer.SlideDirection) 方法。

您可以使用 setDisplayMode(ohos.agp.components.SlideDrawer.DisplayMode) 方法為所有方向設(shè)置指定的顯示模式。

不建議同時(shí)使用 DisplayMode#NO_ANIMATION 和 padding。

參數(shù):

參數(shù)名稱 參數(shù)描述
startMode 指示與 SlideDirection#START 方向相關(guān)的顯示模式。
topMode 指示與 SlideDirection#TOP 方向相關(guān)的顯示模式。
endMode 指示與 SlideDirection#END 方向相關(guān)的顯示模式。
bottomMode 指示與 SlideDirection#BOTTOM 方向相關(guān)的顯示模式。

Throws:

Throw名稱 Throw描述
IllegalArgumentException 如果任何模式為空,則引發(fā)此異常。

Since:

5

getDisplayMode

public SlideDrawer.DisplayMode getDisplayMode(SlideDrawer.SlideDirection direction)

獲取可選組件在某個(gè)方向上的顯示方式。

默認(rèn)模式為 DEFAULT_DISPLAY_MODE。

您可以使用 getDisplayMode() 方法一次調(diào)用獲取所有方向的顯示模式。

參數(shù):

參數(shù)名稱 參數(shù)描述
direction 指示方向。

返回:

返回顯示模式。

Throws:

Throw名稱 Throw描述
IllegalArgumentException 如果方向值為空,則引發(fā)此異常。

Since:

5

getDisplayMode

public SlideDrawer.DisplayMode[] getDisplayMode()

獲取所有方向的可選組件的顯示模式。

默認(rèn)模式為 DEFAULT_DISPLAY_MODE。

您可以使用getDisplayMode(ohos.agp.components.SlideDrawer.SlideDirection) 方法獲取某個(gè)方向的顯示模式。

返回:

返回模式數(shù)組,其中: 第一個(gè)元素(索引 0)- SlideDirection#START 方向的模式; 第二個(gè)元素(索引 1) - SlideDirection#TOP 方向的模式; 第三個(gè)元素(索引 2)- SlideDirection#BOTTOM 方向的模式; 第四個(gè)元素(索引 3)- SlideDirection#END 方向的模式。

Since:

5

open

public boolean open()

如果 SlideDrawer 包含僅用于單向的可選組件,則打開 SlideDrawer)。

返回:

如果操作成功,則返回 true; 否則返回 false。

Since:

5

open

public boolean open(SlideDrawer.SlideDirection direction)

如果 SlideDrawer 當(dāng)前狀態(tài)為 DrawerState#CLOSE,則朝某個(gè)方向打開 SlideDrawer。 如果 SlideDrawer 包含僅可以從一個(gè)方向與幻燈片一起顯示的可選組件,則可以傳遞 null 作為方向以打開 SlideDrawer。

參數(shù):

參數(shù)名稱 參數(shù)描述
direction 方向,可以設(shè)置為null。

返回:

如果操作成功,則返回 true; 否則返回 false。

Since:

5

openSmoothly

public boolean openSmoothly()

如果 SlideDrawer 包含僅用于單向的可選組件,則平滑打開 SlideDrawer)。

返回:

如果操作成功,則返回 true; 否則返回 false。

Since:

5

openSmoothly

public boolean openSmoothly(SlideDrawer.SlideDirection direction)

如果 SlideDrawer 當(dāng)前狀態(tài)為 DrawerState#CLOSE,則在某個(gè)方向平滑打開 SlideDrawer。 如果 SlideDrawer 包含僅可以從一個(gè)方向與幻燈片一起顯示的可選組件,則可以傳遞 null 作為方向以打開 SlideDrawer。

參數(shù):

參數(shù)名稱 參數(shù)描述
direction 方向,可以設(shè)置為null。

返回:

如果操作成功,則返回 true; 否則返回 false。

Since:

5

openSmoothly

public boolean openSmoothly(int interval)

如果 SlideDrawer 包含僅用于單向的可選組件,則平滑打開 SlideDrawer)。

參數(shù):

參數(shù)名稱 參數(shù)描述
interval 滾動(dòng)的間隔值,以毫秒為單位。

返回:

如果操作成功,則返回 true; 否則返回 false。

Throws:

Throw名稱 Throw描述
IllegalArgumentException 如果間隔值小于 0,則拋出此異常。

Since:

5

openSmoothly

public boolean openSmoothly(SlideDrawer.SlideDirection direction, int interval)

如果 SlideDrawer 當(dāng)前狀態(tài)為 DrawerState#CLOSE,則在某個(gè)方向平滑打開 SlideDrawer。 如果 SlideDrawer 包含僅可以從一個(gè)方向與幻燈片一起顯示的可選組件,則可以傳遞 null 作為方向以打開 SlideDrawer。

參數(shù):

參數(shù)名稱 參數(shù)描述
direction 方向,可以設(shè)置為null。
interval 滾動(dòng)的間隔值,以毫秒為單位。

返回:

如果操作成功,則返回 true; 否則返回 false。

Throws:

Throw名稱 Throw描述
IllegalArgumentException 如果間隔值小于 0,則拋出此異常。

Since:

5

close

public boolean close()

如果當(dāng)前狀態(tài)為 DrawerState#OPEN,則關(guān)閉 SlideDrawer。

返回:

如果操作成功,則返回 true; 否則返回 false。

Since:

5

close

public boolean close(SlideDrawer.SlideDirection direction)

如果當(dāng)前狀態(tài)為 DrawerState#OPEN 且方向參數(shù)等于 getSlideDirection() 返回的值,則在某個(gè)方向關(guān)閉 SlideDrawer。 無論如何,您都可以傳遞 null 作為關(guān)閉 SlideDrawer 的方向。

參數(shù):

參數(shù)名稱 參數(shù)描述
direction 方向,可以設(shè)置為null。

返回:

如果操作成功,則返回 true; 否則返回 false。

Since:

5

closeSmoothly

public boolean closeSmoothly()

如果 SlideDrawer 當(dāng)前狀態(tài)為 DrawerState#OPEN,則平滑關(guān)閉 SlideDrawer。

返回:

如果操作成功,則返回 true; 否則返回 false。

Since:

5

closeSmoothly

public boolean closeSmoothly(SlideDrawer.SlideDirection direction)

如果當(dāng)前狀態(tài)為 DrawerState#OPEN 且方向參數(shù)等于 getSlideDirection() 返回的值,則在某個(gè)方向平滑關(guān)閉 SlideDrawer。 無論如何,您都可以傳遞 null 作為關(guān)閉 SlideDrawer 的方向。

參數(shù):

參數(shù)名稱 參數(shù)描述
direction 方向,可以設(shè)置為null。

返回:

如果操作成功,則返回 true; 否則返回 false。

Since:

5

closeSmoothly

public boolean closeSmoothly(int interval)

如果 SlideDrawer 當(dāng)前狀態(tài)為 DrawerState#OPEN,則平滑關(guān)閉 SlideDrawer。

參數(shù):

參數(shù)名稱 參數(shù)描述
interval 滾動(dòng)的間隔值,以毫秒為單位。

返回:

如果操作成功,則返回 true; 否則返回 false。

Throws:

Throw名稱 Throw描述
IllegalArgumentException 如果間隔值小于 0,則拋出此異常。

Since:

5

closeSmoothly

public boolean closeSmoothly(SlideDrawer.SlideDirection direction, int interval)

如果當(dāng)前狀態(tài)為 DrawerState#OPEN 且方向參數(shù)等于 getSlideDirection() 返回的值,則在某個(gè)方向平滑關(guān)閉 SlideDrawer。 無論如何,您都可以傳遞 null 作為關(guān)閉 SlideDrawer 的方向。

參數(shù):

參數(shù)名稱 參數(shù)描述
direction 方向,可以設(shè)置為null。
interval 滾動(dòng)的間隔值,以毫秒為單位。

返回:

如果操作成功,則返回 true; 否則返回 false。

Throws:

Throw名稱 Throw描述
IllegalArgumentException 如果間隔值小于 0,則拋出此異常。

Since:

5

toggle

public boolean toggle()

在 DrawerState#OPEN 和 DrawerState#CLOSE 之間切換 SlideDrawer 狀態(tài)。

返回:

如果操作成功,則返回 true; 否則返回 false。

Since:

5

toggle

public boolean toggle(SlideDrawer.SlideDirection direction)

在特定方向上切換 DrawerState#OPEN 和 DrawerState#CLOSE 之間的 SlideDrawer 狀態(tài)。 如果 SlideDrawer 包含僅可以從一個(gè)方向與幻燈片一起顯示的可選組件,則可以傳遞 null 作為方向以切換 SlideDrawer 狀態(tài)。

參數(shù):

參數(shù)名稱 參數(shù)描述
direction 方向,可以設(shè)置為null。

返回:

如果操作成功,則返回 true; 否則返回 false。

Since:

5

toggleSmoothly

public boolean toggleSmoothly()

在 DrawerState#OPEN 和 DrawerState#CLOSE 之間平滑切換 SlideDrawer 狀態(tài)。

返回:

如果操作成功,則返回 true; 否則返回 false。

Since:

5

toggleSmoothly

public boolean toggleSmoothly(SlideDrawer.SlideDirection direction)

DrawerState#OPEN 和 DrawerState#CLOSE 之間的 SlideDrawer 狀態(tài)在某個(gè)方向上平滑切換。 如果 SlideDrawer 包含僅可以從一個(gè)方向與幻燈片一起顯示的可選組件,則可以傳遞 null 作為方向以切換 SlideDrawer 狀態(tài)。

參數(shù):

參數(shù)名稱 參數(shù)描述
direction 方向,可以設(shè)置為null。

返回:

如果操作成功,則返回 true; 否則返回 false。

Since:

5

toggleSmoothly

public boolean toggleSmoothly(int interval)

在 DrawerState#OPEN 和 DrawerState#CLOSE 之間平滑切換 SlideDrawer 狀態(tài)。

參數(shù):

參數(shù)名稱 參數(shù)描述
interval 滾動(dòng)的間隔值,以毫秒為單位。

返回:

如果操作成功,則返回 true; 否則返回 false。

Throws:

Throw名稱 Throw描述
IllegalArgumentException 如果間隔值小于 0,則拋出此異常。

Since:

5

toggleSmoothly

public boolean toggleSmoothly(SlideDrawer.SlideDirection direction, int interval)

DrawerState#OPEN 和 DrawerState#CLOSE 之間的 SlideDrawer 狀態(tài)在某個(gè)方向上平滑切換。 如果 SlideDrawer 包含僅可以從一個(gè)方向與幻燈片一起顯示的可選組件,則可以傳遞 null 作為方向以切換 SlideDrawer 狀態(tài)。

參數(shù):

參數(shù)名稱 參數(shù)描述
direction 方向,可以設(shè)置為null。
interval 滾動(dòng)的間隔值,以毫秒為單位。

返回:

如果操作成功,則返回 true; 否則返回 false。

Throws:

Throw名稱 Throw描述
IllegalArgumentException 如果間隔值小于 0,則拋出此異常。

Since:

5

verifyLayoutConfig

public ComponentContainer.LayoutConfig verifyLayoutConfig(ComponentContainer.LayoutConfig config)

根據(jù)當(dāng)前布局類型驗(yàn)證布局參數(shù)。

指定者:

接口 ComponentParent 中的 verifyLayoutConfig

覆蓋:

ComponentContainer 類中的 verifyLayoutConfig

參數(shù):

參數(shù)名稱 參數(shù)描述
config 指示要轉(zhuǎn)換為 ComponentContainer 實(shí)例的一組布局參數(shù)。

返回:

返回 LayoutConfig 實(shí)例,它表示布局參數(shù)。

createLayoutConfig

public ComponentContainer.LayoutConfig createLayoutConfig(Context context, AttrSet attrSet)

使用子組件的屬性集創(chuàng)建布局參數(shù)。

覆蓋:

ComponentContainer 類中的 createLayoutConfig

參數(shù):

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

返回:

返回創(chuàng)建的布局參數(shù)。

removeComponents

public void removeComponents(int start, int count)

從組件列表中的指定位置移除所有組件。

指定者:

接口 ComponentParent 中的 removeComponents

覆蓋:

ComponentContainer 類中的 removeComponents

參數(shù):

參數(shù)名稱 參數(shù)描述
start 表示第一個(gè)移除的組件的位置索引。
count 表示要移除的組件數(shù)量。

當(dāng)前文章:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSSlideDrawer
轉(zhuǎn)載注明:http://m.5511xx.com/article/dhdssso.html