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


C# RecyclerView.GetChildPosition方法代码示例

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


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

示例1: OnInterceptTouchEvent

 public bool OnInterceptTouchEvent(RecyclerView rv, MotionEvent e)
 {
     View child = rv.FindChildViewUnder(e.GetX(), e.GetY());
     if (child != null && clickListener != null && gestureDetector.OnTouchEvent(e))
     {
         clickListener.OnClick(child, rv.GetChildPosition(child));
     }
     return false;
 }
开发者ID:shaxxx,项目名称:SignalMeter,代码行数:9,代码来源:RecyclerTouchListener.cs

示例2: RecyclerTouchListener

 public RecyclerTouchListener(Context context, RecyclerView recyclerView, IOnClickListener clickListener)
 {
     this.clickListener = clickListener;
     var gestureListener = new GenericOnGestureListener();
     gestureListener.ActionOnLongPress = (e) =>
     {
         View child = recyclerView.FindChildViewUnder(e.GetX(), e.GetY());
         if (child != null && clickListener != null)
         {
             clickListener.OnLongClick(child, recyclerView.GetChildPosition(child));
         }
     };
     gestureListener.FuncOnSingleTapUp = (e) => true;
     gestureDetector = new GestureDetector(context, gestureListener);
 }
开发者ID:shaxxx,项目名称:SignalMeter,代码行数:15,代码来源:RecyclerTouchListener.cs

示例3: GetItemOffsets

		public override void GetItemOffsets (Rect outRect, View view, RecyclerView parent, RecyclerView.State state)
		{
			base.GetItemOffsets (outRect, view, parent, state);

			if (mDivider == null) {
				return;
			}
			if (parent.GetChildPosition (view) < 1) {
				return;
			}
			if (GetOrientation (parent) == LinearLayoutManager.Vertical) {
				outRect.Top = mDivider.IntrinsicHeight;
			} else {
				outRect.Left = mDivider.IntrinsicWidth;
			}
		}
开发者ID:Dealtis,项目名称:oldDMS_3,代码行数:16,代码来源:DividerItemDecoration.cs

示例4: OnScrolled

            public override void OnScrolled(RecyclerView recyclerView, int dx, int dy)
            {
                View firstVisibleView 	= recyclerView.GetChildAt(0);
                int firstVisiblePosition = recyclerView.GetChildPosition(firstVisibleView);
                int visibleRange 		= recyclerView.ChildCount;
                int lastVisiblePosition = firstVisiblePosition + visibleRange;
                int itemCount 			= recyclerView.GetAdapter().ItemCount;
                int position;

                if(firstVisiblePosition==0)
                    position=0;
                else if(lastVisiblePosition==itemCount-1)
                    position = itemCount-1;
                else
                    position = firstVisiblePosition;

                float proportion=(float)position/(float)itemCount;
                this.scroll.setPosition(scroll.height*proportion);
            }
开发者ID:dbeattie71,项目名称:FastScroll,代码行数:19,代码来源:FastScroller.cs


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