.
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user