本文整理汇总了Java中android.view.View.setZ方法的典型用法代码示例。如果您正苦于以下问题:Java View.setZ方法的具体用法?Java View.setZ怎么用?Java View.setZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.setZ方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addPlanetAnimation
import android.view.View; //导入方法依赖的package包/类
private void addPlanetAnimation() {
View planet0 = findViewById(R.id.planet_0);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) planet0.setZ(50);
wowo.addAnimation(planet0)
.add(WoWoTranslationAnimation.builder().page(1)
.keepX(0)
.fromY(0).toY(planet0.getHeight() + 200)
.ease(Ease.OutBack).sameEaseBack(false).build())
.add(WoWoTranslationAnimation.builder().page(2)
.fromX(0).toX(screenW)
.keepY(planet0.getHeight() + 200)
.ease(Ease.InBack).sameEaseBack(false).build());
View planet1 = findViewById(R.id.planet_1);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) planet1.setZ(50);
wowo.addAnimation(planet1)
.add(WoWoTranslationAnimation.builder().page(1)
.fromX(0).toX(-planet1.getWidth())
.keepY(0)
.ease(Ease.OutBack).sameEaseBack(false).build())
.add(WoWoTranslationAnimation.builder().page(2)
.fromX(-planet1.getWidth()).toX(-screenW - planet1.getWidth())
.keepY(0)
.ease(Ease.InBack).sameEaseBack(false).build());
}
示例2: addTextAnimation
import android.view.View; //导入方法依赖的package包/类
private void addTextAnimation() {
View text = findViewById(R.id.text);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) text.setZ(50);
String[] texts = new String[]{
"HOME?",
"OR SKY?",
"OR UNIVERSE?",
"Let's Discover More!",
};
wowo.addAnimation(text)
.add(WoWoTextViewTextAnimation.builder().page(0).from(texts[0]).to(texts[1]).build())
.add(WoWoTextViewTextAnimation.builder().page(1).from(texts[1]).to(texts[2]).build())
.add(WoWoTextViewTextAnimation.builder().page(2).from(texts[2]).to(texts[3]).build())
.add(WoWoTextViewColorAnimation.builder().page(1).from("#05502f").to(Color.WHITE).build());
}
示例3: addMeteorAnimation
import android.view.View; //导入方法依赖的package包/类
private void addMeteorAnimation() {
View meteor = findViewById(R.id.meteor);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) meteor.setZ(50);
float fullOffset = screenW + meteor.getWidth();
float offset = fullOffset / 2;
wowo.addAnimation(meteor)
.add(WoWoTranslationAnimation.builder().page(1)
.fromX(0).fromY(0)
.toX(offset).toY(offset).ease(Ease.OutBack).sameEaseBack(false).build())
.add(WoWoTranslationAnimation.builder().page(2)
.fromX(offset).fromY(offset)
.toX(fullOffset).toY(fullOffset).ease(Ease.InBack).sameEaseBack(false).build());
}
示例4: setItemViewProperty
import android.view.View; //导入方法依赖的package包/类
@Override
protected void setItemViewProperty(View itemView, float targetOffset) {
itemView.setRotation(targetOffset);
float scale = calculateScale(itemView,targetOffset);
itemView.setScaleX(scale);
itemView.setScaleY(scale);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
itemView.setZ(scale);
}
}
示例5: toStartState
import android.view.View; //导入方法依赖的package包/类
@Override
protected void toStartState(View view) {
view.setX(fromX);
view.setY(fromY);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) view.setZ(fromZ);
}
示例6: toMiddleState
import android.view.View; //导入方法依赖的package包/类
@Override
protected void toMiddleState(View view, float offset) {
view.setX(fromX + (toX - fromX) * offset);
view.setY(fromY + (toY - fromY) * offset);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) view.setZ(fromZ + (toZ - fromZ) * offset);
}
示例7: toEndState
import android.view.View; //导入方法依赖的package包/类
@Override
protected void toEndState(View view) {
view.setX(toX);
view.setY(toY);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) view.setZ(toZ);
}
示例8: addButtonAnimation
import android.view.View; //导入方法依赖的package包/类
private void addButtonAnimation() {
View button = findViewById(R.id.button);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) button.setZ(50);
wowo.addAnimation(button)
.add(WoWoAlphaAnimation.builder().page(2).from(0).to(1).build());
}
示例9: setZ
import android.view.View; //导入方法依赖的package包/类
public static void setZ(View view, float z) {
view.setZ(z);
}
示例10: renderLayout
import android.view.View; //导入方法依赖的package包/类
protected void renderLayout(BaseCell cell, View view) {
if (cell.style != null) {
ViewGroup.LayoutParams lp = view.getLayoutParams();
if (lp == null || !(lp instanceof VirtualLayoutManager.LayoutParams)) {
if (lp == null) {
lp = new VirtualLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
} else {
lp = new VirtualLayoutManager.LayoutParams(lp.width, lp.height);
}
view.setLayoutParams(lp);
}
if (lp instanceof VirtualLayoutManager.LayoutParams) {
VirtualLayoutManager.LayoutParams params = (VirtualLayoutManager.LayoutParams) lp;
if (cell.style.height >= 0) {
params.storeOriginHeight();
params.height = cell.style.height;
} else {
params.restoreOriginHeight();
}
if (cell.style.width >= 0) {
params.storeOriginWidth();
params.width = cell.style.width;
} else {
params.restoreOriginWidth();
}
params.mAspectRatio = cell.style.aspectRatio;
params.zIndex = cell.style.zIndex;
if (params.zIndex == 0) {
if (cell.parent != null && cell.parent.style != null) {
params.zIndex = cell.parent.style.zIndex;
}
}
if (VERSION.SDK_INT >= 21) {
view.setZ(params.zIndex);
}
} else {
if (cell.style.height >= 0) {
lp.height = cell.style.height;
}
if (cell.style.width >= 0) {
lp.width = cell.style.width;
}
}
if (lp instanceof ViewGroup.MarginLayoutParams) {
ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) lp;
layoutParams.topMargin = cell.style.margin[MARGIN_TOP_INDEX];
layoutParams.leftMargin = cell.style.margin[MARGIN_LEFT_INDEX];
layoutParams.bottomMargin = cell.style.margin[MARGIN_BOTTOM_INDEX];
layoutParams.rightMargin = cell.style.margin[MARGIN_RIGHT_INDEX];
}
// reset translation animation before reused
view.setTranslationX(0);
view.setTranslationY(0);
}
}