-
Notifications
You must be signed in to change notification settings - Fork 991
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MBL-2029: [Phase 1] UI Updates: New copy, icon, and alert count for p…
…po menu item in discovery overflow menu (#2234) * update overflow menu item * linter --------- Co-authored-by: Leigh Douglas <[email protected]>
- Loading branch information
1 parent
02fe7a8
commit 2dd3f3b
Showing
6 changed files
with
163 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="22dp" | ||
android:height="22dp" | ||
android:viewportWidth="22" | ||
android:viewportHeight="22"> | ||
<group> | ||
<clip-path | ||
android:pathData="M0,0h21.314v22h-21.314z"/> | ||
<path | ||
android:pathData="M15.977,2.484H5.015C5.051,1.778 5.496,1.372 6.236,1.372H14.757C15.496,1.372 15.942,1.778 15.977,2.484Z" | ||
android:fillColor="#5F6368"/> | ||
<path | ||
android:pathData="M17.754,4.965C17.475,4.921 17.178,4.899 16.867,4.899H4.126C3.814,4.899 3.518,4.921 3.239,4.965C3.333,4.131 3.898,3.665 4.82,3.665H16.181C17.103,3.665 17.661,4.131 17.754,4.965Z" | ||
android:fillColor="#5F6368"/> | ||
<path | ||
android:pathData="M4.126,20.602H16.867C18.682,20.602 19.594,19.698 19.594,17.909V8.989C19.594,7.2 18.682,6.297 16.867,6.297H4.126C2.31,6.297 1.398,7.2 1.398,8.989V17.909C1.398,19.698 2.31,20.602 4.126,20.602Z" | ||
android:fillColor="#5F6368"/> | ||
</group> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,25 +21,29 @@ class LoggedInViewHolderViewModelTest : KSRobolectricTestCase() { | |
private lateinit var vm: LoggedInViewHolderViewModel.ViewModel | ||
private val activityCount = TestSubscriber<Int>() | ||
private val activityCountTextColor = TestSubscriber<Int>() | ||
private val backingActionCount = TestSubscriber<Int>() | ||
private val avatarUrl = TestSubscriber<String>() | ||
private val dashboardRowIsGone = TestSubscriber<Boolean>() | ||
private val name = TestSubscriber<String>() | ||
private val unreadMessagesCount = TestSubscriber<Int>() | ||
private val user = TestSubscriber<User>() | ||
private val pledgedProjectsIsVisible = TestSubscriber<Boolean>() | ||
private val backingsV2IsVisible = TestSubscriber<Boolean>() | ||
private val pledgedProjectsIndicatorIsVisible = TestSubscriber<Boolean>() | ||
private val disposables = CompositeDisposable() | ||
|
||
fun setUpEnvironment(environment: Environment) { | ||
this.vm = LoggedInViewHolderViewModel.ViewModel(environment) | ||
this.vm.outputs.activityCount().subscribe { this.activityCount.onNext(it) }.addToDisposable(disposables) | ||
this.vm.outputs.activityCountTextColor().subscribe { this.activityCountTextColor.onNext(it) }.addToDisposable(disposables) | ||
this.vm.outputs.backingActionCount().subscribe { this.backingActionCount.onNext(it) }.addToDisposable(disposables) | ||
this.vm.outputs.avatarUrl().subscribe { this.avatarUrl.onNext(it) }.addToDisposable(disposables) | ||
this.vm.outputs.dashboardRowIsGone().subscribe { this.dashboardRowIsGone.onNext(it) }.addToDisposable(disposables) | ||
this.vm.outputs.name().subscribe { this.name.onNext(it) }.addToDisposable(disposables) | ||
this.vm.outputs.unreadMessagesCount().subscribe { this.unreadMessagesCount.onNext(it) }.addToDisposable(disposables) | ||
this.vm.outputs.user().subscribe { this.user.onNext(it) }.addToDisposable(disposables) | ||
this.vm.outputs.pledgedProjectsIsVisible().subscribe { this.pledgedProjectsIsVisible.onNext(it) }.addToDisposable(disposables) | ||
this.vm.outputs.backingsV2IsVisible().subscribe { this.backingsV2IsVisible.onNext(it) }.addToDisposable(disposables) | ||
this.vm.outputs.pledgedProjectsIndicatorIsVisible().subscribe { this.pledgedProjectsIndicatorIsVisible.onNext(it) }.addToDisposable(disposables) | ||
} | ||
|
||
|
@@ -204,7 +208,10 @@ class LoggedInViewHolderViewModelTest : KSRobolectricTestCase() { | |
} | ||
val ffClient = object : MockFeatureFlagClient() { | ||
override fun getBoolean(FlagKey: FlagKey): Boolean { | ||
return true | ||
return when (FlagKey) { | ||
com.kickstarter.libs.featureflag.FlagKey.ANDROID_PLEDGED_PROJECTS_OVERVIEW_V2 -> false | ||
else -> true | ||
} | ||
} | ||
} | ||
|
||
|
@@ -216,6 +223,7 @@ class LoggedInViewHolderViewModelTest : KSRobolectricTestCase() { | |
setUpEnvironment(environment) | ||
|
||
this.pledgedProjectsIsVisible.assertValue(true) | ||
this.backingsV2IsVisible.assertValue(false) | ||
} | ||
|
||
@Test | ||
|
@@ -240,7 +248,10 @@ class LoggedInViewHolderViewModelTest : KSRobolectricTestCase() { | |
} | ||
val ffClient = object : MockFeatureFlagClient() { | ||
override fun getBoolean(FlagKey: FlagKey): Boolean { | ||
return true | ||
return when (FlagKey) { | ||
com.kickstarter.libs.featureflag.FlagKey.ANDROID_PLEDGED_PROJECTS_OVERVIEW_V2 -> false | ||
else -> true | ||
} | ||
} | ||
} | ||
|
||
|
@@ -252,6 +263,7 @@ class LoggedInViewHolderViewModelTest : KSRobolectricTestCase() { | |
setUpEnvironment(environment) | ||
|
||
this.pledgedProjectsIsVisible.assertValue(false) | ||
this.backingsV2IsVisible.assertValue(false) | ||
} | ||
|
||
@Test | ||
|
@@ -291,6 +303,44 @@ class LoggedInViewHolderViewModelTest : KSRobolectricTestCase() { | |
this.pledgedProjectsIsVisible.assertValue(false) | ||
} | ||
|
||
@Test | ||
fun `test v2 feature flag enabled, show v2 and not v1`() { | ||
val privacy = UserPrivacy( | ||
"Some Name", | ||
"[email protected]", | ||
true, | ||
true, | ||
true, | ||
true, | ||
"USD", | ||
enabledFeatures = listOf("some_key_here") | ||
) | ||
|
||
val apolloClient = object : MockApolloClientV2() { | ||
override fun userPrivacy(): Observable<UserPrivacy> { | ||
return Observable.just( | ||
privacy | ||
) | ||
} | ||
} | ||
|
||
val ffClient = object : MockFeatureFlagClient() { | ||
override fun getBoolean(FlagKey: FlagKey): Boolean { | ||
return true | ||
} | ||
} | ||
|
||
val environment = environment().toBuilder() | ||
.apolloClientV2(apolloClient) | ||
.featureFlagClient(ffClient) | ||
.build() | ||
|
||
setUpEnvironment(environment) | ||
|
||
this.pledgedProjectsIsVisible.assertNoValues() | ||
this.backingsV2IsVisible.assertValue(true) | ||
} | ||
|
||
@After | ||
fun clear() { | ||
disposables.clear() | ||
|