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


Java ViewCompat.setHasTransientState方法代码示例

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


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

示例1: doPreLayoutAnimation

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void doPreLayoutAnimation(Animator.AnimatorListener listener) {
    final AnimatorSet animatorSet = new AnimatorSet();
    ArrayList<Long> deleteIds = new ArrayList<>();
    int i;
    for (i = 0; i < mTopMap.size(); i++) {
        long id = mTopMap.keyAt(i);
        int newPos = getPositionForId(id);
        if (newPos < 0) {
            // delete
            int oldPos = mPositionMap.get(id);
            View child = getChildAt(oldPos);
            final Animator anim = getDeleteAnimator(child);
            mPositionMap.remove(id);
            animatorSet.play(anim);
            deleteIds.add(id);
        }
    }

    for (i = 0; i < deleteIds.size(); i++) {
        mTopMap.remove(deleteIds.get(i));
    }

    if (mOpenChangeDisappearAnimation) {
        for (i = 0; i < mPositionMap.size(); i++) {
            View view = getChildAt(mPositionMap.valueAt(i));
            ViewCompat.setHasTransientState(view, true);
            mDetachViewsMap.put(mPositionMap.keyAt(i), view);
        }
    }
    if (!animatorSet.getChildAnimations().isEmpty()) {
        animatorSet.addListener(listener);
        animatorSet.start();
    } else {
        listener.onAnimationEnd(animatorSet);
    }
}
 
开发者ID:coopese,项目名称:qmui,代码行数:37,代码来源:QMUIAnimationListView.java

示例2: animateDismissItem

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void animateDismissItem(View selectedItemView)
{
    final TranslateAnimation translateAnimation =
            new TranslateAnimation(0, 0 - selectedItemView.getWidth(), 0, 0);
    translateAnimation.setDuration(ANIMATION_DURATION);
    translateAnimation.setAnimationListener(new DismissAnimationListener(TouchHelper.this.selected));
    ViewCompat.setHasTransientState(selectedItemView, true);
    selectedItemView.startAnimation(translateAnimation);
}
 
开发者ID:WangZhiYao,项目名称:RealmTasks,代码行数:10,代码来源:TouchHelper.java

示例3: animateCompleteItem

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void animateCompleteItem(View selectedItemView)
{
    final TranslateAnimation translateAnimation =
            new TranslateAnimation(0, 0, 0, 0);
    translateAnimation.setDuration(ANIMATION_DURATION);
    translateAnimation.setAnimationListener(new CompleteAnimationListener(TouchHelper.this.selected));
    ViewCompat.setHasTransientState(selectedItemView, true);
    selectedItemView.startAnimation(translateAnimation);
}
 
开发者ID:WangZhiYao,项目名称:RealmTasks,代码行数:10,代码来源:TouchHelper.java

示例4: onAnimationEnd

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void onAnimationEnd(Animation animation)
{
    callback.onDismissed(itemViewHolder);
    ViewCompat.setHasTransientState(itemViewHolder.itemView, false);
}
 
开发者ID:WangZhiYao,项目名称:RealmTasks,代码行数:7,代码来源:TouchHelper.java

示例5: closeContainer

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void closeContainer(ViewGroup.MarginLayoutParams params) {
    containerState = GesturedListViewItemMenuState.CLOSED;

    containerView.setVisibility(View.GONE);
    params.height = 0;

    containerView.requestLayout();

    ViewCompat.setHasTransientState(containerView, false);
}
 
开发者ID:orgzly,项目名称:orgzly-android,代码行数:11,代码来源:GesturedListViewItemMenu.java


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