Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🔁] Cancel Pledge redesign #594

Merged
merged 1 commit into from Aug 23, 2019
Merged

[🔁] Cancel Pledge redesign #594

merged 1 commit into from Aug 23, 2019

Conversation

eoji
Copy link
Contributor

@eoji eoji commented Aug 21, 2019

📲 What

Implementation of the cancel pledge redesign.

🤔 Why

Redesign™

🛠 How

  • Changed background color to ksr_grey_300.
  • Removed toolbar.
  • The pledge amount and project name are now bold.
  • There were some BehaviorSubjects that should've been PublishSubjects, you know how it goes.
  • It now animates horizontally, instead of vertically.

👀 See

After 🦋 Before 🐛
screenshot-2019-08-21_114404 screenshot-2019-07-12_153909
device-2019-08-21-114534 2019-08-21 11_46_02 cancelpledge

📋 QA

Notes 2 u, the QA individual:
1️⃣ Tertiary (gray) buttons are ksr_grey_400 and not ksr_grey_500 so it does not match the Abstract.
2️⃣ Outlined text fields do not have a fill. We can switch to the filled text fields if desired.
3️⃣ Regression test: you should still be able to cancel your pledge or dismiss the screen.

Story 📖

https://dripsprint.atlassian.net/browse/NT-200

@eoji eoji requested a review from a team August 22, 2019 20:12
@@ -42,12 +46,12 @@ class CancelPledgeFragment : BaseFragment<CancelPledgeViewModel.ViewModel>() {
this.viewModel.outputs.showServerError()
.compose(bindToLifecycle())
.compose(Transformers.observeForUI())
.subscribe { Snackbar.make(snackbar_anchor, R.string.Something_went_wrong_please_try_again, Snackbar.LENGTH_SHORT).show() }
.subscribe { snackbar(cancel_pledge_root, getString(R.string.Something_went_wrong_please_try_again)).show() }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍿

<3 functions as first class citizens in Kotlin! 🎆

"amount", amount, "project_name", name)

val spannableString = SpannableString(formattedString)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok so at this point formatted string already has the data interpolated, and using SpannableString is really just to add bold-ness to the string for the amount and name of the project, right?

I'm getting it!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...I think

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes!

Copy link

@oliverswitzer oliverswitzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Out of curiosity, what was the reason behind changing over to a BehaviorSubject for progressBarIsVisible and PublishSubject for the showCancelError and showServerError? Does it have to do with the fact that we no longer have a close button on the new version of this screen?

(also apologies for the delay between making comments and approving, had to hop into a meeting)

@eoji
Copy link
Contributor Author

eoji commented Aug 23, 2019

Hey @oliverswitzer, np!!

So, a PublishSubject is a special type of Observable that when it's subscribed to, it will only emit new emissions.

Compared to a BehaviorSubject. A BehaviorSubject is a special type of Observable that when it's subscribed to, it will emit its last emission and any new emissions.

So you want to use a BehaviorSubject when you want the VM to maintain that state (say like when you're rotating your phone!) and a PublishSubject when that state is ephemeral. Using the CancelPledgeFragmentViewModel as an example, if we were showing a ProgressBar, we still want to show it after a rotation. For an error, we just want to show it once, and not repeat it if the user rotated their phone.

@eoji eoji merged commit 5814f14 into master Aug 23, 2019
@eoji eoji deleted the redesign-cancel-pledge branch August 23, 2019 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants