Skip to content
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.

Commit

Permalink
#198 - Change helper method getSectionItemViewTypeForAdapterViewType …
Browse files Browse the repository at this point in the history
…to static
  • Loading branch information
luizgrp committed May 12, 2020
1 parent b17f6d3 commit 2a2721b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ public int getItemViewType(final int position) {
* <li>SectionedRecyclerViewAdapter.VIEW_TYPE_EMPTY</li>
* </ul>
*/
public int getSectionItemViewTypeForAdapterViewType(final int itemViewType) {
public static int getSectionItemViewTypeForAdapterViewType(final int itemViewType) {
return itemViewType % VIEW_TYPE_QTY;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public void givenViewType0_whenGetSectionItemViewTypeForAdapterViewType_thenRetu


// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeHeader);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeHeader);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_HEADER));
Expand All @@ -286,7 +286,7 @@ public void givenViewType1_whenGetSectionItemViewTypeForAdapterViewType_thenRetu
final int viewTypeFooter = 1;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeFooter);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeFooter);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_FOOTER));
Expand All @@ -298,7 +298,7 @@ public void givenViewType2_whenGetSectionItemViewTypeForAdapterViewType_thenRetu
final int viewTypeItemLoaded = 2;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeItemLoaded);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeItemLoaded);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_ITEM_LOADED));
Expand All @@ -310,7 +310,7 @@ public void givenViewType3_whenGetSectionItemViewTypeForAdapterViewType_thenRetu
final int viewTypeLoading = 3;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeLoading);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeLoading);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_LOADING));
Expand All @@ -322,7 +322,7 @@ public void givenViewType4_whenGetSectionItemViewTypeForAdapterViewType_thenRetu
final int viewTypeFailed = 4;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeFailed);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeFailed);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_FAILED));
Expand All @@ -334,7 +334,7 @@ public void givenViewType5_whenGetSectionItemViewTypeForAdapterViewType_thenRetu
final int viewTypeEmpty = 5;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeEmpty);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeEmpty);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_EMPTY));
Expand All @@ -346,7 +346,7 @@ public void givenAdapterViewTypeForHeader_whenGetSectionItemViewTypeForAdapterVi
final int viewTypeHeader = 12;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeHeader);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeHeader);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_HEADER));
Expand All @@ -358,7 +358,7 @@ public void givenAdapterViewTypeForFooter_whenGetSectionItemViewTypeForAdapterVi
final int viewTypeFooter = 13;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeFooter);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeFooter);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_FOOTER));
Expand All @@ -370,7 +370,7 @@ public void givenAdapterViewTypeForLoaded_whenGetSectionItemViewTypeForAdapterVi
final int viewTypeItemLoaded = 14;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeItemLoaded);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeItemLoaded);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_ITEM_LOADED));
Expand All @@ -382,7 +382,7 @@ public void givenAdapterViewTypeForLoading_whenGetSectionItemViewTypeForAdapterV
final int viewTypeLoading = 15;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeLoading);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeLoading);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_LOADING));
Expand All @@ -394,7 +394,7 @@ public void givenAdapterViewTypeForFailed_whenGetSectionItemViewTypeForAdapterVi
final int viewTypeFailed = 16;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeFailed);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeFailed);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_FAILED));
Expand All @@ -406,7 +406,7 @@ public void givenAdapterViewTypeForEmpty_whenGetSectionItemViewTypeForAdapterVie
final int viewTypeEmpty = 17;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeEmpty);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeEmpty);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_EMPTY));
Expand All @@ -418,7 +418,7 @@ public void givenAdapterViewTypeConstantForHeader_whenGetSectionItemViewTypeForA
final int viewTypeHeader = SectionedRecyclerViewAdapter.VIEW_TYPE_HEADER;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeHeader);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeHeader);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_HEADER));
Expand All @@ -430,7 +430,7 @@ public void givenAdapterViewTypeConstantForFooter_whenGetSectionItemViewTypeForA
final int viewTypeFooter = SectionedRecyclerViewAdapter.VIEW_TYPE_FOOTER;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeFooter);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeFooter);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_FOOTER));
Expand All @@ -442,7 +442,7 @@ public void givenAdapterViewTypeConstantForItemLoaded_whenGetSectionItemViewType
final int viewTypeItemLoaded = SectionedRecyclerViewAdapter.VIEW_TYPE_ITEM_LOADED;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeItemLoaded);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeItemLoaded);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_ITEM_LOADED));
Expand All @@ -454,7 +454,7 @@ public void givenAdapterViewTypeConstantForLoading_whenGetSectionItemViewTypeFor
final int viewTypeLoading = SectionedRecyclerViewAdapter.VIEW_TYPE_LOADING;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeLoading);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeLoading);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_LOADING));
Expand All @@ -466,7 +466,7 @@ public void givenAdapterViewTypeConstantForFailed_whenGetSectionItemViewTypeForA
final int viewTypeFailed = SectionedRecyclerViewAdapter.VIEW_TYPE_FAILED;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeFailed);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeFailed);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_FAILED));
Expand All @@ -478,7 +478,7 @@ public void givenAdapterViewTypeConstantForEmpty_whenGetSectionItemViewTypeForAd
final int viewTypeEmpty = SectionedRecyclerViewAdapter.VIEW_TYPE_EMPTY;

// When
final int result = sectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeEmpty);
final int result = SectionedRecyclerViewAdapter.getSectionItemViewTypeForAdapterViewType(viewTypeEmpty);

// Then
assertThat(result, is(SectionedRecyclerViewAdapter.VIEW_TYPE_EMPTY));
Expand Down

0 comments on commit 2a2721b

Please sign in to comment.