.
This commit is contained in:
@@ -3,7 +3,6 @@ package com.ssb.simplitend.caregiverdashboard.activities;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
@@ -111,6 +110,21 @@ public class CaregiverDashActivity extends AppCompatActivity implements
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
menuBinding.cgProfile.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(this, CaregiverProfileActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
menuBinding.contactAdmin.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(this, ContactAdminActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
menuBinding.settings.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(this, CaregiverSettingsActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void watchSubscription(){
|
||||
@@ -121,8 +135,6 @@ public class CaregiverDashActivity extends AppCompatActivity implements
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}else{
|
||||
Toast.makeText(this, "Subscription on.", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.ssb.simplitend.caregiverdashboard.activities;
|
||||
|
||||
import static com.ssb.simplitend.caregiverdashboard.activities.EditProfileInfoActivity.IS_CAREGIVER;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.ssb.simplitend.R;
|
||||
import com.ssb.simplitend.apputils.AppUtil;
|
||||
import com.ssb.simplitend.apputils.CaregiverDataCache;
|
||||
import com.ssb.simplitend.databinding.ActivityCaregiverProfileBinding;
|
||||
import com.ssb.simplitend.welcome.welcomecg.mvvm.CareGiverData;
|
||||
|
||||
public class CaregiverProfileActivity extends AppCompatActivity implements CompoundButton.OnCheckedChangeListener {
|
||||
|
||||
protected ActivityCaregiverProfileBinding binding;
|
||||
|
||||
private CareGiverData careGiverData;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityCaregiverProfileBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
CaregiverDataCache.getCaregiverData(this, (careGiverData1 -> {
|
||||
this.careGiverData = careGiverData1;
|
||||
|
||||
setCareGiverDetails();
|
||||
}), true);
|
||||
|
||||
initViews();
|
||||
|
||||
clickEvents();
|
||||
}
|
||||
|
||||
private void setCareGiverDetails() {
|
||||
if (careGiverData == null) {
|
||||
Toast.makeText(this, "Couldn't load the data.", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (careGiverData.profile_photo != null) {
|
||||
// image
|
||||
Glide.with(this)
|
||||
.load(AppUtil.IMAGE_BASE_URL + careGiverData.profile_photo)
|
||||
.placeholder(android.R.color.darker_gray)
|
||||
.error(R.drawable.ic_contact)
|
||||
.into(binding.image);
|
||||
}
|
||||
|
||||
binding.name.setText(careGiverData.first_name);
|
||||
binding.phoneNumber.setText(careGiverData.phone_number);
|
||||
binding.email.setText(careGiverData.email);
|
||||
binding.dob.setText(careGiverData.date_of_birth);
|
||||
|
||||
int biometric = AppUtil.getWantSecurityFlag(this);
|
||||
|
||||
if (biometric == AppUtil.CG_SECURITY_NEEDED){
|
||||
binding.biometricCheck.setChecked(true);
|
||||
}else {
|
||||
binding.biometricCheck.setChecked(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
binding.biometricCheck.setOnCheckedChangeListener(this);
|
||||
}
|
||||
|
||||
private void clickEvents() {
|
||||
binding.backBtn.setOnClickListener(v -> onBackPressed());
|
||||
|
||||
binding.editBtn.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(this, EditProfileInfoActivity.class);
|
||||
intent.putExtra(IS_CAREGIVER, true);
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
binding.changePwd.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(this, CgChangePwdActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
binding.changePin.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(this, ChangePinActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// biometric check change listener
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
if (checked){
|
||||
AppUtil.setWantSecurityFlag(this, AppUtil.CG_SECURITY_NEEDED);
|
||||
}else{
|
||||
AppUtil.setWantSecurityFlag(this, AppUtil.CG_NO_SECURITY_NEEDED);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.ssb.simplitend.caregiverdashboard.activities;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.ssb.simplitend.R;
|
||||
import com.ssb.simplitend.apputils.AppUtil;
|
||||
import com.ssb.simplitend.caregiverdashboard.activities.deactivateacc.DeActivateAccountActivity;
|
||||
import com.ssb.simplitend.databinding.ActivityCgSettingsBinding;
|
||||
import com.ssb.simplitend.welcome.activities.WelcomeActivity;
|
||||
|
||||
public class CaregiverSettingsActivity extends AppCompatActivity {
|
||||
|
||||
private ActivityCgSettingsBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityCgSettingsBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
initViews();
|
||||
|
||||
clickEvents();
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
|
||||
}
|
||||
|
||||
private void clickEvents() {
|
||||
binding.backBtn.setOnClickListener(v -> onBackPressed());
|
||||
|
||||
binding.logout.setOnClickListener(v -> {
|
||||
AppUtil.showAlert(this,
|
||||
"Are you sure?", "Do you want to sign out?",
|
||||
getString(R.string.no),
|
||||
((dialogInterface, i) -> {}),
|
||||
getString(R.string.yes),
|
||||
((dialogInterface, i) -> {
|
||||
AppUtil.cgSignOut(this);
|
||||
|
||||
Intent intent = new Intent(this, WelcomeActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}));
|
||||
});
|
||||
|
||||
binding.deActivate.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(this, DeActivateAccountActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ssb.simplitend.caregiverdashboard.activities;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import com.ssb.simplitend.R;
|
||||
import com.ssb.simplitend.databinding.CgChangePasswordFragmentBinding;
|
||||
|
||||
public class CgChangePwdActivity extends AppCompatActivity {
|
||||
|
||||
private CgChangePasswordFragmentBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = CgChangePasswordFragmentBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
// viewing old pwd view
|
||||
binding.oldPwdTitle.setVisibility(View.VISIBLE);
|
||||
binding.oldPwdView.setVisibility(View.VISIBLE);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,14 @@
|
||||
package com.ssb.simplitend.caregiverdashboard.activities;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.vectordrawable.graphics.drawable.Animatable2Compat;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.engine.GlideException;
|
||||
import com.bumptech.glide.load.resource.gif.GifDrawable;
|
||||
import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.daimajia.androidanimations.library.Techniques;
|
||||
import com.daimajia.androidanimations.library.YoYo;
|
||||
import com.ssb.simplitend.R;
|
||||
import com.ssb.simplitend.apputils.CaregiverDataCache;
|
||||
import com.ssb.simplitend.cg_geofencing.CgGeoFencingActivity;
|
||||
@@ -73,7 +63,7 @@ public class CgProfileProgressActivity extends AppCompatActivity {
|
||||
});
|
||||
|
||||
binding.profileInfo.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(this, PatientProfileInfoActivity.class);
|
||||
Intent intent = new Intent(this, EditProfileInfoActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ssb.simplitend.caregiverdashboard.activities;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.ssb.simplitend.R;
|
||||
import com.ssb.simplitend.databinding.ChangePinFragmentBinding;
|
||||
|
||||
public class ChangePinActivity extends AppCompatActivity {
|
||||
|
||||
private ChangePinFragmentBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
binding = ChangePinFragmentBinding.inflate(getLayoutInflater());
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(binding.getRoot());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ssb.simplitend.caregiverdashboard.activities;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import com.ssb.simplitend.R;
|
||||
import com.ssb.simplitend.databinding.ActivityContactAdminBinding;
|
||||
|
||||
public class ContactAdminActivity extends AppCompatActivity {
|
||||
|
||||
private ActivityContactAdminBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityContactAdminBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
initViews();
|
||||
|
||||
clickEvents();
|
||||
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
|
||||
smoothEditTextScroll();
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
private void smoothEditTextScroll() {
|
||||
// scrolling edit text
|
||||
|
||||
binding.description.setOnTouchListener((v, event) -> {
|
||||
if (binding.description.hasFocus()) {
|
||||
v.getParent().requestDisallowInterceptTouchEvent(true);
|
||||
if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_SCROLL) {
|
||||
v.getParent().requestDisallowInterceptTouchEvent(false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
binding.query.setOnTouchListener((v, event) -> {
|
||||
if (binding.query.hasFocus()) {
|
||||
v.getParent().requestDisallowInterceptTouchEvent(true);
|
||||
if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_SCROLL) {
|
||||
v.getParent().requestDisallowInterceptTouchEvent(false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void clickEvents() {
|
||||
binding.backBtn.setOnClickListener(v -> onBackPressed());
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,13 @@ package com.ssb.simplitend.caregiverdashboard.activities;
|
||||
|
||||
import android.app.DatePickerDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -19,6 +21,7 @@ import com.ssb.simplitend.R;
|
||||
import com.ssb.simplitend.apputils.AppUtil;
|
||||
import com.ssb.simplitend.apputils.CaregiverDataCache;
|
||||
import com.ssb.simplitend.databinding.ActivityPersonalInfoBinding;
|
||||
import com.ssb.simplitend.welcome.welcomecg.mvvm.CareGiverData;
|
||||
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
|
||||
|
||||
import org.json.JSONArray;
|
||||
@@ -28,16 +31,14 @@ import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.lang.reflect.Array;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
|
||||
public class PatientProfileInfoActivity extends AppCompatActivity {
|
||||
public class EditProfileInfoActivity extends AppCompatActivity {
|
||||
|
||||
private static final String TAG = "PatientProfileInfoActiv";
|
||||
|
||||
@@ -50,21 +51,38 @@ public class PatientProfileInfoActivity extends AppCompatActivity {
|
||||
|
||||
private PatientData patientData;
|
||||
|
||||
private CareGiverData careGiverData;
|
||||
|
||||
private ArrayList<String> countryList;
|
||||
private HashMap<String, ArrayList<String>> country_N_states_map;
|
||||
|
||||
public static final String IS_CAREGIVER = "is_caregiver";
|
||||
|
||||
private boolean isCaregiver;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityPersonalInfoBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
Intent intent = getIntent();
|
||||
if (intent != null){
|
||||
isCaregiver = intent.getBooleanExtra(IS_CAREGIVER, false);
|
||||
}
|
||||
|
||||
if (isCaregiver){
|
||||
// no address for caregiver
|
||||
binding.addressView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
initViews();
|
||||
|
||||
clickEvents();
|
||||
|
||||
CaregiverDataCache.getCaregiverData(this, (careGiverData -> {
|
||||
this.patientData = careGiverData.patientDetails;
|
||||
this.careGiverData = careGiverData;
|
||||
|
||||
setDetails();
|
||||
}), true);
|
||||
@@ -73,34 +91,48 @@ public class PatientProfileInfoActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
private void setDetails() {
|
||||
if (patientData == null) {
|
||||
Toast.makeText(this, "Couldn't load patient data.", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (isCaregiver){
|
||||
// load caregiver data
|
||||
if (careGiverData == null){
|
||||
Toast.makeText(this, "Couldn't load your data.", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
binding.name.setText(patientData.first_name);
|
||||
binding.dob.setText(formatDateToMMddYYYY("yyyy-MM-dd", patientData.date_of_birth));
|
||||
binding.contactNumber.setText(patientData.phone_number);
|
||||
binding.email.setText(patientData.email);
|
||||
binding.name.setText(careGiverData.first_name);
|
||||
binding.dob.setText(formatDateToMMddYYYY("yyyy-MM-dd", careGiverData.date_of_birth));
|
||||
binding.contactNumber.setText(careGiverData.phone_number);
|
||||
binding.email.setText(careGiverData.email);
|
||||
}else{
|
||||
if (patientData == null) {
|
||||
Toast.makeText(this, "Couldn't load patient data.", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
binding.street.setText(patientData.address_line1);
|
||||
binding.town.setText(patientData.city);
|
||||
binding.zipCode.setText(patientData.post_code);
|
||||
// load patient data
|
||||
binding.name.setText(patientData.first_name);
|
||||
binding.dob.setText(formatDateToMMddYYYY("yyyy-MM-dd", patientData.date_of_birth));
|
||||
binding.contactNumber.setText(patientData.phone_number);
|
||||
binding.email.setText(patientData.email);
|
||||
|
||||
String country = patientData.country;
|
||||
String state = patientData.state;
|
||||
if (!countryList.contains(country)){
|
||||
countryList.add(country);
|
||||
ArrayList<String> states = new ArrayList<>();
|
||||
states.add(state);
|
||||
country_N_states_map.put(country, states);
|
||||
}
|
||||
binding.street.setText(patientData.address_line1);
|
||||
binding.town.setText(patientData.city);
|
||||
binding.zipCode.setText(patientData.post_code);
|
||||
|
||||
binding.countrySpinner.selectItemByIndex(countryList.indexOf(country));
|
||||
try {
|
||||
binding.stateSpinner.selectItemByIndex(country_N_states_map.get(country).indexOf(state));
|
||||
} catch (Exception e) {
|
||||
Toast.makeText(this, "Couldn't load state.", Toast.LENGTH_SHORT).show();
|
||||
String country = patientData.country;
|
||||
String state = patientData.state;
|
||||
if (!countryList.contains(country)){
|
||||
countryList.add(country);
|
||||
ArrayList<String> states = new ArrayList<>();
|
||||
states.add(state);
|
||||
country_N_states_map.put(country, states);
|
||||
}
|
||||
|
||||
binding.countrySpinner.selectItemByIndex(countryList.indexOf(country));
|
||||
try {
|
||||
binding.stateSpinner.selectItemByIndex(country_N_states_map.get(country).indexOf(state));
|
||||
} catch (Exception e) {
|
||||
Toast.makeText(this, "Couldn't load state.", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -293,7 +325,7 @@ public class PatientProfileInfoActivity extends AppCompatActivity {
|
||||
public void afterTextChanged(Editable editable) {
|
||||
if (editable.toString().length() == 6){
|
||||
binding.zipCode.clearFocus();
|
||||
AppUtil.closeKeyboard(PatientProfileInfoActivity.this);
|
||||
AppUtil.closeKeyboard(EditProfileInfoActivity.this);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.ssb.simplitend.caregiverdashboard.activities.deactivateacc;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import com.ssb.simplitend.databinding.ActivityDeactivateAccBinding;
|
||||
|
||||
public class DeActivateAccountActivity extends AppCompatActivity {
|
||||
|
||||
protected ActivityDeactivateAccBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityDeactivateAccBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
initViews();
|
||||
|
||||
clickEvents();
|
||||
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
// first showing the confirmation page
|
||||
binding.firstView.setVisibility(View.VISIBLE);
|
||||
binding.secondView.setVisibility(View.GONE);
|
||||
|
||||
smoothEditTextScroll();
|
||||
}
|
||||
|
||||
private void clickEvents() {
|
||||
binding.dont.setOnClickListener(v -> onBackPressed());
|
||||
binding.dont2.setOnClickListener(v -> onBackPressed());
|
||||
|
||||
binding.doit.setOnClickListener(v -> {
|
||||
// now showing the reason page
|
||||
binding.firstView.setVisibility(View.GONE);
|
||||
binding.secondView.setVisibility(View.VISIBLE);
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
private void smoothEditTextScroll() {
|
||||
// scrolling edit text
|
||||
|
||||
binding.reasonInput.setOnTouchListener((v, event) -> {
|
||||
if (binding.reasonInput.hasFocus()) {
|
||||
v.getParent().requestDisallowInterceptTouchEvent(true);
|
||||
if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_SCROLL) {
|
||||
v.getParent().requestDisallowInterceptTouchEvent(false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -15,10 +15,9 @@ import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.ssb.simplitend.apputils.AppUtil;
|
||||
import com.ssb.simplitend.apputils.CaregiverDataCache;
|
||||
import com.ssb.simplitend.caregiverdashboard.activities.PatientProfileInfoActivity;
|
||||
import com.ssb.simplitend.caregiverdashboard.activities.EditProfileInfoActivity;
|
||||
import com.ssb.simplitend.caregiverdashboard.activities.PatientProfileShowerActivity;
|
||||
import com.ssb.simplitend.cg_geofencing.CgGeoFencingActivity;
|
||||
import com.ssb.simplitend.databinding.CaregiverDashFragmentBinding;
|
||||
import com.ssb.simplitend.databinding.MyPatientFragmentBinding;
|
||||
import com.ssb.simplitend.welcome.welcomecg.mvvm.CareGiverData;
|
||||
|
||||
@@ -62,7 +61,7 @@ public class MyPatientFragment extends Fragment {
|
||||
private void clickEvents() {
|
||||
|
||||
binding.peronalInfo.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(requireActivity(), PatientProfileInfoActivity.class);
|
||||
Intent intent = new Intent(requireActivity(), EditProfileInfoActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.ssb.simplitend.R;
|
||||
import com.ssb.simplitend.apputils.AppUtil;
|
||||
@@ -81,11 +80,13 @@ public class CgSubscriptionActivity extends AppCompatActivity
|
||||
return;
|
||||
}
|
||||
|
||||
int position = binding.viewPager.getCurrentItem();
|
||||
if (subscriptionPlans == null || position < 0 || position >= subscriptionPlans.size()) {
|
||||
Toast.makeText(this, "Couldn't load plan.", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
// int position = binding.viewPager.getCurrentItem();
|
||||
// if (subscriptionPlans == null || position < 0 || position >= subscriptionPlans.size()) {
|
||||
// Toast.makeText(this, "Couldn't load plan.", Toast.LENGTH_SHORT).show();
|
||||
// return;
|
||||
// }
|
||||
|
||||
int position = 0;
|
||||
|
||||
progressDialog.setTitle("Please wait...");
|
||||
progressDialog.setMessage("while we take you to the payment gateway.");
|
||||
@@ -131,17 +132,17 @@ public class CgSubscriptionActivity extends AppCompatActivity
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
binding.viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
super.onPageSelected(position);
|
||||
if (subscriptionPlans == null
|
||||
|| position < 0 || position >= subscriptionPlans.size()) return;
|
||||
|
||||
String btn_text = "Make payment $" + subscriptionPlans.get(position).plan_value;
|
||||
binding.makePayment.setText(btn_text);
|
||||
}
|
||||
});
|
||||
// binding.viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||
// @Override
|
||||
// public void onPageSelected(int position) {
|
||||
// super.onPageSelected(position);
|
||||
// if (subscriptionPlans == null
|
||||
// || position < 0 || position >= subscriptionPlans.size()) return;
|
||||
//
|
||||
// String btn_text = "Make payment $" + subscriptionPlans.get(position).plan_value;
|
||||
// binding.makePayment.setText(btn_text);
|
||||
// }
|
||||
// });
|
||||
|
||||
// loading subscription plans
|
||||
progressDialog = new ProgressDialog(this);
|
||||
@@ -246,10 +247,10 @@ public class CgSubscriptionActivity extends AppCompatActivity
|
||||
this.subscriptionPlans = subscriptionPlans;
|
||||
progressDialog.dismiss();
|
||||
|
||||
// loading plans
|
||||
PlanAdapter planAdapter = new PlanAdapter(subscriptionPlans);
|
||||
binding.viewPager.setAdapter(planAdapter);
|
||||
binding.circleIndicator.setViewPager(binding.viewPager);
|
||||
// // loading plans
|
||||
// PlanAdapter planAdapter = new PlanAdapter(subscriptionPlans);
|
||||
// binding.viewPager.setAdapter(planAdapter);
|
||||
// binding.circleIndicator.setViewPager(binding.viewPager);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -132,7 +132,7 @@ public class CgAuthActivity extends AppCompatActivity {
|
||||
private void authenticateBiometrics() {
|
||||
if (biometricManager == null) return;
|
||||
|
||||
int biometric_status = biometricManager.canAuthenticate(BIOMETRIC_STRONG | BiometricManager.Authenticators.BIOMETRIC_WEAK);
|
||||
int biometric_status = biometricManager.canAuthenticate(BIOMETRIC_STRONG);
|
||||
|
||||
if (biometric_status == BiometricManager.BIOMETRIC_SUCCESS) {
|
||||
// go ahead and do it.
|
||||
|
||||
Reference in New Issue
Block a user