This commit is contained in:
2023-10-20 17:43:40 +05:30
parent 0d91373e28
commit 8f7156e3e3
8 changed files with 148 additions and 32 deletions

View File

@@ -1,18 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\adity\.android\avd\Samsung_Z3_flip_API_34.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-10-17T08:31:08.829911500Z" />
<runningDeviceTargetsSelectedWithDialog>
<Target>
<type value="RUNNING_DEVICE_TARGET" />

View File

@@ -27,6 +27,7 @@ import com.app.simplitend.cg_subscription.mvp.SubscriptionCredentials;
import com.app.simplitend.cg_subscription.mvp.SubscriptionPresenter;
import com.app.simplitend.databinding.CgSubscriptionLayoutBinding;
import com.app.simplitend.welcome.welcomecg.mvvm.CareGiverData;
import com.stripe.android.PaymentConfiguration;
import com.stripe.android.paymentsheet.PaymentSheet;
import com.stripe.android.paymentsheet.PaymentSheetResult;
@@ -324,6 +325,9 @@ public class CgSubscriptionActivity extends AppCompatActivity
// Display for example, an order confirmation screen
Toast.makeText(this, "Payment successful.", Toast.LENGTH_SHORT).show();
this.careGiverData.isCaregiverTakeSubscription = 1;
CaregiverDataCache.setCareGiverData(this.careGiverData);
Intent intent = new Intent(this, CgProfileProgressActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
@@ -505,7 +509,7 @@ public class CgSubscriptionActivity extends AppCompatActivity
if (monthly_price == null || yearly_price == null) throw new Exception();
binding.yearDiscountedPrice.setText(yearly_price);
binding.monthlyPrice.setText(monthly_price);
binding.monthlyPrice.setText("$" + monthly_price);
BigDecimal TWELVE = new BigDecimal(12);
@@ -544,6 +548,8 @@ public class CgSubscriptionActivity extends AppCompatActivity
return;
}
PaymentConfiguration.init(getApplicationContext(), credentials.stripe_publish_key);
final PaymentSheet.CustomerConfiguration customerConfig = new PaymentSheet.CustomerConfiguration(
credentials.customerId,
credentials.ephemeralKey
@@ -554,7 +560,7 @@ public class CgSubscriptionActivity extends AppCompatActivity
final PaymentSheet.Configuration configuration = new PaymentSheet.Configuration.Builder("SimpliTend")
.customer(customerConfig)
.allowsDelayedPaymentMethods(true)
.allowsDelayedPaymentMethods(false)
.build();
paymentSheet.presentWithPaymentIntent(

View File

@@ -227,7 +227,7 @@ public class NotificationsActivity extends AppCompatActivity implements Callback
binding.description.setText(notification.description);
// 0-> medcine , 1-> activity , 2-> outofgeofence, 3-> reuqestedDirection , 4-> SOS , 5-> location , 6- radius add or update
// 0-> medcine , 1-> activity , 2-> outofgeofence, 3-> reuqestedDirection , 4-> SOS , 5-> location , 6- radius add or update, 7 - subscription
int imageRes = -1;
switch (notification.type){
@@ -248,6 +248,8 @@ public class NotificationsActivity extends AppCompatActivity implements Callback
case "4":
imageRes = R.drawable.ic_sos_noti;
break;
default:
imageRes = R.drawable.ic_subscription_noti;
}
if (imageRes != -1) {

View File

@@ -197,6 +197,11 @@ public class PatientDashboardFragment extends Fragment implements ProfileContrac
}
private void clickEvents() {
binding.refreshBtn.setOnClickListener(v -> {
showLoadingProgress(true);
loadReminders();
});
binding.chats.setOnClickListener(v -> {
PatientDataCache.getPatientData(requireContext(), (patientData1 -> {
if (patientData1 != null){
@@ -326,6 +331,16 @@ public class PatientDashboardFragment extends Fragment implements ProfileContrac
this);
}
private void showLoadingProgress(boolean isLoading){
if (isLoading){
binding.refreshBtn.setVisibility(View.GONE);
binding.refreshProgress.setVisibility(View.VISIBLE);
}else{
binding.refreshBtn.setVisibility(View.VISIBLE);
binding.refreshProgress.setVisibility(View.GONE);
}
}
private void updateTime() {
Calendar calendar = Calendar.getInstance();
@@ -364,20 +379,33 @@ public class PatientDashboardFragment extends Fragment implements ProfileContrac
}
private void removeReminder() {
binding.homeReminder.setVisibility(View.GONE);
try {
ViewGroup.LayoutParams layoutParams = binding.bgImg.getLayoutParams();
layoutParams.height = (int) getResources().getDimension(com.intuit.sdp.R.dimen._140sdp);
binding.bgImg.setLayoutParams(layoutParams);
} catch (Exception e) {
// do nothing
}
// removing card from screen code.
// binding.homeReminder.setVisibility(View.GONE);
//
// try {
// ViewGroup.LayoutParams layoutParams = binding.bgImg.getLayoutParams();
// layoutParams.height = (int) getResources().getDimension(com.intuit.sdp.R.dimen._140sdp);
// binding.bgImg.setLayoutParams(layoutParams);
// } catch (Exception e) {
// // do nothing
// }
showLoadingProgress(false);
String no_med_message_title = "No upcoming activity or Medication reminder!";
binding.messageTitle.setText(no_med_message_title);
binding.messageSub1.setVisibility(View.GONE);
binding.messageSub2.setVisibility(View.GONE);
viewModel.message_title = null;
}
private void addReminder() {
showLoadingProgress(false);
if (viewModel.message_title == null || viewModel.message_title.isEmpty()) {
// removeReminder();
return;
@@ -395,6 +423,8 @@ public class PatientDashboardFragment extends Fragment implements ProfileContrac
binding.messageTitle.setText(viewModel.message_title);
binding.messageSub1.setText(viewModel.message_sub_title_1);
binding.messageSub2.setText(viewModel.message_sub_title_2);
binding.messageSub1.setVisibility(View.VISIBLE);
binding.messageSub2.setVisibility(View.VISIBLE);
}
@Override
@@ -408,6 +438,8 @@ public class PatientDashboardFragment extends Fragment implements ProfileContrac
viewModel.message_title = null;
viewModel.message_sub_title_1 = null;
viewModel.message_sub_title_2 = null;
showLoadingProgress(false);
}
@Override

View File

@@ -275,10 +275,11 @@ public class RegisterFragment extends Fragment implements WelcomeContracts.Verif
}
}
if (binding.contactNumber.getText().toString().trim().isEmpty() ||
binding.contactNumber.getText().toString().trim().length() < 10) {
binding.contactNumber.setError("Invalid");
if (binding.contactNumber.getText().toString().trim().isEmpty()) {
binding.contactNumber.setError("Required");
allOkay = false;
} else if (binding.contactNumber.getText().toString().trim().length() < 10) {
binding.contactNumber.setError("Phone number should be 10 digits");
} else if (binding.countryCodes.getSelectedIndex() == -1 ||
binding.countryCodes.getSelectedIndex() >= countryCodeList.size()) {
allOkay = false;

View File

@@ -0,0 +1,44 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="34.016dp"
android:height="37dp"
android:viewportWidth="34.016"
android:viewportHeight="37">
<path
android:pathData="M14.242,4.112a9.9,9.9 0,0 0,-9.866 9.921L4.376,18.812A7.935,7.935 0,0 1,3.442 22.218L1.552,25.376a3.179,3.179 0,0 0,1.776 4.845,34.221 34.221,0 0,0 21.82,0 3.317,3.317 0,0 0,1.776 -4.845l-1.891,-3.158a8.154,8.154 0,0 1,-0.921 -3.406L24.112,14.033A9.923,9.923 0,0 0,14.242 4.112Z"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#fff"
android:strokeLineCap="round"/>
<path
android:pathData="M17.443,4.112a7.987,7.987 0,0 0,-1.68 -0.494,8.527 8.527,0 0,0 -4.8,0.494c0.508,-1.828 1.768,-3.112 3.238,-3.112S16.935,2.284 17.443,4.112Z"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#fff"
android:strokeLineCap="round"/>
<path
android:pathData="M19.952,31.913c0,2.248 -2.363,4.087 -5.25,4.087a6.1,6.1 0,0 1,-3.71 -1.2A3.712,3.712 0,0 1,9.453 31.913"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#fff"/>
<path
android:pathData="M33.016,26.452A7.2,7.2 0,1 1,25.807 19.252,7.2 7.2,0 0,1 33.016,26.452Z"
android:fillColor="#fff"/>
<path
android:pathData="M33.016,26.452A7.2,7.2 0,1 1,25.807 19.252,7.322 7.322,0 0,1 30.907,21.362 7.047,7.047 0,0 1,33.016 26.452Z"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#ea3829"/>
<path
android:pathData="M25.811,23.216v4.1"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#ea3829"
android:strokeLineCap="round"/>
<path
android:pathData="M25.811,29.66v-0.009"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#ea3829"
android:strokeLineCap="round"/>
</vector>

View File

@@ -212,6 +212,29 @@
</LinearLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_home_nav_up"
android:layout_alignParentBottom="true"
android:layout_margin="15dp"
/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/caregiver_img"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_margin="15dp"
app:backgroundTint="@color/white"
/>
</RelativeLayout>
</LinearLayout>

View File

@@ -67,13 +67,11 @@
android:layout_height="30dp"
android:contentDescription="@string/notification"
app:srcCompat="@drawable/ic_notification"
app:srcCompat="@drawable/ic_pat_home_noti"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/profile"
android:layout_marginHorizontal="15dp"
app:tint="@color/white" />
android:layout_marginHorizontal="15dp" />
</RelativeLayout>
@@ -109,7 +107,7 @@
<com.google.android.material.card.MaterialCardView
android:id="@+id/home_reminder"
android:visibility="gone"
android:visibility="visible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -139,7 +137,6 @@
android:maxLines="2"
android:ellipsize="end"
/>
<RelativeLayout
@@ -192,6 +189,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:contentDescription="@string/close"
android:visibility="gone"
app:srcCompat="@drawable/ic_close_primary"
@@ -200,6 +198,28 @@
/>
<ImageView
android:id="@+id/refresh_btn"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_refresh"
android:contentDescription="@string/refresh"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:visibility="visible"
/>
<ProgressBar
android:id="@+id/refresh_progress"
android:visibility="gone"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:indeterminateTint="@color/color_primary_dark"
android:indeterminate="true"
/>
</RelativeLayout>
</LinearLayout>