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

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

新聞中心

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

NotificationSlot

創(chuàng)新互聯(lián)建站是一家集網(wǎng)站建設(shè),菏澤企業(yè)網(wǎng)站建設(shè),菏澤品牌網(wǎng)站建設(shè),網(wǎng)站定制,菏澤網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)絡(luò)營(yíng)銷,網(wǎng)絡(luò)優(yōu)化,菏澤網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競(jìng)爭(zhēng)力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時(shí)我們時(shí)刻保持專業(yè)、時(shí)尚、前沿,時(shí)刻以成就客戶成長(zhǎng)自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。

java.lang.Object

|---ohos.event.notification.NotificationSlot

public final class NotificationSlot
extends Object
implements Sequenceable

定義了一個(gè)公共通知主題,它是一個(gè)包含通知音、振動(dòng)、鎖屏顯示和級(jí)別的功能的集合。 您可以將這個(gè)類與一個(gè)應(yīng)用程序關(guān)聯(lián)起來(lái),使應(yīng)用程序發(fā)布的所有通知都具有通知主題的特性。

一個(gè)應(yīng)用程序可以與一個(gè)或多個(gè) NotificationSlot 實(shí)例相關(guān)聯(lián)。

Since:

1

嵌套類摘要

從接口 ohos.utils.Sequenceable 繼承的嵌套類/接口
Sequenceable.ProducerT

字段摘要

修飾符和類型 字段 描述
static int LEVEL_DEFAULT 表示開啟通知功能,狀態(tài)欄顯示通知圖標(biāo),不帶橫幅,但有提示音。
static int LEVEL_HIGH 表示開啟通知功能,狀態(tài)欄顯示通知圖標(biāo),帶有橫幅和提示音。
static int LEVEL_LOW 表示通知功能開啟,狀態(tài)欄顯示通知圖標(biāo),無(wú)橫幅或提示音。
static int LEVEL_MIN 表示開啟了通知功能,但狀態(tài)欄中不顯示通知圖標(biāo),沒有橫幅或提示音。
static int LEVEL_NONE 表示通知功能已關(guān)閉。
static int LEVEL_UNDEFINED 表示用戶未定義級(jí)別。
static Sequenceable.ProducerNotificationSlot PRODUCER 從 Parcel 創(chuàng)建一個(gè) NotificationSlot 實(shí)例。

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

構(gòu)造函數(shù) 描述
NotificationSlot(String id, String name, int level) 用于初始化 NotificationSlot 對(duì)象的 ID、名稱和級(jí)別的構(gòu)造函數(shù)。

方法總結(jié)

修飾符和類型 方法 描述
boolean canEnableLight() 獲取NotificationSlot對(duì)象中是否開啟通知燈,由setEnableLight(boolean)設(shè)置。
boolean canVibrate() 獲取 NotificationSlot 對(duì)象的振動(dòng)狀態(tài),由 setEnableVibration(boolean) 設(shè)置。
void enableBadge(boolean isShowBadge) 設(shè)置收到通知后是否在主屏幕上顯示應(yīng)用程序圖標(biāo)標(biāo)記(應(yīng)用程序圖標(biāo)角落的數(shù)字或點(diǎn))。
void enableBypassDnd(boolean bypassDnd) 設(shè)置是否繞過系統(tǒng)中的請(qǐng)勿打擾 (DND) 模式。
String getDescription() 獲取一個(gè) NotificationSlot 對(duì)象的描述,由 setDescription(java.lang.String) 設(shè)置。
String getId() 獲取 NotificationSlot 對(duì)象的 ID。
int getLedLightColor() 獲取 NotificationSlot 對(duì)象中通知燈的顏色,由 setLedLightColor(int) 設(shè)置。
int getLevel() 獲取 NotificationSlot 對(duì)象的級(jí)別,由 setLevel(int) 設(shè)置。
int getLockscreenVisibleness() 獲取一個(gè)NotificationSlot對(duì)象在鎖屏上的通知顯示效果,由setLockscreenVisibleness(int)設(shè)置。
String getName() 獲取 NotificationSlot 對(duì)象的名稱。
String getSlotGroup() 獲取該NotificationSlot對(duì)象所屬的NotificationSlotGroup對(duì)象的ID,由setSlotGroup(java.lang.String)設(shè)置。
Uri getSound() 獲取NotificationSlot對(duì)象的提示音,由setSound(ohos.utils.net.Uri)設(shè)置。
long[] getVibrationStyle() 獲取此 NotificationSlot 中通知的振動(dòng)樣式。
boolean isEnableBypassDnd() 獲取 NotificationSlot 對(duì)象是否繞過免打擾模式,由 enableBypassDnd(boolean) 設(shè)置。
boolean isShowBadge() 獲取 NotificationSlot 對(duì)象的應(yīng)用程序圖標(biāo)徽章狀態(tài),該狀態(tài)由 enableBadge(boolean) 設(shè)置。
boolean marshalling(Parcel out) 將 NotificationSlot 對(duì)象編組到 Parcel 中。
void setDescription(String description) 設(shè)置 NotificationSlot 對(duì)象的描述。
void setEnableLight(boolean isLightEnabled) 指定在設(shè)備上收到通知時(shí)是否啟用通知燈,前提是此設(shè)備有通知燈。
void setEnableVibration(boolean vibration) 設(shè)置是否在收到通知時(shí)啟用振動(dòng)。
void setLedLightColor(int color) 將通知燈的顏色設(shè)置為在設(shè)備上接收到通知時(shí)閃爍,前提是此設(shè)備具有通知燈并且使用值 true 調(diào)用 setEnableLight(boolean)。
void setLevel(int level) 設(shè)置 NotificationSlot 對(duì)象的級(jí)別。
void setLockscreenVisibleness(int visibleness) 設(shè)置是否以及如何在鎖定屏幕上顯示通知。
void setName(String name) 設(shè)置 NotificationSlot 對(duì)象的名稱。
void setSlotGroup(String groupId) 將 NotificationSlot 對(duì)象綁定到指定的 NotificationSlotGroup。
void setSound(Uri sound) 為 NotificationSlot 對(duì)象設(shè)置提示音,在收到通知后播放。
void setVibrationStyle(long[] vibrationValues) 設(shè)置此 NotificationSlot 中通知的振動(dòng)樣式。
String toString() 返回對(duì)象的字符串表示形式。
boolean unmarshalling(Parcel in) 從 Parcel 中解組 NotificationSlot 對(duì)象。
從類 java.lang.Object 繼承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
從接口 ohos.utils.Sequenceable 繼承的方法
hasFileDescriptor

字段詳細(xì)信息

LEVEL_DEFAULT

public static final int LEVEL_DEFAULT

表示開啟通知功能,狀態(tài)欄顯示通知圖標(biāo),不帶橫幅,但有提示音。

Since:

1

LEVEL_HIGH

public static final int LEVEL_HIGH

表示開啟通知功能,狀態(tài)欄顯示通知圖標(biāo),帶有橫幅和提示音。

Since:

1

LEVEL_LOW

public static final int LEVEL_LOW

表示通知功能開啟,狀態(tài)欄顯示通知圖標(biāo),無(wú)橫幅或提示音。

Since:

1

LEVEL_MIN

public static final int LEVEL_MIN

表示開啟了通知功能,但狀態(tài)欄中不顯示通知圖標(biāo),沒有橫幅或提示音。

Since:

1

LEVEL_NONE

public static final int LEVEL_NONE

表示通知功能已關(guān)閉。

Since:

1

LEVEL_UNDEFINED

public static final int LEVEL_UNDEFINED

表示用戶未定義級(jí)別。

這是一個(gè)保留的常量。 不要將其與任何通知相關(guān)聯(lián)。

Since:

3

PRODUCER

public static final Sequenceable.ProducerNotificationSlot PRODUCER

從 Parcel 創(chuàng)建一個(gè) NotificationSlot 實(shí)例。

Since:

4

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

NotificationSlot

public NotificationSlot(String id, String name, int level)

用于初始化 NotificationSlot 對(duì)象的 ID、名稱和級(jí)別的構(gòu)造函數(shù)。

參數(shù):

參數(shù)名稱 參數(shù)描述
id 指定 NotificationSlot 對(duì)象的 ID。 ID 必須是唯一的,并且它的長(zhǎng)度不能超過 1000 個(gè)字符(超出的部分會(huì)被自動(dòng)截?cái)啵?/td>
name 指定 NotificationSlot 對(duì)象的名稱。 名稱必須對(duì)用戶可見,且長(zhǎng)度不得超過 1000 個(gè)字符(超出部分會(huì)自動(dòng)截?cái)啵?/td>
level 指定 NotificationSlot 對(duì)象的級(jí)別,決定通知的顯示效果。 該值可以是 LEVEL_NONE、LEVEL_MIN、LEVEL_LOW、LEVEL_DEFAULT 或 LEVEL_HIGH。

Since:

1

方法詳情

setLevel

public void setLevel(int level)

設(shè)置 NotificationSlot 對(duì)象的級(jí)別。

必須在調(diào)用 NotificationHelper#addNotificationSlot(NotificationSlot) 方法之前設(shè)置 setLevel(int level)。 否則,設(shè)置將不會(huì)生效。

參數(shù):

參數(shù)名稱 參數(shù)描述
level 指定 NotificationSlot 對(duì)象的級(jí)別,決定通知的顯示效果。 該值可以是 LEVEL_NONE、LEVEL_MIN、LEVEL_LOW、LEVEL_DEFAULT 或 LEVEL_HIGH。

Since:

1

setName

public void setName(String name)

設(shè)置 NotificationSlot 對(duì)象的名稱。

無(wú)論是否通過 NotificationHelper#addNotificationSlot(NotificationSlot) 創(chuàng)建了 NotificationSlot 對(duì)象,setName(String) 的設(shè)置都有效。

參數(shù):

參數(shù)名稱 參數(shù)描述
name 指定 NotificationSlot 對(duì)象的名稱。 名稱對(duì)用戶可見,長(zhǎng)度不得超過 1000 個(gè)字符(超出部分自動(dòng)截?cái)啵?/td>

Since:

1

setDescription

public void setDescription(String description)

設(shè)置 NotificationSlot 對(duì)象的描述。

無(wú)論是否通過 NotificationHelper#addNotificationSlot(NotificationSlot) 創(chuàng)建了 NotificationSlot 對(duì)象,setDescription(String) 的設(shè)置都有效。

參數(shù):

參數(shù)名稱 參數(shù)描述
description 描述 NotificationSlot 對(duì)象。 描述對(duì)用戶可見,其長(zhǎng)度不得超過 1000 個(gè)字符(超出部分將自動(dòng)截?cái)啵?/td>

Since:

1

enableBadge

public void enableBadge(boolean isShowBadge)

設(shè)置收到通知后是否在主屏幕上顯示應(yīng)用程序圖標(biāo)標(biāo)記(應(yīng)用程序圖標(biāo)角落的數(shù)字或點(diǎn))。

enableBadge(boolean) 必須在調(diào)用 NotificationHelper#addNotificationSlot(NotificationSlot) 方法之前設(shè)置。 否則,設(shè)置將不會(huì)生效。

參數(shù):

參數(shù)名稱 參數(shù)描述
isShowBadge 指定是否顯示應(yīng)用程序圖標(biāo)標(biāo)志。 如果該值為 true,則啟用應(yīng)用程序圖標(biāo)徽章; 如果值為 false,則禁用應(yīng)用程序圖標(biāo)徽章。

Since:

1

enableBypassDnd

public void enableBypassDnd(boolean bypassDnd)

設(shè)置是否繞過系統(tǒng)中的請(qǐng)勿打擾 (DND) 模式。

enableBypassDnd(boolean)的設(shè)置只有在系統(tǒng)通知設(shè)置中為應(yīng)用程序開啟允許中斷功能時(shí)才會(huì)生效。

參數(shù):

參數(shù)名稱 參數(shù)描述
bypassDnd 指定是否繞過應(yīng)用程序的 DND 模式。 如果該值為 true,則繞過免打擾模式; 如果該值為 false,則不繞過 DND 模式。

Since:

1

setEnableVibration

public void setEnableVibration(boolean vibration)

設(shè)置是否在收到通知時(shí)啟用振動(dòng)。

必須在調(diào)用 NotificationHelper#addNotificationSlot(NotificationSlot) 方法之前設(shè)置 setEnableVibration(boolean)。 否則,設(shè)置將不會(huì)生效。

參數(shù):

參數(shù)名稱 參數(shù)描述
vibration 指示是否在收到通知時(shí)啟用振動(dòng)。 如果該值為true,則啟用振動(dòng); 如果值為 false,則禁用振動(dòng)。

Since:

1

setLockscreenVisibleness

public void setLockscreenVisibleness(int visibleness)

設(shè)置是否以及如何在鎖定屏幕上顯示通知。

此方法指定在鎖定屏幕上顯示通知的不同效果,以保護(hù)用戶隱私。

該設(shè)置僅在系統(tǒng)通知設(shè)置中為應(yīng)用程序開啟鎖屏通知功能時(shí)生效。

參數(shù):

參數(shù)名稱 參數(shù)描述
visibleness 指定鎖屏上的通知顯示效果,可以設(shè)置為 NotificationRequest#VISIBLENESS_TYPE_PUBLIC、NotificationRequest#VISIBLENESS_TYPE_PRIVATE 或 NotificationRequest#VISIBLENESS_TYPE_SECRET。

Since:

1

setSound

public void setSound(Uri sound)

為 NotificationSlot 對(duì)象設(shè)置提示音,在收到通知后播放。

必須在調(diào)用 NotificationHelper#addNotificationSlot(NotificationSlot) 方法之前設(shè)置 setSound(Uri)。 否則,設(shè)置將不會(huì)生效。

參數(shù):

參數(shù)名稱 參數(shù)描述
sound 指定提示音的路徑。

Since:

1

setEnableLight

public void setEnableLight(boolean isLightEnabled)

指定在設(shè)備上收到通知時(shí)是否啟用通知燈,前提是此設(shè)備有通知燈。

必須在調(diào)用 NotificationHelper#addNotificationSlot(NotificationSlot) 方法之前設(shè)置 setEnableLight(boolean)。 否則,設(shè)置將不會(huì)生效。

參數(shù):

參數(shù)名稱 參數(shù)描述
isLightEnabled 指定是否啟用脈搏通知燈。 true 表示開啟通知燈,false 表示不開啟。

Since:

1

setLedLightColor

public void setLedLightColor(int color)

將通知燈的顏色設(shè)置為在設(shè)備上接收到通知時(shí)閃爍,前提是此設(shè)備具有通知燈并且使用值 true 調(diào)用 setEnableLight(boolean)。

必須在調(diào)用 NotificationHelper#addNotificationSlot(NotificationSlot) 方法之前設(shè)置 setLedLightColor(int)。 否則,設(shè)置將不會(huì)生效。

參數(shù):

參數(shù)名稱 參數(shù)描述
color 指示通知燈的顏色。

Since:

1

setSlotGroup

public void setSlotGroup(String groupId)

將 NotificationSlot 對(duì)象綁定到指定的 NotificationSlotGroup。

必須在調(diào)用 NotificationHelper#addNotificationSlot(NotificationSlot) 方法之前調(diào)用 setSlotGroup(String)。 否則,此方法不會(huì)生效。

參數(shù):

參數(shù)名稱 參數(shù)描述
groupId 表示要綁定的 NotificationSlotGroup 對(duì)象的 ID,必須是通過調(diào)用 NotificationHelper#addNotificationSlotGroup(NotificationSlotGroup) 創(chuàng)建的。

Since:

3

getId

public String getId()

獲取 NotificationSlot 對(duì)象的 ID。

返回:

返回 NotificationSlot 對(duì)象的 ID,由 NotificationSlot(java.lang.String,java.lang.String,int) 設(shè)置。

Since:

1

getName

public String getName()

獲取 NotificationSlot 對(duì)象的名稱。

返回:

返回由 setName(java.lang.String) 設(shè)置的 NotificationSlot 對(duì)象的名稱。

Since:

1

getDescription

public String getDescription()

獲取一個(gè) NotificationSlot 對(duì)象的描述,由 setDescription(java.lang.String) 設(shè)置。

返回:

返回 NotificationSlot 對(duì)象的描述。

Since:

1

getLevel

public int getLevel()

獲取 NotificationSlot 對(duì)象的級(jí)別,由 setLevel(int) 設(shè)置。

返回:

返回 NotificationSlot 對(duì)象的級(jí)別。

Since:

1

isShowBadge

public boolean isShowBadge()

獲取 NotificationSlot 對(duì)象的應(yīng)用程序圖標(biāo)徽章狀態(tài),該狀態(tài)由 enableBadge(boolean) 設(shè)置。

返回:

如果啟用了應(yīng)用程序圖標(biāo)徽章,則返回 true; 否則返回 false。

Since:

1

isEnableBypassDnd

public boolean isEnableBypassDnd()

獲取 NotificationSlot 對(duì)象是否繞過免打擾模式,由 enableBypassDnd(boolean) 設(shè)置。

返回:

如果繞過 DND 模式,則返回 true; 否則返回 false。

Since:

1

canVibrate

public boolean canVibrate()

獲取 NotificationSlot 對(duì)象的振動(dòng)狀態(tài),由 setEnableVibration(boolean) 設(shè)置。

返回:

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

Since:

1

getLockscreenVisibleness

public int getLockscreenVisibleness()

獲取一個(gè)NotificationSlot對(duì)象在鎖屏上的通知顯示效果,由setLockscreenVisibleness(int)設(shè)置。

返回:

返回 NotificationSlot 對(duì)象在鎖屏上的通知顯示效果。

Since:

1

getSound

public Uri getSound()

獲取NotificationSlot對(duì)象的提示音,由setSound(ohos.utils.net.Uri)設(shè)置。

返回:

返回 NotificationSlot 對(duì)象的提示音。

Since:

1

canEnableLight

public boolean canEnableLight()

獲取NotificationSlot對(duì)象中是否開啟通知燈,由setEnableLight(boolean)設(shè)置。

返回:

如果啟用通知燈,則返回 true; 否則返回 false。

Since:

1

getLedLightColor

public int getLedLightColor()

獲取 NotificationSlot 對(duì)象中通知燈的顏色,由 setLedLightColor(int) 設(shè)置。

返回:

返回通知燈的顏色。

Since:

1

getSlotGroup

public String getSlotGroup()

獲取該NotificationSlot對(duì)象所屬的NotificationSlotGroup對(duì)象的ID,由setSlotGroup(java.lang.String)設(shè)置。

返回:

返回此 NotificationSlot 對(duì)象所屬的 NotificationSlotGroup 的 ID。

Since:

3

setVibrationStyle

public void setVibrationStyle(long[] vibrationValues)

設(shè)置此 NotificationSlot 中通知的振動(dòng)樣式。

如果將空數(shù)組或 null 傳遞給此方法,則系統(tǒng)將調(diào)用 setEnableVibration(boolean) 并將輸入?yún)?shù)設(shè)置為 false。 如果將有效值傳遞給此方法,則系統(tǒng)調(diào)用 setEnableVibration(boolean) 并將輸入?yún)?shù)設(shè)置為 true。 該方法僅在調(diào)用 NotificationHelper#addNotificationSlot(NotificationSlot) 之前生效。

參數(shù):

參數(shù)名稱 參數(shù)描述
vibrationValues 指示要設(shè)置的振動(dòng)樣式。

Since:

4

getVibrationStyle

public long[] getVibrationStyle()

獲取此 NotificationSlot 中通知的振動(dòng)樣式。

返回:

返回此 NotificationSlot 的振動(dòng)樣式。

Since:

4

marshalling

public boolean marshalling(Parcel out)

將 NotificationSlot 對(duì)象編組到 Parcel 中。

進(jìn)程可以調(diào)用 unmarshalling(ohos.utils.Parcel) 方法從 Parcel 中解組 NotificationSlot 對(duì)象以實(shí)現(xiàn)進(jìn)程間通信 (IPC)。

指定者:

接口 Sequenceable 中的編組

參數(shù):

參數(shù)名稱 參數(shù)描述
out 指示用于編組的 Parcel 對(duì)象。

返回:

如果編組成功,則返回 true; 否則返回 false。

Since:

1

unmarshalling

public boolean unmarshalling(Parcel in)

從 Parcel 中解組 NotificationSlot 對(duì)象。

指定者:

在接口 Sequenceable 中解組

參數(shù):

參數(shù)名稱 參數(shù)描述
in 指示用于解組的 Parcel 對(duì)象。

返回:

如果解組成功,則返回 true; 否則返回 false。

Since:

1

toString

public String toString()

從類復(fù)制的描述:對(duì)象

返回對(duì)象的字符串表示形式。 通常,toString 方法返回一個(gè)“以文本方式表示”該對(duì)象的字符串。 結(jié)果應(yīng)該是一個(gè)簡(jiǎn)潔但信息豐富的表示,易于人們閱讀。 建議所有子類重寫此方法。

Object 類的 toString 方法返回一個(gè)字符串,該字符串由對(duì)象作為其實(shí)例的類的名稱、at 符號(hào)字符“@”和對(duì)象哈希碼的無(wú)符號(hào)十六進(jìn)制表示形式組成。 換句話說,此方法返回一個(gè)等于以下值的字符串:

 getClass().getName() + '@' + Integer.toHexString(hashCode()) 

覆蓋:

類 Object 中的 toString

返回:

對(duì)象的字符串表示形式。

Since:

4


分享名稱:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSNotificationSlot
標(biāo)題URL:http://m.5511xx.com/article/djegdch.html