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


Java RecyclerViewDragDropManager.STATE_FLAG_IS_ACTIVE属性代码示例

本文整理汇总了Java中com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropManager.STATE_FLAG_IS_ACTIVE属性的典型用法代码示例。如果您正苦于以下问题:Java RecyclerViewDragDropManager.STATE_FLAG_IS_ACTIVE属性的具体用法?Java RecyclerViewDragDropManager.STATE_FLAG_IS_ACTIVE怎么用?Java RecyclerViewDragDropManager.STATE_FLAG_IS_ACTIVE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropManager的用法示例。


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

示例1: onBindViewHolder

@Override
public void onBindViewHolder(MyViewHolder holder, int position) {
    final MyItem item = mProvider.get(position);

    // set listeners
    // (if the item is *not pinned*, click event comes to the itemView)
    holder.itemView.setOnClickListener(mItemViewOnClickListener);
    // (if the item is *pinned*, click event comes to the mContainer)
    holder.mContainer.setOnClickListener(mSwipeableViewContainerOnClickListener);

    // set text
    holder.mTextView.setText(item.getContent());

    // set background resource (target view ID: container)
    final int dragState = holder.getDragStateFlags();
    final int swipeState = holder.getSwipeStateFlags();

    if (((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_UPDATED) != 0) ||
            ((swipeState & RecyclerViewSwipeManager.STATE_FLAG_IS_UPDATED) != 0)) {
        int bgResId;

        if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_ACTIVE) != 0) {
            bgResId = R.drawable.bg_item_dragging_active_state;
        } else if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_DRAGGING) != 0) {
            bgResId = R.drawable.bg_item_dragging_state;
        } else if ((swipeState & RecyclerViewSwipeManager.STATE_FLAG_IS_ACTIVE) != 0) {
            bgResId = R.drawable.bg_item_swiping_active_state;
        } else if ((swipeState & RecyclerViewSwipeManager.STATE_FLAG_SWIPING) != 0) {
            bgResId = R.drawable.bg_item_swiping_state;
        } else {
            bgResId = R.drawable.bg_item_normal_state;
        }

        holder.mContainer.setBackgroundResource(bgResId);
    }

    // set swiping properties
    holder.setSwipeItemSlideAmount(
            item.isPinedToSwipeLeft() ? RecyclerViewSwipeManager.OUTSIDE_OF_THE_WINDOW_LEFT : 0);
}
 
开发者ID:hanks-zyh,项目名称:RecylerView,代码行数:40,代码来源:MyDraggableSwipeableItemAdapter.java

示例2: onBindViewHolder

@Override
public void onBindViewHolder(MyViewHolder holder, int position) {


    MyItem item = dataList.get(position);
    holder.textView.setText(item.getContent());

    // set background resource (target view ID: container)
    final int dragState = holder.getDragStateFlags();
    final int swipeState = holder.getSwipeStateFlags();

    if (((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_UPDATED) != 0) ||
            ((swipeState & RecyclerViewSwipeManager.STATE_FLAG_IS_UPDATED) != 0)) {
        int bgResId;

        if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_ACTIVE) != 0) {
            bgResId = R.drawable.bg_item_dragging_active_state;
        } else if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_DRAGGING) != 0) {
            bgResId = R.drawable.bg_item_dragging_state;
        } else if ((swipeState & RecyclerViewSwipeManager.STATE_FLAG_IS_ACTIVE) != 0) {
            bgResId = R.drawable.bg_item_swiping_active_state;
        } else if ((swipeState & RecyclerViewSwipeManager.STATE_FLAG_SWIPING) != 0) {
            bgResId = R.drawable.bg_item_swiping_state;
        } else {
            bgResId = R.drawable.bg_item_normal_state;
        }

        holder.container.setBackgroundResource(bgResId);
    }

    // set swiping properties
    holder.setSwipeItemSlideAmount(
            item.isPinedToSwipeLeft() ? RecyclerViewSwipeManager.OUTSIDE_OF_THE_WINDOW_LEFT : 0);
}
 
开发者ID:hanks-zyh,项目名称:RecylerView,代码行数:34,代码来源:MyAdapter.java

示例3: onBindViewHolder

@Override
public void onBindViewHolder(ViewHolder holder, int position) {
	TourItem item = _items.get(position);

	holder._name.setText(item.getName());
	holder._description.setText(item.getDescription());
	if(item.getDescription().equals(""))
		holder._description.setVisibility(View.GONE);
	else
		holder._description.setVisibility(View.VISIBLE);

	if(item.hasMainImage()) {
		String image_filepath = item.getMainImageFilepath();
		ImageView image_view = holder._thumbnail;
		Utilities.loadBitmap(image_view, image_filepath, Utilities.dp_to_px(40), Utilities.dp_to_px(40), getActivity());
	} else
		holder._thumbnail.setImageResource(R.drawable.default_thumbnail);

	// set background resource (target view ID: container)
	final int dragState = holder.getDragStateFlags();

	if (((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_UPDATED) != 0)) {
		int bgResId;

		if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_ACTIVE) != 0) {
			bgResId = R.drawable.bg_item_dragging_active_state;
		} else if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_DRAGGING) != 0) {
			bgResId = R.drawable.bg_item_dragging_state;
		} else {
			bgResId = R.drawable.bg_item_normal_state;
		}
		holder._container.setBackgroundResource(bgResId);
	}
}
 
开发者ID:WriterOfAlicrow,项目名称:OpenCVTour,代码行数:34,代码来源:TourItemListFragment.java

示例4: onBindItemGroupViewHolder

private void onBindItemGroupViewHolder(MyGroupViewHolder holder, int groupPosition) {
    // group item
    final AbstractExpandableDataProvider.GroupData item = mProvider.getGroupItem(groupPosition);

    // set text
    holder.mTextView.setText(item.getText());

    // set background resource (target view ID: container)
    final int dragState = holder.getDragStateFlags();
    final int expandState = holder.getExpandStateFlags();

    if (((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_UPDATED) != 0) ||
            ((expandState & RecyclerViewExpandableItemManager.STATE_FLAG_IS_UPDATED) != 0)) {
        int bgResId;
        boolean isExpanded;

        if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_ACTIVE) != 0) {
            bgResId = R.drawable.bg_group_item_dragging_active_state;

            // need to clear drawable state here to get correct appearance of the dragging item.
            DrawableUtils.clearState(holder.mContainer.getForeground());
        } else if (((dragState & RecyclerViewDragDropManager.STATE_FLAG_DRAGGING) != 0) &&
                ((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_IN_RANGE) != 0)) {
            bgResId = R.drawable.bg_group_item_dragging_state;
        } else if ((expandState & RecyclerViewExpandableItemManager.STATE_FLAG_IS_EXPANDED) != 0) {
            bgResId = R.drawable.bg_group_item_expanded_state;
        } else {
            bgResId = R.drawable.bg_group_item_normal_state;
        }

        if ((expandState & RecyclerViewExpandableItemManager.STATE_FLAG_IS_EXPANDED) != 0) {
            isExpanded = true;
        } else {
            isExpanded = false;
        }

        holder.mContainer.setBackgroundResource(bgResId);
        holder.mIndicator.setExpandedState(isExpanded, true);
    }
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:40,代码来源:MyExpandableDraggableWithSectionItemAdapter.java

示例5: onBindChildViewHolder

@Override
public void onBindChildViewHolder(MyChildViewHolder holder, int groupPosition, int childPosition, int viewType) {
    // child item
    final AbstractExpandableDataProvider.ChildData item = mProvider.getChildItem(groupPosition, childPosition);

    // set text
    holder.mTextView.setText(item.getText());

    final int dragState = holder.getDragStateFlags();

    if (((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_UPDATED) != 0)) {
        int bgResId;

        if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_ACTIVE) != 0) {
            bgResId = R.drawable.bg_item_dragging_active_state;

            // need to clear drawable state here to get correct appearance of the dragging item.
            DrawableUtils.clearState(holder.mContainer.getForeground());
        } else if (((dragState & RecyclerViewDragDropManager.STATE_FLAG_DRAGGING) != 0) &&
                ((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_IN_RANGE) != 0)) {
            bgResId = R.drawable.bg_item_dragging_state;
        } else {
            bgResId = R.drawable.bg_item_normal_state;
        }

        holder.mContainer.setBackgroundResource(bgResId);
    }
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:28,代码来源:MyExpandableDraggableWithSectionItemAdapter.java

示例6: onBindViewHolder

@Override
public void onBindViewHolder(MyViewHolder holder, int position) {
    final AbstractDataProvider.Data item = mProvider.getItem(position);

    // set text
    holder.mTextView.setText(item.getText());

    // set background resource (target view ID: container)
    final int dragState = holder.getDragStateFlags();

    if (((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_UPDATED) != 0)) {
        int bgResId;

        if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_ACTIVE) != 0) {
            bgResId = R.drawable.bg_item_dragging_active_state;

            // need to clear drawable state here to get correct appearance of the dragging item.
            DrawableUtils.clearState(holder.mContainer.getForeground());
        } else if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_DRAGGING) != 0) {
            bgResId = R.drawable.bg_item_dragging_state;
        } else {
            bgResId = R.drawable.bg_item_normal_state;
        }

        holder.mContainer.setBackgroundResource(bgResId);
    }
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:27,代码来源:MyDraggableItemAdapter.java

示例7: onBindSectionItemViewHolder

private void onBindSectionItemViewHolder(MyViewHolder holder, int position) {
    final AbstractDataProvider.Data item = mProvider.getItem(position);

    // set text
    holder.mTextView.setText(item.getText());

    // set background resource (target view ID: container)
    final int dragState = holder.getDragStateFlags();

    if (((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_UPDATED) != 0)) {
        int bgResId;

        if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_ACTIVE) != 0) {
            bgResId = R.drawable.bg_item_dragging_active_state;

            // need to clear drawable state here to get correct appearance of the dragging item.
            DrawableUtils.clearState(holder.mContainer.getForeground());
        } else if (
                ((dragState & RecyclerViewDragDropManager.STATE_FLAG_DRAGGING) != 0) &&
                ((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_IN_RANGE) != 0)) {
            bgResId = R.drawable.bg_item_dragging_state;
        } else {
            bgResId = R.drawable.bg_item_normal_state;
        }

        holder.mContainer.setBackgroundResource(bgResId);
    }
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:28,代码来源:MyDraggableWithSectionItemAdapter.java

示例8: onBindViewHolder

@Override
public void onBindViewHolder(MyViewHolder holder, int position) {
    final AbstractDataProvider.Data item = mProvider.getItem(position);

    // set listeners
    // (if the item is *not pinned*, click event comes to the itemView)
    holder.itemView.setOnClickListener(mItemViewOnClickListener);
    // (if the item is *pinned*, click event comes to the mContainer)
    holder.mContainer.setOnClickListener(mSwipeableViewContainerOnClickListener);

    // set text
    holder.mTextView.setText(item.getText());

    // set background resource (target view ID: container)
    final int dragState = holder.getDragStateFlags();
    final int swipeState = holder.getSwipeStateFlags();

    if (((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_UPDATED) != 0) ||
            ((swipeState & RecyclerViewSwipeManager.STATE_FLAG_IS_UPDATED) != 0)) {
        int bgResId;

        if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_ACTIVE) != 0) {
            bgResId = R.drawable.bg_item_dragging_active_state;

            // need to clear drawable state here to get correct appearance of the dragging item.
            DrawableUtils.clearState(holder.mContainer.getForeground());
        } else if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_DRAGGING) != 0) {
            bgResId = R.drawable.bg_item_dragging_state;
        } else if ((swipeState & RecyclerViewSwipeManager.STATE_FLAG_IS_ACTIVE) != 0) {
            bgResId = R.drawable.bg_item_swiping_active_state;
        } else if ((swipeState & RecyclerViewSwipeManager.STATE_FLAG_SWIPING) != 0) {
            bgResId = R.drawable.bg_item_swiping_state;
        } else {
            bgResId = R.drawable.bg_item_normal_state;
        }

        holder.mContainer.setBackgroundResource(bgResId);
    }

    // set swiping properties
    holder.setSwipeItemSlideAmount(
            item.isPinnedToSwipeLeft() ? RecyclerViewSwipeManager.OUTSIDE_OF_THE_WINDOW_LEFT : 0);
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:43,代码来源:MyDraggableSwipeableItemAdapter.java

示例9: onBindGroupViewHolder

@Override
public void onBindGroupViewHolder(MyGroupViewHolder holder, int groupPosition, int viewType) {
    // group item
    final AbstractExpandableDataProvider.GroupData item = mProvider.getGroupItem(groupPosition);

    // set listeners
    holder.itemView.setOnClickListener(mItemViewOnClickListener);

    // set text
    holder.mTextView.setText(item.getText());

    // set background resource (target view ID: container)
    final int dragState = holder.getDragStateFlags();
    final int expandState = holder.getExpandStateFlags();
    final int swipeState = holder.getSwipeStateFlags();

    if (((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_UPDATED) != 0) ||
            ((expandState & RecyclerViewExpandableItemManager.STATE_FLAG_IS_UPDATED) != 0) ||
            ((swipeState & RecyclerViewSwipeManager.STATE_FLAG_IS_UPDATED) != 0)) {
        int bgResId;
        boolean isExpanded;

        if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_ACTIVE) != 0) {
            bgResId = R.drawable.bg_group_item_dragging_active_state;

            // need to clear drawable state here to get correct appearance of the dragging item.
            DrawableUtils.clearState(holder.mContainer.getForeground());
        } else if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_DRAGGING) != 0) {
            bgResId = R.drawable.bg_group_item_dragging_state;
        } else if ((swipeState & RecyclerViewSwipeManager.STATE_FLAG_IS_ACTIVE) != 0) {
            bgResId = R.drawable.bg_group_item_swiping_active_state;
        } else if ((swipeState & RecyclerViewSwipeManager.STATE_FLAG_SWIPING) != 0) {
            bgResId = R.drawable.bg_group_item_swiping_state;
        } else if ((expandState & RecyclerViewExpandableItemManager.STATE_FLAG_IS_EXPANDED) != 0) {
            bgResId = R.drawable.bg_group_item_expanded_state;
        } else {
            bgResId = R.drawable.bg_group_item_normal_state;
        }

        if ((expandState & RecyclerViewExpandableItemManager.STATE_FLAG_IS_EXPANDED) != 0) {
            isExpanded = true;
        } else {
            isExpanded = false;
        }

        holder.mContainer.setBackgroundResource(bgResId);
        holder.mIndicator.setExpandedState(isExpanded, true);
    }

    // set swiping properties
    holder.setSwipeItemSlideAmount(
            item.isPinnedToSwipeLeft() ? RecyclerViewSwipeManager.OUTSIDE_OF_THE_WINDOW_LEFT : 0);
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:53,代码来源:MyExpandableDraggableSwipeableItemAdapter.java

示例10: onBindChildViewHolder

@Override
public void onBindChildViewHolder(MyChildViewHolder holder, int groupPosition, int childPosition, int viewType) {
    // child item
    final AbstractExpandableDataProvider.ChildData item = mProvider.getChildItem(groupPosition, childPosition);

    // set listeners
    // (if the item is *not pinned*, click event comes to the itemView)
    holder.itemView.setOnClickListener(mItemViewOnClickListener);
    // (if the item is *pinned*, click event comes to the mContainer)
    holder.mContainer.setOnClickListener(mSwipeableViewContainerOnClickListener);

    // set text
    holder.mTextView.setText(item.getText());

    final int dragState = holder.getDragStateFlags();
    final int swipeState = holder.getSwipeStateFlags();

    if (((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_UPDATED) != 0) ||
            ((swipeState & RecyclerViewSwipeManager.STATE_FLAG_IS_UPDATED) != 0)) {
        int bgResId;

        if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_IS_ACTIVE) != 0) {
            bgResId = R.drawable.bg_item_dragging_active_state;

            // need to clear drawable state here to get correct appearance of the dragging item.
            DrawableUtils.clearState(holder.mContainer.getForeground());
        } else if ((dragState & RecyclerViewDragDropManager.STATE_FLAG_DRAGGING) != 0) {
            bgResId = R.drawable.bg_item_dragging_state;
        } else if ((swipeState & RecyclerViewSwipeManager.STATE_FLAG_IS_ACTIVE) != 0) {
            bgResId = R.drawable.bg_item_swiping_active_state;
        } else if ((swipeState & RecyclerViewSwipeManager.STATE_FLAG_SWIPING) != 0) {
            bgResId = R.drawable.bg_item_swiping_state;
        } else {
            bgResId = R.drawable.bg_item_normal_state;
        }

        holder.mContainer.setBackgroundResource(bgResId);
    }

    // set swiping properties
    holder.setSwipeItemSlideAmount(
            item.isPinnedToSwipeLeft() ? RecyclerViewSwipeManager.OUTSIDE_OF_THE_WINDOW_LEFT : 0);
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:43,代码来源:MyExpandableDraggableSwipeableItemAdapter.java


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