This commit is contained in:
2023-08-01 21:20:23 +05:30
parent 7e411fd994
commit 01d6dcd35f
71 changed files with 1571 additions and 399 deletions

View File

@@ -2,12 +2,10 @@ package com.ssb.simplitend.patientprofile;
import com.ssb.simplitend.patientprofile.medicalinfo.mvvm.MedicationInfo;
import com.ssb.simplitend.patientprofile.medreminder.mvvm.models.FreqNMedTypeResult;
import com.ssb.simplitend.patientprofile.medreminder.mvvm.models.Reminder;
import com.ssb.simplitend.patientprofile.medreminder.mvvm.models.ReminderResult;
import com.ssb.simplitend.patientprofile.setuproutine.mvvm.RoutineDetails;
import com.ssb.simplitend.welcome.mvvm.models.CallResponse;
import com.ssb.simplitend.welcome.mvvm.models.PatientData;
import com.ssb.simplitend.welcome.mvvm.models.PatientResult;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
import java.util.List;
import java.util.Map;

View File

@@ -4,7 +4,7 @@ import com.ssb.simplitend.patientprofile.medicalinfo.mvvm.MedicationInfo;
import com.ssb.simplitend.patientprofile.medreminder.mvvm.models.FreqNMedTypeResult;
import com.ssb.simplitend.patientprofile.medreminder.mvvm.models.ReminderResult;
import com.ssb.simplitend.patientprofile.setuproutine.mvvm.RoutineDetails;
import com.ssb.simplitend.welcome.mvvm.models.PatientData;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
import java.util.List;

View File

@@ -1,7 +1,6 @@
package com.ssb.simplitend.patientprofile;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@@ -16,10 +15,9 @@ import androidx.navigation.Navigation;
import com.ssb.simplitend.R;
import com.ssb.simplitend.apputils.AppUtil;
import com.ssb.simplitend.apputils.RetrofitHelper;
import com.ssb.simplitend.patient_dashboard.DashBoardActivity;
import com.ssb.simplitend.databinding.ProfileProgressFragmentBinding;
import com.ssb.simplitend.welcome.mvvm.models.CallResponse;
import com.ssb.simplitend.welcome.mvvm.models.PatientData;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
import retrofit2.Call;
import retrofit2.Callback;

View File

@@ -2,6 +2,7 @@ package com.ssb.simplitend.patientprofile.medicalinfo;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.text.InputFilter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -13,6 +14,8 @@ import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.navigation.Navigation;
import com.google.i18n.phonenumbers.PhoneNumberUtil;
import com.google.i18n.phonenumbers.Phonenumber;
import com.ssb.simplitend.R;
import com.ssb.simplitend.apputils.AppUtil;
import com.ssb.simplitend.apputils.ProfileProgress;
@@ -21,6 +24,7 @@ import com.ssb.simplitend.patientprofile.ProfileContracts;
import com.ssb.simplitend.patientprofile.medicalinfo.mvvm.MedicalInfoViewModel;
import com.ssb.simplitend.patientprofile.medicalinfo.mvvm.MedicationInfo;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@@ -39,6 +43,7 @@ public class AddMedicalInfoFragment extends Fragment implements
private MedicationInfo medicalInfo;
public static final String MEDICAL_INFO_KEY = "medical_info";
private ArrayList<String> countryCodeList;
public AddMedicalInfoFragment(){
// required empty const.
@@ -61,6 +66,72 @@ public class AddMedicalInfoFragment extends Fragment implements
private void initViews() {
progressDialog = new ProgressDialog(requireContext());
// populating country code list
countryCodeList = medicalInfoViewModel.loadCountryCodeDropDown(requireContext());
binding.countryCodes.setLifecycleOwner(this);
binding.countryCodes.setItems(countryCodeList);
if (!countryCodeList.contains("+1")){
countryCodeList.add("+1");
}
binding.countryCodes.selectItemByIndex(countryCodeList.indexOf("+1"));
binding.countryCodes.setDismissWhenNotifiedItemSelected(true);
binding.countryCodes.setIsFocusable(true);
// phone number formatting
// to deal with input pasting in the edit text
InputFilter phoneFilter = (charSequence, i, i1, spanned, i2, i3) -> {
String phone_number_str = charSequence.toString();
String country_code = null;
if (binding.countryCodes.getSelectedIndex() != -1){
country_code = countryCodeList.get(binding.countryCodes.getSelectedIndex());
}
try {
PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil.getInstance();
Phonenumber.PhoneNumber phoneNumber = phoneNumberUtil.parse(charSequence, "US");
phone_number_str = String.valueOf(phoneNumber.getNationalNumber());
country_code = "+" + phoneNumber.getCountryCode();
} catch (Exception e) {
// nothing
}
if (country_code != null && !countryCodeList.contains(country_code)){
countryCodeList.add(country_code);
}
if (country_code != null){
binding.countryCodes.selectItemByIndex(countryCodeList.indexOf(country_code));
}
if (phone_number_str.length() > 10){
// pasted number length is greater than 10
return phone_number_str.substring(0, 10);
}
String total_phone_number = binding.phoneNumber.getText().toString() + phone_number_str;
if (total_phone_number.length() > 10){
// max length should be 10
return "";
}else{
return phone_number_str;
}
};
binding.phoneNumber.setFilters(new InputFilter[]{phoneFilter});
// arguments
Bundle bundle = getArguments();
if (bundle != null && bundle.getSerializable(MEDICAL_INFO_KEY) != null){
@@ -75,7 +146,9 @@ public class AddMedicalInfoFragment extends Fragment implements
binding.diagnosis.setText(medicalInfo.diagnosis);
binding.primaryDoc.setText(medicalInfo.primary_care_doctor);
binding.docContact.setText(medicalInfo.doctor_phone_number);
binding.phoneNumber.setText(medicalInfo.doctor_phone_number);
binding.hospitalPref.setText(medicalInfo.hospital_preference);
binding.allergies.setText(medicalInfo.allergies);
binding.dietRestrict.setText(medicalInfo.diet_restriction);
@@ -124,7 +197,18 @@ public class AddMedicalInfoFragment extends Fragment implements
MediaType.parse("text/plain"));
body.put("primary_care_doctor", primary_doc_body);
RequestBody doc_contact_body = RequestBody.create(binding.docContact.getText().toString().trim(),
String phoneNumber = "";
if (binding.countryCodes.getSelectedIndex() == -1){
phoneNumber += "+1";
}else{
phoneNumber += countryCodeList.get(binding.countryCodes.getSelectedIndex());
}
phoneNumber += " ";
phoneNumber += binding.phoneNumber.getText().toString();
RequestBody doc_contact_body = RequestBody.create(phoneNumber,
MediaType.parse("text/plain"));
body.put("doctor_phone_number", doc_contact_body);
@@ -180,10 +264,10 @@ public class AddMedicalInfoFragment extends Fragment implements
binding.primaryDoc.setError("Required");
}
if (binding.docContact.getText().toString().trim().isEmpty()
|| binding.docContact.getText().toString().trim().length() < 10){
if (binding.phoneNumber.getText().toString().trim().isEmpty()
|| binding.phoneNumber.getText().toString().trim().length() < 10){
allOkay = false;
binding.docContact.setError("Invalid");
binding.phoneNumber.setError("Invalid");
}
if (binding.hospitalPref.getText().toString().trim().isEmpty()){
@@ -201,6 +285,11 @@ public class AddMedicalInfoFragment extends Fragment implements
binding.dietRestrict.setError("Required");
}
if (allOkay && binding.countryCodes.getSelectedIndex() == -1){
allOkay = false;
Toast.makeText(requireContext(), "Select a country code", Toast.LENGTH_SHORT).show();
}
return allOkay;
}

View File

@@ -1,16 +1,30 @@
package com.ssb.simplitend.patientprofile.medicalinfo.mvvm;
import android.content.Context;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModel;
import com.ssb.simplitend.R;
import com.ssb.simplitend.patientprofile.ProfileContracts;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Map;
import okhttp3.RequestBody;
public class MedicalInfoViewModel extends ViewModel {
private static final String TAG = "MedicalInfoViewModel";
private final MedicalIntoRepository medicalIntoRepository;
public MedicalInfoViewModel(){
@@ -30,4 +44,60 @@ public class MedicalInfoViewModel extends ViewModel {
medicalIntoRepository.getMedicalInfo(patient_id, token, medicationInfoCallback);
}
public ArrayList<String> loadCountryCodeDropDown(Context context) {
ArrayList<String> countryCodeList = new ArrayList<>();
try {
String countryCodeStr = readCountryCodes(context);
JSONArray jsonArray = new JSONArray(countryCodeStr);
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject code = jsonArray.getJSONObject(i);
countryCodeList.add(code.getString("dial_code"));
}
} catch (Exception e) {
// if cannot load all country codes showing only india's dial code
countryCodeList.add("+91");
countryCodeList.add("+1");
Log.e(TAG, "loadCountryCodeDropDown: ", e);
}
return countryCodeList;
}
public String readCountryCodes(Context context) throws IOException {
StringBuilder returnString = new StringBuilder();
InputStream fIn = context.getResources().openRawResource(R.raw.country_code);
InputStreamReader isr = new InputStreamReader(fIn);
BufferedReader input = new BufferedReader(isr);
String line = "";
while ((line = input.readLine()) != null) {
returnString.append(line);
}
try {
isr.close();
if (fIn != null) fIn.close();
input.close();
} catch (Exception e) {
Log.e(TAG, "readCountryCodes: ", e);
}
return returnString.toString();
}
}

View File

@@ -7,7 +7,7 @@ import androidx.annotation.NonNull;
import com.ssb.simplitend.apputils.RetrofitHelper;
import com.ssb.simplitend.patientprofile.PatientProfileAPIService;
import com.ssb.simplitend.patientprofile.ProfileContracts;
import com.ssb.simplitend.welcome.mvvm.models.CallResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
import java.util.Map;

View File

@@ -11,6 +11,7 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
@@ -92,7 +93,19 @@ public class AddReminderFragment extends Fragment implements CompoundButton.OnCh
binding.getTime.setOnClickListener(v -> {
binding.getTime.setError(null);
AppUtil.closeKeyboard(requireActivity());
getTime();
getTime(binding.getTime);
});
binding.getTime2.setOnClickListener(v -> {
binding.getTime.setError(null);
AppUtil.closeKeyboard(requireActivity());
getTime(binding.getTime2);
});
binding.getTime3.setOnClickListener(v -> {
binding.getTime.setError(null);
AppUtil.closeKeyboard(requireActivity());
getTime(binding.getTime3);
});
binding.getDate.setOnClickListener(v -> {
@@ -154,6 +167,18 @@ public class AddReminderFragment extends Fragment implements CompoundButton.OnCh
// and saving the formatted time as text i.e. hh:mm a
reminderResult.time1 = binding.getTime.getHint().toString();
if (binding.getTime2.getVisibility() == View.VISIBLE){
reminderResult.time2 = binding.getTime2.getHint().toString();
}else{
reminderResult.time2 = null;
}
if (binding.getTime3.getVisibility() == View.VISIBLE){
reminderResult.time3 = binding.getTime3.getHint().toString();
}else{
reminderResult.time3 = null;
}
reminderResult.medication_quantity = binding.quantity.getText().toString();
reminderResult.medication_refill_date = binding.getDate.getText().toString();
reminderResult.medication_instruction = binding.instructions.getText().toString().trim();
@@ -217,6 +242,23 @@ public class AddReminderFragment extends Fragment implements CompoundButton.OnCh
binding.frequencySpinner.setOnSpinnerItemSelectedListener((OnSpinnerItemSelectedListener<String>) (i, s, i1, item) -> {
AppUtil.closeKeyboard(requireActivity());
binding.frequencySpinner.setError(null);
if (item != null){
if (item.contains("1")){
binding.getTime.setVisibility(View.VISIBLE);
binding.getTime2.setVisibility(View.GONE);
binding.getTime3.setVisibility(View.GONE);
}else if (item.contains("2")){
binding.getTime.setVisibility(View.VISIBLE);
binding.getTime2.setVisibility(View.VISIBLE);
binding.getTime3.setVisibility(View.GONE);
}else if (item.contains("3")){
binding.getTime.setVisibility(View.VISIBLE);
binding.getTime2.setVisibility(View.VISIBLE);
binding.getTime3.setVisibility(View.VISIBLE);
}
}
});
binding.medicationsSpinner.setOnSpinnerItemSelectedListener((OnSpinnerItemSelectedListener<String>) (i, s, i1, item) -> {
@@ -261,6 +303,18 @@ public class AddReminderFragment extends Fragment implements CompoundButton.OnCh
binding.getTime.setError("Required");
}
if (binding.getTime2.getVisibility() == View.VISIBLE &&
binding.getTime2.getText().toString().trim().isEmpty()) {
allOkay = false;
binding.getTime2.setError("Required");
}
if (binding.getTime3.getVisibility() == View.VISIBLE &&
binding.getTime3.getText().toString().trim().isEmpty()) {
allOkay = false;
binding.getTime3.setError("Required");
}
if (binding.quantity.getText().toString().trim().isEmpty()) {
allOkay = false;
binding.quantity.setError("Required");
@@ -305,18 +359,50 @@ public class AddReminderFragment extends Fragment implements CompoundButton.OnCh
SimpleDateFormat input_sdf = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
SimpleDateFormat output_sdf = new SimpleDateFormat("hh:mm a", Locale.getDefault());
String refill_time;
String refill_time_1, refill_time_2 = null, refill_time_3 = null;
try {
Date date = input_sdf.parse(reminder.time1);
refill_time = output_sdf.format(date);
if (date == null) throw new Exception();
refill_time_1 = output_sdf.format(date);
if (reminder.time2 != null){
binding.getTime2.setVisibility(View.VISIBLE);
Date date2 = input_sdf.parse(reminder.time2);
if (date2 == null) throw new Exception();
refill_time_2 = output_sdf.format(date2);
}else{
binding.getTime2.setVisibility(View.GONE);
}
if (reminder.time3 != null){
binding.getTime3.setVisibility(View.VISIBLE);
Date date3 = input_sdf.parse(reminder.time3);
if (date3 == null) throw new Exception();
refill_time_3 = output_sdf.format(date3);
}else{
binding.getTime3.setVisibility(View.GONE);
}
} catch (Exception e) {
refill_time = reminder.time1;
refill_time_1 = reminder.time1;
refill_time_2 = reminder.time2;
refill_time_3 = reminder.time3;
}
binding.getTime.setText(refill_time);
binding.getTime.setText(refill_time_1);
binding.getTime.setHint(reminder.time1);
if (reminder.time2 != null){
binding.getTime2.setText(refill_time_2);
binding.getTime2.setHint(reminder.time2);
}
if (reminder.time3 != null){
binding.getTime3.setText(refill_time_3);
binding.getTime3.setHint(reminder.time3);
}
for (int i = 0; i < frequencyList.size(); i++) {
if (String.valueOf(frequencyList.get(i).id).equals(reminder.medication_frequency_xid)) {
binding.frequencySpinner.selectItemByIndex(i);
@@ -515,7 +601,8 @@ public class AddReminderFragment extends Fragment implements CompoundButton.OnCh
}
// shows time picker to pick time and set to textview
private void getTime() {
private void getTime(TextView timeText) {
timeText.setError(null);
Calendar calendar = Calendar.getInstance(Locale.getDefault());
@@ -530,8 +617,8 @@ public class AddReminderFragment extends Fragment implements CompoundButton.OnCh
SimpleDateFormat sdf2 = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
String selected_time = sdf.format(cal.getTime());
binding.getTime.setText(selected_time);
binding.getTime.setHint(sdf2.format(cal.getTime()));
timeText.setText(selected_time);
timeText.setHint(sdf2.format(cal.getTime()));
}, calendar.getTime().getHours(), calendar.getTime().getMinutes(), false);
@@ -562,6 +649,9 @@ public class AddReminderFragment extends Fragment implements CompoundButton.OnCh
}
binding.frequencySpinner.setItems(frequencies);
// default selection to one
if (frequencies.size() > 1) binding.frequencySpinner.selectItemByIndex(0);
ArrayList<String> medicationTypes = new ArrayList<>();
for (MedicationType type : medicationTypeList) {
medicationTypes.add(type.title);

View File

@@ -50,6 +50,8 @@ ReminderAdapter.ReminderCheckClickListener{
private ProgressDialog progressDialog;
private ArrayList<ReminderResult> remindersList;
public ReminderFragment(){
// required empty const.
}
@@ -132,7 +134,8 @@ ReminderAdapter.ReminderCheckClickListener{
progressDialog = new ProgressDialog(requireContext());
binding.remindersRv.setLayoutManager(new LinearLayoutManager(requireContext()));
reminderAdapter = new ReminderAdapter();
remindersList = new ArrayList<>();
reminderAdapter = new ReminderAdapter(remindersList);
reminderAdapter.setCheckClickListener(this);
binding.remindersRv.setAdapter(reminderAdapter);
@@ -306,7 +309,7 @@ ReminderAdapter.ReminderCheckClickListener{
binding.remindersRv.setVisibility(View.VISIBLE);
binding.noData.setVisibility(View.GONE);
reminderAdapter.submitList(reminderResultList);
reminderAdapter.submitLIst(reminderResultList);
}else{
binding.remindersRv.setVisibility(View.GONE);
@@ -361,7 +364,7 @@ ReminderAdapter.ReminderCheckClickListener{
getString(R.string.yes), getString(R.string.no),
v -> {
// yes button clicked
int patientReminderId = reminderAdapter.getCurrentList().get(position).id;
int patientReminderId = reminderAdapter.getReminderResultList().get(position).id;
String token = "Bearer " + AppUtil.getUserToken(requireContext());
progressDialog.setTitle("Please wait...");
@@ -382,7 +385,7 @@ ReminderAdapter.ReminderCheckClickListener{
}else if (viewID == R.id.reminder_edit){
Bundle bundle = new Bundle();
bundle.putSerializable(AddReminderFragment.REMINDER_KEY, reminderAdapter.getCurrentList().get(position));
bundle.putSerializable(AddReminderFragment.REMINDER_KEY, reminderAdapter.getReminderResultList().get(position));
Navigation.findNavController(binding.getRoot())
.navigate(R.id.action_reminderFragment_to_addReminderFragment, bundle);

View File

@@ -6,8 +6,6 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListAdapter;
import androidx.recyclerview.widget.RecyclerView;
import com.ssb.simplitend.R;
@@ -15,40 +13,38 @@ import com.ssb.simplitend.databinding.ReminderViewholderBinding;
import com.ssb.simplitend.patientprofile.medreminder.mvvm.models.ReminderResult;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;
public class ReminderAdapter extends ListAdapter<ReminderResult, ReminderAdapter.ReminderViewHolder> {
private static final DiffUtil.ItemCallback<ReminderResult> DIFF_CALLBACK = new DiffUtil.ItemCallback<ReminderResult>() {
@Override
public boolean areItemsTheSame(@NonNull ReminderResult oldItem, @NonNull ReminderResult newItem) {
return false;
}
@Override
public boolean areContentsTheSame(@NonNull ReminderResult oldItem, @NonNull ReminderResult newItem) {
return false;
}
};
public class ReminderAdapter extends RecyclerView.Adapter<ReminderAdapter.ReminderViewHolder> {
private ReminderCheckClickListener checkClickListener;
// static thing for selection status
public final boolean[] selection_state;
private volatile Date selected_date;
public ReminderAdapter(){
super(DIFF_CALLBACK);
this.selection_state = new boolean[2];
private List<ReminderResult> reminderResultList;
public ReminderAdapter(ArrayList<ReminderResult> reminderResultList){
this.reminderResultList = reminderResultList;
}
public void setCheckClickListener(ReminderCheckClickListener checkClickListener) {
this.checkClickListener = checkClickListener;
}
public void submitLIst(List<ReminderResult> reminderResultList){
this.reminderResultList = null;
this.reminderResultList = reminderResultList;
notifyDataSetChanged();
}
public List<ReminderResult> getReminderResultList() {
return reminderResultList;
}
public void setSelected_date(Date selected_date) {
this.selected_date = selected_date;
}
@@ -61,29 +57,31 @@ public class ReminderAdapter extends ListAdapter<ReminderResult, ReminderAdapter
@Override
public ReminderViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
ReminderViewholderBinding binding = ReminderViewholderBinding.inflate(LayoutInflater.from(parent.getContext()));
return new ReminderViewHolder(binding, selection_state);
return new ReminderViewHolder(binding);
}
@Override
public void onBindViewHolder(@NonNull ReminderViewHolder holder, int position) {
holder.setReminder(getItem(position), position);
holder.setReminder(reminderResultList.get(position), position);
holder.binding.done.setOnClickListener(v -> {
if (checkClickListener != null) checkClickListener.onCheck(getItem(position), position);
if (checkClickListener != null) checkClickListener.onCheck(reminderResultList.get(position), position);
});
}
@Override
public int getItemCount() {
return reminderResultList.size();
}
public static class ReminderViewHolder extends RecyclerView.ViewHolder{
public ReminderViewholderBinding binding;
private final boolean[] selection_state;
public ReminderViewHolder(ReminderViewholderBinding binding, boolean[] selection_state){
public ReminderViewHolder(ReminderViewholderBinding binding){
super(binding.getRoot());
this.binding = binding;
this.selection_state = selection_state;
}
public void setReminder(ReminderResult reminder, int position){
@@ -161,7 +159,16 @@ public class ReminderAdapter extends ListAdapter<ReminderResult, ReminderAdapter
} catch (Exception e) {
Toast.makeText(itemView.getContext(), "Couldn't mark it done.", Toast.LENGTH_SHORT).show();
// item selected. un-selecting now
binding.sideBar.setBackgroundTintList(null);
binding.card.setCardBackgroundColor(AppCompatResources.getColorStateList(itemView.getContext(), R.color.white_bg));
binding.done.setImageResource(R.drawable.ic_done_accent);
}
}else{
// item selected. un-selecting now
binding.sideBar.setBackgroundTintList(null);
binding.card.setCardBackgroundColor(AppCompatResources.getColorStateList(itemView.getContext(), R.color.white_bg));
binding.done.setImageResource(R.drawable.ic_done_accent);
}
}

View File

@@ -7,7 +7,7 @@ import com.ssb.simplitend.patientprofile.PatientProfileAPIService;
import com.ssb.simplitend.patientprofile.ProfileContracts;
import com.ssb.simplitend.patientprofile.medreminder.mvvm.models.FreqNMedTypeResult;
import com.ssb.simplitend.patientprofile.medreminder.mvvm.models.ReminderResult;
import com.ssb.simplitend.welcome.mvvm.models.CallResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
import java.util.List;

View File

@@ -174,7 +174,10 @@ public class RoutineAdapter extends ListAdapter<RoutineDetails, RoutineAdapter.R
} catch (Exception e) {
Log.e(TAG, "setData: ", e);
Toast.makeText(itemView.getContext(), "Couldn't mark it done.", Toast.LENGTH_SHORT).show();
binding.check.setImageResource(R.drawable.ic_un_check);
}
}else{
binding.check.setImageResource(R.drawable.ic_un_check);
}
}

View File

@@ -5,18 +5,13 @@ import androidx.annotation.NonNull;
import com.ssb.simplitend.apputils.RetrofitHelper;
import com.ssb.simplitend.patientprofile.PatientProfileAPIService;
import com.ssb.simplitend.patientprofile.ProfileContracts;
import com.ssb.simplitend.welcome.mvvm.models.CallResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
import java.util.List;
import java.util.Map;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.http.Body;
import retrofit2.http.Header;
import retrofit2.http.Path;
public class RoutinesRepository {

View File

@@ -0,0 +1,36 @@
package com.ssb.simplitend.welcome.welcomecg;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Lifecycle;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import com.ssb.simplitend.welcome.welcomecg.fragments.onboardfragemts.OnBoardOneFragment;
import com.ssb.simplitend.welcome.welcomecg.fragments.onboardfragemts.OnBoardThreeFragment;
import com.ssb.simplitend.welcome.welcomecg.fragments.onboardfragemts.OnBoardTwoFragment;
public class CgOnBoardAdapter extends FragmentStateAdapter {
public CgOnBoardAdapter(@NonNull FragmentManager fragmentManager, @NonNull Lifecycle lifecycle) {
super(fragmentManager, lifecycle);
}
@NonNull
@Override
public Fragment createFragment(int position) {
switch (position){
case 2:
return new OnBoardThreeFragment();
case 1:
return new OnBoardTwoFragment();
default:
return new OnBoardOneFragment();
}
}
@Override
public int getItemCount() {
return 3;
}
}

View File

@@ -0,0 +1,34 @@
package com.ssb.simplitend.welcome.welcomecg.fragments;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.navigation.Navigation;
import com.ssb.simplitend.R;
import com.ssb.simplitend.databinding.CgHowToSetUpFragmentBinding;
public class CgHowToSetUpFragment extends Fragment {
// view binding
protected CgHowToSetUpFragmentBinding binding;
public CgHowToSetUpFragment(){
// required empty const.
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
binding = CgHowToSetUpFragmentBinding.inflate(inflater, container, false);
binding.nextBtn.setOnClickListener(v -> Navigation.findNavController(v).navigate(R.id.action_howToSetUpFragment_to_registerFragment));
return binding.getRoot();
}
}

View File

@@ -0,0 +1,102 @@
package com.ssb.simplitend.welcome.welcomecg.fragments;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.navigation.Navigation;
import androidx.viewpager2.widget.ViewPager2;
import com.ssb.simplitend.R;
import com.ssb.simplitend.databinding.CgOnboardFragmentBinding;
import com.ssb.simplitend.welcome.welcomecg.CgOnBoardAdapter;
public class CgOnBoardFragment extends Fragment {
protected CgOnboardFragmentBinding binding;
public CgOnBoardFragment(){
// required
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
binding = CgOnboardFragmentBinding.inflate(inflater, container, false);
initViews();
clickEvents();
return binding.getRoot();
}
private void clickEvents() {
binding.nextBtn.setOnClickListener(v -> {
int current_item = binding.viewPager.getCurrentItem();
if (current_item >= 0 && current_item < 2){
binding.viewPager.setCurrentItem(current_item + 1, true);
}
});
binding.getsStarted.setOnClickListener(v -> {
Navigation.findNavController(v).navigate(R.id.action_cgOnBoardFragment_to_cgHowToSetUpFragment);
});
}
private void initViews() {
// initiating view pager
CgOnBoardAdapter adapter = new CgOnBoardAdapter(getChildFragmentManager(), getLifecycle());
binding.viewPager.setAdapter(adapter);
binding.indicators.setViewPager(binding.viewPager);
binding.viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
@Override
public void onPageSelected(int position) {
super.onPageSelected(position);
if (position == 2){
binding.getsStarted.setVisibility(View.VISIBLE);
binding.nextBtn.setVisibility(View.GONE);
binding.skip.setVisibility(View.GONE);
}else {
binding.getsStarted.setVisibility(View.GONE);
binding.nextBtn.setVisibility(View.VISIBLE);
binding.skip.setVisibility(View.VISIBLE);
}
String title, subtitle;
switch (position){
case 2:
title = getString(R.string.setup_a_geofence_to_protect_your_loved_one);
subtitle = getString(R.string.be_notified_if_your_loved_one_ventures_too_far_from_home_or_a_designated_safe_area);
break;
case 1:
title = getString(R.string.check_your_loved_one_s_medication_schedule);
subtitle = getString(R.string.application_will_notify_you_when_it_is_time_for_your_loved_one_to_take_his_her_medication);
break;
default:
title = getString(R.string.reinventing_connected_ncaregiving);
subtitle = getString(R.string.you_are_always_connected_and_will_be_notified_when_your_loved_ones_need_you);
break;
}
binding.title.setText(title);
binding.subTitle.setText(subtitle);
}
});
}
}

View File

@@ -0,0 +1,30 @@
package com.ssb.simplitend.welcome.welcomecg.fragments.onboardfragemts;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.ssb.simplitend.R;
import com.ssb.simplitend.databinding.CgOnboardViewHolderBinding;
public class OnBoardOneFragment extends Fragment {
public OnBoardOneFragment(){
// required
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
CgOnboardViewHolderBinding binding = CgOnboardViewHolderBinding.inflate(inflater, container, false);
binding.imageView.setImageResource(R.drawable.ic_cg_onboard_one);
return binding.getRoot();
}
}

View File

@@ -0,0 +1,30 @@
package com.ssb.simplitend.welcome.welcomecg.fragments.onboardfragemts;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.ssb.simplitend.R;
import com.ssb.simplitend.databinding.CgOnboardViewHolderBinding;
public class OnBoardThreeFragment extends Fragment {
public OnBoardThreeFragment(){
// required
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
CgOnboardViewHolderBinding binding = CgOnboardViewHolderBinding.inflate(inflater, container, false);
binding.imageView.setImageResource(R.drawable.ic_cg_onboard_three);
return binding.getRoot();
}
}

View File

@@ -0,0 +1,30 @@
package com.ssb.simplitend.welcome.welcomecg.fragments.onboardfragemts;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.ssb.simplitend.R;
import com.ssb.simplitend.databinding.CgOnboardViewHolderBinding;
public class OnBoardTwoFragment extends Fragment {
public OnBoardTwoFragment(){
// required
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
CgOnboardViewHolderBinding binding = CgOnboardViewHolderBinding.inflate(inflater, container, false);
binding.imageView.setImageResource(R.drawable.ic_cg_onboard_two);
return binding.getRoot();
}
}

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments;
package com.ssb.simplitend.welcome.welcomepatient.fragments;
import android.os.Bundle;
import android.view.LayoutInflater;
@@ -47,7 +47,10 @@ public class ChooseRoleFragment extends Fragment {
Navigation.findNavController(v).navigate(R.id.action_chooseRoleFragment_to_signInSignUpFragment);
});
binding.caregiverRole.setOnClickListener(v -> makeRoleSelection(CAREGIVER));
binding.caregiverRole.setOnClickListener(v -> {
makeRoleSelection(CAREGIVER);
Navigation.findNavController(v).navigate(R.id.action_chooseRoleFragment_to_cgOnBoardFragment);
});
}

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments;
package com.ssb.simplitend.welcome.welcomepatient.fragments;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
@@ -6,9 +6,9 @@ import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Lifecycle;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import com.ssb.simplitend.welcome.fragments.onboardfragments.OnBoardOne;
import com.ssb.simplitend.welcome.fragments.onboardfragments.OnBoardThree;
import com.ssb.simplitend.welcome.fragments.onboardfragments.OnBoardTwo;
import com.ssb.simplitend.welcome.welcomepatient.fragments.onboardfragments.OnBoardOne;
import com.ssb.simplitend.welcome.welcomepatient.fragments.onboardfragments.OnBoardThree;
import com.ssb.simplitend.welcome.welcomepatient.fragments.onboardfragments.OnBoardTwo;
public class OnBoardPagerAdapter extends FragmentStateAdapter {

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments;
package com.ssb.simplitend.welcome.welcomepatient.fragments;
import android.app.ProgressDialog;
import android.content.Intent;
@@ -22,9 +22,9 @@ import com.ssb.simplitend.apputils.AppUtil;
import com.ssb.simplitend.apputils.EditTextErrorRemover;
import com.ssb.simplitend.patient_dashboard.DashBoardActivity;
import com.ssb.simplitend.databinding.SignInFragmentBinding;
import com.ssb.simplitend.welcome.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.mvvm.WelcomeViewModel;
import com.ssb.simplitend.welcome.mvvm.models.PatientResult;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeViewModel;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientResult;
import java.util.HashMap;
import java.util.Map;

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments;
package com.ssb.simplitend.welcome.welcomepatient.fragments;
import android.os.Bundle;
import android.view.LayoutInflater;

View File

@@ -1,11 +1,9 @@
package com.ssb.simplitend.welcome.fragments;
package com.ssb.simplitend.welcome.welcomepatient.fragments;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -15,7 +13,7 @@ import androidx.navigation.Navigation;
import com.ssb.simplitend.R;
import com.ssb.simplitend.databinding.WelcomeFragmentBinding;
import com.ssb.simplitend.welcome.mvvm.WelcomeViewModel;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeViewModel;
public class WelcomeFragment extends Fragment {

View File

@@ -1,7 +1,7 @@
package com.ssb.simplitend.welcome.fragments.contacts;
package com.ssb.simplitend.welcome.welcomepatient.fragments.contacts;
import static com.ssb.simplitend.welcome.fragments.contacts.ContactInfoFragment.CONTACT_DATA_KEY;
import static com.ssb.simplitend.welcome.fragments.contacts.CreateContactFragment.TO_EDIT_KEY;
import static com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.ContactInfoFragment.CONTACT_DATA_KEY;
import static com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.CreateContactFragment.TO_EDIT_KEY;
import android.app.ProgressDialog;
import android.os.Bundle;
@@ -20,19 +20,18 @@ import androidx.recyclerview.widget.GridLayoutManager;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.ssb.simplitend.R;
import com.ssb.simplitend.apputils.AppUtil;
import com.ssb.simplitend.apputils.RetrofitHelper;
import com.ssb.simplitend.databinding.AddContactFragmentBinding;
import com.ssb.simplitend.databinding.DoneBottomsheetBinding;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.AddContactAdapter;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.ContactViewModel;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.models.ContactData;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.models.ContactListResponse;
import com.ssb.simplitend.welcome.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.AddContactAdapter;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.ContactViewModel;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactData;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactListResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeContracts;
import java.util.ArrayList;
import java.util.List;
public class AddContactFragment extends Fragment implements WelcomeContracts.ContactListContracts, AddContactAdapter.ContactClickListener{
public class AddContactFragment extends Fragment implements WelcomeContracts.ContactListContracts, AddContactAdapter.ContactClickListener {
// view binding
protected AddContactFragmentBinding binding;

View File

@@ -1,7 +1,7 @@
package com.ssb.simplitend.welcome.fragments.contacts;
package com.ssb.simplitend.welcome.welcomepatient.fragments.contacts;
import static com.ssb.simplitend.welcome.fragments.contacts.CreateContactFragment.CONTACT_KEY;
import static com.ssb.simplitend.welcome.fragments.contacts.CreateContactFragment.TO_EDIT_KEY;
import static com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.CreateContactFragment.CONTACT_KEY;
import static com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.CreateContactFragment.TO_EDIT_KEY;
import android.app.ProgressDialog;
import android.content.Intent;
@@ -22,9 +22,9 @@ import com.bumptech.glide.Glide;
import com.ssb.simplitend.R;
import com.ssb.simplitend.apputils.AppUtil;
import com.ssb.simplitend.databinding.ContactInfoFragmentBinding;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.ContactViewModel;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.models.ContactData;
import com.ssb.simplitend.welcome.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.ContactViewModel;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactData;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeContracts;
public class ContactInfoFragment extends Fragment implements WelcomeContracts.DeleteContactInterface {

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments.contacts;
package com.ssb.simplitend.welcome.welcomepatient.fragments.contacts;
import android.util.Log;
import android.view.LayoutInflater;
@@ -10,7 +10,7 @@ import androidx.recyclerview.widget.ListAdapter;
import androidx.recyclerview.widget.RecyclerView;
import com.ssb.simplitend.databinding.ContactViewHolderBinding;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.Contact;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.Contact;
public class ContactListAdapter extends ListAdapter<Contact, ContactListAdapter.ContactViewHolder> {
@@ -19,12 +19,12 @@ public class ContactListAdapter extends ListAdapter<Contact, ContactListAdapter.
private static final DiffUtil.ItemCallback<Contact> DIFF_UTIL = new DiffUtil.ItemCallback<Contact>() {
@Override
public boolean areItemsTheSame(@NonNull Contact oldItem, @NonNull Contact newItem) {
return oldItem.first_name.equals(newItem.first_name);
return false;
}
@Override
public boolean areContentsTheSame(@NonNull Contact oldItem, @NonNull Contact newItem) {
return oldItem.equals(newItem);
return false;
}
};

View File

@@ -1,7 +1,4 @@
package com.ssb.simplitend.welcome.fragments.contacts;
import static com.ssb.simplitend.welcome.fragments.contacts.CreateContactFragment.CONTACT_KEY;
import static com.ssb.simplitend.welcome.fragments.contacts.CreateContactFragment.TO_EDIT_KEY;
package com.ssb.simplitend.welcome.welcomepatient.fragments.contacts;
import android.Manifest;
import android.annotation.SuppressLint;
@@ -30,9 +27,9 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import com.ssb.simplitend.R;
import com.ssb.simplitend.databinding.ContactListFragmentBinding;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.Contact;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.ContactViewModel;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.models.ContactData;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.Contact;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.ContactViewModel;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactData;
import java.util.ArrayList;
@@ -86,8 +83,8 @@ public class ContactListFragment extends Fragment {
contactListAdapter.setContactClickListener(contact ->
{
Bundle bundle = new Bundle();
bundle.putBoolean(TO_EDIT_KEY, false);
bundle.putSerializable(CONTACT_KEY, new ContactData(contact));
bundle.putBoolean(CreateContactFragment.TO_EDIT_KEY, false);
bundle.putSerializable(CreateContactFragment.CONTACT_KEY, new ContactData(contact));
Navigation.findNavController(binding.getRoot()).navigate(R.id.action_contactListFragment_to_createContactFragment, bundle);
}
);
@@ -189,7 +186,6 @@ public class ContactListFragment extends Fragment {
}
contactViewModel = new ViewModelProvider(requireActivity()).get(ContactViewModel.class);
Log.d(TAG, "initializeViews: viewmodel " + contactViewModel);
contactList = null;
contactList = contactViewModel.getContactList(requireContext());

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments.contacts;
package com.ssb.simplitend.welcome.welcomepatient.fragments.contacts;
import static com.ssb.simplitend.apputils.RetrofitHelper.CREATE_CONTACT;
import static com.ssb.simplitend.apputils.RetrofitHelper.UPDATE_CONTACT;
@@ -33,11 +33,11 @@ import com.google.i18n.phonenumbers.Phonenumber;
import com.ssb.simplitend.R;
import com.ssb.simplitend.apputils.AppUtil;
import com.ssb.simplitend.databinding.CreateEditContactFragmentBinding;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.Contact;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.ContactViewModel;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.models.ContactData;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.models.ContactListResponse;
import com.ssb.simplitend.welcome.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.Contact;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.ContactViewModel;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactData;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactListResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeContracts;
import java.io.File;
import java.util.ArrayList;
@@ -117,6 +117,10 @@ public class CreateContactFragment extends Fragment implements WelcomeContracts.
binding.countryCodes.setItems(countryCodeList);
if (!countryCodeList.contains("+1")){
countryCodeList.add("+1");
}
binding.countryCodes.selectItemByIndex(countryCodeList.indexOf("+91"));
binding.countryCodes.setDismissWhenNotifiedItemSelected(true);
@@ -125,6 +129,52 @@ public class CreateContactFragment extends Fragment implements WelcomeContracts.
progressDialog = new ProgressDialog(requireContext());
// phone number formatting
// to deal with input pasting in the edit text
InputFilter phoneFilter = (charSequence, i, i1, spanned, i2, i3) -> {
String phone_number_str = charSequence.toString();
String country_code = null;
if (binding.countryCodes.getSelectedIndex() != -1){
country_code = countryCodeList.get(binding.countryCodes.getSelectedIndex());
}
try {
PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil.getInstance();
Phonenumber.PhoneNumber phoneNumber = phoneNumberUtil.parse(charSequence, "US");
phone_number_str = String.valueOf(phoneNumber.getNationalNumber());
country_code = "+" + phoneNumber.getCountryCode();
} catch (Exception e) {
// nothing
}
if (country_code != null && !countryCodeList.contains(country_code)){
countryCodeList.add(country_code);
}
if (country_code != null){
binding.countryCodes.selectItemByIndex(countryCodeList.indexOf(country_code));
}
if (phone_number_str.length() > 10){
// pasted number length is greater than 10
return phone_number_str.substring(0, 10);
}
String total_phone_number = binding.phoneNumber.getText().toString() + phone_number_str;
if (total_phone_number.length() > 10){
// max length should be 10
return "";
}else{
return phone_number_str;
}
};
binding.phoneNumber.setFilters(new InputFilter[]{phoneFilter});
Bundle bundle = getArguments();
if (bundle != null) {
@@ -175,52 +225,6 @@ public class CreateContactFragment extends Fragment implements WelcomeContracts.
Toast.makeText(requireContext(), "Task Cancelled", Toast.LENGTH_SHORT).show();
}
});
// phone number formatting
// to deal with input pasting in the edit text
InputFilter phoneFilter = (charSequence, i, i1, spanned, i2, i3) -> {
String phone_number_str = charSequence.toString();
String country_code = null;
if (binding.countryCodes.getSelectedIndex() != -1){
country_code = countryCodeList.get(binding.countryCodes.getSelectedIndex());
}
try {
PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil.getInstance();
Phonenumber.PhoneNumber phoneNumber = phoneNumberUtil.parse(charSequence, "US");
phone_number_str = String.valueOf(phoneNumber.getNationalNumber());
country_code = "+" + phoneNumber.getCountryCode();
} catch (Exception e) {
// nothing
}
if (country_code != null && !countryCodeList.contains(country_code)){
countryCodeList.add(country_code);
}
if (country_code != null){
binding.countryCodes.selectItemByIndex(countryCodeList.indexOf(country_code));
}
if (phone_number_str.length() > 10){
// pasted number length is greater than 10
return phone_number_str.substring(0, 10);
}
String total_phone_number = binding.phoneNumber.getText().toString() + phone_number_str;
if (total_phone_number.length() > 10){
// max length should be 10
return "";
}else{
return phone_number_str;
}
};
binding.phoneNumber.setFilters(new InputFilter[]{phoneFilter});
}
private void clickEvents() {
@@ -499,33 +503,10 @@ public class CreateContactFragment extends Fragment implements WelcomeContracts.
if (contactData.first_name != null)
binding.name.setText(contactData.first_name);
String[] code_phone = contactData.phone_number.split(" ");
if (code_phone.length > 1) {
// there is a country code
int index = countryCodeList.indexOf(code_phone[0]);
int i;
if (index >= 0) {
// country code exits
binding.countryCodes.selectItemByIndex(index);
i = 1;
} else {
// country code doesn't exits
i = 0;
binding.countryCodes.clearSelectedItem();
}
contactData.phone_number = "";
for (; i < code_phone.length; i++) {
contactData.phone_number = contactData.phone_number.concat(code_phone[i]);
}
} else {
binding.countryCodes.clearSelectedItem();
}
binding.phoneNumber.setText(contactData.phone_number);
if (contactData.country_code != null && countryCodeList.contains(contactData.country_code)){
binding.countryCodes.selectItemByIndex(countryCodeList.indexOf(contactData.country_code));
}
if (contactData.email_address != null)
binding.email.setText(contactData.email_address);

View File

@@ -1,6 +1,6 @@
package com.ssb.simplitend.welcome.fragments.contacts.mvvm;
package com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm;
import static com.ssb.simplitend.welcome.fragments.contacts.CreateContactFragment.TO_EDIT_KEY;
import static com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.CreateContactFragment.TO_EDIT_KEY;
import android.app.AlertDialog;
import android.os.Bundle;
@@ -17,7 +17,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.ssb.simplitend.R;
import com.ssb.simplitend.databinding.AddContactViewholderBinding;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.models.ContactData;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactData;
public class AddContactAdapter extends ListAdapter<ContactData, AddContactAdapter.ContactViewHolder> {

View File

@@ -1,4 +1,6 @@
package com.ssb.simplitend.welcome.fragments.contacts.mvvm;
package com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm;
import androidx.annotation.Nullable;
import java.io.Serializable;
import java.util.Objects;
@@ -9,6 +11,9 @@ public class Contact implements Serializable {
public String is_sos, updated_at, created_at;
@Nullable
public String country_code;
public long id;
public Contact(){}
@@ -32,19 +37,6 @@ public class Contact implements Serializable {
this.created_at = created_at;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Contact contact = (Contact) o;
return first_name.equals(contact.first_name) && Objects.equals(imageUri, contact.imageUri) && phone_number.equals(contact.phone_number) && Objects.equals(relationship, contact.relationship) && Objects.equals(email_address, contact.email_address);
}
@Override
public int hashCode() {
return Objects.hash(first_name, imageUri, phone_number, relationship, email_address);
}
@Override
public String toString() {
return "Contact{" +

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments.contacts.mvvm;
package com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm;
import android.app.Application;
import android.content.Context;
@@ -13,7 +13,7 @@ import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.ssb.simplitend.R;
import com.ssb.simplitend.databinding.DecisionBottomsheetBinding;
import com.ssb.simplitend.databinding.DoneBottomsheetBinding;
import com.ssb.simplitend.welcome.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeContracts;
import org.json.JSONArray;
import org.json.JSONObject;
@@ -27,7 +27,6 @@ import java.util.Map;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
public class ContactViewModel extends AndroidViewModel {

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments.contacts.mvvm;
package com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm;
import android.content.ContentResolver;
import android.content.Context;
@@ -9,11 +9,13 @@ import android.util.Log;
import androidx.annotation.NonNull;
import com.google.i18n.phonenumbers.PhoneNumberUtil;
import com.google.i18n.phonenumbers.Phonenumber;
import com.ssb.simplitend.apputils.RetrofitHelper;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.models.ContactListResponse;
import com.ssb.simplitend.welcome.mvvm.WelcomeApiService;
import com.ssb.simplitend.welcome.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.mvvm.models.CallResponse;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactListResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeApiService;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
import java.util.ArrayList;
import java.util.HashSet;
@@ -175,27 +177,36 @@ public class UserContactRepository {
if (cursor != null) {
// To avoid duplicate phone numbers
HashSet<String> mobileNoSet = new HashSet<String>();
HashSet<String> mobileNoSet = new HashSet<>();
try {
final int nameIndex = cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME);
final int numberIndex = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
Log.d("aditya", "getContactList: " + cursor.getColumnCount());
String name, number, photoUri;
String name, number, country_code = null;
while (cursor.moveToNext()) {
name = cursor.getString(nameIndex);
number = cursor.getString(numberIndex);
Log.d(TAG, "getContactList: " + number);
if (!mobileNoSet.contains(number)) {
number = PhoneNumberUtils.formatNumber(number, Locale.getDefault().getCountry());
try {
PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil.getInstance();
Phonenumber.PhoneNumber phoneNumber = phoneNumberUtil.parse(number, "US");
number = number.replace("-", "");
number = number.replace("(", "");
number = number.replace(")", "");
number = String.valueOf(phoneNumber.getNationalNumber());
country_code = "+" + phoneNumber.getCountryCode();
} catch (Exception e) {
number = number.replace("-", "");
number = number.replace("(", "");
number = number.replace(")", "");
}
contactList.add(new Contact(name, number));
Contact contact = new Contact(name, number);
contact.country_code = country_code;
contactList.add(contact);
mobileNoSet.add(number);
}
}

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments.contacts.mvvm.models;
package com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models;
import androidx.annotation.NonNull;

View File

@@ -1,8 +1,8 @@
package com.ssb.simplitend.welcome.fragments.contacts.mvvm.models;
package com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models;
import androidx.annotation.NonNull;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.Contact;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.Contact;
import java.io.Serializable;
import java.util.Objects;
@@ -17,6 +17,8 @@ public class ContactData implements Serializable {
public String contact_photo;
public CareGiverData care_giver_data;
public String country_code;
public int contact_id;
public ContactData() {
@@ -25,6 +27,7 @@ public class ContactData implements Serializable {
public ContactData(Contact contact){
this.first_name = contact.first_name;
this.phone_number = contact.phone_number;
this.country_code = contact.country_code;
}
public ContactData(int id) {

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments.contacts.mvvm.models;
package com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models;
import androidx.annotation.NonNull;

View File

@@ -1,6 +1,4 @@
package com.ssb.simplitend.welcome.fragments.forgotpin;
import static com.ssb.simplitend.welcome.fragments.forgotpin.ForgotPinFragment.EMAIL_KEY;
package com.ssb.simplitend.welcome.welcomepatient.fragments.forgotpin;
import android.app.ProgressDialog;
import android.os.Bundle;
@@ -22,9 +20,9 @@ import com.ssb.simplitend.R;
import com.ssb.simplitend.apputils.AppUtil;
import com.ssb.simplitend.apputils.EditTextErrorRemover;
import com.ssb.simplitend.databinding.ChangePinFragmentBinding;
import com.ssb.simplitend.welcome.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.mvvm.WelcomeViewModel;
import com.ssb.simplitend.welcome.mvvm.models.PatientData;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeViewModel;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
import java.util.HashMap;
import java.util.Map;
@@ -70,13 +68,13 @@ public class ChangePinFragment extends Fragment implements WelcomeContracts.Upda
Bundle bundle = getArguments();
if (bundle == null || bundle.getString(EMAIL_KEY) == null){
if (bundle == null || bundle.getString(ForgotPinFragment.EMAIL_KEY) == null){
Toast.makeText(requireContext(), "Something went wrong", Toast.LENGTH_SHORT).show();
Navigation.findNavController(binding.getRoot()).popBackStack();
return;
}
email_id = bundle.getString(EMAIL_KEY);
email_id = bundle.getString(ForgotPinFragment.EMAIL_KEY);
}

View File

@@ -1,7 +1,4 @@
package com.ssb.simplitend.welcome.fragments.forgotpin;
import static com.ssb.simplitend.welcome.fragments.forgotpin.ForgotPinFragment.EMAIL_KEY;
import static com.ssb.simplitend.welcome.fragments.forgotpin.ForgotPinFragment.USER_ID_KEY;
package com.ssb.simplitend.welcome.welcomepatient.fragments.forgotpin;
import android.app.ProgressDialog;
import android.os.Bundle;
@@ -22,9 +19,9 @@ import com.bumptech.glide.Glide;
import com.ssb.simplitend.R;
import com.ssb.simplitend.apputils.AppUtil;
import com.ssb.simplitend.databinding.CheckMailFragmentBinding;
import com.ssb.simplitend.welcome.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.mvvm.WelcomeViewModel;
import com.ssb.simplitend.welcome.mvvm.models.OTPSentResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeViewModel;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.OTPSentResponse;
import java.util.HashMap;
import java.util.Map;
@@ -69,16 +66,16 @@ public class CheckMailFragment extends Fragment implements WelcomeContracts.Veri
super.onViewCreated(view, savedInstanceState);
Bundle bundle = getArguments();
if (bundle == null || bundle.getString(USER_ID_KEY) == null || bundle.getString(EMAIL_KEY) == null) {
if (bundle == null || bundle.getString(ForgotPinFragment.USER_ID_KEY) == null || bundle.getString(ForgotPinFragment.EMAIL_KEY) == null) {
Toast.makeText(requireContext(), "Something went wrong", Toast.LENGTH_SHORT).show();
Navigation.findNavController(binding.getRoot()).popBackStack();
return;
}
user_id = bundle.getString(USER_ID_KEY);
email_id = bundle.getString(EMAIL_KEY);
user_id = bundle.getString(ForgotPinFragment.USER_ID_KEY);
email_id = bundle.getString(ForgotPinFragment.EMAIL_KEY);
try {
binding.email.setText(encodeEmail(bundle.getString(EMAIL_KEY)));
binding.email.setText(encodeEmail(bundle.getString(ForgotPinFragment.EMAIL_KEY)));
}catch (Exception e){
binding.email.setText(email_id);
}
@@ -302,7 +299,7 @@ public class CheckMailFragment extends Fragment implements WelcomeContracts.Veri
Toast.makeText(requireContext(), "OTP verified successfully", Toast.LENGTH_SHORT).show();
Bundle bundle = new Bundle();
bundle.putString(EMAIL_KEY, email_id);
bundle.putString(ForgotPinFragment.EMAIL_KEY, email_id);
Navigation.findNavController(binding.getRoot())
.navigate(R.id.action_checkMailFragment_to_changePinFragment, bundle);

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments.forgotpin;
package com.ssb.simplitend.welcome.welcomepatient.fragments.forgotpin;
import android.app.ProgressDialog;
import android.os.Bundle;
@@ -18,9 +18,9 @@ import com.ssb.simplitend.R;
import com.ssb.simplitend.apputils.AppUtil;
import com.ssb.simplitend.apputils.EditTextErrorRemover;
import com.ssb.simplitend.databinding.ForgotPinFragmentBinding;
import com.ssb.simplitend.welcome.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.mvvm.WelcomeViewModel;
import com.ssb.simplitend.welcome.mvvm.models.OTPSentResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeViewModel;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.OTPSentResponse;
public class ForgotPinFragment extends Fragment implements WelcomeContracts.SendOTPToEmailCallback {

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments.onboardfragments;
package com.ssb.simplitend.welcome.welcomepatient.fragments.onboardfragments;
import android.os.Bundle;
import android.view.LayoutInflater;

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments.onboardfragments;
package com.ssb.simplitend.welcome.welcomepatient.fragments.onboardfragments;
import android.os.Bundle;
import android.view.LayoutInflater;

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments.onboardfragments;
package com.ssb.simplitend.welcome.welcomepatient.fragments.onboardfragments;
import android.os.Bundle;
import android.view.LayoutInflater;

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments.register;
package com.ssb.simplitend.welcome.welcomepatient.fragments.register;
import android.app.ProgressDialog;
import android.os.Bundle;
@@ -18,12 +18,11 @@ import androidx.navigation.Navigation;
import com.ssb.simplitend.R;
import com.ssb.simplitend.apputils.AppUtil;
import com.ssb.simplitend.apputils.RetrofitHelper;
import com.ssb.simplitend.databinding.CreatePinFragmentBinding;
import com.ssb.simplitend.welcome.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.mvvm.WelcomeViewModel;
import com.ssb.simplitend.welcome.mvvm.models.PatientData;
import com.ssb.simplitend.welcome.mvvm.models.PatientResult;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeViewModel;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientResult;
public class CreatePinFragment extends Fragment implements WelcomeContracts.RegisterPatientContract {

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments.register;
package com.ssb.simplitend.welcome.welcomepatient.fragments.register;
import android.os.Bundle;
import android.view.LayoutInflater;

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments.register;
package com.ssb.simplitend.welcome.welcomepatient.fragments.register;
import static android.content.Context.LOCATION_SERVICE;
@@ -10,17 +10,14 @@ import android.content.Intent;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.SystemClock;
import android.provider.Settings;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.result.ActivityResultLauncher;
@@ -52,8 +49,8 @@ import com.skydoves.powerspinner.OnSpinnerItemSelectedListener;
import com.ssb.simplitend.R;
import com.ssb.simplitend.apputils.AppUtil;
import com.ssb.simplitend.databinding.LocationFragmentBinding;
import com.ssb.simplitend.welcome.mvvm.WelcomeViewModel;
import com.ssb.simplitend.welcome.mvvm.models.PatientData;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeViewModel;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
import org.json.JSONArray;
import org.json.JSONObject;
@@ -182,10 +179,30 @@ public class LocationFragment extends Fragment implements OnMapReadyCallback,
binding.town.setOnEditorActionListener((textView, i, keyEvent) -> {
AppUtil.closeKeyboard(requireActivity());
binding.town.clearFocus();
binding.countrySpinner.show();
binding.stateSpinner.show();
return true;
});
binding.zipCode.addTextChangedListener(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().length() == 6){
binding.zipCode.clearFocus();
AppUtil.closeKeyboard(requireActivity());
}
}
});
}
// load data from watcher
@@ -522,7 +539,12 @@ public class LocationFragment extends Fragment implements OnMapReadyCallback,
binding.stateSpinner.clearSelectedItem();
}
binding.stateSpinner.requestFocus();
binding.street.requestFocus();
if (getActivity() != null) {
getActivity().getWindow()
.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}
});
binding.stateSpinner.setOnSpinnerItemSelectedListener((OnSpinnerItemSelectedListener<String>) (i, s, i1, t1) -> {

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments.register;
package com.ssb.simplitend.welcome.welcomepatient.fragments.register;
import android.app.DatePickerDialog;
import android.app.ProgressDialog;
@@ -28,9 +28,9 @@ import com.ssb.simplitend.R;
import com.ssb.simplitend.apputils.AppUtil;
import com.ssb.simplitend.apputils.EditTextErrorRemover;
import com.ssb.simplitend.databinding.RegisterFragmentBinding;
import com.ssb.simplitend.welcome.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.mvvm.WelcomeViewModel;
import com.ssb.simplitend.welcome.mvvm.models.PatientData;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeContracts;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeViewModel;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -95,18 +95,22 @@ public class RegisterFragment extends Fragment implements WelcomeContracts.Verif
binding.countryCodes.setItems(countryCodeList);
if (!countryCodeList.contains("+1")){
countryCodeList.add("+1");
}
binding.countryCodes.selectItemByIndex(countryCodeList.indexOf("+1"));
binding.countryCodes.setDismissWhenNotifiedItemSelected(true);
binding.countryCodes.setIsFocusable(true);
setErrorRemovers();
loadPatientDataSavedState();
setFocusManager();
setErrorRemovers();
}
private void setFocusManager() {
@@ -135,7 +139,7 @@ public class RegisterFragment extends Fragment implements WelcomeContracts.Verif
String country_code;
if (binding.countryCodes.getSelectedIndex() == -2){
if (binding.countryCodes.getSelectedIndex() == -1){
country_code = "+1";
}else{
country_code = countryCodeList.get(binding.countryCodes.getSelectedIndex());
@@ -184,11 +188,7 @@ public class RegisterFragment extends Fragment implements WelcomeContracts.Verif
binding.dob.setText(patientData.date_of_birth);
if (patientData.phone_number != null) {
String[] contact = patientData.phone_number.split(" ");
if (contact.length == 2) {
binding.contactNumber.setText(contact[1]);
binding.countryCodes.selectItemByIndex(countryCodeList.indexOf(contact[0]));
}
binding.contactNumber.setText(patientData.phone_number);
}
binding.email.setText(patientData.email);
@@ -253,6 +253,9 @@ public class RegisterFragment extends Fragment implements WelcomeContracts.Verif
try {
Date selected_date = sdf.parse(binding.dob.getText().toString().trim());
Calendar selected_calender = Calendar.getInstance();
if (selected_date == null) throw new Exception();
selected_calender.setTime(selected_date);
Calendar minAdultAge = Calendar.getInstance();

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments.register;
package com.ssb.simplitend.welcome.welcomepatient.fragments.register;
import android.os.Bundle;
import android.os.Handler;

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.fragments.register;
package com.ssb.simplitend.welcome.welcomepatient.fragments.register;
import android.os.Bundle;
import android.view.LayoutInflater;
@@ -43,7 +43,6 @@ public class ThankYouFragment extends Fragment {
Glide.with(requireContext())
.asGif()
.load(R.raw.done_anim)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.into(binding.animIv);
}

View File

@@ -1,12 +1,11 @@
package com.ssb.simplitend.welcome.mvvm;
package com.ssb.simplitend.welcome.welcomepatient.mvvm;
import com.google.gson.JsonObject;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.Contact;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.models.ContactListResponse;
import com.ssb.simplitend.welcome.mvvm.models.CallResponse;
import com.ssb.simplitend.welcome.mvvm.models.OTPSentResponse;
import com.ssb.simplitend.welcome.mvvm.models.PatientData;
import com.ssb.simplitend.welcome.mvvm.models.PatientResult;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.Contact;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactListResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.OTPSentResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientResult;
import java.util.List;
import java.util.Map;

View File

@@ -1,10 +1,10 @@
package com.ssb.simplitend.welcome.mvvm;
package com.ssb.simplitend.welcome.welcomepatient.mvvm;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.Contact;
import com.ssb.simplitend.welcome.fragments.contacts.mvvm.models.ContactListResponse;
import com.ssb.simplitend.welcome.mvvm.models.OTPSentResponse;
import com.ssb.simplitend.welcome.mvvm.models.PatientData;
import com.ssb.simplitend.welcome.mvvm.models.PatientResult;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.Contact;
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactListResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.OTPSentResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientResult;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.mvvm;
package com.ssb.simplitend.welcome.welcomepatient.mvvm;
import static com.ssb.simplitend.apputils.RetrofitHelper.getRetrofit;
@@ -6,10 +6,10 @@ import android.util.Log;
import androidx.annotation.NonNull;
import com.ssb.simplitend.welcome.mvvm.models.CallResponse;
import com.ssb.simplitend.welcome.mvvm.models.OTPSentResponse;
import com.ssb.simplitend.welcome.mvvm.models.PatientData;
import com.ssb.simplitend.welcome.mvvm.models.PatientResult;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.OTPSentResponse;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientResult;
import java.util.List;
import java.util.Map;

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.mvvm;
package com.ssb.simplitend.welcome.welcomepatient.mvvm;
import android.content.Context;
import android.util.Log;
@@ -7,7 +7,7 @@ import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModel;
import com.ssb.simplitend.R;
import com.ssb.simplitend.welcome.mvvm.models.PatientData;
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
import org.json.JSONArray;
import org.json.JSONObject;

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.mvvm.models;
package com.ssb.simplitend.welcome.welcomepatient.mvvm.models;
// base class for response
public class CallResponse<T> {

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.mvvm.models;
package com.ssb.simplitend.welcome.welcomepatient.mvvm.models;
public class OTPSentResponse{
public int id;

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.mvvm.models;
package com.ssb.simplitend.welcome.welcomepatient.mvvm.models;
public class PatientData {
// fields

View File

@@ -1,4 +1,4 @@
package com.ssb.simplitend.welcome.mvvm.models;
package com.ssb.simplitend.welcome.welcomepatient.mvvm.models;
import com.google.gson.annotations.SerializedName;