W3Cschool
恭喜您成為首批注冊(cè)用戶(hù)
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
java.lang.Object
|---ohos.agp.components.ComponentTransition
public class ComponentTransition
extends Object
為 ComponentContainer 對(duì)象的布局更改提供動(dòng)畫(huà)。
要在布局容器上執(zhí)行布局轉(zhuǎn)換,請(qǐng)創(chuàng)建一個(gè) ComponentTransition 對(duì)象,然后使用 ComponentContainer#setComponentTransition 設(shè)置一個(gè) ComponentContainer 對(duì)象。
修飾符和類(lèi)型 | 字段 | 描述 |
---|---|---|
static int | CHANGING | 指示在由布局修改更改的組件上運(yùn)行的動(dòng)畫(huà),而不是通過(guò)在布局容器中添加或刪除組件。 |
static int | OTHERS_GONE | 指示在組件上運(yùn)行的動(dòng)畫(huà),因?yàn)樗鼈兊年P(guān)聯(lián)組件之一從 ComponentContainer 中消失而發(fā)生更改。 |
static int | OTHERS_SHOW | 指示在組件上運(yùn)行的動(dòng)畫(huà),因?yàn)樗鼈兊年P(guān)聯(lián)組件之一出現(xiàn)在 ComponentContainer 中而發(fā)生更改。 |
static int | SELF_GONE | 表示當(dāng)組件從 ComponentContainer 中消失時(shí)在組件上運(yùn)行的動(dòng)畫(huà)。 |
static int | SELF_SHOW | 表示當(dāng)組件出現(xiàn)在 ComponentContainer 中時(shí)在組件上運(yùn)行的動(dòng)畫(huà)。 |
構(gòu)造函數(shù) | 描述 |
---|---|
ComponentTransition() | 用于創(chuàng)建 ComponentTransition 實(shí)例的默認(rèn)構(gòu)造函數(shù)。 |
修飾符和類(lèi)型 | 方法 | 描述 |
---|---|---|
void | addTransitionType(int type) | 為 ComponentTransition 對(duì)象啟用過(guò)渡類(lèi)型。 |
AnimatorProperty | getAnimatorProperty(int type) | 獲取指定轉(zhuǎn)場(chǎng)類(lèi)型的組件屬性動(dòng)畫(huà)器。 |
boolean | hasTransitionType(int type) | 檢查是否為 ComponentTransition 對(duì)象啟用了指定的過(guò)渡類(lèi)型。 |
void | release() | 釋放一個(gè) ComponentTransition 對(duì)象。 |
void | removeTransitionType(int type) | 從 ComponentTransition 對(duì)象中移除過(guò)渡類(lèi)型。 |
void | setAnimatorProperty(int type, AnimatorProperty animator) | 設(shè)置指定轉(zhuǎn)換類(lèi)型的可自定義組件屬性動(dòng)畫(huà)器。 |
void | setTransitionTypeDuration(int type, int duration) | 設(shè)置指定過(guò)渡類(lèi)型動(dòng)畫(huà)的持續(xù)時(shí)間。 |
從類(lèi) java.lang.Object 繼承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
public static final int CHANGING
指示在由布局修改更改的組件上運(yùn)行的動(dòng)畫(huà),而不是通過(guò)在布局容器中添加或刪除組件。
默認(rèn)情況下,此轉(zhuǎn)換類(lèi)型被禁用。 您可以調(diào)用 addTransitionType(int) 來(lái)啟用它。
public static final int OTHERS_GONE
指示在組件上運(yùn)行的動(dòng)畫(huà),因?yàn)樗鼈兊年P(guān)聯(lián)組件之一從 ComponentContainer 中消失而發(fā)生更改。
public static final int OTHERS_SHOW
指示在組件上運(yùn)行的動(dòng)畫(huà),因?yàn)樗鼈兊年P(guān)聯(lián)組件之一出現(xiàn)在 ComponentContainer 中而發(fā)生更改。
public static final int SELF_GONE
表示當(dāng)組件從 ComponentContainer 中消失時(shí)在組件上運(yùn)行的動(dòng)畫(huà)。
public static final int SELF_SHOW
表示當(dāng)組件出現(xiàn)在 ComponentContainer 中時(shí)在組件上運(yùn)行的動(dòng)畫(huà)。
public ComponentTransition()
用于創(chuàng)建 ComponentTransition 實(shí)例的默認(rèn)構(gòu)造函數(shù)。
public void release()
釋放一個(gè) ComponentTransition 對(duì)象。
public void addTransitionType(int type)
為 ComponentTransition 對(duì)象啟用過(guò)渡類(lèi)型。
過(guò)渡類(lèi)型包括 SELF_SHOW、OTHERS_SHOW、OTHERS_GONE、SELF_GONE 和 CHANGING。
參數(shù):
參數(shù)名稱(chēng) | 參數(shù)描述 |
---|---|
type | 指示要啟用的轉(zhuǎn)換類(lèi)型。 |
public void removeTransitionType(int type)
從 ComponentTransition 對(duì)象中移除過(guò)渡類(lèi)型。
默認(rèn)情況下,啟用除 CHANGING 之外的所有轉(zhuǎn)換類(lèi)型。
參數(shù):
參數(shù)名稱(chēng) | 參數(shù)描述 |
---|---|
type | 指示要?jiǎng)h除的轉(zhuǎn)換類(lèi)型。 |
public boolean hasTransitionType(int type)
檢查是否為 ComponentTransition 對(duì)象啟用了指定的過(guò)渡類(lèi)型。
參數(shù):
參數(shù)名稱(chēng) | 參數(shù)描述 |
---|---|
type | 表示指定的過(guò)渡類(lèi)型。 |
返回:
如果添加了指定的過(guò)渡類(lèi)型,則返回 true; 否則返回 false。
public void setTransitionTypeDuration(int type, int duration)
設(shè)置指定過(guò)渡類(lèi)型動(dòng)畫(huà)的持續(xù)時(shí)間。
參數(shù):
參數(shù)名稱(chēng) | 參數(shù)描述 |
---|---|
type | 表示指定的轉(zhuǎn)場(chǎng)類(lèi)型,可以是SELF_SHOW、OTHERS_SHOW、OTHERS_GONE、SELF_GONE或CHANGING。 |
duration | 指示過(guò)渡動(dòng)畫(huà)的持續(xù)時(shí)間,以毫秒為單位。 |
public void setAnimatorProperty(int type, AnimatorProperty animator)
設(shè)置指定轉(zhuǎn)換類(lèi)型的可自定義組件屬性動(dòng)畫(huà)器。
參數(shù):
參數(shù)名稱(chēng) | 參數(shù)描述 |
---|---|
type | 表示指定的轉(zhuǎn)場(chǎng)類(lèi)型,可以是SELF_SHOW、OTHERS_SHOW、OTHERS_GONE、SELF_GONE或CHANGING。 |
animator | 表示組件屬性動(dòng)畫(huà)器。 |
public AnimatorProperty getAnimatorProperty(int type)
獲取指定轉(zhuǎn)場(chǎng)類(lèi)型的組件屬性動(dòng)畫(huà)器。
參數(shù):
參數(shù)名稱(chēng) | 參數(shù)描述 |
---|---|
type | 表示指定的轉(zhuǎn)場(chǎng)類(lèi)型,可以是SELF_SHOW、OTHERS_SHOW、OTHERS_GONE、SELF_GONE或CHANGING。 |
返回:
返回指定轉(zhuǎn)場(chǎng)類(lèi)型的AnimatorProperty對(duì)象; 否則返回 null。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: