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


Java AdapterViewUtil.getViewForPosition方法代码示例

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


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

示例1: fling

import com.nhaarman.listviewanimations.util.AdapterViewUtil; //导入方法依赖的package包/类
/**
 * Flings the {@link android.view.View} corresponding to given position out of sight.
 * Calling this method has the same effect as manually swiping an item off the screen.
 *
 * @param position the position of the item in the {@link android.widget.ListAdapter}. Must be visible.
 */
public void fling(final int position) {
    int firstVisiblePosition = mListViewWrapper.getFirstVisiblePosition();
    int lastVisiblePosition = mListViewWrapper.getLastVisiblePosition();
    if (position < firstVisiblePosition || position > lastVisiblePosition) {
        throw new IllegalArgumentException("View for position " + position + " not visible!");
    }

    View downView = AdapterViewUtil.getViewForPosition(mListViewWrapper, position);
    if (downView == null) {
        throw new IllegalStateException("No view found for position " + position);
    }
    flingView(downView, position, true);

    mActiveSwipeCount++;
    mVirtualListCount--;
}
 
开发者ID:sathishmscict,项目名称:ListViewAnimations,代码行数:23,代码来源:SwipeTouchListener.java

示例2: dismissAbove

import com.nhaarman.listviewanimations.util.AdapterViewUtil; //导入方法依赖的package包/类
private void dismissAbove(final int position) {
    View view = AdapterViewUtil.getViewForPosition(getListViewWrapper(), getListViewWrapper().getFirstVisiblePosition());

    if (view != null) {
        view.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED), View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
        int scrollDistance = view.getMeasuredHeight();

        getListViewWrapper().smoothScrollBy(scrollDistance, (int) mDismissAnimationTime);
        mHandler.postDelayed(new RestoreScrollRunnable(scrollDistance, position), mDismissAnimationTime);
    }
}
 
开发者ID:sathishmscict,项目名称:ListViewAnimations,代码行数:12,代码来源:SwipeDismissTouchListener.java


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