This commit is contained in:
14Sandee
2023-11-10 19:33:54 +05:30
parent 41c9500d50
commit caf4afb576
19 changed files with 218 additions and 43 deletions

View File

@@ -1,18 +1,18 @@
<?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="SERIAL_NUMBER" />
<value value="RZCW41EJRPN" />
<type value="VIRTUAL_DEVICE_PATH" />
<value value="$USER_HOME$/.android/avd/Pixel_7_Pro_API_33.avd" />
</Key>
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-11-08T14:09:30.889381Z" />
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-11-10T13:43:49.882091Z" />
<targetsSelectedWithDialog>
<Target>
<type value="QUICK_BOOT_TARGET" />

View File

@@ -32,7 +32,9 @@ import androidx.recyclerview.widget.RecyclerView;
import com.app.simplitend.R;
import com.app.simplitend.apputils.AppUtil;
import com.app.simplitend.apputils.PatientDataCache;
import com.app.simplitend.databinding.FuaEduDialogBinding;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
import java.util.Collections;
@@ -79,6 +81,17 @@ public class FUAActivity extends AppCompatActivity {
Dialog fuaDialog = new Dialog(this, R.style.BottomSheetDialog);
fuaDialog.setContentView(dialogBinding.getRoot());
PatientDataCache.getPatientData(this, (patientData -> {
if (patientData != null && patientData.profile_photo != null){
Glide.with(this)
.load(AppUtil.IMAGE_BASE_URL + patientData.profile_photo)
.placeholder(R.drawable.senior_img)
.error(R.drawable.senior_img)
.fitCenter()
.into(dialogBinding.seniorImg);
}
}), false);
dialogBinding.checkBox.setOnCheckedChangeListener((compoundButton, b) -> {
AppUtil.setShouldShowFuaDialog(this, !b);
});

View File

@@ -9,6 +9,7 @@ import androidx.annotation.Nullable;
import com.app.simplitend.welcome.welcomecg.WelcomeApiService;
import com.app.simplitend.welcome.welcomecg.mvvm.CareGiverData;
import com.app.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
import com.onesignal.OneSignal;
import retrofit2.Call;
import retrofit2.Callback;
@@ -44,7 +45,9 @@ public abstract class CaregiverDataCache {
progressDialog.setCancelable(false);
if (show_progress) progressDialog.show();
apiService.getCgUserData("Bearer " + AppUtil.getCgToken(context))
String sub_id = OneSignal.getUser().getPushSubscription().getId() + "";
apiService.getCgUserData("Bearer " + AppUtil.getCgToken(context), sub_id)
.enqueue(new Callback<CallResponse<CareGiverData>>() {
@Override
public void onResponse(Call<CallResponse<CareGiverData>> call, Response<CallResponse<CareGiverData>> response) {

View File

@@ -11,10 +11,13 @@ import com.app.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.
import com.app.simplitend.welcome.welcomepatient.mvvm.WelcomeApiService;
import com.app.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
import com.app.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
import com.onesignal.OneSignal;
import java.util.ArrayList;
import java.util.List;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@@ -107,7 +110,10 @@ public class PatientDataCache {
progressDialog.show();
}
apiService.getUsrProfileProgress("Bearer " + AppUtil.getPatientToken(context))
String sub_id = OneSignal.getUser().getPushSubscription().getId() + "";
apiService.getUsrProfileProgress("Bearer " + AppUtil.getPatientToken(context),
sub_id, AppUtil.getTimeZone())
.enqueue(new Callback<CallResponse<PatientData>>() {
@Override
public void onResponse(Call<CallResponse<PatientData>> call, Response<CallResponse<PatientData>> response) {

View File

@@ -288,6 +288,7 @@ public class CgGeoFencingActivity extends AppCompatActivity implements OnMapRead
List<Place.Field> fields = Arrays.asList(Place.Field.ID, Place.Field.NAME, Place.Field.LAT_LNG);
Intent intent = new Autocomplete.IntentBuilder(AutocompleteActivityMode.OVERLAY, fields)
.setHint(getString(R.string.enter_new_address_here))
.build(this);
startAutocompleteMapSearch.launch(intent);

View File

@@ -23,8 +23,12 @@ import com.app.simplitend.databinding.ActivityNotificationsBinding;
import com.app.simplitend.databinding.NotificationViewholderBinding;
import com.app.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
import retrofit2.Call;
import retrofit2.Callback;
@@ -269,12 +273,19 @@ public class NotificationsActivity extends AppCompatActivity implements Callback
}
// created at format 2023-11-03T11:13:22.000000Z
if (notification.created_at != null){
String time = AppUtil.formatDate(
"yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'",
"dd MMM yyyy 'at' hh:mm a",
notification.created_at
);
if (notification.date_added != null){
String time;
try {
SimpleDateFormat fromSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
fromSdf.setTimeZone(TimeZone.getTimeZone("UTC"));
SimpleDateFormat toSdf = new SimpleDateFormat("dd MMM yyyy 'at' hh:mm a", Locale.getDefault());
toSdf.setTimeZone(TimeZone.getDefault());
Date date = fromSdf.parse(notification.date_added);
time = toSdf.format(date);
}catch (Exception e){
time = null;
}
if (time == null){
binding.timeView.setVisibility(View.GONE);

View File

@@ -17,6 +17,9 @@ import com.app.simplitend.databinding.ChatFragmentBinding;
import com.app.simplitend.patient_dashboard.chats.mvvm.Message;
import com.bumptech.glide.Glide;
import com.stfalcon.chatkit.messages.MessagesListAdapter;
import com.stfalcon.chatkit.utils.DateFormatter;
import java.util.Date;
public class ChatFragment extends Fragment implements SocketHelper.Callback<Message> {
@@ -66,15 +69,32 @@ public class ChatFragment extends Fragment implements SocketHelper.Callback<Mess
clickEvents();
enableDenButton(false);
if (patient_id != null){
SocketHelper socketHelper = SocketHelper.getInstance();
socketHelper.establishConnection(null);
socketHelper.establishConnection(new SocketHelper.SockCallBack() {
@Override
public void onSocketConnected() {
new Handler(Looper.getMainLooper()).post(() -> {
enableDenButton(true);
});
}
@Override
public void onConnectionError(Exception e) {
}
@Override
public void onDisconnected() {
}
});
socketHelper.getMessage(this, patient_id, nick_name,
receiver_image,
author_image);
enableDenButton(true);
}
return binding.getRoot();
@@ -153,6 +173,16 @@ public class ChatFragment extends Fragment implements SocketHelper.Callback<Mess
}
});
messageAdapter.setDateHeadersFormatter(date -> {
if (DateFormatter.isToday(date)) {
return "Today";
} else if (DateFormatter.isYesterday(date)) {
return "Yesterday";
} else {
return DateFormatter.format(date, DateFormatter.Template.STRING_DAY_MONTH_YEAR);
}
});
binding.messageList.setAdapter(messageAdapter);
}

View File

@@ -18,7 +18,7 @@ public class SocketHelper {
private static final String TAG = "SOCKET_CHAT_TAG";
public static final String kHost = "http://77.68.102.23:3002/";
public static final String kHost = "http://simplitendapp.betadelivery.com:3002/";
private static SocketHelper instance;
private Socket mSocket;

View File

@@ -23,11 +23,9 @@ import retrofit2.http.Query;
public interface PatientProfileAPIService {
@GET("api/auth-user-data")
Call<CallResponse<PatientData>> getUsrProfileProgress(@Header("Authorization") String token);
@GET("api/auth-user-data")
Call<CallResponse<PatientData>> getUsrProfileProgress(@Header("Authorization") String token,
@Query("player_id") String player_id,
@Header("timezone") String timezone);
@GET("api/patient-reminder-list/{id}")

View File

@@ -27,7 +27,10 @@ import com.app.simplitend.apputils.RetrofitHelper;
import com.app.simplitend.databinding.ProfileProgressFragmentBinding;
import com.app.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
import com.app.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
import com.onesignal.OneSignal;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@@ -87,7 +90,9 @@ public class ProfileProgressFragment extends Fragment implements ProfileContract
String token = "Bearer " + AppUtil.getPatientToken(requireContext());
apiService.getUsrProfileProgress(token)
String sub_id = OneSignal.getUser().getPushSubscription().getId() + "";
apiService.getUsrProfileProgress(token, sub_id, AppUtil.getTimeZone())
.enqueue(new Callback<CallResponse<PatientData>>() {
@Override
public void onResponse(Call<CallResponse<PatientData>> call, Response<CallResponse<PatientData>> response) {
@@ -154,7 +159,9 @@ public class ProfileProgressFragment extends Fragment implements ProfileContract
String token = "Bearer " + AppUtil.getPatientToken(requireContext());
apiService.getUsrProfileProgress(token)
String sub_id = OneSignal.getUser().getPushSubscription().getId() + "";
apiService.getUsrProfileProgress(token, sub_id, AppUtil.getTimeZone())
.enqueue(new Callback<CallResponse<PatientData>>() {
@Override
public void onResponse(Call<CallResponse<PatientData>> call, Response<CallResponse<PatientData>> response) {

View File

@@ -35,6 +35,7 @@ import com.app.simplitend.databinding.RegisterationDoneFragmentBinding;
import com.app.simplitend.patient_dashboard.DashBoardActivity;
import com.app.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
import com.app.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
import com.onesignal.OneSignal;
import retrofit2.Call;
import retrofit2.Callback;
@@ -138,7 +139,9 @@ public class RegisterCompleteFragment extends Fragment implements ProfileContrac
String token = "Bearer " + AppUtil.getPatientToken(requireContext());
apiService.getUsrProfileProgress(token)
String sub_id = OneSignal.getUser().getPushSubscription().getId() + "";
apiService.getUsrProfileProgress(token, sub_id, AppUtil.getTimeZone())
.enqueue(new Callback<CallResponse<PatientData>>() {
@Override
public void onResponse(Call<CallResponse<PatientData>> call, Response<CallResponse<PatientData>> response) {

View File

@@ -133,15 +133,15 @@ public class ReminderAdapter extends RecyclerView.Adapter<ReminderAdapter.Remind
break;
case "Spoon":
binding.medImg.setImageResource(R.drawable.ic_med_spoon);
quantity = reminder.medication_quantity + " units";
quantity = reminder.medication_quantity + " spoon";
break;
case "Cup":
binding.medImg.setImageResource(R.drawable.ic_cup);
quantity = reminder.medication_quantity + " units";
quantity = reminder.medication_quantity + " cup";
break;
case "Syringe":
binding.medImg.setImageResource(R.drawable.ic_syringe);
quantity = reminder.medication_quantity + " units";
quantity = reminder.medication_quantity + " syringe";
break;
default:
binding.medImg.setImageResource(R.drawable.ic_other_med);

View File

@@ -15,6 +15,7 @@ import retrofit2.http.Header;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PartMap;
import retrofit2.http.Query;
public interface WelcomeApiService {
@@ -46,6 +47,7 @@ public interface WelcomeApiService {
@Header("Authorization") String token);
@GET("api/caregiver-user-data")
Call<CallResponse<CareGiverData>> getCgUserData(@Header("Authorization") String token);
Call<CallResponse<CareGiverData>> getCgUserData(@Header("Authorization") String token,
@Query("player_id") String player_id);
}

View File

@@ -200,6 +200,12 @@ public class CreateContactFragment extends Fragment implements WelcomeContracts.
}
});
binding.cancelBtn.setOnClickListener(view -> {
if (getActivity() != null) {
getActivity().onBackPressed();
}
});
binding.nextBtn.setOnClickListener(v -> {
String[] phone_numbers = getAllPhoneNumbers();

View File

@@ -37,7 +37,10 @@ import com.app.simplitend.welcome.welcomecg.fragments.CgAuthActivity;
import com.app.simplitend.welcome.welcomecg.mvvm.CareGiverData;
import com.app.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
import com.app.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
import com.onesignal.OneSignal;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@@ -81,7 +84,9 @@ public class SplashFragment extends Fragment
PatientProfileAPIService apiService = RetrofitHelper.getRetrofit().create(PatientProfileAPIService.class);
apiService.getUsrProfileProgress("Bearer " + patient_token, AppUtil.getTimeZone())
String sub_id = OneSignal.getUser().getPushSubscription().getId() + "";
apiService.getUsrProfileProgress("Bearer " + patient_token, sub_id, AppUtil.getTimeZone())
.enqueue(new Callback<CallResponse<PatientData>>() {
@Override
public void onResponse(Call<CallResponse<PatientData>> call, Response<CallResponse<PatientData>> response) {
@@ -107,7 +112,9 @@ public class SplashFragment extends Fragment
WelcomeApiService welcomeApiService = RetrofitHelper.getRetrofit().create(WelcomeApiService.class);
welcomeApiService.getCgUserData("Bearer " + cg_token)
String sub_id = OneSignal.getUser().getPushSubscription().getId() + "";
welcomeApiService.getCgUserData("Bearer " + cg_token, sub_id)
.enqueue(new Callback<CallResponse<CareGiverData>>() {
@Override
public void onResponse(Call<CallResponse<CareGiverData>> call, Response<CallResponse<CareGiverData>> response) {

View File

@@ -77,7 +77,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/search_places"
android:text="@string/enter_new_address_here"
android:fontFamily="@font/nunito_regular"
android:textColor="@android:color/darker_gray"
android:textSize="@dimen/_14ssp"
@@ -217,7 +217,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/reset"
android:text="@string/cancel"
android:fontFamily="@font/nunito_regular"
android:textColor="@color/black"
android:textAllCaps="false"

View File

@@ -453,21 +453,46 @@
android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
android:textColor="@android:color/holo_red_dark"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/next_btn"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="2"
android:layout_marginHorizontal="15dp"
android:backgroundTint="@color/color_primary"
android:layout_marginTop="20dp"
tools:text="@string/create_contact"
android:textColor="@color/white_bg"
android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
android:textAllCaps="false"
android:paddingVertical="15dp"
app:cornerRadius="10dp"
android:layout_marginBottom="15dp"
/>
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
android:id="@+id/cancel_btn"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:backgroundTint="@color/white"
android:text="@string/cancel"
android:textColor="@color/black"
android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
android:textAllCaps="false"
android:paddingVertical="15dp"
app:cornerRadius="10dp"
android:layout_marginEnd="5dp"
/>
<com.google.android.material.button.MaterialButton
android:id="@+id/next_btn"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:backgroundTint="@color/color_primary"
tools:text="@string/create_contact"
android:textColor="@color/white_bg"
android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
android:textAllCaps="false"
android:paddingVertical="15dp"
app:cornerRadius="10dp"
android:layout_marginStart="5dp"
/>
</LinearLayout>
</LinearLayout>

View File

@@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/round_corners"
android:backgroundTint="@color/white"
android:orientation="vertical">
@@ -20,6 +21,64 @@
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/go_to_profile"
android:fontFamily="@font/nunito_bold"
android:textColor="@color/black"
android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
/>
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/senior_img"
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/senior_img"
app:civ_circle_background_color="@color/color_primary_dark"
app:civ_border_width="0.5dp"
app:civ_border_color="@color/color_primary_dark"
android:layout_marginHorizontal="8dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/double_next_arrow"
android:fontFamily="@font/nunito_bold"
android:textColor="@color/black"
android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
android:maxLines="1"
android:ellipsize="end"
/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/frequently_used_apps"
android:fontFamily="@font/nunito_bold"
android:textColor="@color/black"
android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
android:layout_marginHorizontal="15dp"
/>
<CheckBox
android:id="@+id/check_box"
android:layout_width="wrap_content"

View File

@@ -479,8 +479,12 @@
<string name="confirm_your_pin">Confirm your pin</string>
<string name="first_name">Name*</string>
<string name="enter_your_first_name">Enter your 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="to_update_the_frequently_used_apps_go_to_nprofile_frequently_used_apps"><![CDATA[To update the frequently used apps,]]></string>
<string name="don_t_show_this">Don\'t show this</string>
<string name="next_medication_schedule">Next medication schedule:</string>
<string name="go_to_profile">go to profile</string>
<string name="double_next_arrow"><![CDATA[>>]]></string>
<string name="enter_new_address_here">Enter new address here</string>
<string name="cancel">Cancel</string>
</resources>