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

CCCT-467 || User Payment Info #2912

Open
wants to merge 8 commits into
base: connect_qa
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 158 additions & 0 deletions app/res/layout/fragment_connect_payment_setup.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/connect_background_color"
android:padding="16dp"
tools:context="org.commcare.fragments.connect.ConnectPaymentSetupFragment">

<org.commcare.views.connect.connecttextview.ConnectRegularTextView
android:id="@+id/connectMediumTextView"
android:layout_width="match_parent"
android:textSize="14sp"
android:letterSpacing="0.08"
android:layout_height="wrap_content"
android:text="Please confirm your exact name and phone number to receive payment"
android:textColor="@color/black"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<LinearLayout
android:id="@+id/name_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="start"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/connectMediumTextView">

<LinearLayout
android:layout_width="42dp"
android:layout_height="42dp"
android:background="@drawable/connect_side_icon_bg"
android:gravity="center">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="1dp"
android:src="@drawable/ic_outline_person_24" />

</LinearLayout>

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/nameTextValue"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginLeft="16dp"
android:background="@drawable/connect_edit_text_bg"
android:hint="ConnectID Name"
android:imeOptions="actionNext"
android:paddingStart="16dp"
android:textColorHint="@color/connect_grey"
tools:ignore="RtlSymmetry" />

</LinearLayout>

<LinearLayout
android:id="@+id/phone_layout"
android:layout_width="match_parent"
android:layout_marginTop="16dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="@+id/name_layout"
tools:layout_editor_absoluteX="16dp">

<LinearLayout
android:layout_width="42dp"
android:layout_height="42dp"
android:background="@drawable/connect_side_icon_bg"
android:gravity="center">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="1dp"
android:src="@drawable/ic_outline_phone_24" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:background="@drawable/connect_edit_text_bg"
android:padding="0dp">

<EditText
android:id="@+id/countryCode"
android:layout_width="64dp"
android:layout_height="55dp"
android:background="@null"
android:gravity="center"
android:hint="@string/connect_phone_country_code_default"
android:inputType="number"
android:text="@string/connect_phone_country_code_default"
android:textColorHint="@color/connect_grey" />

<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginVertical="10dp"
android:background="@color/connect_blue_color_10" />

<AutoCompleteTextView
android:id="@+id/connect_primary_phone_input"
android:layout_width="fill_parent"
android:layout_height="55dp"
android:background="@null"
android:digits="1234567890"
android:focusable="true"
android:focusableInTouchMode="true"
android:hint="@string/connect_phone_number_hint"
android:inputType="numberDecimal"
android:paddingStart="16dp"
android:textAlignment="textStart"
android:textColorHint="@color/connect_grey"
tools:ignore="RtlSymmetry" />
</LinearLayout>

<org.commcare.views.connect.connecttextview.ConnectMediumTextView
android:id="@+id/errorTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingTop="4dp"
android:textColor="@android:color/holo_red_light"
android:textSize="14sp"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>

<org.commcare.views.connect.RoundedButton

android:id="@+id/continue_button"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_marginTop="24dp"
android:layout_gravity="end"
android:gravity="start|center"
android:text="Save"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/phone_layout"
app:roundButtonBackgroundColor="@color/connect_blue_color"
app:roundButtonBorderRadius="@dimen/dp48"
app:roundButtonIcon="@drawable/connect_right_arrow"
app:roundButtonIconLeftAlign="false"
app:roundButtonTextColor="@color/white"
app:roundButtonTextSize="6.5sp" />
</androidx.constraintlayout.widget.ConstraintLayout>
159 changes: 159 additions & 0 deletions app/res/layout/screen_connect_payment_phone_verify.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="@color/white"
android:orientation="vertical">

<ImageView
android:id="@+id/company_logo"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_marginTop="60dp"
android:contentDescription="@null"
android:src="@drawable/ic_dimagi_logo" />

<View
android:id="@+id/divider"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_marginHorizontal="20dp"
android:layout_marginTop="40dp"
android:background="@color/connect_light_grey" />

<org.commcare.views.connect.connecttextview.ConnectBoldTextView
android:id="@+id/connect_phone_verify_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:fontFamily="@font/roboto_medium"
android:text="@string/enter_otp"
android:textColor="@color/connect_dark_blue_color"
android:textSize="16sp" />

<org.commcare.views.connect.connecttextview.ConnectRegularTextView
android:id="@+id/connect_phone_verify_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:textColor="@color/connect_secondary_text"
android:textSize="16sp"
tools:text="+91 7748962888" />

<LinearLayout
android:id="@+id/otp_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:gravity="start"
android:orientation="horizontal">

<LinearLayout
android:layout_width="42dp"
android:layout_height="42dp"
android:background="@drawable/connect_side_icon_bg"
android:gravity="center">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@null"
android:padding="1dp"
android:src="@drawable/ic_outline_lock_24" />

</LinearLayout>

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/connect_phone_verify_code"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginStart="16dp"
android:background="@drawable/connect_edit_text_bg"
android:hint="OTP"
android:imeOptions="actionNext"
android:inputType="numberDecimal"
android:paddingStart="16dp"
android:textColorHint="@color/connect_grey"
tools:ignore="RtlSymmetry" />

</LinearLayout>

<org.commcare.views.connect.connecttextview.ConnectMediumTextView
android:id="@+id/connect_phone_verify_error"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/content_min_margin"
android:gravity="start"
android:textColor="@color/red"
android:textSize="14sp"
android:visibility="gone" />

<org.commcare.views.connect.connecttextview.ConnectMediumTextView
android:id="@+id/connect_phone_verify_resend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="80dp"
android:layout_marginTop="16dp"
android:fontFamily="@font/roboto_medium"
android:text="Resend OTP in 60s"
android:textColor="@android:color/holo_blue_dark"
android:textSize="12sp" />

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:orientation="horizontal">

<org.commcare.views.connect.RoundedButton
android:id="@+id/connect_resend_otp_button"
android:layout_width="150dp"
android:layout_height="45dp"
android:layout_gravity="end"
android:visibility="visible"
android:gravity="center"
android:text="@string/connect_payment_info_resend_otp"
app:roundButtonBackgroundColor="@color/white"
app:roundButtonBorderRadius="@dimen/dp48"
app:roundButtonIconLeftAlign="false"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
app:roundButtonIconTintColor="@color/white"
app:roundButtonTextColor="@color/connect_blue_color"
app:roundButtonBorderWidth="1dp"
app:roundButtonBorderVisible="true"
app:roundButtonBorderColor="@color/connect_blue_color"
app:roundButtonTextSize="6.5sp" />

<org.commcare.views.connect.RoundedButton
android:id="@+id/connect_phone_verify_button"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_gravity="end"
android:gravity="start|center"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:text="@string/connect_verify_phone_verify"
app:roundButtonBackgroundColor="@color/connect_blue_color"
app:roundButtonBorderRadius="@dimen/dp48"
app:roundButtonIconLeftAlign="false"
app:roundButtonIconTintColor="@color/white"
app:roundButtonTextColor="@color/white"
app:roundButtonTextSize="6.5sp" />
</RelativeLayout>
</LinearLayout>
</layout>
40 changes: 39 additions & 1 deletion app/res/navigation/nav_graph_connect.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
<action
android:id="@+id/action_connect_jobs_list_fragment_to_connect_downloading_fragment2"
app:destination="@id/connect_downloading_fragment" />
<action
android:id="@+id/action_connect_jobs_list_fragment_to_connectPaymentSetupFragment"
app:destination="@id/connectPaymentSetupFragment" />
</fragment>

<fragment
Expand Down Expand Up @@ -154,6 +157,42 @@
android:name="unitId"
app:argType="string" />
</fragment>
<fragment
android:id="@+id/connectPaymentSetupFragment"
android:name="org.commcare.fragments.connect.ConnectPaymentSetupFragment"
android:label="fragment_connect_payment_setup"
tools:layout="@layout/fragment_connect_payment_setup">
<action
android:id="@+id/action_connectPaymentSetupFragment_to_connectPaymentSetupPhoneVerificationFragment"
app:destination="@id/connectPaymentSetupPhoneVerificationFragment" />
</fragment>
<fragment
android:id="@+id/connectPaymentSetupPhoneVerificationFragment"
android:name="org.commcare.fragments.connect.ConnectPaymentSetupPhoneVerificationFragment"
android:label="ConnectPaymentSetupPhoneVerificationFragment"
tools:layout="@layout/screen_connect_payment_phone_verify">
<argument
android:name="phone"
app:argType="string"
app:nullable="true" />
<argument
android:name="paymentProfileName"
app:argType="string"
app:nullable="true" />
<argument
android:name="username"
app:argType="string"
app:nullable="true" />
<argument
android:name="password"
app:argType="string"
app:nullable="true" />
<action
android:id="@+id/action_connectPaymentSetupPhoneVerificationFragment_to_connect_jobs_list_fragment"
app:destination="@id/connect_jobs_list_fragment"
app:popUpTo="@id/connect_jobs_list_fragment"
app:popUpToInclusive="true" />
</fragment>
<dialog
android:id="@+id/connect_job_detail_bottom_sheet_dialog_fragment"
android:name="org.commcare.fragments.connect.ConnectJobDetailBottomSheetDialogFragment"
Expand All @@ -162,5 +201,4 @@


</dialog>

</navigation>
4 changes: 4 additions & 0 deletions app/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
<string name="ConnectPaymentConfirmationURL">https://%s/api/payment/%s/confirm</string>
<string name="ConnectInitiateUserAccountDeactivationURL">https://connectid.dimagi.com/users/recover/initiate_deactivation</string>
<string name="ConnectConfirmUserAccountDeactivationURL">https://connectid.dimagi.com/users/recover/confirm_deactivation</string>
<string name="ConnectPaymentPhoneNumberURL">https://connectid.dimagi.com/users/profile/payment_phone_number</string>
<string name="ConnectConfirmPaymentOtpURL">https://connectid.dimagi.com/users/profile/confirm_payment_otp</string>

<!-- region: All strings for multiple apps and app-agnostic properties -->

Expand Down Expand Up @@ -876,6 +878,8 @@
<string name="connect_commcare_app">CommCare App</string>
<string name="connect_job_tile_daily_limit_description">Daily Limit reached. No Payment for submitting forms</string>
<string name="connect_job_tile_daily_limit">Over Limit</string>
<string name="connect_payment_info">Payment Info</string>
<string name="connect_payment_info_resend_otp">Resend OTP</string>
<string name="connect_job_tile_daily_visits">Daily Visits</string>
<string name="connect_appbar_title_app_lock">App Lock</string>
<string name="connect_appbar_title_password_verification">Password Verification</string>
Expand Down
Loading