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

Add Event Payment preferences #1058

Merged
merged 1 commit into from Jun 17, 2018

Conversation

4 participants
@mishuvs
Copy link
Member

mishuvs commented Jun 11, 2018

Fixes #1049

Changes: Adds Event Settings -> Payment Preferences

Gif for the change:
videotogif_2018 06 15_11 14 04

@mishuvs

This comment has been minimized.

Copy link
Member Author

mishuvs commented Jun 11, 2018

@iamareebjamal Nested Preference Screens are not supported with PreferenceFragmentCompat. [1]
So I got on to this one which proves out to be very lengthy method. What are your views?
Also, @sridharjajoo @Masquerade0097

(Is there a way I can share code for WIP-PRs without triggering tests?)

@open-event-bot

This comment has been minimized.

Copy link

open-event-bot bot commented Jun 11, 2018

Hi @mishuvs!

It looks like one or more of your builds have failed.
I've added the relevant info below to save you some time.

@iamareebjamal

This comment has been minimized.

Copy link
Member

iamareebjamal commented Jun 11, 2018

Nested Preference?

@mishuvs

This comment has been minimized.

Copy link
Member Author

mishuvs commented Jun 12, 2018

Nested Preference?

@iamareebjamal I meant using preference sub screens

@iamareebjamal

This comment has been minimized.

Copy link
Member

iamareebjamal commented Jun 12, 2018

Just use titles

@mishuvs mishuvs force-pushed the mishuvs:payment-preference branch from e250bf8 to d0ef1c3 Jun 13, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 13, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 13, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 13, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 13, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 13, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 13, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 13, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 13, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 13, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 13, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 13, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 13, 2018

@mishuvs mishuvs force-pushed the mishuvs:payment-preference branch from d0ef1c3 to 06c251c Jun 13, 2018

@open-event-bot

This comment has been minimized.

Copy link

open-event-bot bot commented Jun 13, 2018

Hi @mishuvs!

It looks like one or more of your builds have failed.
I've added the relevant info below to save you some time.

@fossasia fossasia deleted a comment from codacy-bot Jun 13, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 13, 2018

@codecov

This comment has been minimized.

Copy link

codecov bot commented Jun 13, 2018

Codecov Report

Merging #1058 into development will decrease coverage by 0.25%.
The diff coverage is 2.94%.

Impacted file tree graph

@@                Coverage Diff                @@
##             development    #1058      +/-   ##
=================================================
- Coverage           26.7%   26.45%   -0.26%     
  Complexity           608      608              
=================================================
  Files                179      181       +2     
  Lines               6477     6544      +67     
  Branches             252      252              
=================================================
+ Hits                1730     1731       +1     
- Misses              4673     4739      +66     
  Partials              74       74
Impacted Files Coverage Δ Complexity Δ
...sia/openevent/app/core/main/FragmentNavigator.java 40.74% <0%> (-1.57%) 6 <0> (ø)
...event/app/core/settings/EventSettingsFragment.java 0% <0%> (ø) 0 <0> (?)
...ent/app/core/event/create/CreateEventFragment.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...asia/openevent/app/data/SharedPreferencesImpl.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...nevent/app/core/settings/PaymentPrefsFragment.java 0% <0%> (ø) 0 <0> (?)
...nt/app/core/event/create/CreateEventPresenter.java 40% <8.33%> (-10.65%) 8 <0> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f53d2f4...98f0f0d. Read the comment docs.

@mishuvs mishuvs changed the title [WIP] Add Event Payment preferences Add Event Payment preferences Jun 13, 2018

android:text="@string/accept_payment_through_paypal" />

<android.support.design.widget.TextInputLayout
android:id="@+id/paypal_email_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/spacing_extra_small"
android:visibility="@{ paypalPayment.checked ? View.VISIBLE : View.GONE }">
android:visibility="@{ event.canPayByPaypal ? View.VISIBLE : View.GONE }">

This comment has been minimized.

Copy link
@mishuvs

mishuvs Jun 13, 2018

Author Member

@iamareebjamal @Masquerade0097 I am trying to get this TextInputLayout to show/hide but it reacts correctly only at first and doesn't change after I further check checkbox. I have used @= in checkbox so the value event.canPayByPaypal is also updating.
Any idea why?

This comment has been minimized.

Copy link
@Masquerade0097

Masquerade0097 Jun 14, 2018

Member

@mishuvs I think the problem is similar to this https://stackoverflow.com/questions/20040542/android-development-checkbox-setchecked-not-working.
Use android:onCheckChanged, it will work as expected.

@fossasia fossasia deleted a comment from codacy-bot Jun 15, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 15, 2018

@mishuvs mishuvs force-pushed the mishuvs:payment-preference branch from 5066418 to 117ba01 Jun 15, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 15, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 15, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 15, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 15, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 15, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 15, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 15, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 15, 2018

@fossasia fossasia deleted a comment from codacy-bot Jun 15, 2018

@mishuvs mishuvs force-pushed the mishuvs:payment-preference branch from 31f51fe to d7fe648 Jun 15, 2018

@mishuvs

This comment has been minimized.

Copy link
Member Author

mishuvs commented Jun 15, 2018

@iamareebjamal @Masquerade0097 @sridharjajoo Please review. (Gif updated)

@sridharjajoo

This comment has been minimized.

Copy link
Member

sridharjajoo commented Jun 15, 2018

LGTM

@mishuvs mishuvs force-pushed the mishuvs:payment-preference branch 2 times, most recently from 4096051 to 1363b8f Jun 16, 2018

@@ -147,6 +147,8 @@
<string name="payment_methods">Payment Methods</string>
<string name="payment_by_paypal">Payment By PayPal</string>
<string name="accept_payment_through_paypal">Accept Payment through PayPal</string>
<string name="dont_accept_payment_through_paypal">Not Accepting Payment through Paypal</string>
<string name="dont_accept_payment_through_stripe">Not Accepting Payment through Paypal</string>

This comment has been minimized.

Copy link
@Masquerade0097

Masquerade0097 Jun 16, 2018

Member

Change Paypal -> Stripe.

@mishuvs mishuvs force-pushed the mishuvs:payment-preference branch from 1363b8f to 1d20c4a Jun 16, 2018

@open-event-bot

This comment has been minimized.

Copy link

open-event-bot bot commented Jun 16, 2018

Hi @mishuvs!

It looks like one or more of your builds have failed.
I've added the relevant info below to save you some time.

@mishuvs mishuvs force-pushed the mishuvs:payment-preference branch from 1d20c4a to f738722 Jun 16, 2018

@mishuvs

This comment has been minimized.

Copy link
Member Author

mishuvs commented Jun 16, 2018

@Masquerade0097 I have made the change. Please review.

preferences.getBoolean(PREF_ACCEPT_PAYPAL, false)
);
event.setPaypalEmail(
preferences.getString(PREF_PAYPAL_EMAIL, "")

This comment has been minimized.

Copy link
@iamareebjamal

iamareebjamal Jun 16, 2018

Member

Empty is evil. Use null

@mishuvs mishuvs force-pushed the mishuvs:payment-preference branch from f738722 to 98f0f0d Jun 17, 2018

@open-event-bot open-event-bot bot removed the needs-review label Jun 17, 2018

@iamareebjamal iamareebjamal merged commit 4c4ada0 into fossasia:development Jun 17, 2018

2 of 5 checks passed

Codacy/PR Quality Review Codacy was unable to analyse your pull request.
Details
codecov/patch 2.94% of diff hit (target 26.7%)
Details
codecov/project 26.45% (-0.26%) compared to f53d2f4
Details
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@mishuvs mishuvs deleted the mishuvs:payment-preference branch Jun 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.