本文整理汇总了Java中com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction类的典型用法代码示例。如果您正苦于以下问题:Java SwipeResultAction类的具体用法?Java SwipeResultAction怎么用?Java SwipeResultAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SwipeResultAction类属于com.h6ah4i.android.widget.advrecyclerview.swipeable.action包,在下文中一共展示了SwipeResultAction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: invokeOnSwipeItem
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static SwipeResultAction invokeOnSwipeItem(
BaseSwipeableItemAdapter<?> adapter, RecyclerView.ViewHolder holder, int position, int result) {
if (adapter instanceof LegacySwipeableItemAdapter) {
int reaction = ((LegacySwipeableItemAdapter) adapter).onSwipeItem(
holder, position, result);
switch (reaction) {
case RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT:
case RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_MOVE_TO_SWIPED_DIRECTION:
case RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM:
//noinspection deprecation
return new LegacySwipeResultAction<>(
(LegacySwipeableItemAdapter) adapter,
holder, position, result, reaction);
default:
throw new IllegalStateException("Unexpected reaction type: " + reaction);
}
} else {
return ((SwipeableItemAdapter) adapter).onSwipeItem(holder, position, result);
}
}
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:25,代码来源:SwipeableItemInternalUtils.java
示例2: onSwipeItem
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public SwipeResultAction onSwipeItem(RecyclerView.ViewHolder holder, int position, int result) {
if (!(mExpandableItemAdapter instanceof BaseExpandableSwipeableItemAdapter)) {
return null;
}
if (position == RecyclerView.NO_POSITION) {
return null;
}
final BaseExpandableSwipeableItemAdapter<?, ?> adapter = (BaseExpandableSwipeableItemAdapter<?, ?>) mExpandableItemAdapter;
final int flatPosition = position;
final long expandablePosition = mPositionTranslator.getExpandablePosition(flatPosition);
final int groupPosition = ExpandableAdapterHelper.getPackedPositionGroup(expandablePosition);
final int childPosition = ExpandableAdapterHelper.getPackedPositionChild(expandablePosition);
return ExpandableSwipeableItemInternalUtils.invokeOnSwipeItem(
adapter, holder, groupPosition, childPosition, result);
}
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:21,代码来源:ExpandableRecyclerViewWrapperAdapter.java
示例3: onSwipeItem
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@Override
public SwipeResultAction onSwipeItem(TabViewHolder holder, final int position, int result) {
switch (result) {
// swipe left -- remove
case RecyclerViewSwipeManager.RESULT_SWIPED_LEFT:
return new SwipeResultActionRemoveItem() {
@Override
protected void onPerformAction() {
super.onPerformAction();
remove(position);
}
};
case RecyclerViewSwipeManager.RESULT_CANCELED:
default:
return new SwipeResultActionDefault();
}
}
开发者ID:gandulf,项目名称:DsaTab,代码行数:18,代码来源:TabInfoDraggableItemAdapter.java
示例4: onSwipeItem
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@Override
public SwipeResultAction onSwipeItem(ViewHolder holder, int position, int result) {
if (result == Swipeable.RESULT_SWIPED_LEFT) {
if (holder.lastSwipeAmount < (-REMOVE_ITEM_THRESHOLD)) {
return new SwipeLeftRemoveAction(this, position);
} else {
return new SwipeLeftPinningAction(this, position);
}
} else {
return new SwipeCancelAction(this, position);
}
}
开发者ID:h6ah4i,项目名称:RecyclerViewiOSMailAppLikeSwipe,代码行数:13,代码来源:MainActivity.java
示例5: onSwipeChildItem
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@Override
public SwipeResultAction onSwipeChildItem(CollectionViewHolder holder, int groupPosition, int childPosition, int result) {
Logger.d("LocalCollectionAdapter", "onSwipeChildItem(groupPosition = " + groupPosition + ", childPosition = " + childPosition + ", result = " + result + ")");
switch (result) {
// swipe right
case SwipeableItemConstants.RESULT_SWIPED_RIGHT:
case SwipeableItemConstants.RESULT_SWIPED_LEFT:
return new ChildSwipeResultAction(groupPosition, childPosition);
// other --- do nothing
case SwipeableItemConstants.RESULT_CANCELED:
default:
return null;
}
}
开发者ID:PureDark,项目名称:H-Viewer,代码行数:15,代码来源:LocalCollectionAdapter.java
示例6: onSwipeItemFinished
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@SuppressWarnings("unchecked")
SwipeResultAction onSwipeItemFinished(RecyclerView.ViewHolder holder, int position, int result) {
if (LOCAL_LOGD) {
Log.d(TAG, "onSwipeItemFinished(holder = " + holder + ", position = " + position + ", result = " + result + ")");
}
mSwipingItemId = RecyclerView.NO_ID;
return SwipeableItemInternalUtils.invokeOnSwipeItem(mSwipeableItemAdapter, holder, position, result);
}
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:11,代码来源:SwipeableItemWrapperAdapter.java
示例7: onSwipeItemFinished2
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@SuppressWarnings("unchecked")
void onSwipeItemFinished2(RecyclerView.ViewHolder holder, int position, int result, int afterReaction, SwipeResultAction resultAction) {
((SwipeableItemViewHolder) holder).setSwipeResult(result);
((SwipeableItemViewHolder) holder).setAfterSwipeReaction(afterReaction);
setSwipeItemSlideAmount(
((SwipeableItemViewHolder) holder),
getSwipeAmountFromAfterReaction(result, afterReaction),
swipeHorizontal());
resultAction.performAction();
notifyDataSetChanged();
}
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:16,代码来源:SwipeableItemWrapperAdapter.java
示例8: finishSwipeSlideToDefaultPosition
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
public boolean finishSwipeSlideToDefaultPosition(
RecyclerView.ViewHolder holder, boolean horizontal,
boolean shouldAnimate, long duration,
int itemPosition, SwipeResultAction resultAction) {
cancelDeferredProcess(holder);
return slideToSpecifiedPositionInternal(holder, 0, horizontal, shouldAnimate, duration,
new SwipeFinishInfo(itemPosition, resultAction));
}
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:9,代码来源:ItemSlidingAnimator.java
示例9: finishSwipeSlideToOutsideOfWindow
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
public boolean finishSwipeSlideToOutsideOfWindow(
RecyclerView.ViewHolder holder, int dir,
boolean shouldAnimate, long duration,
int itemPosition, SwipeResultAction resultAction) {
cancelDeferredProcess(holder);
return slideToOutsideOfWindowInternal(
holder, dir, shouldAnimate, duration,
new SwipeFinishInfo(itemPosition, resultAction));
}
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:10,代码来源:ItemSlidingAnimator.java
示例10: onSwipeItem
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public SwipeResultAction onSwipeItem(VH holder, int position, int result) {
RecyclerView.Adapter adapter = getWrappedAdapter();
if (!(adapter instanceof BaseSwipeableItemAdapter)) {
return new SwipeResultActionDefault();
}
int correctedPosition = getOriginalPosition(position);
return SwipeableItemInternalUtils.invokeOnSwipeItem(
(BaseSwipeableItemAdapter) adapter, holder, correctedPosition, result);
}
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:14,代码来源:DraggableItemWrapperAdapter.java
示例11: invokeOnSwipeItem
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static SwipeResultAction invokeOnSwipeItem(
BaseExpandableSwipeableItemAdapter<?, ?> adapter, RecyclerView.ViewHolder holder,
int groupPosition, int childPosition, int result) {
if (adapter instanceof LegacyExpandableSwipeableItemAdapter) {
int reaction;
if (childPosition == RecyclerView.NO_POSITION) {
reaction = ((LegacyExpandableSwipeableItemAdapter) adapter).onSwipeGroupItem(
holder, groupPosition, result);
} else {
reaction = ((LegacyExpandableSwipeableItemAdapter) adapter).onSwipeChildItem(
holder, groupPosition, childPosition, result);
}
switch (reaction) {
case RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT:
case RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_MOVE_TO_SWIPED_DIRECTION:
case RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM:
//noinspection deprecation
return new LegacyExpandableSwipeResultAction<>(
(LegacyExpandableSwipeableItemAdapter<RecyclerView.ViewHolder, RecyclerView.ViewHolder>) adapter,
holder, groupPosition, childPosition, result, reaction);
default:
throw new IllegalStateException("Unexpected reaction type: " + reaction);
}
} else {
if (childPosition == RecyclerView.NO_POSITION) {
return ((ExpandableSwipeableItemAdapter) adapter).onSwipeGroupItem(holder, groupPosition, result);
} else {
return ((ExpandableSwipeableItemAdapter) adapter).onSwipeChildItem(holder, groupPosition, childPosition, result);
}
}
}
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:36,代码来源:ExpandableSwipeableItemInternalUtils.java
示例12: onSwipeItem
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@Override
public SwipeResultAction onSwipeItem(RecordHolder holder, int position, int result) {
switch (result) {
// swipe right
case SwipeableItemConstants.RESULT_SWIPED_RIGHT:
case SwipeableItemConstants.RESULT_SWIPED_LEFT:
return new DeleteAction(position);
case SwipeableItemConstants.RESULT_CANCELED:
default:
return null;
}
}
开发者ID:seven332,项目名称:Nimingban,代码行数:13,代码来源:RecordActivity.java
示例13: onSwipeItem
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@Override
public SwipeResultAction onSwipeItem(DraftHolder holder, int position, int result) {
switch (result) {
// swipe right
case SwipeableItemConstants.RESULT_SWIPED_RIGHT:
case SwipeableItemConstants.RESULT_SWIPED_LEFT:
return new DeleteAction(position);
case SwipeableItemConstants.RESULT_CANCELED:
default:
return null;
}
}
开发者ID:seven332,项目名称:Nimingban,代码行数:13,代码来源:DraftActivity.java
示例14: onSwipeItem
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@Override
public SwipeResultAction onSwipeItem(ForumHolder holder, int position, int result) {
switch (result) {
// swipe right
case SwipeableItemConstants.RESULT_SWIPED_RIGHT:
case SwipeableItemConstants.RESULT_SWIPED_LEFT:
return new DeleteAction(position);
case SwipeableItemConstants.RESULT_CANCELED:
default:
return null;
}
}
开发者ID:seven332,项目名称:Nimingban,代码行数:13,代码来源:SortForumsActivity.java
示例15: onSwipeItem
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@Override
public SwipeResultAction onSwipeItem(FeedHolder holder, int position, int result) {
mFeedHelper.setEnable(true);
switch (result) {
// swipe right
case SwipeableItemConstants.RESULT_SWIPED_RIGHT:
case SwipeableItemConstants.RESULT_SWIPED_LEFT:
return new DeleteAction(position);
case SwipeableItemConstants.RESULT_CANCELED:
default:
return null;
}
}
开发者ID:seven332,项目名称:Nimingban,代码行数:15,代码来源:FeedActivity.java
示例16: onSwipeItem
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@Override
public SwipeResultAction onSwipeItem(QuickSearchHolder holder, int position, int result) {
switch (result) {
// swipe left --- pin
case SwipeableItemConstants.RESULT_SWIPED_LEFT:
return new SwipeLeftResultAction(position);
// other --- do nothing
case SwipeableItemConstants.RESULT_SWIPED_RIGHT:
case SwipeableItemConstants.RESULT_CANCELED:
default:
return new SwipeResultActionDefault();
}
}
开发者ID:seven332,项目名称:EhViewer,代码行数:14,代码来源:QuickSearchScene.java
示例17: onSwipeItem
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@Override
public SwipeResultAction onSwipeItem(HistoryHolder holder, int position, int result) {
switch (result) {
case SwipeableItemConstants.RESULT_SWIPED_LEFT:
case SwipeableItemConstants.RESULT_SWIPED_RIGHT:
return new SwipeResultActionClear(position);
case SwipeableItemConstants.RESULT_CANCELED:
default:
return new SwipeResultActionDefault();
}
}
开发者ID:seven332,项目名称:EhViewer,代码行数:12,代码来源:HistoryScene.java
示例18: onSwipeItem
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@Override
public SwipeResultAction onSwipeItem(LabelHolder holder, int position, int result) {
switch (result) {
// swipe left --- pin
case SwipeableItemConstants.RESULT_SWIPED_LEFT:
return new SwipeLeftResultAction(position);
// other --- do nothing
case SwipeableItemConstants.RESULT_SWIPED_RIGHT:
case SwipeableItemConstants.RESULT_CANCELED:
default:
return new SwipeResultActionDefault();
}
}
开发者ID:seven332,项目名称:EhViewer,代码行数:14,代码来源:DownloadLabelsScene.java
示例19: onSwipeItem
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@Override
public SwipeResultAction onSwipeItem(MyViewHolder holder, int position, int result)
{
Log.d("SWIPED", "onSwipeItem(position = " + position + ", result = " + result + ")");
ChatroomRecyclerObject item;
try
{
item = mChatroomObjects.get(position);
}
catch (IndexOutOfBoundsException e)
{
e.printStackTrace();
item = null;
}
switch (result)
{
// swipe left --- pin
case Swipeable.RESULT_SWIPED_RIGHT:
if (!holder.isCloseButtonRevealed())
{
holder.revealCloseButton();
}
if (item != null && !item.isPinned())
{
item.setIsPinned(true);
notifyItemChanged(position);
}
return null;
// other --- do nothing
case Swipeable.RESULT_SWIPED_LEFT:
case Swipeable.RESULT_CANCELED:
default:
if (item != null && item.isPinned())
{
item.setIsPinned(false);
notifyItemChanged(position);
}
holder.hideCloseButton();
// if (position != RecyclerView.NO_POSITION) {
// return new UnpinResultAction(this, position);
// } else {
// return null;
// }
return null;
}
}
开发者ID:HueToYou,项目名称:ChatExchange-old,代码行数:51,代码来源:RecyclerAdapter.java
示例20: onSwipeItem
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction; //导入依赖的package包/类
@Override
public SwipeResultAction onSwipeItem(ViewHolder holder, int position, int result) {
return null;
}
开发者ID:jerry4718,项目名称:mobile-android,代码行数:5,代码来源:HisAdapter.java
注:本文中的com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultAction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论