diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml index a6ac57b..90593e2 100644 --- a/.idea/deploymentTargetDropDown.xml +++ b/.idea/deploymentTargetDropDown.xml @@ -12,7 +12,7 @@ - + diff --git a/app/src/main/java/com/app/simplitend/apputils/TextUtils.java b/app/src/main/java/com/app/simplitend/apputils/TextUtils.java new file mode 100644 index 0000000..aced243 --- /dev/null +++ b/app/src/main/java/com/app/simplitend/apputils/TextUtils.java @@ -0,0 +1,27 @@ +package com.app.simplitend.apputils; + +import android.text.Editable; +import android.text.TextWatcher; + +public abstract class TextUtils { + + public static final TextWatcher LEADING_SPACE_WATCHER = new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { + + } + + @Override + public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { + + } + + @Override + public void afterTextChanged(Editable editable) { + if (editable.toString().trim().isEmpty()){ + editable.delete(0, editable.length()); + } + } + }; + +} diff --git a/app/src/main/java/com/app/simplitend/caregiverdashboard/activities/deactivateacc/DeActivateAccountActivity.java b/app/src/main/java/com/app/simplitend/caregiverdashboard/activities/deactivateacc/DeActivateAccountActivity.java index 9beb864..adf2db6 100644 --- a/app/src/main/java/com/app/simplitend/caregiverdashboard/activities/deactivateacc/DeActivateAccountActivity.java +++ b/app/src/main/java/com/app/simplitend/caregiverdashboard/activities/deactivateacc/DeActivateAccountActivity.java @@ -8,6 +8,7 @@ import android.content.Intent; import android.os.Bundle; import android.view.MotionEvent; import android.view.View; +import android.widget.RadioButton; import android.widget.Toast; import com.app.simplitend.apputils.AppUtil; @@ -17,6 +18,7 @@ import com.app.simplitend.databinding.ActivityDeactivateAccBinding; import com.app.simplitend.welcome.activities.WelcomeActivity; import com.app.simplitend.welcome.welcomecg.mvvm.CareGiverData; import com.app.simplitend.welcome.welcomepatient.mvvm.models.PatientData; +import com.google.android.material.radiobutton.MaterialRadioButton; public class DeActivateAccountActivity extends AppCompatActivity implements AccountPresenter.AccountReDeActivateCallback { @@ -83,6 +85,7 @@ public class DeActivateAccountActivity extends AppCompatActivity implements Acco String token; if (isPatient){ + if (patientData == null){ Toast.makeText(this, "Couldn't load data", Toast.LENGTH_SHORT).show(); return; @@ -101,6 +104,21 @@ public class DeActivateAccountActivity extends AppCompatActivity implements Acco return; } + int selected_radio_id = binding.reasonRadio.getCheckedRadioButtonId(); + if (selected_radio_id <= 0){ + Toast.makeText(this, "Kindly select a reason", Toast.LENGTH_SHORT).show(); + return; + } + + String reason; + try { + reason = ((MaterialRadioButton) findViewById(selected_radio_id)).getText().toString(); + }catch (Exception e){ + reason = "Other"; + } + + // TODO: 25/10/23 use the reason + progressDialog.setTitle("Please wait...."); progressDialog.setMessage("while we de-activate your account"); progressDialog.setCancelable(false); diff --git a/app/src/main/java/com/app/simplitend/patientprofile/medreminder/AddReminderFragment.java b/app/src/main/java/com/app/simplitend/patientprofile/medreminder/AddReminderFragment.java index c3f38dc..cb13005 100644 --- a/app/src/main/java/com/app/simplitend/patientprofile/medreminder/AddReminderFragment.java +++ b/app/src/main/java/com/app/simplitend/patientprofile/medreminder/AddReminderFragment.java @@ -38,6 +38,7 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.Locale; +import java.util.TimeZone; public class AddReminderFragment extends Fragment implements CompoundButton.OnCheckedChangeListener, ProfileContracts.FreqNMedTypesCallback, @@ -192,6 +193,18 @@ public class AddReminderFragment extends Fragment implements CompoundButton.OnCh reminderResult.time3 = null; } + // Sending time zone + TimeZone timeZone = TimeZone.getDefault(); + // Getting the GMT offset in milliseconds + int gmtOffsetMillis = timeZone.getRawOffset(); + // Converting milliseconds to hours and minutes + int hours = gmtOffsetMillis / 3600000; + int minutes = (gmtOffsetMillis % 3600000) / 60000; + + String gmtStandard = "GMT" + (gmtOffsetMillis >= 0 ? "+" : "") + hours + ":" + String.format(Locale.getDefault(), "%02d", minutes); + Toast.makeText(requireContext(), "" + gmtStandard, Toast.LENGTH_SHORT).show(); + reminderResult.timezone = gmtStandard; + reminderResult.medication_quantity = binding.quantity.getText().toString(); reminderResult.medication_refill_date = binding.getDate.getText().toString(); reminderResult.medication_instruction = binding.instructions.getText().toString().trim(); diff --git a/app/src/main/java/com/app/simplitend/patientprofile/medreminder/mvvm/models/ReminderResult.java b/app/src/main/java/com/app/simplitend/patientprofile/medreminder/mvvm/models/ReminderResult.java index 299f990..0b68ca2 100644 --- a/app/src/main/java/com/app/simplitend/patientprofile/medreminder/mvvm/models/ReminderResult.java +++ b/app/src/main/java/com/app/simplitend/patientprofile/medreminder/mvvm/models/ReminderResult.java @@ -43,6 +43,7 @@ public class ReminderResult implements Serializable { public String reminder_marked; public String is_update; + public String timezone; public ReminderResult(){} diff --git a/app/src/main/java/com/app/simplitend/patientprofile/setuproutine/AddRoutineFragment.java b/app/src/main/java/com/app/simplitend/patientprofile/setuproutine/AddRoutineFragment.java index 1b42dde..e7831b5 100644 --- a/app/src/main/java/com/app/simplitend/patientprofile/setuproutine/AddRoutineFragment.java +++ b/app/src/main/java/com/app/simplitend/patientprofile/setuproutine/AddRoutineFragment.java @@ -5,6 +5,7 @@ import android.app.Activity; import android.app.ProgressDialog; import android.app.TimePickerDialog; import android.os.Bundle; +import android.util.Log; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; @@ -31,6 +32,7 @@ import java.util.Calendar; import java.util.Date; import java.util.Locale; import java.util.Objects; +import java.util.TimeZone; public class AddRoutineFragment extends Fragment implements CompoundButton.OnCheckedChangeListener, ProfileContracts.AddNUpdateRoutineCallback { @@ -224,6 +226,18 @@ public class AddRoutineFragment extends Fragment implements CompoundButton.OnChe routineDetails.routine_start_time = binding.startTime.getHint().toString(); routineDetails.routine_end_time = binding.endTime.getHint().toString(); + // Sending time zone + TimeZone timeZone = TimeZone.getDefault(); + // Getting the GMT offset in milliseconds + int gmtOffsetMillis = timeZone.getRawOffset(); + // Converting milliseconds to hours and minutes + int hours = gmtOffsetMillis / 3600000; + int minutes = (gmtOffsetMillis % 3600000) / 60000; + + String gmtStandard = "GMT" + (gmtOffsetMillis >= 0 ? "+" : "") + hours + ":" + String.format(Locale.getDefault(), "%02d", minutes); + Toast.makeText(requireContext(), "" + gmtStandard, Toast.LENGTH_SHORT).show(); + routineDetails.timezone = gmtStandard; + routineDetails.sun = week_state[0] ? "1" : "0"; routineDetails.mon = week_state[1] ? "1" : "0"; routineDetails.tue = week_state[2] ? "1" : "0"; diff --git a/app/src/main/java/com/app/simplitend/patientprofile/setuproutine/mvvm/RoutineDetails.java b/app/src/main/java/com/app/simplitend/patientprofile/setuproutine/mvvm/RoutineDetails.java index e0f656b..6aa81a5 100644 --- a/app/src/main/java/com/app/simplitend/patientprofile/setuproutine/mvvm/RoutineDetails.java +++ b/app/src/main/java/com/app/simplitend/patientprofile/setuproutine/mvvm/RoutineDetails.java @@ -30,6 +30,7 @@ public class RoutineDetails implements Serializable { public String updated_at; public String routine_marked; + public String timezone; @Override public boolean equals(Object o) { diff --git a/app/src/main/java/com/app/simplitend/welcome/welcomecg/fragments/CgCheckEmailFragment.java b/app/src/main/java/com/app/simplitend/welcome/welcomecg/fragments/CgCheckEmailFragment.java index 58b666f..c525517 100644 --- a/app/src/main/java/com/app/simplitend/welcome/welcomecg/fragments/CgCheckEmailFragment.java +++ b/app/src/main/java/com/app/simplitend/welcome/welcomecg/fragments/CgCheckEmailFragment.java @@ -90,7 +90,7 @@ public class CgCheckEmailFragment extends Fragment implements WelcomeContracts.F if (checkOTPInputs()){ verifyOTP(); }else{ - Toast.makeText(requireContext(), "Enter OTP received on your email.", Toast.LENGTH_SHORT).show(); + Toast.makeText(requireContext(), "Enter PIN received on your email.", Toast.LENGTH_SHORT).show(); } }); diff --git a/app/src/main/java/com/app/simplitend/welcome/welcomecg/fragments/CgRegisterFragment.java b/app/src/main/java/com/app/simplitend/welcome/welcomecg/fragments/CgRegisterFragment.java index 35c71af..c81a2f3 100644 --- a/app/src/main/java/com/app/simplitend/welcome/welcomecg/fragments/CgRegisterFragment.java +++ b/app/src/main/java/com/app/simplitend/welcome/welcomecg/fragments/CgRegisterFragment.java @@ -8,6 +8,7 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.text.InputFilter; +import android.text.Spanned; import android.util.Log; import android.util.Patterns; import android.view.LayoutInflater; @@ -25,6 +26,7 @@ import androidx.lifecycle.ViewModelProvider; import androidx.navigation.NavOptions; import androidx.navigation.Navigation; +import com.app.simplitend.apputils.TextUtils; import com.google.i18n.phonenumbers.NumberParseException; import com.google.i18n.phonenumbers.PhoneNumberUtil; import com.google.i18n.phonenumbers.Phonenumber; @@ -122,6 +124,11 @@ public class CgRegisterFragment extends Fragment implements WelcomeContracts.Reg } }, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH)); datePickerDialog.getDatePicker().setMaxDate(calendar.getTimeInMillis()); + + // max age 120 years + calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + 18 - 122); + datePickerDialog.getDatePicker().setMinDate(calendar.getTimeInMillis()); + datePickerDialog.setTitle("Select a date"); datePickerDialog.setMessage("Note: Click on the date, month or year to edit manually"); @@ -147,6 +154,9 @@ public class CgRegisterFragment extends Fragment implements WelcomeContracts.Reg setFocusManager(); + // not allowing leading spaces + binding.name.addTextChangedListener(TextUtils.LEADING_SPACE_WATCHER); + binding.email.addTextChangedListener(TextUtils.LEADING_SPACE_WATCHER); } private void clickEvents() { diff --git a/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/contacts/AddContactFragment.java b/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/contacts/AddContactFragment.java index 707cad4..ea88c6b 100644 --- a/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/contacts/AddContactFragment.java +++ b/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/contacts/AddContactFragment.java @@ -163,7 +163,7 @@ public class AddContactFragment extends Fragment implements WelcomeContracts.Con // and doctor not yet set AppUtil.showAlert(requireContext(), "This contact is reserved", - "Contact is reserved for your primary doctor, Please add medical information.", + "Last contact is reserved for your primary doctor. Once you complete your medical information, the contact information will be filled in automatically.", getString(R.string.ok), ((dialogInterface, i) -> {}), null, null); return; } diff --git a/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/contacts/mvvm/ContactViewModel.java b/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/contacts/mvvm/ContactViewModel.java index a9a589d..7d3853c 100644 --- a/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/contacts/mvvm/ContactViewModel.java +++ b/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/contacts/mvvm/ContactViewModel.java @@ -181,9 +181,7 @@ public class ContactViewModel extends AndroidViewModel { String title; if (isSosSet && sos_contact_name != null){ - title = "Are you sure you want to remove " + sos_contact_name + " as Sos? & add " + - ((current_name.trim().isEmpty())?"this contact":current_name) + - " as Sos?"; + title = "You are about to change emergency number from " + sos_contact_name + " to this contact. Please confirm"; }else{ title = context.getString(R.string.make_sos); } diff --git a/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/forgotpin/CheckMailFragment.java b/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/forgotpin/CheckMailFragment.java index 04ac463..705097c 100644 --- a/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/forgotpin/CheckMailFragment.java +++ b/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/forgotpin/CheckMailFragment.java @@ -221,7 +221,7 @@ public class CheckMailFragment extends Fragment implements WelcomeContracts.Veri if (checkOTPInputs()){ verifyOTP(); }else { - Toast.makeText(requireContext(), "Enter OTP received on your email.", Toast.LENGTH_SHORT).show(); + Toast.makeText(requireContext(), "Enter PIN received on your email.", Toast.LENGTH_SHORT).show(); } }); diff --git a/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/register/ReActivateFragment.java b/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/register/ReActivateFragment.java index 1cd98c6..4cd5369 100644 --- a/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/register/ReActivateFragment.java +++ b/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/register/ReActivateFragment.java @@ -73,10 +73,12 @@ public class ReActivateFragment extends Fragment implements AccountPresenter.Acc // setting message String message; + String title = null; if (AccountPresenter.ACC_DEACTIVATE_BY_USER == caregiver_status){ // deactivated by cg if (is_caregiver){ message = getString(R.string.re_activate_msg_cg_by_cg); + title = getString(R.string.deactivate_title_cg); binding.reActivateBtn.setVisibility(View.VISIBLE); }else { @@ -96,6 +98,9 @@ public class ReActivateFragment extends Fragment implements AccountPresenter.Acc } binding.message.setText(message); + if (title != null){ + binding.title.setText(title); + } } private void clickEvents() { diff --git a/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/register/RegisterFragment.java b/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/register/RegisterFragment.java index 7133472..7e2f770 100644 --- a/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/register/RegisterFragment.java +++ b/app/src/main/java/com/app/simplitend/welcome/welcomepatient/fragments/register/RegisterFragment.java @@ -5,7 +5,10 @@ import android.app.ProgressDialog; import android.content.Intent; import android.net.Uri; import android.os.Bundle; +import android.text.Editable; import android.text.InputFilter; +import android.text.Spanned; +import android.text.TextWatcher; import android.util.Log; import android.util.Patterns; import android.view.LayoutInflater; @@ -20,6 +23,7 @@ import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; import androidx.navigation.Navigation; +import com.app.simplitend.apputils.TextUtils; import com.google.i18n.phonenumbers.NumberParseException; import com.google.i18n.phonenumbers.PhoneNumberUtil; import com.google.i18n.phonenumbers.Phonenumber; @@ -95,6 +99,10 @@ public class RegisterFragment extends Fragment implements WelcomeContracts.Verif } }, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH)); datePickerDialog.getDatePicker().setMaxDate(calendar.getTimeInMillis()); + + // max age 120 years + calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + 18 - 122); + datePickerDialog.getDatePicker().setMinDate(calendar.getTimeInMillis()); datePickerDialog.setTitle("Select a date"); datePickerDialog.setMessage("Note: Click on the date, month or year to edit manually"); @@ -120,6 +128,9 @@ public class RegisterFragment extends Fragment implements WelcomeContracts.Verif setFocusManager(); + // not allowing leading spaces + binding.name.addTextChangedListener(TextUtils.LEADING_SPACE_WATCHER); + binding.email.addTextChangedListener(TextUtils.LEADING_SPACE_WATCHER); } private void setFocusManager() { diff --git a/app/src/main/res/layout/activity_cg_profile_progress.xml b/app/src/main/res/layout/activity_cg_profile_progress.xml index 9ed2f93..6f8aff3 100644 --- a/app/src/main/res/layout/activity_cg_profile_progress.xml +++ b/app/src/main/res/layout/activity_cg_profile_progress.xml @@ -580,7 +580,7 @@ android:id="@+id/fua" android:layout_width="match_parent" android:layout_height="wrap_content" - android:visibility="visible" + android:visibility="gone" android:orientation="horizontal"> - - - - - - - - - - - + + + + + + + + + + + + + + - /> + android:orientation="vertical"> + android:src="@drawable/arrow_back" /> + android:textColor="@color/black" /> + android:textColor="@color/black" /> + android:fontFamily="@font/nunito_medium" + android:text="@string/name" + android:textAppearance="@style/TextAppearance.Material3.TitleMedium" + android:textColor="@color/black" /> + android:fontFamily="@font/nunito_medium" + android:text="@string/date_of_birth" + android:textAppearance="@style/TextAppearance.Material3.TitleMedium" + android:textColor="@color/black" /> + android:fontFamily="@font/nunito_medium" + android:text="@string/contact_number" + android:textAppearance="@style/TextAppearance.Material3.TitleMedium" + android:textColor="@color/black" /> + android:contentDescription="@string/phone_number" + android:src="@drawable/ic_phone" /> + app:spinner_popup_elevation="14dp" + app:spinner_popup_max_height="200dp" /> + android:layout_marginVertical="10dp" + android:background="@android:color/darker_gray" /> + android:paddingVertical="15dp" + android:textAppearance="@style/TextAppearance.Material3.TitleMedium" + + android:textColor="@color/black" + android:textColorHint="@android:color/darker_gray" /> + android:orientation="horizontal"> + android:textColor="@color/black" /> - - - - - - - - - + + + + + + + + + @@ -249,51 +237,48 @@ android:id="@+id/email" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/edit_text_bg_2" android:layout_marginHorizontal="15dp" android:layout_marginVertical="10dp" + android:autofillHints="emailAddress" - android:hint="@string/enter_email_address" - android:fontFamily="@font/nunito_regular" - android:textColor="@color/black" - android:textColorHint="@android:color/darker_gray" - android:textAppearance="@style/TextAppearance.Material3.TitleMedium" - - android:paddingVertical="15dp" - android:padding="10dp" - + android:background="@drawable/edit_text_bg_2" android:drawableStart="@drawable/ic_email" android:drawablePadding="10dp" + android:fontFamily="@font/nunito_regular" + android:hint="@string/enter_email_address" - android:autofillHints="emailAddress" android:inputType="textEmailAddress" - /> + android:padding="10dp" + + android:paddingVertical="15dp" + android:textAppearance="@style/TextAppearance.Material3.TitleMedium" + + android:textColor="@color/black" + android:textColorHint="@android:color/darker_gray" /> + android:orientation="horizontal"> + android:button="@drawable/remember_me_selector" + android:checked="false" + android:paddingHorizontal="10dp" /> @@ -321,18 +306,17 @@ android:layout_height="wrap_content" android:layout_marginHorizontal="15dp" android:layout_marginVertical="15dp" - android:text="@string/next" - android:textAppearance="@style/TextAppearance.Material3.TitleMedium" - android:textAllCaps="false" - android:fontFamily="@font/nunito_regular" - android:textColor="@color/white_bg" - android:paddingVertical="15dp" - app:backgroundTint="@color/color_primary" - app:cornerRadius="15dp" - android:drawableEnd="@drawable/ic_forward_error" android:drawablePadding="15dp" - /> + android:fontFamily="@font/nunito_regular" + android:paddingVertical="15dp" + android:text="@string/next" + android:textAllCaps="false" + android:textAppearance="@style/TextAppearance.Material3.TitleMedium" + android:textColor="@color/white_bg" + + app:backgroundTint="@color/color_primary" + app:cornerRadius="15dp" /> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 77c401d..2b59de5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -293,7 +293,7 @@ Enter OTP info - Create Geo Fence + Create geofence Unlock with FaceID OR Unlock with Fingerprint or FaceID @@ -352,15 +352,14 @@ Deactivate Account Logout Sad to see you go - Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type + Once your account is deactivated, both your data and the senior profile data will be deleted after 30 days. You will be able to access your profile data if you reactivate your account within 30 days. I don\'t want to deactivate Yes I am ready to deactivate my account Reason for leaving ? - Please select from below the possible reasons + Would you tell us why? Tell us why you are leaving ? - Enter your reason here\.\.\. Do Not Deactivate - Confirm Deactivation + Confirm deactivation and cancel my subscription Yearly -25% OFF $71.4 @@ -396,7 +395,7 @@ Instructions: You are about to change emergency number from this contact to 911. Please confirm Your account has been deactivated - To reactivate your account, please click on the re-activate button below. You will be able to use your account again. + Kindly uninstall the SimpliTend apps from your phone as well as the Senior phone.\n\nYou will be able to reactivate your account within the next 30 days installing the SimpliTend app and log into your account. Your account is disabled/deactivated by admin. To reactivate your account, please contact admin. Your caregiver has deactivated your account. To reactivate account please inform caregiver to activate the account and continue for uninterrupted services. Your account is disabled/deactivated by admin. To reactivate your account, please contact admin. @@ -455,5 +454,16 @@ Your payment was successfully processed You can now link to your loved one\'s smartphone and receive notifications Link to senior phone + Your account has been deactivated and your subscription has been cancelled + We are sorry to see you go + Add a comment... + Too difficult to use the application + Missing feature + Too expensive + Bad customer support + Other + I don\'t have a need for this app anymore + Let\'s get started + abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ \ No newline at end of file