当前位置: 首页>>代码示例>>Java>>正文


Java Animation.RELATIVE_TO_PARENT属性代码示例

本文整理汇总了Java中android.view.animation.Animation.RELATIVE_TO_PARENT属性的典型用法代码示例。如果您正苦于以下问题:Java Animation.RELATIVE_TO_PARENT属性的具体用法?Java Animation.RELATIVE_TO_PARENT怎么用?Java Animation.RELATIVE_TO_PARENT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.view.animation.Animation的用法示例。


在下文中一共展示了Animation.RELATIVE_TO_PARENT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    Window window = getWindow();
    window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    setContentView(R.layout.activity_capture);

    scanPreview = (SurfaceView) findViewById(R.id.capture_preview);
    scanContainer = (RelativeLayout) findViewById(R.id.capture_container);
    scanCropView = (RelativeLayout) findViewById(R.id.capture_crop_view);
    scanLine = (ImageView) findViewById(R.id.capture_scan_line);

    inactivityTimer = new InactivityTimer(this);
    beepManager = new BeepManager(this);

    TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f, Animation
            .RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT,
            0.9f);
    animation.setDuration(4500);
    animation.setRepeatCount(-1);
    animation.setRepeatMode(Animation.RESTART);
    scanLine.startAnimation(animation);
}
 
开发者ID:Hultron,项目名称:LifeHelper,代码行数:24,代码来源:CaptureActivity.java

示例2: onCreate

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    Window window = getWindow();
    window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    setContentView(R.layout.activity_scan);

    scanPreview = (SurfaceView) findViewById(R.id.capture_preview);
    scanContainer = (RelativeLayout) findViewById(R.id.capture_container);
    scanCropView = (RelativeLayout) findViewById(R.id.capture_crop_view);
    scanLine = (ImageView) findViewById(R.id.capture_scan_line);

    inactivityTimer = new InactivityTimer(this);
    beepManager = new BeepManager(this);

    TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.9f);
    animation.setDuration(4500);
    animation.setRepeatCount(-1);
    animation.setRepeatMode(Animation.RESTART);
    scanLine.startAnimation(animation);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

}
 
开发者ID:TonnyL,项目名称:Espresso,代码行数:27,代码来源:CaptureActivity.java

示例3: loadLayoutAnimation

/**
 * 对话框的布局动画
 */
@Override
public Animation loadLayoutAnimation() {
    if (layoutAnim) {
        if (layoutAnimation == null) {
            TranslateAnimation translateAnimation = new TranslateAnimation(
                    Animation.RELATIVE_TO_PARENT, 0f, Animation.RELATIVE_TO_PARENT, 0f,
                    Animation.RELATIVE_TO_PARENT, 1f, Animation.RELATIVE_TO_PARENT, 0f);
            setDefaultConfig(translateAnimation, false);
            translateAnimation.setDuration(160);
            return translateAnimation;
        } else {
            return layoutAnimation;
        }
    }
    return null;
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:19,代码来源:UIIDialogImpl.java

示例4: onCreate

@Override
public void onCreate(Bundle icicle) {
	super.onCreate(icicle);
	Window window = getWindow();
	window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
	setContentView(R.layout.activity_capture);

	scanPreview = (SurfaceView) findViewById(R.id.capture_preview);
	scanContainer = (RelativeLayout) findViewById(R.id.capture_container);
	scanCropView = (RelativeLayout) findViewById(R.id.capture_crop_view);
	scanLine = (ImageView) findViewById(R.id.capture_scan_line);

	inactivityTimer = new InactivityTimer(this);
	beepManager = new BeepManager(this);

	TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT,
			0.9f);
	animation.setDuration(4500);
	animation.setRepeatCount(-1);
	animation.setRepeatMode(Animation.RESTART);
	scanLine.startAnimation(animation);
	
	findViewById(R.id.capture_flashlight).setOnClickListener(this);
	findViewById(R.id.capture_scan_photo).setOnClickListener(this);
}
 
开发者ID:wp521,项目名称:MyFire,代码行数:25,代码来源:CaptureActivity.java

示例5: doEnterAnim

public void doEnterAnim(final View contentView, long animDuration) {
    if (builder.gravity == Gravity.BOTTOM) {
        ValueAnimator enterAnimator = ValueAnimator.ofFloat(contentView.getHeight(), 0);
        enterAnimator.setDuration(animDuration);
        enterAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                float value = (float) animation.getAnimatedValue();
                contentView.setTranslationY(value);
            }
        });
        enterAnimator.start();
    } else {
        ScaleAnimation scaleAnimation = new ScaleAnimation(0F, 1.0F, 0F, 1.0F,
                Animation.RELATIVE_TO_PARENT, 0.5F, Animation.RELATIVE_TO_PARENT, 0.5F);
        scaleAnimation.setDuration(animDuration);
        scaleAnimation.setFillAfter(true);
        contentView.startAnimation(scaleAnimation);
    }
}
 
开发者ID:devilist,项目名称:RecyclerWheelPicker,代码行数:20,代码来源:WheelPicker.java

示例6: getStartAnimation

/**
 * 获得入场动画
 *
 * @return
 */
protected Animation getStartAnimation() {
    AlphaAnimation animAlpha = new AlphaAnimation(0, 1);
    animAlpha.setDuration(TIME_START_ANIM);
    animAlpha.setFillAfter(true);

    TranslateAnimation animTrans = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 1.5f,
            Animation.RELATIVE_TO_PARENT, 0f,
            Animation.RELATIVE_TO_PARENT, 0f,
            Animation.RELATIVE_TO_PARENT, 0f);
    animTrans.setDuration(TIME_START_ANIM);
    animTrans.setFillAfter(true);
    animTrans.setInterpolator(new DecelerateInterpolator());

    AnimationSet sets = new AnimationSet(true);
    sets.addAnimation(animAlpha);
    sets.addAnimation(animTrans);

    return sets;
}
 
开发者ID:jeasinlee,项目名称:AndroidBasicLibs,代码行数:24,代码来源:DrawerToast.java

示例7: getEndAnimation

/**
 * 获得离场动画
 *
 * @return
 */
protected Animation getEndAnimation() {
    AlphaAnimation animAlpha = new AlphaAnimation(1, 0);
    animAlpha.setDuration(TIME_END_ANIM);
    animAlpha.setFillAfter(true);

    TranslateAnimation animTrans = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0f,
            Animation.RELATIVE_TO_PARENT, -1.5f,
            Animation.RELATIVE_TO_PARENT, 0f,
            Animation.RELATIVE_TO_PARENT, 0f);
    animTrans.setDuration(TIME_END_ANIM);
    animTrans.setFillAfter(true);
    animTrans.setInterpolator(new AccelerateInterpolator());

    AnimationSet sets = new AnimationSet(true);
    sets.addAnimation(animAlpha);
    sets.addAnimation(animTrans);

    return sets;
}
 
开发者ID:jeasinlee,项目名称:AndroidBasicLibs,代码行数:24,代码来源:DrawerToast.java

示例8: randomTranslate

private TranslateAnimation randomTranslate(int startTopInParent, int duration, AnimationListener l) {
	float halfPercent = (1 + startTopInParent * 1.0f / mScreenHeight) / 2;
	TranslateAnimation trans = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, (float) ((Math.random() > 0.5f ? 1 : -1) * Math.random()) * 5,
			Animation.RELATIVE_TO_PARENT, 0, Animation.RELATIVE_TO_PARENT, (float) (Math.random() * halfPercent + halfPercent));
	trans.setInterpolator(this, android.R.anim.linear_interpolator);
	trans.setStartOffset(0);
	trans.setDuration(duration);
	trans.setAnimationListener(l);
	return trans;
}
 
开发者ID:isuhao,项目名称:QMark,代码行数:10,代码来源:WelcomeSnowActy.java

示例9: randomTranslateX

private TranslateAnimation randomTranslateX() {
	TranslateAnimation trans = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, (float) ((Math.random() > 0.5f ? 1 : -1) * Math.random()),
			Animation.RELATIVE_TO_PARENT, 0, Animation.RELATIVE_TO_PARENT, 0);
	trans.setInterpolator(this, android.R.anim.accelerate_decelerate_interpolator);
	trans.setRepeatCount(Animation.INFINITE);
	trans.setRepeatMode(Animation.REVERSE);
	trans.setStartOffset(0);
	trans.setDuration((int) (Math.random() * 2000 + 1000));
	return trans;
}
 
开发者ID:isuhao,项目名称:QMark,代码行数:10,代码来源:WelcomeSnowActy.java

示例10: outToLeftAnimation

private Animation outToLeftAnimation() {
	Animation outtoLeft = new TranslateAnimation(
			Animation.RELATIVE_TO_PARENT, 0.0f,
			Animation.RELATIVE_TO_PARENT, -1.0f,
			Animation.RELATIVE_TO_PARENT, 0.0f,
			Animation.RELATIVE_TO_PARENT, 0.0f);
	outtoLeft.setDuration(300);
	outtoLeft.setInterpolator(new AccelerateInterpolator());
	return outtoLeft;
}
 
开发者ID:tiberiusteng,项目名称:financisto1-holo,代码行数:10,代码来源:PinView.java

示例11: inFromRightAnimation

private Animation inFromRightAnimation() {

        Animation inFromRight = new TranslateAnimation(
                Animation.RELATIVE_TO_PARENT, +1.0f,
                Animation.RELATIVE_TO_PARENT, 0.0f,
                Animation.RELATIVE_TO_PARENT, 0.0f,
                Animation.RELATIVE_TO_PARENT, 0.0f);
        inFromRight.setDuration(600);
        inFromRight.setInterpolator(new AccelerateInterpolator());
        return inFromRight;
    }
 
开发者ID:sarveshchavan7,项目名称:Trivia-Knowledge,代码行数:11,代码来源:Category.java

示例12: outToBottomAnimation

public static Animation outToBottomAnimation() {
	Animation outtoRight = new TranslateAnimation(
			Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f,
			Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,  +1.0f
	);
	outtoRight.setDuration(DURATION);
	outtoRight.setInterpolator(new AccelerateInterpolator());
	return outtoRight;
}
 
开发者ID:ceji-longquan,项目名称:ceji_android,代码行数:9,代码来源:Animations.java

示例13: inFromTopAnimation

public static Animation inFromTopAnimation() {
	Animation outtoRight = new TranslateAnimation(
			Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f,
			Animation.RELATIVE_TO_PARENT,  -1.0f, Animation.RELATIVE_TO_PARENT,  0.0f
	);
	outtoRight.setDuration(DURATION);
	outtoRight.setInterpolator(new AccelerateInterpolator());
	return outtoRight;
}
 
开发者ID:ceji-longquan,项目名称:ceji_android,代码行数:9,代码来源:Animations.java

示例14: inFromRightAnimation

private Animation inFromRightAnimation() {
	Animation inFromRight = new TranslateAnimation(
			Animation.RELATIVE_TO_PARENT, +1.0f,
			Animation.RELATIVE_TO_PARENT, 0.0f,
			Animation.RELATIVE_TO_PARENT, 0.0f,
			Animation.RELATIVE_TO_PARENT, 0.0f);
	inFromRight.setDuration(300);
	inFromRight.setInterpolator(new AccelerateInterpolator());
	return inFromRight;
}
 
开发者ID:tiberiusteng,项目名称:financisto1-holo,代码行数:10,代码来源:PinView.java

示例15: outToTopAnimation

public static Animation outToTopAnimation() {
	Animation outtoRight = new TranslateAnimation(
			Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f,
			Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,  -1.0f
	);
	outtoRight.setDuration(DURATION);
	outtoRight.setInterpolator(new AccelerateInterpolator());
	return outtoRight;
}
 
开发者ID:ceji-longquan,项目名称:ceji_android,代码行数:9,代码来源:Animations.java


注:本文中的android.view.animation.Animation.RELATIVE_TO_PARENT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。