當前位置: 首頁>>代碼示例>>Java>>正文


Java ViewPropertyAnimator類代碼示例

本文整理匯總了Java中com.nineoldandroids.view.ViewPropertyAnimator的典型用法代碼示例。如果您正苦於以下問題:Java ViewPropertyAnimator類的具體用法?Java ViewPropertyAnimator怎麽用?Java ViewPropertyAnimator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ViewPropertyAnimator類屬於com.nineoldandroids.view包,在下文中一共展示了ViewPropertyAnimator類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: liftingFromBottom

import com.nineoldandroids.view.ViewPropertyAnimator; //導入依賴的package包/類
/**
 * Lifting view
 *
 * @param view         The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param fromY        initial Y position of view
 * @param duration     aniamtion duration
 * @param startDelay   start delay before animation begin
 */
@Deprecated
public static void liftingFromBottom(View view, float baseRotation, float fromY, int duration, int startDelay) {
    ViewHelper.setRotationX(view, baseRotation);
    ViewHelper.setTranslationY(view, fromY);

    ViewPropertyAnimator
            .animate(view)
            .setInterpolator(new AccelerateDecelerateInterpolator())
            .setDuration(duration)
            .setStartDelay(startDelay)
            .rotationX(0)
            .translationY(0)
            .start();

}
 
開發者ID:SimonCherryGZ,項目名稱:JewelryUI,代碼行數:25,代碼來源:ViewAnimationUtils.java

示例2: onActivityResult

import com.nineoldandroids.view.ViewPropertyAnimator; //導入依賴的package包/類
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode == RESULT_OK) {
        Bundle bundle = data.getExtras();
        ArrayList<AddedProduct> backList = (ArrayList<AddedProduct>) bundle.getSerializable("backap");
        List<AddedProduct> newList = new ArrayList<>();
        if (backList != null) {
            newList.addAll(backList);
            for (AddedProduct pro : backList) {
                Integer proId = Integer.valueOf(pro.getProductId());
                Integer count = pro.getCount();
                mSelfHelpPlaceOrderAdapter.getCountMap().put(proId, count);
            }
            mSelfHelpPlaceOrderAdapter.setData(newList);
        }
        if (backList != null && backList.size() > 0) {
            ToastUtil.show(getActivityContext(), "添加成功");
            mRlSelfHelp.setVisibility(View.GONE);
            mRlBottom.setVisibility(View.VISIBLE);
            ViewPropertyAnimator.animate(mRlBottom).translationY(-CommonUtils.dip2px(getActivityContext(), 55));
            mRvProduct.setVisibility(View.VISIBLE);
            mRlSelectBar.setVisibility(View.GONE);
        } else {
            mRlSelfHelp.setVisibility(View.VISIBLE);
            mRlBottom.setVisibility(View.GONE);
            mRlSelectBar.setVisibility(View.GONE);
        }
        setTitleEditShow();
    }
}
 
開發者ID:ebridfighter,項目名稱:GongXianSheng,代碼行數:31,代碼來源:SelfHelpPlaceOrderActivity.java

示例3: switchEditMode

import com.nineoldandroids.view.ViewPropertyAnimator; //導入依賴的package包/類
private void switchEditMode() {
        //強製隱藏鍵盤
        InputMethodManager imm = (InputMethodManager) getSystemService(getActivityContext().INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(mLlAll.getWindowToken(), 0); //強製隱藏鍵盤
        if (!editMode) {
            this.setTitleRightText(getString(R.string.titile_finish));
//            setTitleLeftIcon(true, R.drawable.nav_add);
            mRlSelectBar.setVisibility(View.VISIBLE);
            ViewPropertyAnimator.animate(mRlBottom).setDuration(500).translationY(CommonUtils.dip2px(getActivityContext(), 55));
            ViewPropertyAnimator.animate(mRlSelectBar).setDuration(500).translationY(-CommonUtils.dip2px(getActivityContext(), 55));
            editMode = true;
        } else {
            mIntelligentPlaceOrderAdapter.clearSelect();
            setTitleRightText(getString(R.string.title_edit));
            ViewPropertyAnimator.animate(mRlBottom).setDuration(500).translationY(-CommonUtils.dip2px(getActivityContext(), 55));
            ViewPropertyAnimator.animate(mRlSelectBar).setDuration(500).translationY(CommonUtils.dip2px(getActivityContext(), 55));
            showBackBtn();
            editMode = false;
        }
        mIntelligentPlaceOrderAdapter.setEditMode(editMode);
        mIntelligentPlaceOrderAdapter.notifyDataSetChanged();
        if (mIntelligentPlaceOrderAdapter != null && mIntelligentPlaceOrderAdapter.getItemCount() == 0) {
            mRlBottom.setVisibility(View.INVISIBLE);
            setTitleRightText("");
        }
    }
 
開發者ID:ebridfighter,項目名稱:GongXianSheng,代碼行數:27,代碼來源:IntelligentPlaceOrderActivity.java

示例4: showCurrentWord

import com.nineoldandroids.view.ViewPropertyAnimator; //導入依賴的package包/類
protected void showCurrentWord(String letter) {
        currentWord.setText(letter);
        if(!isScale){
            isScale = true;
            ViewPropertyAnimator.animate(currentWord).scaleX(1f)
                    .setInterpolator(new OvershootInterpolator())
                    .setDuration(450).start();
            ViewPropertyAnimator.animate(currentWord).scaleY(1f)
                    .setInterpolator(new OvershootInterpolator())
                    .setDuration(450).start();
        }

        //先移除之前的任務
        handler.removeCallbacksAndMessages(null);

        //延時隱藏currentWord
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
//				currentWord.setVisibility(View.INVISIBLE);
                ViewPropertyAnimator.animate(currentWord).scaleX(0f).setDuration(450).start();
                ViewPropertyAnimator.animate(currentWord).scaleY(0f).setDuration(450).start();
                isScale = false;
            }
        }, 1500);
    }
 
開發者ID:929467676,項目名稱:fastindex-master,代碼行數:27,代碼來源:MainActivity.java

示例5: onScroll

import com.nineoldandroids.view.ViewPropertyAnimator; //導入依賴的package包/類
@Override
public void onScroll(AbsListView absListView, int firstVisibleItem, int visibleItemCount, int totalItemCount) {

    if (mLastFirstVisibleItem < firstVisibleItem) {
        if (floatShowing) floatShowing = false;
        if (!floatHiding) {
            ViewPropertyAnimator.animate(view).translationY(500).setDuration(300);
            floatHiding = true;
        }
    }
    if (mLastFirstVisibleItem > firstVisibleItem) {
        if (floatHiding) {
            floatHiding = false;
        }
        if (!floatShowing) {
            ViewPropertyAnimator.animate(view).translationY(0).setDuration(300);
            floatShowing = true;
        }
    }
    mLastFirstVisibleItem = firstVisibleItem;
    if (onScrollListener != null)
        onScrollListener.onScroll(absListView, firstVisibleItem, visibleItemCount, totalItemCount);
}
 
開發者ID:shegang,項目名稱:meishiDemo,代碼行數:24,代碼來源:AutoHideButtonFloat.java

示例6: setTypeBanner

import com.nineoldandroids.view.ViewPropertyAnimator; //導入依賴的package包/類
private void setTypeBanner(MyViewHolder myViewHolder) {
    //以屬性動畫的形式放大
    ViewPropertyAnimator.animate(myViewHolder.itemView).scaleX(1).setDuration(350).start();
    ViewPropertyAnimator.animate(myViewHolder.itemView).scaleY(1).setDuration(350).start();
    //自定義你的Holder,實現更多複雜的界麵,不一定是圖片翻頁,其他任何控件翻頁亦可。
    myViewHolder.mConvenientBanner.setPages(
            new CBViewHolderCreator<LocalImageHolderView>() {
                @Override
                public LocalImageHolderView createHolder() {
                    return new LocalImageHolderView();
                }
            }, mLocalImages)
            //設置兩個點圖片作為翻頁指示器,不設置則沒有指示器,可以根據自己需求自行配合自己的指示器,不需要圓點指示器可用不設
            .setPageIndicator(new int[]{R.drawable.page_switch_normal, R.drawable.page_switch_checked})
            //設置指示器的方向
            .setPageIndicatorAlign(ConvenientBanner.PageIndicatorAlign.CENTER_HORIZONTAL);
}
 
開發者ID:v991314,項目名稱:3DGameInfo,代碼行數:18,代碼來源:Chapter_adapter_banner.java

示例7: setTypeNomal

import com.nineoldandroids.view.ViewPropertyAnimator; //導入依賴的package包/類
private void setTypeNomal(MyViewHolder myViewHolder, int position) {
//        Random r = new Random();
//        int colr = Color.rgb(r.nextInt(256), r.nextInt(256), r.nextInt(256));
//        myViewHolder.mCardView.setCardBackgroundColor(colr);
        //以屬性動畫的形式放大
        ViewPropertyAnimator.animate(myViewHolder.itemView).scaleX(1).setDuration(350).start();
        ViewPropertyAnimator.animate(myViewHolder.itemView).scaleY(1).setDuration(350).start();
        TextView comment_textView = myViewHolder.comment_TextView;
        TextView date_textView = myViewHolder.date_TextView;
        TextView title_textView = myViewHolder.title_TextView;
        ImageView pic_imageView = myViewHolder.pic_ImageView;
        comment_textView.setText(mData.get(position - 1).getFeedback());
        date_textView.setText(DateUtils.dateFromat(mData.get(position - 1).getSenddate()));
        title_textView.setText(mData.get(position - 1).getTitle());
        //獲取到圖片地址
        String litpic = mData.get(position - 1).getLitpic();
        if (litpic == null) {
            pic_imageView.setImageResource(R.drawable.product_default);
            return;
        }
        //地址拚接
        String imageUrl = API.DMGEAME_URL + litpic;
        Picasso.with(mContext).load(imageUrl).error(R.drawable.product_default).into(pic_imageView);

    }
 
開發者ID:v991314,項目名稱:3DGameInfo,代碼行數:26,代碼來源:Chapter_adapter_banner.java

示例8: onUpOrCancelMotionEvent

import com.nineoldandroids.view.ViewPropertyAnimator; //導入依賴的package包/類
@Override
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
    mBaseTranslationY = 0;

    float headerTranslationY = ViewHelper.getTranslationY(mHeaderView);
    int toolbarHeight = mToolbarView.getHeight();
    if (scrollState == ScrollState.UP) {
        if (toolbarHeight < mRecyclerView.getCurrentScrollY()) {
            if (headerTranslationY != -toolbarHeight) {
                ViewPropertyAnimator.animate(mHeaderView).cancel();
                ViewPropertyAnimator.animate(mHeaderView).translationY(-toolbarHeight).setDuration(200).start();
            }
        }
    } else if (scrollState == ScrollState.DOWN) {
        if (toolbarHeight < mRecyclerView.getCurrentScrollY()) {
            if (headerTranslationY != 0) {
                ViewPropertyAnimator.animate(mHeaderView).cancel();
                ViewPropertyAnimator.animate(mHeaderView).translationY(0).setDuration(200).start();
            }
        }
    }
}
 
開發者ID:LeMinhAn,項目名稱:AndroidObservableScrollView-master,代碼行數:23,代碼來源:ScrollFromBottomRecyclerViewActivity.java

示例9: showFab

import com.nineoldandroids.view.ViewPropertyAnimator; //導入依賴的package包/類
private void showFab(boolean animated) {
    if (mFab == null) {
        return;
    }
    if (!mFabIsShown) {
        if (animated) {
            ViewPropertyAnimator.animate(mFab).cancel();
            ViewPropertyAnimator.animate(mFab).scaleX(1).scaleY(1).setDuration(200).start();
        } else {
            ViewHelper.setScaleX(mFab, 1);
            ViewHelper.setScaleY(mFab, 1);
        }
        mFabIsShown = true;
    } else {
        // Ensure that FAB is shown
        ViewHelper.setScaleX(mFab, 1);
        ViewHelper.setScaleY(mFab, 1);
    }
}
 
開發者ID:LeMinhAn,項目名稱:AndroidObservableScrollView-master,代碼行數:20,代碼來源:SlidingUpBaseActivity.java

示例10: hideFab

import com.nineoldandroids.view.ViewPropertyAnimator; //導入依賴的package包/類
private void hideFab(boolean animated) {
    if (mFab == null) {
        return;
    }
    if (mFabIsShown) {
        if (animated) {
            ViewPropertyAnimator.animate(mFab).cancel();
            ViewPropertyAnimator.animate(mFab).scaleX(0).scaleY(0).setDuration(200).start();
        } else {
            ViewHelper.setScaleX(mFab, 0);
            ViewHelper.setScaleY(mFab, 0);
        }
        mFabIsShown = false;
    } else {
        // Ensure that FAB is hidden
        ViewHelper.setScaleX(mFab, 0);
        ViewHelper.setScaleY(mFab, 0);
    }
}
 
開發者ID:LeMinhAn,項目名稱:AndroidObservableScrollView-master,代碼行數:20,代碼來源:SlidingUpBaseActivity.java

示例11: onUpOrCancelMotionEvent

import com.nineoldandroids.view.ViewPropertyAnimator; //導入依賴的package包/類
@Override
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
    mBaseTranslationY = 0;

    float headerTranslationY = ViewHelper.getTranslationY(mHeaderView);
    int toolbarHeight = mToolbarView.getHeight();
    if (scrollState == ScrollState.UP) {
        if (toolbarHeight < mListView.getCurrentScrollY()) {
            if (headerTranslationY != -toolbarHeight) {
                ViewPropertyAnimator.animate(mHeaderView).cancel();
                ViewPropertyAnimator.animate(mHeaderView).translationY(-toolbarHeight).setDuration(200).start();
            }
        }
    } else if (scrollState == ScrollState.DOWN) {
        if (toolbarHeight < mListView.getCurrentScrollY()) {
            if (headerTranslationY != 0) {
                ViewPropertyAnimator.animate(mHeaderView).cancel();
                ViewPropertyAnimator.animate(mHeaderView).translationY(0).setDuration(200).start();
            }
        }
    }
}
 
開發者ID:LeMinhAn,項目名稱:AndroidObservableScrollView-master,代碼行數:23,代碼來源:ScrollFromBottomListViewActivity.java

示例12: onScrollChanged

import com.nineoldandroids.view.ViewPropertyAnimator; //導入依賴的package包/類
@Override
public void onScrollChanged(int scrollY, boolean firstScroll, boolean dragging) {
    if (mDragging) {
        int toolbarHeight = mToolbarView.getHeight();
        if (mFirstScroll) {
            mFirstScroll = false;
            float currentHeaderTranslationY = ViewHelper.getTranslationY(mHeaderView);
            if (-toolbarHeight < currentHeaderTranslationY) {
                mBaseTranslationY = scrollY;
            }
        }
        float headerTranslationY = ScrollUtils.getFloat(-(scrollY - mBaseTranslationY), -toolbarHeight, 0);
        ViewPropertyAnimator.animate(mHeaderView).cancel();
        ViewHelper.setTranslationY(mHeaderView, headerTranslationY);
    }
}
 
開發者ID:LeMinhAn,項目名稱:AndroidObservableScrollView-master,代碼行數:17,代碼來源:StickyHeaderWebViewActivity.java

示例13: handleCancelEvent

import com.nineoldandroids.view.ViewPropertyAnimator; //導入依賴的package包/類
@SuppressWarnings("UnusedParameters")
private boolean handleCancelEvent(final MotionEvent motionEvent) {
    if (mVelocityTracker == null) {
        return false;
    }

    if (mCurrentDismissData != null && mSwiping) {
        ViewPropertyAnimator.animate(mCurrentDismissData.view)
                .translationX(0)
                .alpha(1)
                .setDuration(mAnimationTime)
                .setListener(null);
    }
    mVelocityTracker.recycle();
    mVelocityTracker = null;
    mDownX = 0;
    mDownY = 0;
    mCurrentDismissData = null;
    mSwiping = false;
    return false;
}
 
開發者ID:xulailing,項目名稱:android-open-project-demo-master,代碼行數:22,代碼來源:SwipeDismissListViewTouchListener.java

示例14: liftingFromBottom

import com.nineoldandroids.view.ViewPropertyAnimator; //導入依賴的package包/類
/**
 * Lifting view
 *
 * @param view         The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param duration     aniamtion duration
 * @param startDelay   start delay before animation begin
 */
public static void liftingFromBottom(View view, float baseRotation, int duration,
        int startDelay) {

    ViewHelper.setRotationX(view, baseRotation);
    ViewHelper.setTranslationY(view, view.getHeight() / 3);

    ViewPropertyAnimator
            .animate(view)
            .setInterpolator(new AccelerateDecelerateInterpolator())
            .setDuration(duration)
            .setStartDelay(startDelay)
            .rotationX(0)
            .translationY(0)
            .start();

}
 
開發者ID:Drakuwa,項目名稱:Fridge,代碼行數:25,代碼來源:ViewAnimationUtils.java

示例15: liftingFromBottom

import com.nineoldandroids.view.ViewPropertyAnimator; //導入依賴的package包/類
/**
 * Lifting view
 *
 * @param view The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param duration aniamtion duration
 * @param startDelay start delay before animation begin
 */
@Deprecated
public static void liftingFromBottom(View view, float baseRotation, int duration, int startDelay){
    ViewHelper.setRotationX(view, baseRotation);
    ViewHelper.setTranslationY(view, view.getHeight() / 3);

    ViewPropertyAnimator
            .animate(view)
            .setInterpolator(new AccelerateDecelerateInterpolator())
            .setDuration(duration)
            .setStartDelay(startDelay)
            .rotationX(0)
            .translationY(0)
            .start();

}
 
開發者ID:gowong,項目名稱:material-sheet-fab,代碼行數:24,代碼來源:ViewAnimationUtils.java


注:本文中的com.nineoldandroids.view.ViewPropertyAnimator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。