Skip to content

Commit

Permalink
fix: Pay home
Browse files Browse the repository at this point in the history
  • Loading branch information
therajanmaurya committed Oct 31, 2023
1 parent e338fae commit 375675a
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 4 deletions.
5 changes: 5 additions & 0 deletions mifospay/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
android:exported="true"
android:theme="@style/AppTheme" />

<activity
android:name=".payments.ui.SendActivity"
android:exported="true"
android:theme="@style/AppTheme" />

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="org.mifos.mobilewallet.mifospay.provider"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import org.mifos.mobilewallet.mifospay.history.ui.adapter.HistoryAdapter
import org.mifos.mobilewallet.mifospay.home.BaseHomeContract
import org.mifos.mobilewallet.mifospay.home.BaseHomeContract.HomeView
import org.mifos.mobilewallet.mifospay.home.presenter.HomeViewModel
import org.mifos.mobilewallet.mifospay.payments.ui.SendActivity
import org.mifos.mobilewallet.mifospay.qr.ui.ShowQrActivity
import org.mifos.mobilewallet.mifospay.utils.Constants
import org.mifos.mobilewallet.mifospay.utils.Toaster
Expand Down Expand Up @@ -121,7 +122,7 @@ class HomeFragment : BaseFragment(), HomeView {
})
},
onPay = {

startActivity(Intent(this@HomeFragment.requireContext(), SendActivity::class.java))
})
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.mifos.mobilewallet.mifospay.payments.ui

import android.os.Bundle
import androidx.fragment.app.add
import androidx.fragment.app.commit
import dagger.hilt.android.AndroidEntryPoint
import org.mifos.mobilewallet.mifospay.R
import org.mifos.mobilewallet.mifospay.base.BaseActivity
import org.mifos.mobilewallet.mifospay.utils.Constants

@AndroidEntryPoint
class SendActivity : BaseActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_send)
setToolbarTitle(getString(R.string.pay))
showColoredBackButton(Constants.BLACK_BACK_BUTTON)
if (savedInstanceState == null) {
supportFragmentManager.commit {
setReorderingAllowed(true)
add<SendFragment>(R.id.fragment_container_view)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ public void onVPASelected() {
TransitionManager.beginDelayedTransition(sendContainer);
mBtnVpa.setSelected(true);
mBtnVpa.setFocusable(true);
mBtnVpa.setChipBackgroundColorResource(R.color.clickedblue);
mBtnVpa.setChipBackgroundColorResource(R.color.black);
mBtnVpa.setTextColor(ContextCompat.getColor(requireContext(), R.color.white));
mBtnMobile.setSelected(false);
mBtnMobile.setChipBackgroundColorResource(R.color.changedBackgroundColour);
mBtnMobile.setTextColor(ContextCompat.getColor(requireContext(), R.color.black));
btnScanQr.setVisibility(View.VISIBLE);
mRlMobile.setVisibility(View.GONE);
mTilVpa.setVisibility(View.VISIBLE);
Expand All @@ -116,9 +118,11 @@ public void onMobileSelected() {
TransitionManager.beginDelayedTransition(sendContainer);
mBtnMobile.setSelected(true);
mBtnMobile.setFocusable(true);
mBtnMobile.setChipBackgroundColorResource(R.color.clickedblue);
mBtnMobile.setChipBackgroundColorResource(R.color.black);
mBtnMobile.setTextColor(ContextCompat.getColor(requireContext(), R.color.white));
mBtnVpa.setSelected(false);
mBtnVpa.setChipBackgroundColorResource(R.color.changedBackgroundColour);
mBtnVpa.setTextColor(ContextCompat.getColor(requireContext(), R.color.black));
mTilVpa.setVisibility(View.GONE);
btnScanQr.setVisibility(View.GONE);
mRlMobile.setVisibility(View.VISIBLE);
Expand Down
25 changes: 25 additions & 0 deletions mifospay/src/main/res/layout/activity_send.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<include layout="@layout/toolbar" />

<androidx.fragment.app.FragmentContainerView
android:id="@+id/fragment_container_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
3 changes: 2 additions & 1 deletion mifospay/src/main/res/layout/fragment_send.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@
android:layout_alignParentBottom="true"
android:layout_marginStart="11dp"
android:layout_marginLeft="11dp"
android:textColor="@color/white"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:clickable="true"
android:text="@string/vpa"
android:textAlignment="center"
android:textAllCaps="false"
android:typeface="sans"
app:chipBackgroundColor="@color/clickedblue" />
app:chipBackgroundColor="@color/black" />

<com.google.android.material.chip.Chip
android:id="@+id/btn_mobile"
Expand Down
1 change: 1 addition & 0 deletions mifospay/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
<string name="title_activity_new_si">NewSIActivity</string>
<string name="share_receipt">Share Receipt Link</string>
<string name="default_web_client_id"></string>
<string name="pay">Pay</string>



Expand Down

0 comments on commit 375675a

Please sign in to comment.