本文整理汇总了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);
}
}
示例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);
}
示例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);
}
示例4: onAnimationEnd
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void onAnimationEnd(Animation animation)
{
callback.onDismissed(itemViewHolder);
ViewCompat.setHasTransientState(itemViewHolder.itemView, false);
}
示例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);
}