This commit is contained in:
14Sandee
2023-11-20 20:36:31 +05:30
parent ddae42141c
commit e352ee41d5
10 changed files with 109 additions and 88 deletions

View File

@@ -7,12 +7,12 @@
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\ADITYA\.android\avd\Aditya_Pie.avd" />
<value value="$USER_HOME$/.android/avd/Pixel_7_Pro_API_33.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-11-17T19:42:40.119339700Z" />
<timeTargetWasSelectedWithDropDown value="2023-11-20T12:11:11.626003Z" />
<targetsSelectedWithDialog>
<Target>
<type value="QUICK_BOOT_TARGET" />

View File

@@ -588,8 +588,15 @@ public abstract class AppUtil {
R.drawable.img_med_refill,
title, body,
refill_description, "Text senior", view -> {
bsd.dismiss();
text_senior_click.onClick(null);
// bsd.dismiss();
// text_senior_click.onClick(null);
CaregiverDataCache.getCaregiverData(context,
(careGiverData -> {
if (careGiverData != null && careGiverData.patientDetails != null){
AppUtil.messageNumber(context, careGiverData.patientDetails.phone_number);
}
}), true);
});
bsd.show();
@@ -680,6 +687,9 @@ public abstract class AppUtil {
public static void patientSignOut(Context context) {
AppUtil.savePatientData(null, -1, context, false);
PatientDataCache.setPatientData(null);
PatientDataCache.setContactList(null);
// turning off app_blocking accessibility permission
Intent stop_accessibility_intent = new Intent(context, TopAppDetectionService.class);
stop_accessibility_intent.setAction(TopAppDetectionService.STOP_ACCESSIBILITY_SERVICE);
@@ -766,6 +776,8 @@ public abstract class AppUtil {
saveCgData(null, -1, context);
setWantSecurityFlag(context, NOT_ASKED_CG_SECURITY);
CaregiverDataCache.setCareGiverData(null);
// setting up notification prefs default to yes
setCgNotificationPref(context, MEDICATIONS_NOTIFICATIONS, true);
setCgNotificationPref(context, MEDICATION_REFILL_NOTIFICATIONS, true);

View File

@@ -12,6 +12,7 @@ import androidx.lifecycle.ViewModelProvider;
import com.app.simplitend.R;
import com.app.simplitend.apputils.AppUtil;
import com.app.simplitend.apputils.CaregiverDataCache;
import com.app.simplitend.caregiverdashboard.activities.deactivateacc.DeActivateAccountActivity;
import com.app.simplitend.caregiverdashboard.mvvm.CaregiverMainViewModel;
import com.app.simplitend.caregiverdashboard.mvvm.CgHomeContracts;

View File

@@ -85,8 +85,6 @@ public class CgDashBoardFragment extends Fragment implements
private boolean gotoGeofenceActivity;
private Marker pat_curr_marker;
public CgDashBoardFragment(){
// required empty
}
@@ -420,6 +418,7 @@ public class CgDashBoardFragment extends Fragment implements
progressDialog.dismiss();
try {
if (gotoGeofenceActivity){
gotoGeofenceActivity = false;
Intent intent = new Intent(requireActivity(), CgGeoFencingActivity.class);
intent.putExtra(GEOFENCE_DETAILS_KEY, geoFenceDetails);
startActivity(intent);

View File

@@ -545,9 +545,28 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
isTrackingSenior = false;
this.selectedStreet = null;
binding.updateBtnsView.setVisibility(View.VISIBLE);
binding.homeLocationBtn.setVisibility(View.GONE);
binding.cgLocationBtn.setVisibility(View.GONE);
// checking is user selected same address
try {
if (patientData == null) throw new Exception();
double lat = Double.parseDouble(patientData.lat);
double lng = Double.parseDouble(patientData.lng);
if (mHomeLatLng.latitude != lat || mHomeLatLng.longitude != lng){
binding.updateBtnsView.setVisibility(View.VISIBLE);
binding.homeLocationBtn.setVisibility(View.GONE);
binding.cgLocationBtn.setVisibility(View.GONE);
}else {
binding.updateBtnsView.setVisibility(View.GONE);
binding.homeLocationBtn.setVisibility(View.VISIBLE);
binding.cgLocationBtn.setVisibility(View.VISIBLE);
}
} catch (Exception e) {
// near marine drive
binding.updateBtnsView.setVisibility(View.VISIBLE);
binding.homeLocationBtn.setVisibility(View.GONE);
binding.cgLocationBtn.setVisibility(View.GONE);
}
updateHomeMarker(this.mHomeLatLng);
addRadius();
@@ -644,9 +663,28 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
this.mHomeLatLng = place.getLatLng();
this.selectedStreet = place.getName();
binding.updateBtnsView.setVisibility(View.VISIBLE);
binding.homeLocationBtn.setVisibility(View.GONE);
binding.cgLocationBtn.setVisibility(View.GONE);
// checking is user selected same address
try {
if (patientData == null) throw new Exception();
double lat = Double.parseDouble(patientData.lat);
double lng = Double.parseDouble(patientData.lng);
if (mHomeLatLng.latitude != lat || mHomeLatLng.longitude != lng){
binding.updateBtnsView.setVisibility(View.VISIBLE);
binding.homeLocationBtn.setVisibility(View.GONE);
binding.cgLocationBtn.setVisibility(View.GONE);
}else{
binding.updateBtnsView.setVisibility(View.GONE);
binding.homeLocationBtn.setVisibility(View.VISIBLE);
binding.cgLocationBtn.setVisibility(View.VISIBLE);
}
} catch (Exception e) {
// near marine drive
binding.updateBtnsView.setVisibility(View.VISIBLE);
binding.homeLocationBtn.setVisibility(View.GONE);
binding.cgLocationBtn.setVisibility(View.GONE);
}
updateHomeMarker(this.mHomeLatLng);
addRadius();
@@ -660,6 +698,15 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
progressDialog.dismiss();
this.geoFenceDetails = geoFenceDetails;
binding.updateBtnsView.setVisibility(View.GONE);
binding.homeLocationBtn.setVisibility(View.VISIBLE);
binding.cgLocationBtn.setVisibility(View.VISIBLE);
binding.search.setVisibility(View.GONE);
binding.changeBtn.setText(getString(R.string.change));
Toast.makeText(this, "Geofence updated successfully", Toast.LENGTH_SHORT).show();
bottomSheetDialog.dismiss();
updateHomeMarker(mHomeLatLng);
@@ -677,6 +724,10 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
binding.updateBtnsView.setVisibility(View.GONE);
binding.homeLocationBtn.setVisibility(View.VISIBLE);
binding.cgLocationBtn.setVisibility(View.VISIBLE);
binding.search.setVisibility(View.GONE);
binding.changeBtn.setText(getString(R.string.change));
this.careGiverData.patientDetails = patientData;
this.patientData = patientData;
CaregiverDataCache.setCareGiverData(this.careGiverData);

View File

@@ -70,7 +70,7 @@ public class LocationService extends Service implements LocationClient.DefaultLo
SocketHelper.getInstance().establishConnection(null);
Notification notification = new NotificationCompat.Builder(this, LOCATION_NOTIFICATION_CHANNEL_ID)
.setContentTitle("SimpliTend is sharing your current location")
.setContentTitle("Your phone is connected to your caregiver")
.setSmallIcon(R.mipmap.ic_launcher_round)
.setOngoing(true)
.build();

View File

@@ -26,6 +26,7 @@ import androidx.lifecycle.ViewModelProvider;
import com.app.simplitend.R;
import com.app.simplitend.apputils.AppUtil;
import com.app.simplitend.apputils.PatientDataCache;
import com.app.simplitend.databinding.ActivityDirectionToHomeBinding;
import com.google.android.gms.location.FusedLocationProviderClient;
import com.google.android.gms.location.LocationListener;
@@ -362,88 +363,44 @@ public class DirectionToHomeActivity extends AppCompatActivity
}
private void loadAddresses(DirectionsResult directionsResult) {
try {
// fetching address from the lag lng
Geocoder geocoder = new Geocoder(this, Locale.getDefault());
List<Address> addresses = geocoder.getFromLocation(directionsResult.routes[0].legs[0].startLocation.lat, directionsResult.routes[0].legs[0].startLocation.lng, 1);
// String home_loc = AppUtil.getCompleteAddress(this, pat_lat, pat_lng);
PatientDataCache.getPatientData(this, (patientData -> {
if (patientData != null){
StringBuilder home_add = new StringBuilder();
if (addresses != null && addresses.size() > 0 && addresses.get(0) != null) {
Address address = addresses.get(0);
your_loc = "";
if (address.getMaxAddressLineIndex() > 0 && address.getAddressLine(0) != null){
your_loc = address.getAddressLine(0);
if (patientData.address_line1 != null && !patientData.address_line1.trim().isEmpty()){
home_add.append(patientData.address_line1);
}
if (your_loc != null && !your_loc.isEmpty()) your_loc += ", ";
if (address.getLocality() != null){
your_loc += address.getLocality();
if (home_add.length() > 0){
home_add.append(", ");
}
if (your_loc != null && !your_loc.isEmpty()) your_loc += ", ";
if (address.getAdminArea() != null){
your_loc += address.getAdminArea();
if (patientData.city != null && !patientData.city.trim().isEmpty()){
home_add.append(patientData.city);
}
if (your_loc != null && !your_loc.isEmpty()) your_loc += ", ";
if (home_add.length() > 0){
home_add.append(", ");
}
if (address.getCountryName() != null){
your_loc += address.getCountryName();
if (patientData.state != null && !patientData.state.trim().isEmpty()){
home_add.append(patientData.state);
}
if (home_add.length() > 0){
home_add.append(", ");
}
if (patientData.country != null && !patientData.country.trim().isEmpty()){
home_add.append(patientData.country);
}
if (home_add.length() > 0){
binding.homeLoc.setText(home_add);
}
}
} catch (Exception e) {
// do nothing as we couldn't load the location from the lat lng
if (your_loc != null && your_loc.isEmpty()) your_loc = null;
}
if (your_loc != null){
binding.yourLoc.setText(your_loc);
}
String home_loc = "";
try {
// fetching address from the lag lng
Geocoder geocoder = new Geocoder(this, Locale.getDefault());
List<Address> addresses = geocoder.getFromLocation(directionsResult.routes[0].legs[0].endLocation.lat, directionsResult.routes[0].legs[0].endLocation.lng, 1);
if (addresses != null && addresses.size() > 0 && addresses.get(0) != null) {
Address address = addresses.get(0);
if (address.getMaxAddressLineIndex() > 0 && address.getAddressLine(0) != null){
home_loc = address.getAddressLine(0);
}
if (home_loc != null && !home_loc.isEmpty()) home_loc += ", ";
if (address.getLocality() != null){
home_loc += address.getLocality();
}
if (home_loc != null && !home_loc.isEmpty()) home_loc += ", ";
if (address.getAdminArea() != null){
home_loc += address.getAdminArea();
}
if (home_loc != null && !home_loc.isEmpty()) home_loc += ", ";
if (address.getCountryName() != null){
home_loc += address.getCountryName();
}
}
} catch (Exception e) {
// do nothing as we couldn't load the location from the lat lng
if (home_loc != null && home_loc.isEmpty()) home_loc = null;
}
if (home_loc != null){
binding.homeLoc.setText(home_loc);
}
}), true);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -125,7 +125,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
@@ -142,6 +141,8 @@
android:layout_marginStart="5dp"
android:layout_gravity="center_vertical"
android:text="@string/your_location"
android:fontFamily="@font/nunito_medium"
android:textColor="@color/black"
@@ -160,7 +161,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
@@ -177,6 +177,8 @@
android:layout_marginStart="5dp"
android:layout_gravity="center_vertical"
android:text="@string/home_address_txt"
android:fontFamily="@font/nunito_medium"
android:textColor="@color/black"

View File

@@ -135,7 +135,6 @@
android:layout_marginHorizontal="15dp"
android:layout_marginVertical="10dp"
android:autofillHints="name"
android:background="@drawable/edit_text_bg_2"
android:drawableStart="@drawable/ic_relation"
android:drawablePadding="10dp"