Solved issues and support from release 1
This commit is contained in:
@@ -13,7 +13,7 @@ android {
|
||||
applicationId "com.app.simplitend"
|
||||
minSdk 24
|
||||
targetSdk 33
|
||||
versionCode 4
|
||||
versionCode 5
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@@ -70,6 +70,7 @@ public class PatientProfileShowerActivity extends AppCompatActivity {
|
||||
switch (which_f){
|
||||
case CONTACTS_F:
|
||||
fragment = new AddContactFragment();
|
||||
((AddContactFragment) fragment).setIsSetupComplete(true);
|
||||
break;
|
||||
case MED_REMINDER_F:
|
||||
fragment = new ReminderFragment();
|
||||
|
||||
@@ -57,6 +57,9 @@ import com.google.android.gms.maps.SupportMapFragment;
|
||||
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.android.gms.maps.model.MarkerOptions;
|
||||
import com.onesignal.OneSignal;
|
||||
import com.onesignal.notifications.INotificationLifecycleListener;
|
||||
import com.onesignal.notifications.INotificationWillDisplayEvent;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -67,7 +70,7 @@ import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class CgDashBoardFragment extends Fragment implements
|
||||
OnMapReadyCallback, ArticleContracts.GetArticleCallback, CgHomeContracts.GetGeoFenceCallback, ProfileContracts.GetRemindersListCallback, CaregiverMainViewModel.GetNearestResultCallback, ProfileContracts.GetRoutinesCallback, CaregiverMainViewModel.GetNearestActivityCallback {
|
||||
OnMapReadyCallback, ArticleContracts.GetArticleCallback, CgHomeContracts.GetGeoFenceCallback, ProfileContracts.GetRemindersListCallback, CaregiverMainViewModel.GetNearestResultCallback, ProfileContracts.GetRoutinesCallback, CaregiverMainViewModel.GetNearestActivityCallback, INotificationLifecycleListener {
|
||||
|
||||
// view binding
|
||||
protected CaregiverDashFragmentBinding binding;
|
||||
@@ -141,12 +144,15 @@ public class CgDashBoardFragment extends Fragment implements
|
||||
|
||||
loadArticles();
|
||||
|
||||
OneSignal.getNotifications().addForegroundLifecycleListener(this);
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
updateNotificationsCount();
|
||||
CaregiverDataCache.getCaregiverData(requireActivity(), (careGiverData1 -> {
|
||||
this.careGiverData = careGiverData1;
|
||||
|
||||
@@ -162,6 +168,18 @@ public class CgDashBoardFragment extends Fragment implements
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
OneSignal.getNotifications().removeForegroundLifecycleListener(this);
|
||||
}
|
||||
|
||||
private void updateNotificationsCount() {
|
||||
int notificationsCount = AppUtil.getNoOfNotificationsCount(requireContext());
|
||||
if (notificationsCount > 0){
|
||||
binding.notificationCount.setText(String.valueOf(notificationsCount));
|
||||
binding.notificationCount.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
binding.notificationCount.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadActivities() {
|
||||
@@ -639,4 +657,13 @@ public class CgDashBoardFragment extends Fragment implements
|
||||
viewModel.ongoingActivityText = binding.onGoingActivity.getText().toString();
|
||||
viewModel.upcomingActivityText = binding.upcomingActivity.getText().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWillDisplay(@NonNull INotificationWillDisplayEvent iNotificationWillDisplayEvent) {
|
||||
try {
|
||||
requireActivity().runOnUiThread(this::updateNotificationsCount);
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,10 +49,16 @@ public class AddContactFragment extends Fragment implements WelcomeContracts.Con
|
||||
private int contacts_count;
|
||||
private boolean is_doctor_set;
|
||||
|
||||
private boolean isSetupComplete;
|
||||
|
||||
public AddContactFragment(){
|
||||
// required empty const.
|
||||
}
|
||||
|
||||
public void setIsSetupComplete(boolean isSetupComplete){
|
||||
this.isSetupComplete = isSetupComplete;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
@@ -60,6 +66,10 @@ public class AddContactFragment extends Fragment implements WelcomeContracts.Con
|
||||
|
||||
contactViewModel = new ViewModelProvider(requireActivity()).get(ContactViewModel.class);
|
||||
|
||||
if (isSetupComplete) {
|
||||
binding.titleTxt.setText("Contacts");
|
||||
}
|
||||
|
||||
initViews();
|
||||
|
||||
clickEvents();
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
android:src="@drawable/arrow_back" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_txt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
|
||||
@@ -32,18 +32,57 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/actionBarSize">
|
||||
|
||||
<ImageView
|
||||
<RelativeLayout
|
||||
android:id="@+id/notifications"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
|
||||
android:src="@drawable/ic_home_notification"
|
||||
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
>
|
||||
|
||||
/>
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:contentDescription="@string/notification"
|
||||
app:srcCompat="@drawable/ic_notification_home"
|
||||
app:tint="@color/black"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="5dp"
|
||||
/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/notification_count"
|
||||
android:layout_width="@dimen/_15sdp"
|
||||
android:layout_height="@dimen/_15sdp"
|
||||
|
||||
android:background="@drawable/round_corners"
|
||||
android:backgroundTint="@android:color/holo_red_light"
|
||||
|
||||
android:visibility="visible"
|
||||
|
||||
tools:text="9"
|
||||
android:fontFamily="@font/nunito_regular"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="11sp"
|
||||
android:gravity="center"
|
||||
|
||||
android:layout_marginStart="7dp"
|
||||
|
||||
android:maxLength="2"
|
||||
android:singleLine="true"
|
||||
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
<string name="changes_successful">Changes successful</string>
|
||||
<string name="med_added_successful">Details added successfully</string>
|
||||
<string name="add_10_family_and_friend_contact_information">Let\'s make a list of your 10 favorite contacts</string>
|
||||
<string name="atleast_add_one_contact">Spam calls and calls from anyone not on this list will be blocked</string>
|
||||
<string name="atleast_add_one_contact">Calls from other contacts not in this list will be blocked</string>
|
||||
<string name="contact_information">Contact information</string>
|
||||
<string name="static_gmail_com">static_12345@gmail.com</string>
|
||||
<string name="_12_02_2001">12-02-2001</string>
|
||||
|
||||
Reference in New Issue
Block a user