.
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package com.app.simplitend.appblocking;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
@@ -17,6 +20,7 @@ import android.provider.Telephony;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
@@ -28,6 +32,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.app.simplitend.R;
|
||||
import com.app.simplitend.apputils.AppUtil;
|
||||
import com.app.simplitend.databinding.FuaEduDialogBinding;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -68,6 +73,19 @@ public class FUAActivity extends AppCompatActivity {
|
||||
no_fua_txt = findViewById(R.id.no_fua_text);
|
||||
all_apps_title = findViewById(R.id.all_app_tile);
|
||||
fua_sub_title = findViewById(R.id.fua_sub_title);
|
||||
|
||||
if (AppUtil.shouldShowFUADialog(this)){
|
||||
FuaEduDialogBinding dialogBinding = FuaEduDialogBinding.inflate(getLayoutInflater());
|
||||
Dialog fuaDialog = new Dialog(this, R.style.BottomSheetDialog);
|
||||
fuaDialog.setContentView(dialogBinding.getRoot());
|
||||
|
||||
dialogBinding.checkBox.setOnCheckedChangeListener((compoundButton, b) -> {
|
||||
AppUtil.setShouldShowFuaDialog(this, !b);
|
||||
});
|
||||
|
||||
dialogBinding.close.setOnClickListener(v -> fuaDialog.dismiss());
|
||||
fuaDialog.show();
|
||||
}
|
||||
|
||||
if (!isAccessibilityAppBlockingEnabled()) {
|
||||
openAccessibilityDialog();
|
||||
|
||||
@@ -321,7 +321,7 @@ public abstract class AppUtil {
|
||||
setupBottomSheet(binding,
|
||||
R.drawable.img_medication_time,
|
||||
title, "Current location",
|
||||
"Unknown", "Call patient",
|
||||
"Unknown", "Call senior",
|
||||
v -> {
|
||||
CaregiverDataCache.getCaregiverData(context, (careGiverData -> {
|
||||
bsd.dismiss();
|
||||
@@ -433,7 +433,7 @@ public abstract class AppUtil {
|
||||
setupBottomSheet(binding,
|
||||
R.drawable.img_directioin_requested,
|
||||
title, body,
|
||||
null, "Call patient",
|
||||
null, "Call senior",
|
||||
v -> {
|
||||
CaregiverDataCache.getCaregiverData(context, (careGiverData -> {
|
||||
bsd.dismiss();
|
||||
@@ -460,7 +460,7 @@ public abstract class AppUtil {
|
||||
setupBottomSheet(binding,
|
||||
R.drawable.img_sos_requested,
|
||||
title, body,
|
||||
null, "Call patient",
|
||||
null, "Call senior",
|
||||
v -> {
|
||||
CaregiverDataCache.getCaregiverData(context, (careGiverData -> {
|
||||
bsd.dismiss();
|
||||
@@ -579,6 +579,8 @@ public abstract class AppUtil {
|
||||
stop_accessibility_intent.setAction(TopAppDetectionService.STOP_ACCESSIBILITY_SERVICE);
|
||||
context.startService(stop_accessibility_intent);
|
||||
|
||||
setShouldShowFuaDialog(context, true);
|
||||
|
||||
// removing contact listing
|
||||
setWhiteListedContacts(context, null);
|
||||
|
||||
@@ -691,6 +693,19 @@ public abstract class AppUtil {
|
||||
return sp.getBoolean(notification, true);
|
||||
}
|
||||
|
||||
private static final String FUA_DIALOG = "FUA_dialog";
|
||||
|
||||
public static void setShouldShowFuaDialog(Context context, boolean b){
|
||||
SharedPreferences sp = context.getSharedPreferences(CAREGIVER_DETAILS, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
editor.putBoolean(FUA_DIALOG, b);
|
||||
editor.apply();
|
||||
}
|
||||
public static boolean shouldShowFUADialog(Context context){
|
||||
SharedPreferences sp = context.getSharedPreferences(CAREGIVER_DETAILS, Context.MODE_PRIVATE);
|
||||
return sp.getBoolean(FUA_DIALOG, true);
|
||||
}
|
||||
|
||||
// patient geofencing
|
||||
private static final String PATIENT_GEOFENCE_RADIUS = "patient_geofence_radius";
|
||||
private static final String PATIENT_GEOFENCE_RADIUS_UNIT = "patient_geofence_radius_unit";
|
||||
|
||||
@@ -160,7 +160,6 @@ public class CgDashBoardFragment extends Fragment implements
|
||||
if (careGiverData == null) return;
|
||||
|
||||
binding.nearestReminder.setText(viewModel.upcomingReminderText);
|
||||
binding.dailyReminder.setText(viewModel.dailyReminderText);
|
||||
|
||||
reminderViewModel.getRemindersList(careGiverData.patientId,
|
||||
Calendar.getInstance().get(Calendar.DAY_OF_WEEK)-1,
|
||||
@@ -226,7 +225,6 @@ public class CgDashBoardFragment extends Fragment implements
|
||||
binding.upcomingActivity.setText(viewModel.upcomingActivityText);
|
||||
binding.onGoingActivity.setText(viewModel.ongoingActivityText);
|
||||
binding.nearestReminder.setText(viewModel.upcomingReminderText);
|
||||
binding.dailyReminder.setText(viewModel.dailyReminderText);
|
||||
|
||||
loadReminders();
|
||||
loadActivities();
|
||||
@@ -437,10 +435,8 @@ public class CgDashBoardFragment extends Fragment implements
|
||||
binding.refreshBtn.setVisibility(View.VISIBLE);
|
||||
|
||||
binding.nearestReminder.setText(R.string.couldnt_load_data);
|
||||
binding.dailyReminder.setText(R.string.couldnt_load_data);
|
||||
|
||||
viewModel.upcomingReminderText = binding.nearestReminder.getText().toString();
|
||||
viewModel.dailyReminderText = binding.dailyReminder.getText().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -450,25 +446,6 @@ public class CgDashBoardFragment extends Fragment implements
|
||||
binding.refreshProgress.setVisibility(View.GONE);
|
||||
binding.refreshBtn.setVisibility(View.VISIBLE);
|
||||
|
||||
try {
|
||||
// daily routine setting
|
||||
String daily_r_txt;
|
||||
|
||||
if (nearestReminder.daily_reminder_time == null){
|
||||
daily_r_txt = "No daily reminders for today";
|
||||
}else{
|
||||
SimpleDateFormat input_sdf = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
|
||||
SimpleDateFormat format_sdf = new SimpleDateFormat("hh:mm a", Locale.getDefault());
|
||||
|
||||
String daily_r_time = format_sdf.format(Objects.requireNonNull(input_sdf.parse(nearestReminder.daily_reminder_time)));
|
||||
daily_r_txt = "Daily reminder at " + daily_r_time;
|
||||
}
|
||||
|
||||
binding.dailyReminder.setText(daily_r_txt);
|
||||
}catch (Exception e){
|
||||
binding.dailyReminder.setText(R.string.couldnt_load_data);
|
||||
}
|
||||
|
||||
// next reminder setting
|
||||
try {
|
||||
if (nearestReminder == null) throw new Exception();
|
||||
@@ -476,7 +453,6 @@ public class CgDashBoardFragment extends Fragment implements
|
||||
if (nearestReminder.upcoming_time == null){
|
||||
binding.nearestReminder.setText(R.string.all_reminder_done);
|
||||
viewModel.upcomingReminderText = binding.nearestReminder.getText().toString();
|
||||
viewModel.dailyReminderText = binding.dailyReminder.getText().toString();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -501,25 +477,15 @@ public class CgDashBoardFragment extends Fragment implements
|
||||
long m = (time_diff / 60) % 60;
|
||||
long h = (time_diff / (60 * 60)) % 24;
|
||||
|
||||
StringBuilder reminder_txt = new StringBuilder("Remind " + nearestReminder.medication_name);
|
||||
StringBuilder reminder_txt = new StringBuilder(nearestReminder.medication_name);
|
||||
|
||||
if (time_diff > 3600){
|
||||
// time greater than 60 mins
|
||||
// thus, showing direct time
|
||||
SimpleDateFormat format_sdf = new SimpleDateFormat("hh:mm a", Locale.getDefault());
|
||||
SimpleDateFormat format_sdf = new SimpleDateFormat("hh:mm a", Locale.getDefault());
|
||||
|
||||
try {
|
||||
String time = format_sdf.format(upcoming_date);
|
||||
reminder_txt.append(" at ").append(time);
|
||||
} catch (Exception e) {
|
||||
reminder_txt.append(" at ").append(nearestReminder.upcoming_time);
|
||||
}
|
||||
|
||||
}else{
|
||||
// show in minutes
|
||||
reminder_txt.append(" in ").append(m).append(" min");
|
||||
|
||||
if (m > 1) reminder_txt.append("s"); // plural
|
||||
try {
|
||||
String time = format_sdf.format(upcoming_date);
|
||||
reminder_txt.append(" at ").append(time);
|
||||
} catch (Exception e) {
|
||||
reminder_txt.append(" at ").append(nearestReminder.upcoming_time);
|
||||
}
|
||||
|
||||
binding.nearestReminder.setText(reminder_txt);
|
||||
@@ -530,7 +496,6 @@ public class CgDashBoardFragment extends Fragment implements
|
||||
}
|
||||
|
||||
viewModel.upcomingReminderText = binding.nearestReminder.getText().toString();
|
||||
viewModel.dailyReminderText = binding.dailyReminder.getText().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.yarolegovich.slidingrootnav.SlidingRootNav;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@@ -179,26 +178,13 @@ public class CaregiverMainViewModel extends ViewModel {
|
||||
|
||||
NearestReminder nearestReminder = new NearestReminder();
|
||||
|
||||
try {
|
||||
for (ReminderResult reminder: reminderResultList){
|
||||
|
||||
if (reminder.all_days == 1){
|
||||
nearestReminder.daily_reminder_time = reminder.time1;
|
||||
}
|
||||
|
||||
String upcoming_time = selectNextReminder(reminder.time1, reminder.time2, reminder.time3);
|
||||
|
||||
if (upcoming_time != null && smallestTime(upcoming_time, nearestReminder.upcoming_time)){
|
||||
// upcoming_time for this reminder is less than nearestReminder.upcoming_time
|
||||
// thus, updating nearest reminder
|
||||
|
||||
nearestReminder.upcoming_time = upcoming_time;
|
||||
nearestReminder.reminder_id = reminder.id;
|
||||
nearestReminder.medication_name = reminder.medicine_name;
|
||||
}
|
||||
for (ReminderResult reminder: reminderResultList){
|
||||
if (!alreadyPassed(reminder.medicine_time)){
|
||||
nearestReminder.upcoming_time = reminder.medicine_time;
|
||||
nearestReminder.reminder_id = reminder.id;
|
||||
nearestReminder.medication_name = reminder.medicine_name;
|
||||
break;
|
||||
}
|
||||
}catch (Exception e){
|
||||
// do nothing
|
||||
}
|
||||
|
||||
// callback through main thread
|
||||
@@ -206,90 +192,6 @@ public class CaregiverMainViewModel extends ViewModel {
|
||||
});
|
||||
}
|
||||
|
||||
private String selectNextReminder(@NonNull String time1, String time2, String time3) {
|
||||
return selectNextReminder(time1, selectNextReminder(time2, time3));
|
||||
}
|
||||
|
||||
private String selectNextReminder(String time1, String time2) {
|
||||
if (time1 == null && time2 == null) return null;
|
||||
if (time2 == null) {
|
||||
// time 2 is null
|
||||
// thus, checking if time1 has already passed current_time or not.
|
||||
|
||||
if (alreadyPassed(time1)){
|
||||
// the time1 has already passed the current time
|
||||
// thus, returning null
|
||||
|
||||
return null;
|
||||
}else{
|
||||
// the time1 is yet to come
|
||||
|
||||
return time1;
|
||||
}
|
||||
}
|
||||
if (time1 == null){
|
||||
// time1 is null
|
||||
// thus, checking if time2 has already passed current_time or not.
|
||||
|
||||
if (alreadyPassed(time2)){
|
||||
// the time1 has already passed the current time
|
||||
// thus, returning null
|
||||
|
||||
return null;
|
||||
}else{
|
||||
// the time1 is yet to come
|
||||
|
||||
return time2;
|
||||
}
|
||||
}
|
||||
|
||||
// comparing this 2 times with current time
|
||||
// first converting time string to calendar
|
||||
SimpleDateFormat input_sdf = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
|
||||
|
||||
try {
|
||||
Date date1 = input_sdf.parse(time1);
|
||||
Date date2 = input_sdf.parse(time2);
|
||||
|
||||
if (date2 == null || date1 == null) throw new Exception();
|
||||
|
||||
Calendar cur_cal = Calendar.getInstance();
|
||||
Date cur_date = new Date(date1.getYear(), date1.getMonth(), date1.getDate(), cur_cal.get(Calendar.HOUR_OF_DAY), cur_cal.get(Calendar.MINUTE), date1.getSeconds());
|
||||
|
||||
// All three above dates are of same date 01 Jan 1970
|
||||
// but, of different times i.e. hh:mm:ss
|
||||
|
||||
long t1 = date1.getTime();
|
||||
long t2 = date2.getTime();
|
||||
long c_t = cur_date.getTime();
|
||||
|
||||
if (t1 < c_t && t2 > c_t){
|
||||
// t1 time is passed and t2 time is yet to come for the same day
|
||||
// thus, returning t2
|
||||
return time2;
|
||||
}else if (t1 > c_t && t2 < c_t){
|
||||
// t1 is yet to come for this day, and t2 has already been passed
|
||||
// thus, returning t1
|
||||
return time1;
|
||||
}else if (t1 > c_t && t2 > c_t){
|
||||
// Both the times are greater than current time, yet to come
|
||||
// In this case, we show the smallest time
|
||||
|
||||
if (t1 < t2) return time1;
|
||||
else return time2;
|
||||
}else{
|
||||
// Last case would be both the times has passed the current time
|
||||
// thus, returning null
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
// if something goes wrong, returning the time1
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// check if the time has passed current time or not
|
||||
private boolean alreadyPassed(String time1) {
|
||||
SimpleDateFormat input_sdf = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
|
||||
|
||||
@@ -3,8 +3,10 @@ package com.app.simplitend.cg_geofencing;
|
||||
import static com.app.simplitend.patientgeofencing.PatientLocationUpdatesReceiver.LOCATION_REQUEST_TAG;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Color;
|
||||
@@ -118,15 +120,18 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
|
||||
Toast.makeText(this, "Couldn't load Geofence.", Toast.LENGTH_SHORT).show();
|
||||
geoFenceDetails = new GeoFenceDetails();
|
||||
onBackPressed();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
onBackPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
viewModel = new ViewModelProvider(this).get(CaregiverMainViewModel.class);
|
||||
progressDialog = new ProgressDialog(this);
|
||||
|
||||
geofence_bs_binding = GeofenceBottomSheetBinding.inflate(getLayoutInflater());
|
||||
geofence_bs_binding.unitSpinner.selectItemByIndex(1);
|
||||
isTrackingSenior = false;
|
||||
|
||||
CaregiverDataCache.getCaregiverData(this, (careGiverData -> {
|
||||
@@ -183,7 +188,6 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
|
||||
// running on main thread
|
||||
new Handler(Looper.getMainLooper()).post(()-> {
|
||||
pat_cur_latLng = new LatLng(result.getLatitude(), result.getLongitude());
|
||||
Toast.makeText(CgGeoFencingActivity.this, "Update", Toast.LENGTH_SHORT).show();
|
||||
updateCurrentLocationPatientMarker();
|
||||
updatePatientCurrentLocationDetails();
|
||||
});
|
||||
@@ -221,7 +225,11 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
|
||||
}
|
||||
}
|
||||
|
||||
if (MILES.equals(geoFenceDetails.type)) {
|
||||
if (geoFenceDetails.type == null){
|
||||
// default
|
||||
geofence_bs_binding.unitSpinner.selectItemByIndex(1);
|
||||
}
|
||||
else if (MILES.equals(geoFenceDetails.type)) {
|
||||
geofence_bs_binding.unitSpinner.selectItemByIndex(1);
|
||||
radius = radius / 1609.34f;
|
||||
} else {
|
||||
@@ -236,7 +244,6 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
|
||||
geofence_bs_binding.radius.setText("" + radius);
|
||||
}
|
||||
geofence_bs_binding.message.setText(geoFenceDetails.message);
|
||||
geofence_bs_binding.location.setText(geoFenceDetails.location_name);
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
@@ -256,6 +263,14 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
|
||||
private void clickEvents() {
|
||||
binding.backBtn.setOnClickListener(v -> onBackPressed());
|
||||
|
||||
binding.changeBtn.setOnClickListener(v -> {
|
||||
if (binding.search.getVisibility() == View.VISIBLE){
|
||||
binding.search.setVisibility(View.GONE);
|
||||
}else{
|
||||
binding.search.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
binding.setGf.setOnClickListener(v -> {
|
||||
if (bottomSheetDialog != null) {
|
||||
bottomSheetDialog.show();
|
||||
@@ -263,9 +278,7 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
|
||||
});
|
||||
|
||||
geofence_bs_binding.save.setOnClickListener(v -> {
|
||||
if (allOkay()) {
|
||||
saveGeoFence();
|
||||
}
|
||||
saveGeoFence();
|
||||
});
|
||||
|
||||
binding.search.setOnClickListener(v -> {
|
||||
@@ -287,7 +300,13 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
|
||||
|
||||
binding.updateBtn.setOnClickListener(v -> {
|
||||
if (careGiverData != null) {
|
||||
updatePatientAddress();
|
||||
AppUtil.showAlert(this,
|
||||
"Update senior's geofence",
|
||||
"Are you sure you want to update the location?\nSenior Geofence will be updated.",
|
||||
getString(R.string.ok), ((dialogInterface, i) -> {
|
||||
updatePatientAddress();
|
||||
}),
|
||||
"Cancel", ((dialogInterface, i) -> {}));
|
||||
} else {
|
||||
Toast.makeText(this, "Cannot update address.", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -326,19 +345,28 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
|
||||
currL.setLongitude(pat_cur_latLng.longitude);
|
||||
|
||||
double distance = homeL.distanceTo(currL);
|
||||
distance /= 1000; // converting to KMs
|
||||
distance /= 1609.34; // converting to Miles
|
||||
if (distance <= 0.015){
|
||||
binding.distanceAwayTxt.setText(patientData.first_name + " is at Home");
|
||||
}else{
|
||||
binding.distanceAwayTxt.setText(String.format(patientData.first_name + " is %.2f Kms away", distance));
|
||||
binding.distanceAwayTxt.setText(String.format(patientData.first_name + " is %.2f miles away", distance));
|
||||
}
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
// do nothing
|
||||
|
||||
}
|
||||
|
||||
String address = patientData.address_line1;
|
||||
binding.homeAddress.setText(address);
|
||||
StringBuilder senior_address = new StringBuilder(patientData.address_line1);
|
||||
if (senior_address.length() != 0){
|
||||
senior_address.append(", ");
|
||||
}
|
||||
|
||||
senior_address.append(patientData.city).append(", ")
|
||||
.append(patientData.state).append(", ")
|
||||
.append(patientData.country).append(".");
|
||||
|
||||
binding.homeAddress.setText(senior_address);
|
||||
}
|
||||
|
||||
private void updatePatientAddress() {
|
||||
@@ -380,24 +408,6 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
|
||||
}
|
||||
}
|
||||
|
||||
private boolean allOkay() {
|
||||
geofence_bs_binding.message.setError(null);
|
||||
geofence_bs_binding.location.setError(null);
|
||||
boolean allOkay = true;
|
||||
|
||||
if (geofence_bs_binding.message.getText().toString().trim().isEmpty()) {
|
||||
allOkay = false;
|
||||
geofence_bs_binding.message.setError("Required");
|
||||
}
|
||||
|
||||
if (geofence_bs_binding.location.getText().toString().trim().isEmpty()) {
|
||||
allOkay = false;
|
||||
geofence_bs_binding.location.setError("Required");
|
||||
}
|
||||
|
||||
return allOkay;
|
||||
}
|
||||
|
||||
private void saveGeoFence() {
|
||||
if (careGiverData == null) {
|
||||
Toast.makeText(this, "Couldn't add Fence.", Toast.LENGTH_SHORT).show();
|
||||
@@ -415,21 +425,28 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
|
||||
if (geofence_bs_binding.unitSpinner.getSelectedIndex() == 1) {
|
||||
// it is miles
|
||||
radius = radius * 1609.34f; // to meters
|
||||
if (radius < 160.934 || radius > 8046.72) {
|
||||
new AlertDialog.Builder(this)
|
||||
.setMessage("Please select radius between\n0.1 mile - 5 mile")
|
||||
.setPositiveButton(getString(R.string.ok), (dialogInterface, i) -> {
|
||||
dialogInterface.dismiss();
|
||||
}).show();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// it is kms
|
||||
radius = radius * 1000; // to meters
|
||||
}
|
||||
|
||||
if (radius < 1000) {
|
||||
Toast.makeText(this, "Radius should be minimum 1 KM.", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else if (radius > 10_000) {
|
||||
Toast.makeText(this, "Radius should be maximum 10 KM.", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
if (radius < 100 || radius > 8000) {
|
||||
new AlertDialog.Builder(this)
|
||||
.setMessage("Please select radius between\n0.1 km - 8 km")
|
||||
.setPositiveButton(getString(R.string.ok), (dialogInterface, i) -> {
|
||||
dialogInterface.dismiss();
|
||||
}).show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
geoFenceDetails.message = geofence_bs_binding.message.getText().toString();
|
||||
geoFenceDetails.location_name = geofence_bs_binding.location.getText().toString();
|
||||
geoFenceDetails.radius = "" + radius;
|
||||
geoFenceDetails.type = geofence_bs_binding.unitSpinner.getSelectedIndex() == 0 ? KMS : MILES;
|
||||
geoFenceDetails.patient_xid = "" + careGiverData.patientId;
|
||||
@@ -483,6 +500,12 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
|
||||
updateCurrentLocationPatientMarker();
|
||||
|
||||
mMap.setOnMapClickListener(latLng1 -> {
|
||||
if (binding.search.getVisibility() != View.VISIBLE){
|
||||
// search bar is not visible
|
||||
// user is not intending to change the home location
|
||||
return;
|
||||
}
|
||||
|
||||
this.mHomeLatLng = latLng1;
|
||||
isTrackingSenior = false;
|
||||
|
||||
@@ -530,7 +553,7 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
|
||||
updateHomeMarker(home_lat_lng);
|
||||
addRadius();
|
||||
|
||||
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(home_lat_lng, 13));
|
||||
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(home_lat_lng, 14));
|
||||
} catch (Exception e) {
|
||||
// near marine drive
|
||||
Toast.makeText(this, "Couldn't load home location", Toast.LENGTH_SHORT).show();
|
||||
@@ -563,7 +586,7 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
|
||||
if (home_loc_marker != null) home_loc_marker.remove();
|
||||
|
||||
home_loc_marker = mMap.addMarker(markerOptions);
|
||||
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(home_latLng, 13));
|
||||
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(home_latLng, 14));
|
||||
}
|
||||
|
||||
private void registerMapSearchResultLauncher() {
|
||||
|
||||
@@ -136,7 +136,7 @@ public class CgSubscriptionActivity extends AppCompatActivity
|
||||
if (current_subscription_plan_id != null){
|
||||
AppUtil.showAlert(this,
|
||||
"Cancel subscription",
|
||||
"Are you sure you want to cancel the current subscribed plan?\nThis will stop the recurring payments",
|
||||
"Are you sure you want to cancel the current subscribed plan?\nThis will stop the recurring payments.\nYou will be able to use the app until current plan expires.",
|
||||
getString(R.string.no),
|
||||
((dialogInterface, i) -> {}),
|
||||
getString(R.string.yes),
|
||||
|
||||
@@ -252,49 +252,49 @@ public class PatientMainViewModel extends ViewModel {
|
||||
});
|
||||
}
|
||||
|
||||
public synchronized void getNearestReminder(List<ReminderResult> reminderResultList,
|
||||
@NonNull CaregiverMainViewModel.GetNearestResultCallback nearestResultCallback){
|
||||
|
||||
ExecutorService executor = Executors.newSingleThreadExecutor();
|
||||
Handler handler = new Handler(Looper.getMainLooper());
|
||||
|
||||
executor.execute(() -> {
|
||||
// background thread work
|
||||
|
||||
NearestReminder nearestReminder = new NearestReminder();
|
||||
|
||||
try {
|
||||
for (ReminderResult reminder: reminderResultList){
|
||||
|
||||
if (reminder.all_days == 1){
|
||||
nearestReminder.daily_reminder_time = reminder.time1;
|
||||
}
|
||||
|
||||
String upcoming_time = selectNextReminder(reminder.time1, reminder.time2, reminder.time3);
|
||||
|
||||
if (upcoming_time != null && smallestTime(upcoming_time, nearestReminder.upcoming_time)){
|
||||
// upcoming_time for this reminder is less than nearestReminder.upcoming_time
|
||||
// thus, updating nearest reminder
|
||||
|
||||
nearestReminder.upcoming_time = upcoming_time;
|
||||
nearestReminder.reminder_id = reminder.id;
|
||||
nearestReminder.medication_name = reminder.medicine_name;
|
||||
nearestReminder.med_quantity = reminder.medication_quantity;
|
||||
try {
|
||||
nearestReminder.med_type = reminder.medication_type.get(0).title;
|
||||
}catch (Exception e){
|
||||
nearestReminder.med_type = "units";
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
// do nothing
|
||||
}
|
||||
|
||||
// callback through main thread
|
||||
handler.post(() -> nearestResultCallback.nearestReminder(nearestReminder));
|
||||
});
|
||||
}
|
||||
// public synchronized void getNearestReminder(List<ReminderResult> reminderResultList,
|
||||
// @NonNull CaregiverMainViewModel.GetNearestResultCallback nearestResultCallback){
|
||||
//
|
||||
// ExecutorService executor = Executors.newSingleThreadExecutor();
|
||||
// Handler handler = new Handler(Looper.getMainLooper());
|
||||
//
|
||||
// executor.execute(() -> {
|
||||
// // background thread work
|
||||
//
|
||||
// NearestReminder nearestReminder = new NearestReminder();
|
||||
//
|
||||
// try {
|
||||
// for (ReminderResult reminder: reminderResultList){
|
||||
//
|
||||
// if (reminder.all_days == 1){
|
||||
// nearestReminder.daily_reminder_time = reminder.time1;
|
||||
// }
|
||||
//
|
||||
// String upcoming_time = selectNextReminder(reminder.time1, reminder.time2, reminder.time3);
|
||||
//
|
||||
// if (upcoming_time != null && smallestTime(upcoming_time, nearestReminder.upcoming_time)){
|
||||
// // upcoming_time for this reminder is less than nearestReminder.upcoming_time
|
||||
// // thus, updating nearest reminder
|
||||
//
|
||||
// nearestReminder.upcoming_time = upcoming_time;
|
||||
// nearestReminder.reminder_id = reminder.id;
|
||||
// nearestReminder.medication_name = reminder.medicine_name;
|
||||
// nearestReminder.med_quantity = reminder.medication_quantity;
|
||||
// try {
|
||||
// nearestReminder.med_type = reminder.medication_type.get(0).title;
|
||||
// }catch (Exception e){
|
||||
// nearestReminder.med_type = "units";
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }catch (Exception e){
|
||||
// // do nothing
|
||||
// }
|
||||
//
|
||||
// // callback through main thread
|
||||
// handler.post(() -> nearestResultCallback.nearestReminder(nearestReminder));
|
||||
// });
|
||||
// }
|
||||
|
||||
private String selectNextReminder(@NonNull String time1, String time2, String time3) {
|
||||
return selectNextReminder(time1, selectNextReminder(time2, time3));
|
||||
|
||||
@@ -449,7 +449,7 @@ public class PatientDashboardFragment extends Fragment implements ProfileContrac
|
||||
|
||||
@Override
|
||||
public void onRemindersListFetched(List<ReminderResult> reminderResult) {
|
||||
viewModel.getNearestReminder(reminderResult, this);
|
||||
// viewModel.getNearestReminder(reminderResult, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,7 +21,6 @@ import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.skydoves.powerspinner.OnSpinnerItemSelectedListener;
|
||||
import com.app.simplitend.R;
|
||||
import com.app.simplitend.apputils.AppUtil;
|
||||
import com.app.simplitend.databinding.AddReminderFragmentBinding;
|
||||
@@ -32,13 +31,13 @@ import com.app.simplitend.patientprofile.medreminder.mvvm.models.FreqNMedTypeRes
|
||||
import com.app.simplitend.patientprofile.medreminder.mvvm.models.Frequency;
|
||||
import com.app.simplitend.patientprofile.medreminder.mvvm.models.MedicationType;
|
||||
import com.app.simplitend.patientprofile.medreminder.mvvm.models.ReminderResult;
|
||||
import com.skydoves.powerspinner.OnSpinnerItemSelectedListener;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
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,
|
||||
@@ -177,20 +176,18 @@ public class AddReminderFragment extends Fragment implements CompoundButton.OnCh
|
||||
reminderResult.dosage_unit = String.valueOf(dosageTypeList.get(0).id);
|
||||
}
|
||||
|
||||
ArrayList<String> time_list = new ArrayList<>();
|
||||
|
||||
// saving the actual format of time i.e. HH:mm:ss as hint
|
||||
// and saving the formatted time as text i.e. hh:mm a
|
||||
reminderResult.time1 = binding.getTime.getHint().toString();
|
||||
time_list.add(binding.getTime.getHint().toString());
|
||||
|
||||
if (binding.getTime2.getVisibility() == View.VISIBLE){
|
||||
reminderResult.time2 = binding.getTime2.getHint().toString();
|
||||
}else{
|
||||
reminderResult.time2 = null;
|
||||
time_list.add(binding.getTime2.getHint().toString());
|
||||
}
|
||||
|
||||
if (binding.getTime3.getVisibility() == View.VISIBLE){
|
||||
reminderResult.time3 = binding.getTime3.getHint().toString();
|
||||
}else{
|
||||
reminderResult.time3 = null;
|
||||
time_list.add(binding.getTime3.getHint().toString());
|
||||
}
|
||||
|
||||
reminderResult.medication_quantity = binding.quantity.getText().toString();
|
||||
@@ -213,8 +210,13 @@ public class AddReminderFragment extends Fragment implements CompoundButton.OnCh
|
||||
reminderResult.patientRemainderId = reminder.id;
|
||||
|
||||
reminderResult.reminder_marked = reminder.reminder_marked;
|
||||
|
||||
// to edit the reminder need to send medicine_time_list
|
||||
reminderResult.medicine_time_list = new ArrayList<>();
|
||||
reminderResult.medicine_time_list.add(binding.getTime.getHint().toString());
|
||||
} else {
|
||||
reminderResult.is_update = "0";
|
||||
reminderResult.medicine_time_list = time_list;
|
||||
}
|
||||
|
||||
String token = "Bearer " + AppUtil.getPatientToken(requireContext());
|
||||
@@ -446,6 +448,10 @@ public class AddReminderFragment extends Fragment implements CompoundButton.OnCh
|
||||
|
||||
private void setLayoutDetails(ReminderResult reminder) {
|
||||
if (reminder != null) {
|
||||
// removing medication frequency spinner
|
||||
binding.frequencyView.setVisibility(View.GONE);
|
||||
binding.frequencyTitleView.setVisibility(View.GONE);
|
||||
|
||||
// intent is to edit the reminder
|
||||
binding.title.setText(getString(R.string.edit_reminder));
|
||||
|
||||
@@ -455,51 +461,10 @@ public class AddReminderFragment extends Fragment implements CompoundButton.OnCh
|
||||
binding.getDate.setText(formatDate(reminder.medication_refill_date));
|
||||
binding.instructions.setText(reminder.medication_instruction);
|
||||
|
||||
SimpleDateFormat input_sdf = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
|
||||
SimpleDateFormat output_sdf = new SimpleDateFormat("hh:mm a", Locale.getDefault());
|
||||
|
||||
String refill_time_1, refill_time_2 = null, refill_time_3 = null;
|
||||
|
||||
try {
|
||||
Date date = input_sdf.parse(reminder.time1);
|
||||
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_1 = reminder.time1;
|
||||
refill_time_2 = reminder.time2;
|
||||
refill_time_3 = reminder.time3;
|
||||
}
|
||||
|
||||
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);
|
||||
String medicine_time = AppUtil.formatDate("HH:mm:ss", "hh:mm a", reminder.medicine_time);
|
||||
if (medicine_time != null){
|
||||
binding.getTime.setText(medicine_time);
|
||||
binding.getTime.setHint(reminder.medicine_time);
|
||||
}
|
||||
|
||||
for (int i = 0; i < frequencyList.size(); i++) {
|
||||
@@ -700,6 +665,15 @@ public class AddReminderFragment extends Fragment implements CompoundButton.OnCh
|
||||
timeText.setError(null);
|
||||
|
||||
Calendar calendar = Calendar.getInstance(Locale.getDefault());
|
||||
// setting calendar to set time
|
||||
try {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("hh:mm a", Locale.getDefault());
|
||||
Date date = sdf.parse(timeText.getText().toString());
|
||||
if (date == null) throw new Exception();
|
||||
calendar.setTime(date);
|
||||
}catch (Exception e){
|
||||
// do nothing
|
||||
}
|
||||
|
||||
TimePickerDialog tpd = new TimePickerDialog(requireContext(),
|
||||
(TimePickerDialog.OnTimeSetListener) (view, hourOfDay, minute) -> {
|
||||
|
||||
@@ -331,7 +331,6 @@ public class ReminderFragment extends Fragment implements RecyclerTouchListener.
|
||||
binding.noData.setVisibility(View.GONE);
|
||||
|
||||
reminderAdapter.submitLIst(reminderResultList);
|
||||
|
||||
} else {
|
||||
binding.remindersRv.setVisibility(View.GONE);
|
||||
binding.noData.setVisibility(View.VISIBLE);
|
||||
@@ -542,6 +541,10 @@ public class ReminderFragment extends Fragment implements RecyclerTouchListener.
|
||||
|
||||
reminderResult.medication_refill_date = refill_date;
|
||||
|
||||
// to edit the reminder need to send medicine_time_list
|
||||
reminderResult.medicine_time_list = new ArrayList<>();
|
||||
reminderResult.medicine_time_list.add(reminderResult.medicine_time);
|
||||
|
||||
reminderViewModel.addReminder(
|
||||
AppUtil.getPatientUid(requireContext()),
|
||||
reminderResult,
|
||||
|
||||
@@ -9,6 +9,7 @@ import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.app.simplitend.R;
|
||||
import com.app.simplitend.apputils.AppUtil;
|
||||
import com.app.simplitend.databinding.ReminderViewholderBinding;
|
||||
import com.app.simplitend.patientprofile.medreminder.mvvm.models.ReminderResult;
|
||||
|
||||
@@ -108,20 +109,12 @@ public class ReminderAdapter extends RecyclerView.Adapter<ReminderAdapter.Remind
|
||||
|
||||
binding.instruction.setText(instruction);
|
||||
|
||||
SimpleDateFormat input_sdf = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
|
||||
SimpleDateFormat output_sdf = new SimpleDateFormat("hh:mm a", Locale.getDefault());
|
||||
String medicine_time = AppUtil.formatDate("HH:mm:ss", "hh:mm a", reminder.medicine_time);
|
||||
|
||||
String refill_time = selectNextReminder(reminder.time1, reminder.time2, reminder.time3);
|
||||
|
||||
try {
|
||||
Date date = input_sdf.parse(refill_time);
|
||||
refill_time = output_sdf.format(date);
|
||||
}catch (Exception e){
|
||||
// do nothing
|
||||
if (medicine_time != null){
|
||||
binding.time.setText(medicine_time);
|
||||
}
|
||||
|
||||
binding.time.setText(refill_time);
|
||||
|
||||
String quantity = "";
|
||||
|
||||
if (reminder.medication_type != null && reminder.medication_type.size() > 0) {
|
||||
|
||||
@@ -66,7 +66,7 @@ public class ReminderRepository {
|
||||
.enqueue(new Callback<CallResponse<ReminderResult>>() {
|
||||
@Override
|
||||
public void onResponse(Call<CallResponse<ReminderResult>> call, Response<CallResponse<ReminderResult>> response) {
|
||||
if (response.isSuccessful() && response.body() != null && response.body().result != null){
|
||||
if (response.isSuccessful() && response.body() != null){
|
||||
if (response.body().status != 200){
|
||||
addReminderCallBack.onReminderAddFailed(new Exception(), response.body().message);
|
||||
return;
|
||||
|
||||
@@ -28,9 +28,8 @@ public class ReminderResult implements Serializable {
|
||||
public String fri;
|
||||
public String sat;
|
||||
public String sun;
|
||||
public String time1;
|
||||
public String time2;
|
||||
public String time3;
|
||||
public String medicine_time;
|
||||
public ArrayList<String> medicine_time_list;
|
||||
public String active;
|
||||
public String deleted_at;
|
||||
public String created_by;
|
||||
@@ -51,11 +50,11 @@ public class ReminderResult implements Serializable {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ReminderResult that = (ReminderResult) o;
|
||||
return id == that.id && Objects.equals(patient_xid, that.patient_xid) && Objects.equals(medicine_name, that.medicine_name) && Objects.equals(dosage, that.dosage) && Objects.equals(dosage_unit, that.dosage_unit) && Objects.equals(medication_type_xid, that.medication_type_xid) && Objects.equals(medication_frequency_xid, that.medication_frequency_xid) && Objects.equals(reminder_everyday_flag, that.reminder_everyday_flag) && Objects.equals(reminder_weekday_flag, that.reminder_weekday_flag) && Objects.equals(reminder_time, that.reminder_time) && Objects.equals(medication_quantity, that.medication_quantity) && Objects.equals(medication_refill_date, that.medication_refill_date) && Objects.equals(medication_instruction, that.medication_instruction) && Objects.equals(mon, that.mon) && Objects.equals(tue, that.tue) && Objects.equals(wed, that.wed) && Objects.equals(thu, that.thu) && Objects.equals(fri, that.fri) && Objects.equals(sat, that.sat) && Objects.equals(sun, that.sun) && Objects.equals(time1, that.time1) && Objects.equals(time2, that.time2) && Objects.equals(time3, that.time3) && Objects.equals(active, that.active);
|
||||
return id == that.id && Objects.equals(patient_xid, that.patient_xid) && Objects.equals(medicine_name, that.medicine_name) && Objects.equals(dosage, that.dosage) && Objects.equals(dosage_unit, that.dosage_unit) && Objects.equals(medication_type_xid, that.medication_type_xid) && Objects.equals(medication_frequency_xid, that.medication_frequency_xid) && Objects.equals(reminder_everyday_flag, that.reminder_everyday_flag) && Objects.equals(reminder_weekday_flag, that.reminder_weekday_flag) && Objects.equals(reminder_time, that.reminder_time) && Objects.equals(medication_quantity, that.medication_quantity) && Objects.equals(medication_refill_date, that.medication_refill_date) && Objects.equals(medication_instruction, that.medication_instruction) && Objects.equals(mon, that.mon) && Objects.equals(tue, that.tue) && Objects.equals(wed, that.wed) && Objects.equals(thu, that.thu) && Objects.equals(fri, that.fri) && Objects.equals(sat, that.sat) && Objects.equals(sun, that.sun) && Objects.equals(active, that.active);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, patient_xid, medicine_name, dosage, dosage_unit, medication_type_xid, medication_frequency_xid, reminder_everyday_flag, reminder_weekday_flag, reminder_time, medication_quantity, medication_refill_date, medication_instruction, mon, tue, wed, thu, fri, sat, sun, time1, time2, time3, active);
|
||||
return Objects.hash(id, patient_xid, medicine_name, dosage, dosage_unit, medication_type_xid, medication_frequency_xid, reminder_everyday_flag, reminder_weekday_flag, reminder_time, medication_quantity, medication_refill_date, medication_instruction, mon, tue, wed, thu, fri, sat, sun, active);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="23dp"
|
||||
android:width="15dp"
|
||||
android:height="3dp"
|
||||
android:viewportWidth="23"
|
||||
android:viewportHeight="3">
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/search"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -93,6 +94,7 @@
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_below="@id/search"
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -105,7 +107,7 @@
|
||||
app:strokeWidth="1dp"
|
||||
app:strokeColor="@color/color_accent"
|
||||
|
||||
app:cardCornerRadius="15dp"
|
||||
app:cardCornerRadius="10dp"
|
||||
|
||||
>
|
||||
|
||||
@@ -115,6 +117,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/distance_away_txt"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -129,19 +132,38 @@
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/home_address"
|
||||
android:layout_below="@id/distance_away_txt"
|
||||
android:id="@+id/senior_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/_165_hasley_st_newark_nj_07102"
|
||||
android:fontFamily="@font/nunito_regular"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
android:text="@string/senior_address"
|
||||
android:fontFamily="@font/nunito_bold"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:layout_marginBottom="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/home_address"
|
||||
android:layout_below="@id/senior_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_toStartOf="@id/set_gf"
|
||||
|
||||
android:text="@string/loading"
|
||||
android:fontFamily="@font/nunito_regular"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
|
||||
/>
|
||||
|
||||
@@ -152,16 +174,29 @@
|
||||
|
||||
android:layout_alignParentEnd="true"
|
||||
|
||||
android:layout_marginStart="8dp"
|
||||
|
||||
android:layout_marginTop="8dp"
|
||||
|
||||
android:layout_marginVertical="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
|
||||
android:padding="3dp"
|
||||
app:srcCompat="@drawable/ic_setting"
|
||||
app:tint="@color/black" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/change_btn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_below="@+id/home_address"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
|
||||
android:text="@string/change"
|
||||
android:fontFamily="@font/nunito_regular"
|
||||
android:textColor="@color/white"
|
||||
android:textAllCaps="false"
|
||||
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/name"
|
||||
android:text="@string/first_name"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
android:textColor="@color/black"
|
||||
android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
|
||||
@@ -72,7 +72,7 @@
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginVertical="10dp"
|
||||
|
||||
android:hint="@string/enter_your_full_name"
|
||||
android:hint="@string/enter_your_first_name"
|
||||
android:fontFamily="@font/nunito_regular"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@android:color/darker_gray"
|
||||
|
||||
@@ -292,6 +292,7 @@
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/frequency_title_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
@@ -303,6 +304,7 @@
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/frequency_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
|
||||
tools:text="Call patient"
|
||||
tools:text="Call senior"
|
||||
android:fontFamily="@font/nunito_bold"
|
||||
android:textColor="@color/white"
|
||||
android:textAllCaps="false"
|
||||
|
||||
@@ -144,6 +144,7 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="center_vertical"
|
||||
@@ -173,6 +174,7 @@
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
@@ -300,11 +302,10 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nearest_reminder"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/no_data"
|
||||
android:text="@string/next_medication_schedule"
|
||||
android:fontFamily="@font/nunito_semibold"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
@@ -314,9 +315,9 @@
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
|
||||
android:drawablePadding="15dp"
|
||||
android:drawablePadding="10dp"
|
||||
|
||||
app:drawableStartCompat="@drawable/ic_pill"
|
||||
app:drawableStartCompat="@drawable/ic_dash_small"
|
||||
app:drawableTint="@color/color_primary_dark" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -330,7 +331,7 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/daily_reminder"
|
||||
android:id="@+id/nearest_reminder"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -346,7 +347,7 @@
|
||||
|
||||
android:drawablePadding="15dp"
|
||||
|
||||
app:drawableStartCompat="@drawable/ic_dash_small"
|
||||
app:drawableStartCompat="@drawable/ic_pill"
|
||||
app:drawableTint="@color/white" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
android:layout_marginBottom="5dp"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
android:text="@string/create_a_pin"
|
||||
android:textSize="@dimen/_24ssp"
|
||||
android:textSize="@dimen/_18ssp"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<TextView
|
||||
@@ -45,7 +45,7 @@
|
||||
android:layout_marginVertical="5dp"
|
||||
android:fontFamily="@font/nunito_regular"
|
||||
android:text="@string/create_a_pin_to_securely_store_your_personal_data"
|
||||
android:textSize="@dimen/_18ssp"
|
||||
android:textSize="@dimen/_16ssp"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<TextView
|
||||
@@ -56,7 +56,7 @@
|
||||
android:layout_marginTop="50dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
android:textSize="@dimen/_18ssp"
|
||||
android:textSize="@dimen/_16ssp"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/edit_text_bg_2"
|
||||
|
||||
android:hint="@string/enter_your_pin"
|
||||
android:hint="@string/set_4_digit_login_pin"
|
||||
android:paddingVertical="15sp"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:fontFamily="@font/nunito_regular"
|
||||
@@ -114,7 +114,7 @@
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
android:textSize="@dimen/_18ssp"
|
||||
android:textSize="@dimen/_16ssp"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/edit_text_bg_2"
|
||||
|
||||
android:hint="@string/enter_your_pin"
|
||||
android:hint="@string/confirm_your_pin"
|
||||
android:paddingVertical="15sp"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:fontFamily="@font/nunito_regular"
|
||||
|
||||
51
app/src/main/res/layout/fua_edu_dialog.xml
Normal file
51
app/src/main/res/layout/fua_edu_dialog.xml
Normal file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/round_corners"
|
||||
android:backgroundTint="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/to_update_the_frequently_used_apps_go_to_nprofile_frequently_used_apps"
|
||||
android:fontFamily="@font/nunito_bold"
|
||||
android:textColor="@color/black"
|
||||
android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
|
||||
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/check_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/don_t_show_this"
|
||||
android:fontFamily="@font/nunito_regular"
|
||||
android:textColor="@color/black"
|
||||
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_gravity="end"
|
||||
|
||||
android:text="@string/close"
|
||||
android:fontFamily="@font/nunito_bold"
|
||||
android:textColor="@color/white"
|
||||
|
||||
android:layout_marginBottom="15dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -7,39 +7,6 @@
|
||||
android:background="@drawable/top_round_corner"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/location"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
android:textColor="@color/black"
|
||||
android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginTop="35sp"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/location"
|
||||
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:hint="@string/enter_your_location"
|
||||
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:autofillHints="name"
|
||||
android:inputType="textCapSentences"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -78,7 +45,7 @@
|
||||
android:paddingVertical="15dp"
|
||||
android:padding="10dp"
|
||||
|
||||
android:maxLength="6"
|
||||
android:maxLength="5"
|
||||
|
||||
android:inputType="numberDecimal"
|
||||
/>
|
||||
@@ -150,6 +117,11 @@
|
||||
|
||||
android:autofillHints="name"
|
||||
android:inputType="textCapSentences"
|
||||
|
||||
android:digits="@string/allowed_alphabets_with_space"
|
||||
android:singleLine="true"
|
||||
|
||||
android:maxLength="255"
|
||||
/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<string name="for_your_security_please_change_the_temporary_pin_to_a_new_pin">For your security, Please change the temporary pin to a new pin</string>
|
||||
<string name="new_pin">New Pin</string>
|
||||
<string name="enter_your_new_pin">Enter your new pin</string>
|
||||
<string name="confirm_pin">Confirm your Pin</string>
|
||||
<string name="confirm_pin">Re-enter your Pin</string>
|
||||
<string name="reset_pin">Reset Pin</string>
|
||||
<string name="lets_get_started">Lets get started</string>
|
||||
<string name="enter_your_contact_information">Enter your contact information</string>
|
||||
@@ -67,9 +67,9 @@
|
||||
<string name="enter_your_state">Enter your state</string>
|
||||
<string name="enter_your_country">Enter your country</string>
|
||||
<string name="enter_your_zip_code">Enter your zip code</string>
|
||||
<string name="create_a_pin">Create a pin</string>
|
||||
<string name="create_a_pin">Create a 4-digit pin</string>
|
||||
<string name="create_a_pin_to_securely_store_your_personal_data">Create a pin to securely store your personal data</string>
|
||||
<string name="set_4_digit_login_pin">Set 4 digit login pin</string>
|
||||
<string name="set_4_digit_login_pin">Enter 4-digit login pin</string>
|
||||
<string name="set_pin">Set pin</string>
|
||||
<string name="thank_you">Thank you !</string>
|
||||
<string name="let_s_add_your_caregiver_contact_information">Let\'s add your caregiver contact information</string>
|
||||
@@ -298,8 +298,8 @@
|
||||
<string name="or">OR</string>
|
||||
<string name="unlock_with_fingerprint">Unlock with Fingerprint or FaceID</string>
|
||||
<string name="enter_login_pin">Enter Login pin</string>
|
||||
<string name="remote_access_to_patient_s_profile_and_setting">Remote access to patient\'s profile and setting</string>
|
||||
<string name="real_time_patient_tracking">Real time patient tracking</string>
|
||||
<string name="remote_access_to_patient_s_profile_and_setting">Remote access to senior\'s profile and setting</string>
|
||||
<string name="real_time_patient_tracking">Real time senior tracking</string>
|
||||
<string name="real_time_alerts_and_notifications">Real-time alerts and notifications</string>
|
||||
<string name="setup_geo_fence_zone">Setup geo-fence zone</string>
|
||||
<string name="retry"><u>Retry</u></string>
|
||||
@@ -315,7 +315,7 @@
|
||||
<string name="no_contacts_found">No contacts found.</string>
|
||||
<string name="there_are_no_contacts_added_in_your_contact_directory_please_click_on_the_create_new_contact_button_above">There are no contacts added in your contact directory. Please click on the "Create New Contact" button above.</string>
|
||||
<string name="geofencing">Geofencing</string>
|
||||
<string name="set_specific_geographic_areas_and_receive_instant_alerts_when_your_loved_one_leaves_the_geofenced_zone">Set specific geographic areas and receive instant alerts when your loved one leaves the geofenced zone.</string>
|
||||
<string name="set_specific_geographic_areas_and_receive_instant_alerts_when_your_loved_one_leaves_the_geofenced_zone">Add geofence and receive notification when senior’s smartphone leaves the area of the geofence</string>
|
||||
<string name="destination_0_5m_away">Unknown location</string>
|
||||
<string name="_165_hasley_st_newark_nj_07102">Couldn\'t load address</string>
|
||||
<string name="enter_your_location">Enter your location</string>
|
||||
@@ -324,9 +324,9 @@
|
||||
<string name="_0_00">0.00</string>
|
||||
<string name="message">Message</string>
|
||||
<string name="enter_a_message">Enter a message</string>
|
||||
<string name="syncing_patient_information">Syncing patient information</string>
|
||||
<string name="we_are_currently_syncing_patient_data_this_may_take_a_few_seconds">We are currently syncing patient data. This may take a few seconds.</string>
|
||||
<string name="patient_profile">Patient profile</string>
|
||||
<string name="syncing_patient_information">Syncing senior information</string>
|
||||
<string name="we_are_currently_syncing_patient_data_this_may_take_a_few_seconds">We are currently syncing senior data. This may take a few seconds.</string>
|
||||
<string name="patient_profile">Senior profile</string>
|
||||
<string name="contacts">Contacts</string>
|
||||
<string name="medication">Medication</string>
|
||||
<string name="medical_records">Medical Records</string>
|
||||
@@ -388,9 +388,9 @@
|
||||
<string name="select_default_contact">(Select default number)</string>
|
||||
<string name="reset">Reset</string>
|
||||
<string name="update">Update</string>
|
||||
<string name="patients_home_address">Patients Home Address</string>
|
||||
<string name="patients_home_address">Senior\'s Home Address</string>
|
||||
<string name="when_updating_a_password_it_s_essential_to_create_a_strong_unique_password">When updating a password, it\'s essential to create a strong, unique password.</string>
|
||||
<string name="subscribe_description">Your credit card will be charged 24 hours before your subscription period expires. You can cancel your subscription at any time by visiting this page.</string>
|
||||
<string name="subscribe_description">Your credit card will be charged 24 hours before your subscription period expires. You can cancel your subscription at any time by visiting Senior\'s profile and selecting subscription.</string>
|
||||
<string name="contact_email">contact.us@simplitent.com</string>
|
||||
<string name="instructions_title">Instructions:</string>
|
||||
<string name="you_are_about_to_change_emergency_number_from_this_contact_to_911_please_confirm">You are about to change emergency number from this contact to 911. Please confirm</string>
|
||||
@@ -471,5 +471,13 @@
|
||||
<string name="subscribe_cancelled_description">Your subscription has been canceled. You will be able to use your application until the end of your current subscription. Your app will stop working at that point.</string>
|
||||
<string name="allowed_alphanumeric_space_special"><![CDATA[abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890~!@#$%^&*()-_+=[]{}|:;\'\"<>,.?/]]></string>
|
||||
<string name="add_frequently_used_apps_by_visiting_profile_frequently_used_apps"><![CDATA[Add frequently used apps by visiting Profile -> Frequently used apps]]></string>
|
||||
<string name="change">Change</string>
|
||||
<string name="senior_address">Senior address:</string>
|
||||
<string name="confirm_your_pin">Confirm your pin</string>
|
||||
<string name="first_name">First name*</string>
|
||||
<string name="enter_your_first_name">Enter your first name</string>
|
||||
<string name="to_update_the_frequently_used_apps_go_to_nprofile_frequently_used_apps"><![CDATA[To update the frequently used apps, go to profile >> Frequently used apps]]></string>
|
||||
<string name="don_t_show_this">Don\'t show this</string>
|
||||
<string name="next_medication_schedule">Next medication schedule:</string>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user