.
This commit is contained in:
8
.idea/deploymentTargetDropDown.xml
generated
8
.idea/deploymentTargetDropDown.xml
generated
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<runningDeviceTargetSelectedWithDropDown>
|
||||
<targetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<type value="QUICK_BOOT_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="VIRTUAL_DEVICE_PATH" />
|
||||
@@ -11,8 +11,8 @@
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</runningDeviceTargetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2024-01-17T10:14:36.242892Z" />
|
||||
</targetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2024-01-18T07:41:56.824804Z" />
|
||||
<targetsSelectedWithDialog>
|
||||
<Target>
|
||||
<type value="QUICK_BOOT_TARGET" />
|
||||
|
||||
@@ -11,9 +11,11 @@ import android.app.NotificationManager;
|
||||
import android.content.Intent;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.app.simplitend.patient_dashboard.PatientMainViewModel;
|
||||
import com.onesignal.OneSignal;
|
||||
import com.onesignal.notifications.INotificationReceivedEvent;
|
||||
import com.onesignal.notifications.INotificationServiceExtension;
|
||||
@@ -110,10 +112,13 @@ public class NotificationService implements INotificationServiceExtension {
|
||||
iNotificationReceivedEvent.getContext().startActivity(intent);
|
||||
}else{
|
||||
// when patient is logged in
|
||||
if (MEDICINE_TIME.equals(content_type) || ACTIVITY_TIME.equals(content_type) || BATTERY_LOW.equals(content_type)){
|
||||
// Only for meds and activity reminders
|
||||
|
||||
if ( (PatientMainViewModel.remindersList != null && MEDICINE_TIME.equals(content_type)) ||
|
||||
(PatientMainViewModel.activityList != null && ACTIVITY_TIME.equals(content_type)) ||
|
||||
BATTERY_LOW.equals(content_type)){
|
||||
iNotificationReceivedEvent.getContext().startActivity(intent);
|
||||
}
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
|
||||
@@ -246,8 +246,6 @@ public class EditProfileInfoActivity extends AppCompatActivity implements
|
||||
|
||||
} else if (result.getResultCode() == ImagePicker.RESULT_ERROR) {
|
||||
Toast.makeText(this, ImagePicker.getError(result.getData()), Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(this, "Task Cancelled", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.app.simplitend.databinding.ActivityCallsBinding;
|
||||
import com.app.simplitend.databinding.CallListDialogBinding;
|
||||
import com.app.simplitend.databinding.CreateContactViewHolderBinding;
|
||||
import com.app.simplitend.welcome.welcomepatient.fragments.contacts.AddContactAdapter;
|
||||
import com.app.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.FiftyContactsAdapter;
|
||||
import com.app.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactData;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
|
||||
@@ -28,10 +29,14 @@ public class CallsActivity extends AppCompatActivity implements AddContactAdapte
|
||||
protected ActivityCallsBinding binding;
|
||||
|
||||
public static final String CALL_CONTACT_LIST_KEY = "contact_list_key";
|
||||
public static final String IS_50_CONTACTS_VIEW = "is_50_contacts_view";
|
||||
|
||||
protected AddContactAdapter contactAdapter;
|
||||
protected FiftyContactsAdapter fiftyContactsAdapter;
|
||||
protected ArrayList<ContactData> contactList;
|
||||
|
||||
private boolean is50ContactsView;
|
||||
|
||||
private String select_phone_number;
|
||||
|
||||
@Override
|
||||
@@ -42,6 +47,8 @@ public class CallsActivity extends AppCompatActivity implements AddContactAdapte
|
||||
|
||||
contactList = (ArrayList<ContactData>) getIntent().getSerializableExtra(CALL_CONTACT_LIST_KEY);
|
||||
|
||||
is50ContactsView = getIntent().getBooleanExtra(IS_50_CONTACTS_VIEW, false);
|
||||
|
||||
initViews();
|
||||
|
||||
clickEvents();
|
||||
@@ -61,15 +68,28 @@ public class CallsActivity extends AppCompatActivity implements AddContactAdapte
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
binding.contactRv.setLayoutManager(new GridLayoutManager(this, 2, LinearLayoutManager.VERTICAL, false));
|
||||
contactAdapter = new AddContactAdapter();
|
||||
binding.contactRv.setAdapter(contactAdapter);
|
||||
contactAdapter.setContactClickListener(this);
|
||||
if (!is50ContactsView) {
|
||||
binding.contactRv.setLayoutManager(new GridLayoutManager(this, 2, LinearLayoutManager.VERTICAL, false));
|
||||
contactAdapter = new AddContactAdapter();
|
||||
binding.contactRv.setAdapter(contactAdapter);
|
||||
contactAdapter.setContactClickListener(this);
|
||||
|
||||
if (contactList != null){
|
||||
contactAdapter.submitList(contactList);
|
||||
}else{
|
||||
Toast.makeText(this, "Couldn't load contact list", Toast.LENGTH_SHORT).show();
|
||||
if (contactList != null){
|
||||
contactAdapter.submitList(contactList);
|
||||
}else{
|
||||
Toast.makeText(this, "Couldn't load contact list", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
binding.contactRv.setLayoutManager(new LinearLayoutManager(this));
|
||||
fiftyContactsAdapter = new FiftyContactsAdapter();
|
||||
binding.contactRv.setAdapter(fiftyContactsAdapter);
|
||||
fiftyContactsAdapter.setContactClickListener(this);
|
||||
|
||||
if (contactList != null){
|
||||
fiftyContactsAdapter.submitList(contactList);
|
||||
}else{
|
||||
Toast.makeText(this, "Couldn't load contact list", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import static com.app.simplitend.patient_dashboard.DirectionToHomeActivity.LNG_K
|
||||
import static com.app.simplitend.patient_dashboard.NotificationsActivity.USER_ID;
|
||||
import static com.app.simplitend.patient_dashboard.NotificationsActivity.USER_TOKEN;
|
||||
import static com.app.simplitend.patient_dashboard.fragments.CallsActivity.CALL_CONTACT_LIST_KEY;
|
||||
import static com.app.simplitend.patient_dashboard.fragments.CallsActivity.IS_50_CONTACTS_VIEW;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
@@ -381,6 +382,9 @@ public class PatientDashboardFragment extends Fragment implements ProfileContrac
|
||||
if (contactList != null) {
|
||||
Intent intent = new Intent(requireActivity(), CallsActivity.class);
|
||||
intent.putExtra(CALL_CONTACT_LIST_KEY, contactList);
|
||||
if (patientData != null){
|
||||
intent.putExtra(IS_50_CONTACTS_VIEW, patientData.is_contact_view_updated == 1);
|
||||
}
|
||||
startActivity(intent);
|
||||
|
||||
} else {
|
||||
|
||||
@@ -186,8 +186,6 @@ public class CreateContactFragment extends Fragment implements WelcomeContracts.
|
||||
Log.d(TAG, "initializeViews: " + selectedImageUri.getPath());
|
||||
} else if (result.getResultCode() == ImagePicker.RESULT_ERROR) {
|
||||
Toast.makeText(requireContext(), ImagePicker.getError(result.getData()), Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(requireContext(), "Task Cancelled", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
android:id="@+id/contact_rv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:overScrollMode="never" />
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_marginBottom="10dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
@@ -15,6 +14,11 @@
|
||||
app:strokeColor="@color/color_accent"
|
||||
app:strokeWidth="1dp"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
|
||||
app:cardElevation="3dp"
|
||||
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginHorizontal="3dp"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
|
||||
Reference in New Issue
Block a user