Skip to content

Commit

Permalink
Regression 2.19.0 (#1396)
Browse files Browse the repository at this point in the history
* Update internal and external version names to match build name generated by playstore

* Update drawer params clicked with current sort if sort is null, and update tests (#1394)
  • Loading branch information
leighdouglas authored Sep 17, 2021
1 parent e74ba95 commit 48e1545
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/external_version_code.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2013150871
2013150872
2 changes: 1 addition & 1 deletion app/internal_version_code.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2013150871
2013150872
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,17 @@ interface DiscoveryViewModel {
val paramsFromIntent = intent()
.flatMap { DiscoveryIntentMapper.params(it, apiClient) }

val pagerSelectedPage = pagerSetPrimaryPage.distinctUntilChanged()

val drawerParamsClicked = childFilterRowClick
.mergeWith(topFilterRowClick)
.map { it.params() }
.withLatestFrom(
pagerSelectedPage.map { DiscoveryUtils.sortFromPosition(it) }
) { drawerClickParams, currentParams ->
if (drawerClickParams.params().sort() == null)
drawerClickParams.params().toBuilder().sort(currentParams).build()
else drawerClickParams.params()
}

// Merge various param data sources.
val params = Observable.merge(
Expand All @@ -279,8 +287,6 @@ interface DiscoveryViewModel {
drawerParamsClicked
)

val pagerSelectedPage = pagerSetPrimaryPage.distinctUntilChanged()

val sortToTabOpen = Observable.merge(
pagerSelectedPage.map { DiscoveryUtils.sortFromPosition(it) },
params.map { it.sort() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,9 @@ public void testInteractionBetweenParamsAndPageAdapter() {
DiscoveryParams.builder().sort(DiscoveryParams.Sort.MAGIC).build(),
DiscoveryParams.builder().sort(DiscoveryParams.Sort.POPULAR).build(),
DiscoveryParams.builder().sort(DiscoveryParams.Sort.POPULAR).category(CategoryFactory.artCategory()).build(),
DiscoveryParams.builder().category(CategoryFactory.artCategory()).build()
DiscoveryParams.builder().category(CategoryFactory.artCategory()).sort(DiscoveryParams.Sort.POPULAR).build()
);
this.updatePage.assertValues(0, 0, 1, 1, 0);
this.updatePage.assertValues(0, 0, 1, 1, 1);

// Select MAGIC sort position.
this.vm.getInputs().discoveryPagerAdapterSetPrimaryPage(Mockito.mock(DiscoveryPagerAdapter.class), 0);
Expand All @@ -310,10 +310,10 @@ public void testInteractionBetweenParamsAndPageAdapter() {
DiscoveryParams.builder().sort(DiscoveryParams.Sort.MAGIC).build(),
DiscoveryParams.builder().sort(DiscoveryParams.Sort.POPULAR).build(),
DiscoveryParams.builder().sort(DiscoveryParams.Sort.POPULAR).category(CategoryFactory.artCategory()).build(),
DiscoveryParams.builder().category(CategoryFactory.artCategory()).build(),
DiscoveryParams.builder().category(CategoryFactory.artCategory()).sort(DiscoveryParams.Sort.POPULAR).build(),
DiscoveryParams.builder().sort(DiscoveryParams.Sort.MAGIC).category(CategoryFactory.artCategory()).build()
);
this.updatePage.assertValues(0, 0, 1, 1, 0, 0);
this.updatePage.assertValues(0, 0, 1, 1, 1, 0);

// Simulate rotating the device and hitting initial getInputs() again.
this.vm.getOutputs().updateParamsForPage().subscribe(this.rotatedUpdateParams);
Expand Down

0 comments on commit 48e1545

Please sign in to comment.