public class

DebugWrapperAdapter

extends SimpleWrapperAdapter<VH extends RecyclerView.ViewHolder>
java.lang.Object
   ↳ android.support.v7.widget.RecyclerView.Adapter<VH extends android.support.v7.widget.RecyclerView.ViewHolder>
     ↳ com.h6ah4i.android.widget.advrecyclerview.adapter.SimpleWrapperAdapter<VH extends android.support.v7.widget.RecyclerView.ViewHolder>
       ↳ com.h6ah4i.android.widget.advrecyclerview.utils.DebugWrapperAdapter

Class Overview

A wrapper adapter for debugging purpose.

Summary

Constants
int FLAGS_ALL_DEBUG_FEATURES
int FLAG_VERIFY_UNWRAP_POSITION
int FLAG_VERIFY_WRAP_POSITION
[Expand]
Inherited Fields
From class com.h6ah4i.android.widget.advrecyclerview.adapter.SimpleWrapperAdapter
Public Constructors
DebugWrapperAdapter(Adapter adapter)
Constructor
Public Methods
int getSettingFlags()
Returns current setting flags.
void setSettingFlags(int flags)
Sets setting flags.
void unwrapPosition(UnwrapPositionResult dest, int position)
Unwraps position.

This class also invokes wrapPosition(AdapterPathSegment, int) of the child adapter when verify option is enabled.

int wrapPosition(AdapterPathSegment pathSegment, int position)
Wraps position.

This class also invokes unwrapPosition(UnwrapPositionResult, int) of the child adapter when verify option is enabled.

[Expand]
Inherited Methods
From class com.h6ah4i.android.widget.advrecyclerview.adapter.SimpleWrapperAdapter
From class android.support.v7.widget.RecyclerView.Adapter
From class java.lang.Object
From interface com.h6ah4i.android.widget.advrecyclerview.adapter.BridgeAdapterDataObserver.Subscriber
From interface com.h6ah4i.android.widget.advrecyclerview.adapter.WrappedAdapter
From interface com.h6ah4i.android.widget.advrecyclerview.adapter.WrapperAdapter

Constants

public static final int FLAGS_ALL_DEBUG_FEATURES

Constant Value: 3 (0x00000003)

public static final int FLAG_VERIFY_UNWRAP_POSITION

Constant Value: 2 (0x00000002)

public static final int FLAG_VERIFY_WRAP_POSITION

Constant Value: 1 (0x00000001)

Public Constructors

public DebugWrapperAdapter (Adapter adapter)

Constructor

Parameters
adapter The debug target adapter

Public Methods

public int getSettingFlags ()

Returns current setting flags.

Returns
  • Bit-OR of debug feature flags.

public void setSettingFlags (int flags)

Sets setting flags.

Parameters
flags Bit-ORof debug feature flags.

public void unwrapPosition (UnwrapPositionResult dest, int position)

Unwraps position. This method converts the passed wrapped position to child adapter's position.

This class also invokes wrapPosition(AdapterPathSegment, int) of the child adapter when verify option is enabled. If inconsistency has been detected, IllegalStateException will be thrown.

Parameters
dest The destination
position The wrapped position to be unwrapped

public int wrapPosition (AdapterPathSegment pathSegment, int position)

Wraps position. This method converts the passed child adapter's position to wrapped position.

This class also invokes unwrapPosition(UnwrapPositionResult, int) of the child adapter when verify option is enabled. If inconsistency has been detected, IllegalStateException will be thrown.

Parameters
pathSegment The path segment of the child adapter
position The child adapter's position to be wrapped
Returns
  • Wrapped position