當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。