public class

ItemViewTypeComposer

extends Object
java.lang.Object
   ↳ com.h6ah4i.android.widget.advrecyclerview.adapter.ItemViewTypeComposer

Class Overview

Utility class providing "Composed item view type" related definitions and methods.

Spec:

bit 31Expandable group flag (1: expandable group / 0: normal item)
bit 30-24View type segment
bit 23-0Wrapped view type code

Summary

Constants
int BIT_MASK_EXPANDABLE_FLAG Bit mask of the expandable flag part.
int BIT_MASK_SEGMENT Bit mask of the segment part.
int BIT_MASK_WRAPPED_VIEW_TYPE Bit mask of the wrapped view type part.
int BIT_OFFSET_EXPANDABLE_FLAG Bit offset of the expandable flag part.
int BIT_OFFSET_SEGMENT Bit offset of the segment part.
int BIT_OFFSET_WRAPPED_VIEW_TYPE Bit offset of the wrapped view type part.
int BIT_WIDTH_EXPANDABLE_FLAG Bit width of the expandable flag part.
int BIT_WIDTH_SEGMENT Bit width of the segment part.
int BIT_WIDTH_WRAPPED_VIEW_TYPE Bit width of the wrapped view type part.
int MAX_SEGMENT Maximum value of segment.
int MAX_WRAPPED_VIEW_TYPE Maximum value of wrapped view type.
int MIN_SEGMENT Minimum value of segment.
int MIN_WRAPPED_VIEW_TYPE Minimum value of wrapped view type.
Public Methods
static int composeSegment(int segment, int wrappedViewType)
Makes a composed ID with specified segment and wrapped ID.
static int extractSegmentPart(int composedViewType)
Extracts "Segment" part from composed view type.
static int extractWrappedViewTypePart(int composedViewType)
Extracts "Wrapped view type" part from composed view type.
static boolean isExpandableGroup(int composedViewType)
Checks the composed view type is a expandable group or not.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int BIT_MASK_EXPANDABLE_FLAG

Bit mask of the expandable flag part.

Constant Value: -2147483648 (0x80000000)

public static final int BIT_MASK_SEGMENT

Bit mask of the segment part.

Constant Value: 2130706432 (0x7f000000)

public static final int BIT_MASK_WRAPPED_VIEW_TYPE

Bit mask of the wrapped view type part.

Constant Value: 16777215 (0x00ffffff)

public static final int BIT_OFFSET_EXPANDABLE_FLAG

Bit offset of the expandable flag part.

Constant Value: 31 (0x0000001f)

public static final int BIT_OFFSET_SEGMENT

Bit offset of the segment part.

Constant Value: 24 (0x00000018)

public static final int BIT_OFFSET_WRAPPED_VIEW_TYPE

Bit offset of the wrapped view type part.

Constant Value: 0 (0x00000000)

public static final int BIT_WIDTH_EXPANDABLE_FLAG

Bit width of the expandable flag part.

Constant Value: 1 (0x00000001)

public static final int BIT_WIDTH_SEGMENT

Bit width of the segment part.

Constant Value: 7 (0x00000007)

public static final int BIT_WIDTH_WRAPPED_VIEW_TYPE

Bit width of the wrapped view type part.

Constant Value: 24 (0x00000018)

public static final int MAX_SEGMENT

Maximum value of segment.

Constant Value: 127 (0x0000007f)

public static final int MAX_WRAPPED_VIEW_TYPE

Maximum value of wrapped view type.

Constant Value: 8388607 (0x007fffff)

public static final int MIN_SEGMENT

Minimum value of segment.

Constant Value: 0 (0x00000000)

public static final int MIN_WRAPPED_VIEW_TYPE

Minimum value of wrapped view type.

Constant Value: -8388608 (0xff800000)

Public Methods

public static int composeSegment (int segment, int wrappedViewType)

Makes a composed ID with specified segment and wrapped ID.

Parameters
segment Segment
wrappedViewType Wrapped view type
Returns
  • Composed View type.

public static int extractSegmentPart (int composedViewType)

Extracts "Segment" part from composed view type.

Parameters
composedViewType Composed view type
Returns
  • Segment part

public static int extractWrappedViewTypePart (int composedViewType)

Extracts "Wrapped view type" part from composed view type.

Parameters
composedViewType Composed view type
Returns
  • Wrapped view type part

public static boolean isExpandableGroup (int composedViewType)

Checks the composed view type is a expandable group or not.

Parameters
composedViewType Composed view type
Returns
  • True if the specified composed composed view type is an expandable group item view type. Otherwise, false.