This commit is contained in:
meet2711
2024-03-13 20:04:44 +05:30
parent 5159ad7c82
commit 371e6bb6bb
7 changed files with 48 additions and 11 deletions

View File

@@ -447,7 +447,7 @@ public class BottomNotificationActivity extends AppCompatActivity {
case MEAL_REMINDER:
setUpCgBottomSheet(binding,
R.drawable.img_out_of_geo,
title, body,
patient_name + " has skipped their meal!", body,
null, "Call senior",
v -> {
CaregiverDataCache.getCaregiverData(context, (careGiverData -> {

View File

@@ -57,6 +57,9 @@ public class PatSettingsActivity extends AppCompatActivity implements CgHomeCont
OneSignal.getUser().getPushSubscription().optOut();
}
});
binding.callBlockCheck.setChecked(AppUtil.isCallBlockingEnabled(this));
binding.callBlockCheck.setOnCheckedChangeListener(((compoundButton, b) -> AppUtil.setIsCallBlockingEnabled(this, b)));
}
private void clickEvents() {

View File

@@ -43,9 +43,9 @@ public abstract class FoodScheduler {
, lunchMeal, dinnerMeal;
static {
breakFastMeal = new Meal(FOOD_TIME.BREAK_FAST, 18, 56);
lunchMeal = new Meal(FOOD_TIME.LUNCH, 18, 57);
dinnerMeal = new Meal(FOOD_TIME.DINNER, 19, 17);
breakFastMeal = new Meal(FOOD_TIME.BREAK_FAST, 9, 0);
lunchMeal = new Meal(FOOD_TIME.LUNCH, 13, 0);
dinnerMeal = new Meal(FOOD_TIME.DINNER, 20, 0);
}
public static void scheduleFoodReminders(Context context){

View File

@@ -93,6 +93,8 @@ public class PatientDashboardFragment extends Fragment implements ProfileContrac
private ActivityResultLauncher<String> callPermissionLauncher;
private String sos_phone_number = "911";
// date suffixes
String[] suffixes =
// 0 1 2 3 4 5 6 7 8 9
@@ -131,9 +133,9 @@ public class PatientDashboardFragment extends Fragment implements ProfileContrac
callPermissionLauncher = registerForActivityResult(new ActivityResultContracts.RequestPermission(),
isGranted -> {
if (patientData == null) return;
if (sos_phone_number == null) return;
AppUtil.callPhone(requireActivity(), patientData.phone_number);
AppUtil.callPhone(requireActivity(), sos_phone_number);
});
initViews();
@@ -360,18 +362,16 @@ public class PatientDashboardFragment extends Fragment implements ProfileContrac
viewModel.notifyRequestedSOS(AppUtil.getPatientUid(requireContext()) + "",
AppUtil.getPatientToken(requireContext()));
String phone_number = "911";
for (ContactData contactData : contactList1) {
if (contactData.is_sos.equals("1")) {
phone_number = contactData.phone_number;
sos_phone_number = contactData.phone_number;
}
}
if ("911".equals(phone_number)){
if ("911".equals(sos_phone_number)){
WorkManager.getInstance(requireContext()).cancelAllWorkByTag(CALL_BLOCKING_WORk);
WorkRequest workRequest = new OneTimeWorkRequest.Builder(CallUnBlockingWorker.class)
.setInitialDelay(1, TimeUnit.MINUTES)
.setInitialDelay(30, TimeUnit.MINUTES)
.addTag(CALL_BLOCKING_WORk)
.build();

View File

@@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM4,12c0,-4.42 3.58,-8 8,-8 1.85,0 3.55,0.63 4.9,1.69L5.69,16.9C4.63,15.55 4,13.85 4,12zM12,20c-1.85,0 -3.55,-0.63 -4.9,-1.69L18.31,7.1C19.37,8.45 20,10.15 20,12c0,4.42 -3.58,8 -8,8z"/>
</vector>

View File

@@ -161,6 +161,34 @@
app:showText="false"
/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/call_block_check"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:text="@string/call_blocking"
android:fontFamily="@font/nunito_medium"
android:textColor="@color/black"
android:textSize="@dimen/_14ssp"
android:drawablePadding="15dp"
app:drawableStartCompat="@drawable/ic_block"
android:layout_marginHorizontal="15dp"
android:layout_marginTop="25dp"
android:paddingHorizontal="15dp"
android:paddingVertical="15dp"
android:elevation="3dp"
android:background="@drawable/edit_text_bg_2"
app:switchMinWidth="60dp"
app:track="@drawable/switch_track_1"
app:thumbTint="@color/color_primary"
app:showText="false"
/>
<TextView
android:id="@+id/logout"
android:layout_width="match_parent"

View File

@@ -495,5 +495,6 @@
<string name="update_to_50_contacts">Update to 50 contacts</string>
<string name="proceed_to_the_payment_website_to_select_a_subscription_option_and_pay">Proceed to the payment website to select a subscription option and pay</string>
<string name="proceed_to_website">Proceed to website</string>
<string name="call_blocking">Call blocking</string>
</resources>