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


Java RotateAnimation.RELATIVE_TO_SELF属性代码示例

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


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

示例1: init

private void init(Context context) {
	mFlipAnimation = new RotateAnimation(0, -180,
			RotateAnimation.RELATIVE_TO_SELF, 0.5f,
			RotateAnimation.RELATIVE_TO_SELF, 0.5f);
	mFlipAnimation.setInterpolator(new LinearInterpolator());
	mFlipAnimation.setDuration(250);
	mFlipAnimation.setFillAfter(true);
	mReverseFlipAnimation = new RotateAnimation(-180, 0,
			RotateAnimation.RELATIVE_TO_SELF, 0.5f,
			RotateAnimation.RELATIVE_TO_SELF, 0.5f);
	mReverseFlipAnimation.setInterpolator(new LinearInterpolator());
	mReverseFlipAnimation.setDuration(250);
	mReverseFlipAnimation.setFillAfter(true);

	mRefreshView = (LinearLayout) View.inflate(context, R.layout.pull_to_refresh_header, null);
	mRefreshViewText = (TextView) mRefreshView.findViewById(R.id.pull_to_refresh_text);
	mRefreshViewImage = (ImageView) mRefreshView.findViewById(R.id.pull_to_refresh_image);
	mRefreshViewProgress = (ProgressBar) mRefreshView.findViewById(R.id.pull_to_refresh_progress);
	mRefreshViewLastUpdated = (TextView) mRefreshView.findViewById(R.id.pull_to_refresh_updated_at);

	mRefreshState = PULL_TO_REFRESH;
	mRefreshViewImage.setMinimumHeight(50); //设置下拉最小的高度为50
	
	setFadingEdgeLength(0);
	setHeaderDividersEnabled(false);

	//把refreshview加入到listview的头部
	addHeaderView(mRefreshView);
	super.setOnScrollListener(this);
	mRefreshView.setOnClickListener(this);

	mRefreshView.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
	mRefreshViewHeight = mRefreshView.getMeasuredHeight();
	mRefreshOriginalTopPadding = -mRefreshViewHeight;
	
	resetHeaderPadding();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:37,代码来源:PullToRefreshListView.java

示例2: CustomLoadDetailFooter

public CustomLoadDetailFooter(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    mFlipAnimation = new RotateAnimation(0, -180, RotateAnimation.RELATIVE_TO_SELF,
            0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    mFlipAnimation.setInterpolator(new LinearInterpolator());
    mFlipAnimation.setDuration(200);
    mFlipAnimation.setFillAfter(true);

    mReverseFlipAnimation = new RotateAnimation(-180, 0, RotateAnimation.RELATIVE_TO_SELF,
            0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    mReverseFlipAnimation.setInterpolator(new LinearInterpolator());
    mReverseFlipAnimation.setDuration(200);
    mReverseFlipAnimation.setFillAfter(true);
    View header = LayoutInflater.from(getContext()).inflate(R.layout.layout_custom_load_detail_footer, this);
    mRotateView = (ImageView) header.findViewById(R.id.imageView_load_detail_footer_rotation);
    mTitleTextView = (TextView) header.findViewById(R.id.textView_load_detail_footer_title);
}
 
开发者ID:dkzwm,项目名称:SmoothRefreshLayout,代码行数:17,代码来源:CustomLoadDetailFooter.java

示例3: setHintPanelVisible

void setHintPanelVisible(boolean visible)
{
    final int visibility = hintPanel.getVisibility();
    boolean previousVisible = visibility == View.VISIBLE;
    if (previousVisible == visible)
    {
        return;
    }
    if (visible)
    {
        hintPanel.setVisibility(View.VISIBLE);
        final AlphaAnimation alphaAnimation = new AlphaAnimation(0.2f, 1.0f);
        alphaAnimation.setDuration(150);
        hintPanel.setAnimation(alphaAnimation);
        final RotateAnimation rotateAnimation = new RotateAnimation(
                -90, 0, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
        rotateAnimation.setDuration(500);
        arrow.startAnimation(rotateAnimation);
    }
    else
    {
        hintPanel.setVisibility(View.GONE);
    }
}
 
开发者ID:WangZhiYao,项目名称:RealmTasks,代码行数:24,代码来源:ItemViewHolder.java

示例4: initAnimation

private void initAnimation() {
    LinearInterpolator linearInterpolator=new LinearInterpolator();
    flipUpAnimation =new RotateAnimation(0,-180,RotateAnimation.RELATIVE_TO_SELF,0.5f,RotateAnimation.RELATIVE_TO_SELF,0.5f);
    flipUpAnimation.setDuration(FLIP_DURATION);
    flipUpAnimation.setFillAfter(true);
    flipUpAnimation.setInterpolator(linearInterpolator);

    flipDownAnimation=new RotateAnimation(-180,0,RotateAnimation.RELATIVE_TO_SELF,0.5f,RotateAnimation.RELATIVE_TO_SELF,0.5f);
    flipDownAnimation.setDuration(FLIP_DURATION);
    flipDownAnimation.setFillAfter(true);
    flipDownAnimation.setInterpolator(linearInterpolator);

    infiniteRotation=new RotateAnimation(0,360,RotateAnimation.RELATIVE_TO_SELF,0.5f,RotateAnimation.RELATIVE_TO_SELF,0.5f);
    infiniteRotation.setDuration(ROTATE_DURATION);
    infiniteRotation.setRepeatCount(Animation.INFINITE);
    infiniteRotation.setInterpolator(linearInterpolator);
}
 
开发者ID:excitedhaha,项目名称:RefreshLoadLayout,代码行数:17,代码来源:DefaultRefreshIndicator.java

示例5: init

/**
 * init
 * 
 * @description
 * @param context
 *            hylin 2012-7-26上午10:08:33
 */
private void init() {
	// Load all of the animations we need in code rather than through XML
	mFlipAnimation = new RotateAnimation(0, -180,
			RotateAnimation.RELATIVE_TO_SELF, 0.5f,
			RotateAnimation.RELATIVE_TO_SELF, 0.5f);
	mFlipAnimation.setInterpolator(new LinearInterpolator());
	mFlipAnimation.setDuration(250);
	mFlipAnimation.setFillAfter(true);
	mReverseFlipAnimation = new RotateAnimation(-180, 0,
			RotateAnimation.RELATIVE_TO_SELF, 0.5f,
			RotateAnimation.RELATIVE_TO_SELF, 0.5f);
	mReverseFlipAnimation.setInterpolator(new LinearInterpolator());
	mReverseFlipAnimation.setDuration(250);
	mReverseFlipAnimation.setFillAfter(true);

	mInflater = LayoutInflater.from(getContext());
	// header view 在此添加,保证是第一个添加到linearlayout的最上端
	addHeaderView();
}
 
开发者ID:SShineTeam,项目名称:Huochexing12306,代码行数:26,代码来源:PullToRefreshView.java

示例6: buildAnimation

private void buildAnimation() {
    mFlipAnimation = new RotateAnimation(0, -180, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    mFlipAnimation.setInterpolator(new LinearInterpolator());
    mFlipAnimation.setDuration(mRotateAniTime);
    mFlipAnimation.setFillAfter(true);

    mReverseFlipAnimation = new RotateAnimation(-180, 0, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    mReverseFlipAnimation.setInterpolator(new LinearInterpolator());
    mReverseFlipAnimation.setDuration(mRotateAniTime);
    mReverseFlipAnimation.setFillAfter(true);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:PtrClassicDefaultHeader.java

示例7: buildAnimation

protected void buildAnimation() {
    mFlipAnimation = new RotateAnimation(0, -180, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    mFlipAnimation.setInterpolator(new LinearInterpolator());
    mFlipAnimation.setDuration(mRotateAniTime);
    mFlipAnimation.setFillAfter(true);

    mReverseFlipAnimation = new RotateAnimation(-180, 0, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    mReverseFlipAnimation.setInterpolator(new LinearInterpolator());
    mReverseFlipAnimation.setDuration(mRotateAniTime);
    mReverseFlipAnimation.setFillAfter(true);
}
 
开发者ID:yinyiliang,项目名称:RabbitCloud,代码行数:11,代码来源:PtrClassicDefaultFooter.java

示例8: startAnimation

/**
 * Method to rotate image around its axis.
 * isFillEnabled and fillAfter - to image at that position in which we left it
 */
private void startAnimation(double fromDegrees, double toDegrees, long durationMillis) {
    rotateAnimation = new RotateAnimation((float) fromDegrees, (float) toDegrees,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    rotateAnimation.setDuration(durationMillis);
    rotateAnimation.setFillEnabled(true);
    rotateAnimation.setFillAfter(true);
    startAnimation(rotateAnimation);
}
 
开发者ID:TheMindStudios,项目名称:CircleControlView,代码行数:13,代码来源:CircleControlView.java

示例9: TraditionFooterAdapter

public TraditionFooterAdapter(Context context) {
    super(context);
    mFlipAnimation = new RotateAnimation(0, -180,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    mFlipAnimation.setInterpolator(new LinearInterpolator());
    mFlipAnimation.setDuration(250);
    mFlipAnimation.setFillAfter(true);
}
 
开发者ID:REBOOTERS,项目名称:UltimateRefreshView,代码行数:9,代码来源:TraditionFooterAdapter.java

示例10: TraditionHeaderAdapter

public TraditionHeaderAdapter(Context context) {
    super(context);
    mFlipAnimation = new RotateAnimation(0, -180,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    mFlipAnimation.setInterpolator(new LinearInterpolator());
    mFlipAnimation.setDuration(250);
    mFlipAnimation.setFillAfter(true);
}
 
开发者ID:REBOOTERS,项目名称:UltimateRefreshView,代码行数:9,代码来源:TraditionHeaderAdapter.java

示例11: initAnimation

/**
 * 初始化动画
 */
private void initAnimation() {
    // 旋转
    animation = new RotateAnimation(-180, 0, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    animation.setInterpolator(new LinearInterpolator());
    animation.setDuration(300);
    animation.setFillAfter(true);

    //反向旋转
    reverseAnimation = new RotateAnimation(0, -180, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    reverseAnimation.setInterpolator(new LinearInterpolator());
    reverseAnimation.setDuration(300);
    reverseAnimation.setFillAfter(true);
}
 
开发者ID:SNUyi,项目名称:PullListView,代码行数:16,代码来源:PullListView.java

示例12: rotate

/**
 * анимация вращения
 *
 * @param v      - что вертим
 * @param start  - начиная с какого градуса
 * @param finish - заканчивая каким градусом
 */
public static void rotate(final View v,
                          final float start,
                          final float finish,
                          final long duration) {
    RotateAnimation rotateAnimation = new RotateAnimation(start,
                                                          finish,
                                                          RotateAnimation.RELATIVE_TO_SELF,
                                                          0.5f,
                                                          RotateAnimation.RELATIVE_TO_SELF,
                                                          0.5f);
    rotateAnimation.setFillAfter(true);
    rotateAnimation.setDuration(duration);
    v.startAnimation(rotateAnimation);
}
 
开发者ID:interactiveservices,项目名称:utils-android,代码行数:21,代码来源:AnimUtils.java


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