.
This commit is contained in:
12
.idea/deploymentTargetDropDown.xml
generated
12
.idea/deploymentTargetDropDown.xml
generated
@@ -1,18 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<runningDeviceTargetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="SERIAL_NUMBER" />
|
||||
<value value="RZCW41EJRPN" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</runningDeviceTargetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2023-09-14T15:35:51.557788700Z" />
|
||||
<runningDeviceTargetsSelectedWithDialog>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
|
||||
@@ -1,23 +1,48 @@
|
||||
package com.ssb.simplitend.caregiverdashboard.activities;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ProgressDialog;
|
||||
import android.os.Bundle;
|
||||
import android.view.MotionEvent;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.ssb.simplitend.apputils.AppUtil;
|
||||
import com.ssb.simplitend.apputils.CaregiverDataCache;
|
||||
import com.ssb.simplitend.caregiverdashboard.activities.deactivateacc.AccountPresenter;
|
||||
import com.ssb.simplitend.databinding.ActivityContactAdminBinding;
|
||||
import com.ssb.simplitend.welcome.welcomecg.mvvm.CareGiverData;
|
||||
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactData;
|
||||
|
||||
public class ContactAdminActivity extends AppCompatActivity {
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
public class ContactAdminActivity extends AppCompatActivity implements AccountPresenter.ContactAdminCallback {
|
||||
|
||||
private ActivityContactAdminBinding binding;
|
||||
|
||||
private AccountPresenter presenter;
|
||||
private ProgressDialog progressDialog;
|
||||
|
||||
private CareGiverData careGiverData;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityContactAdminBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
CaregiverDataCache.getCaregiverData(this, careGiverData -> {
|
||||
this.careGiverData = careGiverData;
|
||||
}, true);
|
||||
|
||||
presenter = AccountPresenter.getAccountPresenter();
|
||||
progressDialog = new ProgressDialog(this);
|
||||
|
||||
initViews();
|
||||
|
||||
clickEvents();
|
||||
@@ -49,5 +74,76 @@ public class ContactAdminActivity extends AppCompatActivity {
|
||||
|
||||
private void clickEvents() {
|
||||
binding.backBtn.setOnClickListener(v -> onBackPressed());
|
||||
|
||||
binding.submit.setOnClickListener(v -> {
|
||||
if (careGiverData == null){
|
||||
Toast.makeText(this, "Could not connect.", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (allOkay()){
|
||||
submitResponse();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void submitResponse() {
|
||||
progressDialog.setTitle("Please wait...");
|
||||
progressDialog.setMessage("while we submit your query");
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show();
|
||||
|
||||
Map<String, RequestBody> body = new HashMap<>();
|
||||
|
||||
RequestBody topic_body = RequestBody.create(binding.topic.getText().toString(), MediaType.parse("text/plain"));
|
||||
body.put("title", topic_body);
|
||||
|
||||
RequestBody description_body = RequestBody.create(binding.description.getText().toString(), MediaType.parse("text/plain"));
|
||||
body.put("description", description_body);
|
||||
|
||||
RequestBody query_body = RequestBody.create("None", MediaType.parse("text/plain"));
|
||||
body.put("query", query_body);
|
||||
|
||||
RequestBody patient_xid_body = RequestBody.create(careGiverData.patientId + "", MediaType.parse("text/plain"));
|
||||
body.put("patient_xid", patient_xid_body);
|
||||
|
||||
RequestBody caregiver_xid_body = RequestBody.create(careGiverData.caregiver_xid + "", MediaType.parse("text/plain"));
|
||||
body.put("caregiver_xid", caregiver_xid_body);
|
||||
|
||||
presenter.contactAdmin(body,
|
||||
"Bearer " + AppUtil.getCgToken(this),
|
||||
this);
|
||||
|
||||
}
|
||||
|
||||
private boolean allOkay() {
|
||||
boolean allOkay = true;
|
||||
|
||||
if (binding.topic.getText().toString().trim().isEmpty()){
|
||||
binding.topic.setError("Required");
|
||||
allOkay = false;
|
||||
}
|
||||
|
||||
if (binding.description.getText().toString().trim().isEmpty()){
|
||||
binding.description.setError("Required");
|
||||
allOkay = false;
|
||||
}
|
||||
|
||||
return allOkay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
progressDialog.dismiss();
|
||||
|
||||
Toast.makeText(this, "Query sent successfully.", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(String message) {
|
||||
progressDialog.dismiss();
|
||||
|
||||
Toast.makeText(this, message + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ssb.simplitend.caregiverdashboard.activities.deactivateacc;
|
||||
|
||||
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.RequestBody;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.Header;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.PartMap;
|
||||
import retrofit2.http.Path;
|
||||
|
||||
public interface AccountApiService {
|
||||
|
||||
@POST("api/deactivate-reactivate-account/{id}")
|
||||
Call<CallResponse<Object>> de_re_ActivateAccount(@Body Map<String, Integer> body,
|
||||
@Path("id") int caregiver_xid,
|
||||
@Header("Authorization") String token);
|
||||
|
||||
@Multipart
|
||||
@POST("api/caregiver-contact-admin")
|
||||
Call<CallResponse<Object>> contactAdmin(@PartMap Map<String, RequestBody> body,
|
||||
@Header("Authorization") String token);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.ssb.simplitend.caregiverdashboard.activities.deactivateacc;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.ssb.simplitend.apputils.RetrofitHelper;
|
||||
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.RequestBody;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
public class AccountPresenter {
|
||||
|
||||
public static final int ACC_ACTIVE = 1;
|
||||
public static final String ACC_ACTIVE_STR = "1";
|
||||
public static final int ACC_DEACTIVATE_BY_USER = 2;
|
||||
public static final int ACC_DEACTIVATE_BY_ADMIN = 3;
|
||||
|
||||
private static AccountPresenter accountPresenter;
|
||||
|
||||
private AccountApiService apiService;
|
||||
|
||||
private AccountPresenter(){
|
||||
apiService = RetrofitHelper.getRetrofit().create(AccountApiService.class);
|
||||
}
|
||||
|
||||
public synchronized static AccountPresenter getAccountPresenter(){
|
||||
if (accountPresenter == null){
|
||||
accountPresenter = new AccountPresenter();
|
||||
}
|
||||
|
||||
return accountPresenter;
|
||||
}
|
||||
|
||||
public void accountReDeActivate(int active_status,
|
||||
int caregiver_xid,
|
||||
@NonNull String token,
|
||||
@NonNull AccountReDeActivateCallback callback){
|
||||
|
||||
Map<String, Integer> body = new HashMap<>();
|
||||
|
||||
body.put("status", active_status);
|
||||
|
||||
apiService.de_re_ActivateAccount(body, caregiver_xid, token)
|
||||
.enqueue(new Callback<CallResponse<Object>>() {
|
||||
@Override
|
||||
public void onResponse(Call<CallResponse<Object>> call, Response<CallResponse<Object>> response) {
|
||||
if (response.body() != null){
|
||||
if (response.body().status != 200 || response.body().error_code != 0){
|
||||
callback.onAccountDeReActivateFailed(new Exception(), response.body().message);
|
||||
return;
|
||||
}
|
||||
|
||||
callback.onAccountDeReActivate();
|
||||
}else{
|
||||
callback.onAccountDeReActivateFailed(new Exception(), "Couldn't complete that action.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<CallResponse<Object>> call, Throwable t) {
|
||||
callback.onAccountDeReActivateFailed(new Exception(), "Couldn't complete that action.");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void contactAdmin(Map<String, RequestBody> body,
|
||||
@NonNull String token, @NonNull ContactAdminCallback contactAdminCallback){
|
||||
|
||||
apiService.contactAdmin(body, token)
|
||||
.enqueue(new Callback<CallResponse<Object>>() {
|
||||
@Override
|
||||
public void onResponse(Call<CallResponse<Object>> call, Response<CallResponse<Object>> response) {
|
||||
if (response.body() != null){
|
||||
if (response.body().status != 200 || response.body().error_code != 0){
|
||||
contactAdminCallback.onFailed(response.body().message);
|
||||
return;
|
||||
}
|
||||
|
||||
contactAdminCallback.onSuccess();
|
||||
}else{
|
||||
contactAdminCallback.onFailed("Couldn't connect. Please try again later.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<CallResponse<Object>> call, Throwable t) {
|
||||
contactAdminCallback.onFailed("Couldn't connect. Please try again later.");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public interface AccountReDeActivateCallback{
|
||||
void onAccountDeReActivate();
|
||||
|
||||
void onAccountDeReActivateFailed(Throwable throwable, String message);
|
||||
}
|
||||
|
||||
public interface ContactAdminCallback{
|
||||
void onSuccess();
|
||||
|
||||
void onFailed(String message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -3,22 +3,41 @@ package com.ssb.simplitend.caregiverdashboard.activities.deactivateacc;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.ssb.simplitend.apputils.AppUtil;
|
||||
import com.ssb.simplitend.apputils.CaregiverDataCache;
|
||||
import com.ssb.simplitend.databinding.ActivityDeactivateAccBinding;
|
||||
import com.ssb.simplitend.welcome.activities.WelcomeActivity;
|
||||
import com.ssb.simplitend.welcome.welcomecg.mvvm.CareGiverData;
|
||||
|
||||
public class DeActivateAccountActivity extends AppCompatActivity {
|
||||
public class DeActivateAccountActivity extends AppCompatActivity implements AccountPresenter.AccountReDeActivateCallback {
|
||||
|
||||
protected ActivityDeactivateAccBinding binding;
|
||||
|
||||
private AccountPresenter accountPresenter;
|
||||
private ProgressDialog progressDialog;
|
||||
|
||||
private CareGiverData careGiverData;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityDeactivateAccBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
CaregiverDataCache.getCaregiverData(this, (careGiverData1 -> {
|
||||
this.careGiverData = careGiverData1;
|
||||
}), true);
|
||||
|
||||
accountPresenter = AccountPresenter.getAccountPresenter();
|
||||
progressDialog = new ProgressDialog(this);
|
||||
|
||||
initViews();
|
||||
|
||||
clickEvents();
|
||||
@@ -42,6 +61,24 @@ public class DeActivateAccountActivity extends AppCompatActivity {
|
||||
binding.firstView.setVisibility(View.GONE);
|
||||
binding.secondView.setVisibility(View.VISIBLE);
|
||||
});
|
||||
|
||||
binding.confirmDeactivate.setOnClickListener(v -> {
|
||||
if (careGiverData == null){
|
||||
Toast.makeText(this, "Couldn't load data", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
progressDialog.setTitle("Please wait....");
|
||||
progressDialog.setMessage("while we de-activate your account");
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show();
|
||||
|
||||
accountPresenter.accountReDeActivate(AccountPresenter.ACC_DEACTIVATE_BY_USER,
|
||||
careGiverData.caregiver_xid,
|
||||
"Bearer " + AppUtil.getCgToken(this),
|
||||
this);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@@ -60,4 +97,24 @@ public class DeActivateAccountActivity extends AppCompatActivity {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountDeReActivate() {
|
||||
Toast.makeText(this, "Account Deactivated", Toast.LENGTH_SHORT).show();
|
||||
progressDialog.dismiss();
|
||||
|
||||
AppUtil.cgSignOut(this);
|
||||
|
||||
Intent intent = new Intent(this, WelcomeActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountDeReActivateFailed(Throwable throwable, String message) {
|
||||
progressDialog.dismiss();
|
||||
|
||||
Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.ssb.simplitend.welcome.welcomecg.fragments;
|
||||
|
||||
import static com.ssb.simplitend.welcome.welcomecg.fragments.CgConnectFragment.CAREGIVER_EMAIL;
|
||||
import static com.ssb.simplitend.welcome.welcomepatient.fragments.register.ReActivateFragment.CG_STATUS_KEY;
|
||||
import static com.ssb.simplitend.welcome.welcomepatient.fragments.register.ReActivateFragment.CG_XID_KEY;
|
||||
import static com.ssb.simplitend.welcome.welcomepatient.fragments.register.ReActivateFragment.IS_CAREGIVER_KEY;
|
||||
import static com.ssb.simplitend.welcome.welcomepatient.fragments.register.ReActivateFragment.TOKEN_KEY;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
@@ -21,6 +25,7 @@ import com.ssb.simplitend.R;
|
||||
import com.ssb.simplitend.apputils.AppUtil;
|
||||
import com.ssb.simplitend.apputils.CaregiverDataCache;
|
||||
import com.ssb.simplitend.caregiverdashboard.activities.CaregiverDashActivity;
|
||||
import com.ssb.simplitend.caregiverdashboard.activities.deactivateacc.AccountPresenter;
|
||||
import com.ssb.simplitend.databinding.CgSignInFragmentBinding;
|
||||
import com.ssb.simplitend.welcome.welcomecg.WelcomeContracts;
|
||||
import com.ssb.simplitend.welcome.welcomecg.mvvm.CareGiverData;
|
||||
@@ -147,15 +152,39 @@ public class CgSignInFragment extends Fragment implements WelcomeContracts.CgLog
|
||||
.navigate(R.id.action_cgSignInFragment_to_cgConnectFragment, bundle, navOptions);
|
||||
}
|
||||
|
||||
private void gotoReActivateScreen(String cg_status, String token, int cg_xid){
|
||||
NavOptions navOptions = new NavOptions.Builder()
|
||||
.setPopUpTo(R.id.welcomeFragment, true)
|
||||
.build();
|
||||
|
||||
Bundle bundle = new Bundle();
|
||||
|
||||
bundle.putString(CG_STATUS_KEY, cg_status);
|
||||
bundle.putBoolean(IS_CAREGIVER_KEY, true);
|
||||
bundle.putInt(CG_XID_KEY, cg_xid);
|
||||
bundle.putString(TOKEN_KEY, token);
|
||||
|
||||
Navigation.findNavController(binding.getRoot())
|
||||
.navigate(R.id.action_cgSignInFragment_to_reActivateFragment, bundle, navOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoginSuccess(CareGiverData careGiverData, String token) {
|
||||
// caching user data
|
||||
CaregiverDataCache.setCareGiverData(careGiverData);
|
||||
|
||||
progressDialog.dismiss();
|
||||
Toast.makeText(requireContext(), "Log in success.", Toast.LENGTH_SHORT).show();
|
||||
|
||||
AppUtil.saveCgData(token, careGiverData.patientId, requireContext());
|
||||
progressDialog.dismiss();
|
||||
|
||||
if (!careGiverData.caregiver_status.equals(AccountPresenter.ACC_ACTIVE_STR)){
|
||||
// account is not active
|
||||
|
||||
gotoReActivateScreen(careGiverData.caregiver_status, AppUtil.getCgToken(requireContext()),
|
||||
careGiverData.caregiver_xid);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Toast.makeText(requireContext(), "Log in success.", Toast.LENGTH_SHORT).show();
|
||||
|
||||
if (careGiverData.isPatientAndCareGiverConnected == 1){
|
||||
gotoDashboard();
|
||||
|
||||
@@ -39,5 +39,7 @@ public class CareGiverData{
|
||||
public String is_admin;
|
||||
public int patientId;
|
||||
|
||||
public String caregiver_status;
|
||||
|
||||
public PatientData patientDetails;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package com.ssb.simplitend.welcome.welcomepatient.fragments;
|
||||
|
||||
import static com.ssb.simplitend.welcome.welcomepatient.fragments.register.ReActivateFragment.CG_STATUS_KEY;
|
||||
import static com.ssb.simplitend.welcome.welcomepatient.fragments.register.ReActivateFragment.CG_XID_KEY;
|
||||
import static com.ssb.simplitend.welcome.welcomepatient.fragments.register.ReActivateFragment.IS_CAREGIVER_KEY;
|
||||
import static com.ssb.simplitend.welcome.welcomepatient.fragments.register.ReActivateFragment.TOKEN_KEY;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
@@ -21,8 +26,8 @@ import androidx.navigation.Navigation;
|
||||
import com.ssb.simplitend.R;
|
||||
import com.ssb.simplitend.apputils.AppUtil;
|
||||
import com.ssb.simplitend.apputils.EditTextErrorRemover;
|
||||
import com.ssb.simplitend.apputils.CaregiverDataCache;
|
||||
import com.ssb.simplitend.apputils.PatientDataCache;
|
||||
import com.ssb.simplitend.caregiverdashboard.activities.deactivateacc.AccountPresenter;
|
||||
import com.ssb.simplitend.patient_dashboard.DashBoardActivity;
|
||||
import com.ssb.simplitend.databinding.SignInFragmentBinding;
|
||||
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeContracts;
|
||||
@@ -150,16 +155,40 @@ public class SignInFragment extends Fragment implements WelcomeContracts.Registe
|
||||
return allOkay;
|
||||
}
|
||||
|
||||
private void gotoReActivateScreen(String cg_status, String token, int cg_xid){
|
||||
NavOptions navOptions = new NavOptions.Builder()
|
||||
.setPopUpTo(R.id.welcomeFragment, true)
|
||||
.build();
|
||||
|
||||
Bundle bundle = new Bundle();
|
||||
|
||||
bundle.putString(CG_STATUS_KEY, cg_status);
|
||||
bundle.putBoolean(IS_CAREGIVER_KEY, false);
|
||||
bundle.putInt(CG_XID_KEY, cg_xid);
|
||||
bundle.putString(TOKEN_KEY, token);
|
||||
|
||||
Navigation.findNavController(binding.getRoot())
|
||||
.navigate(R.id.action_signInFragment_to_reActivateFragment, bundle, navOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(PatientData patientResult, String token) {
|
||||
// caching user data
|
||||
PatientDataCache.setPatientData(patientResult);
|
||||
AppUtil.savePatientData(token, patientResult.patientId, requireContext(), true);
|
||||
|
||||
progressDialog.dismiss();
|
||||
|
||||
progressDialog.setMessage("Almost there...");
|
||||
if (!patientResult.caregiver_status.equals(AccountPresenter.ACC_ACTIVE_STR)){
|
||||
// account is not active
|
||||
|
||||
AppUtil.savePatientData(token, patientResult.patientId, requireContext(), true);
|
||||
gotoReActivateScreen(patientResult.caregiver_status,
|
||||
AppUtil.getPatientToken(requireContext()), -1);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
progressDialog.setMessage("Almost there...");
|
||||
|
||||
progressDialog.dismiss();
|
||||
|
||||
|
||||
@@ -2,15 +2,12 @@ package com.ssb.simplitend.welcome.welcomepatient.fragments.contacts;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.DiffUtil;
|
||||
import androidx.recyclerview.widget.ListAdapter;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.skydoves.powerspinner.OnSpinnerItemSelectedListener;
|
||||
import com.ssb.simplitend.databinding.ContactViewHolderBinding;
|
||||
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.Contact;
|
||||
|
||||
@@ -39,7 +36,7 @@ public class ContactListAdapter extends ListAdapter<ArrayList<Contact>, ContactL
|
||||
@NonNull
|
||||
@Override
|
||||
public ContactViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
ContactViewHolderBinding binding = ContactViewHolderBinding.inflate(LayoutInflater.from(parent.getContext()));
|
||||
ContactViewHolderBinding binding = ContactViewHolderBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
|
||||
return new ContactViewHolder(binding);
|
||||
}
|
||||
|
||||
@@ -49,7 +46,7 @@ public class ContactListAdapter extends ListAdapter<ArrayList<Contact>, ContactL
|
||||
|
||||
ArrayList<Contact> contacts = getItem(position);
|
||||
|
||||
holder.binding.name.setOnClickListener(v -> {
|
||||
holder.binding.card.setOnClickListener(v -> {
|
||||
if (contactClickListener != null && contacts != null){
|
||||
Contact contact = new Contact(contacts);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Contact implements Serializable {
|
||||
|
||||
@@ -70,4 +71,17 @@ public class Contact implements Serializable {
|
||||
", email_address='" + email_address + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Contact contact = (Contact) o;
|
||||
return phone_number.equals(contact.phone_number);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(phone_number);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
@@ -59,15 +60,15 @@ public class ContactViewModel extends AndroidViewModel {
|
||||
public ArrayList<ArrayList<Contact>> getContactList(Context context) {
|
||||
ArrayList<ArrayList<Contact>> contactLIst = new ArrayList<>();
|
||||
|
||||
HashMap<String, ArrayList<Contact>> contactMap = this.contactRepository.getContactList(context);
|
||||
HashMap<String, Set<Contact>> contactMap = this.contactRepository.getContactList(context);
|
||||
|
||||
for (ArrayList<Contact> contacts: contactMap.values()){
|
||||
for (Set<Contact> contacts: contactMap.values()){
|
||||
if (contacts != null && contacts.size() > 0){
|
||||
contactLIst.add(contacts);
|
||||
contactLIst.add(new ArrayList<>(contacts));
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(contactLIst, (contacts, t1) -> contacts.get(0).first_name.compareTo(t1.get(0).first_name));
|
||||
Collections.sort(contactLIst, (contacts, t1) -> contacts.get(0).first_name.toLowerCase().compareTo(t1.get(0).first_name.toLowerCase()));
|
||||
|
||||
return contactLIst;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.i18n.phonenumbers.PhoneNumberUtil;
|
||||
import com.google.i18n.phonenumbers.Phonenumber;
|
||||
import com.ssb.simplitend.apputils.RetrofitHelper;
|
||||
import com.ssb.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactListResponse;
|
||||
import com.ssb.simplitend.welcome.welcomepatient.mvvm.WelcomeApiService;
|
||||
@@ -17,8 +19,10 @@ import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
@@ -160,13 +164,13 @@ public class UserContactRepository {
|
||||
});
|
||||
}
|
||||
|
||||
public HashMap<String, ArrayList<Contact>> getContactList(Context context) {
|
||||
public HashMap<String, Set<Contact>> getContactList(Context context) {
|
||||
|
||||
/*
|
||||
key -> name
|
||||
values -> different contacts with same name
|
||||
*/
|
||||
HashMap<String, ArrayList<Contact>> contactMap = new HashMap<>();
|
||||
HashMap<String, Set<Contact>> contactMap = new HashMap<>();
|
||||
|
||||
ContentResolver cr = context.getContentResolver();
|
||||
|
||||
@@ -190,25 +194,35 @@ public class UserContactRepository {
|
||||
|
||||
if (number == null) continue;
|
||||
if (name == null || name.isEmpty()) name = "No name";
|
||||
|
||||
|
||||
try {
|
||||
PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil.getInstance();
|
||||
Phonenumber.PhoneNumber formatted_number = phoneNumberUtil.parse(number, "US");
|
||||
number = "+" + formatted_number.getCountryCode() + formatted_number.getNationalNumber();
|
||||
}catch (Exception e){
|
||||
// do nothing
|
||||
}
|
||||
|
||||
Contact contact = new Contact(name, number);
|
||||
|
||||
if (name.equals("DONNA Saatchi")){
|
||||
Log.d(TAG, "getContactList: ");
|
||||
}
|
||||
|
||||
ArrayList<Contact> contactList;
|
||||
Set<Contact> contactList;
|
||||
|
||||
if (contactMap.containsKey(c_id)) {
|
||||
// there is already number associate with this name
|
||||
// thus, adding to the existing contact list against the name
|
||||
contactList = contactMap.get(c_id);
|
||||
} else {
|
||||
contactList = new ArrayList<>();
|
||||
contactList = new HashSet<>();
|
||||
}
|
||||
|
||||
if (contactList == null) contactList = new ArrayList<>();
|
||||
if (contactList == null) contactList = new HashSet<>();
|
||||
|
||||
if (contactList.contains(contact)){
|
||||
// duplicate number for same contact
|
||||
// this, duplication is due to different accounts on device like Google, Whatsapp, etc
|
||||
continue;
|
||||
}
|
||||
|
||||
contactList.add(contact);
|
||||
contactMap.put(c_id, contactList);
|
||||
}
|
||||
@@ -224,7 +238,7 @@ public class UserContactRepository {
|
||||
return contactMap;
|
||||
}
|
||||
|
||||
private void getEmailForContact(Context context, HashMap<String, ArrayList<Contact>> contactMap) {
|
||||
private void getEmailForContact(Context context, HashMap<String, Set<Contact>> contactMap) {
|
||||
Uri emailUri = ContactsContract.CommonDataKinds.Email.CONTENT_URI;
|
||||
String[] emailProjection = {
|
||||
ContactsContract.CommonDataKinds.Email.ADDRESS,
|
||||
@@ -244,7 +258,7 @@ public class UserContactRepository {
|
||||
String c_id = emailCursor.getString(c_id_index);
|
||||
|
||||
if (contactMap.containsKey(c_id)){
|
||||
ArrayList<Contact> contacts = contactMap.get(c_id);
|
||||
Set<Contact> contacts = contactMap.get(c_id);
|
||||
if (contacts != null){
|
||||
for (Contact contact: contacts){
|
||||
if (contact != null){
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
package com.ssb.simplitend.welcome.welcomepatient.fragments.register;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.navigation.NavOptions;
|
||||
import androidx.navigation.Navigation;
|
||||
|
||||
import com.ssb.simplitend.R;
|
||||
import com.ssb.simplitend.apputils.AppUtil;
|
||||
import com.ssb.simplitend.apputils.CaregiverDataCache;
|
||||
import com.ssb.simplitend.apputils.PatientDataCache;
|
||||
import com.ssb.simplitend.caregiverdashboard.activities.deactivateacc.AccountPresenter;
|
||||
import com.ssb.simplitend.databinding.FragmentAccReActivBinding;
|
||||
import com.ssb.simplitend.databinding.SplashFragmentBinding;
|
||||
|
||||
public class ReActivateFragment extends Fragment implements AccountPresenter.AccountReDeActivateCallback {
|
||||
|
||||
// view binding
|
||||
protected FragmentAccReActivBinding binding;
|
||||
|
||||
public static final String CG_STATUS_KEY = "cg_status_key";
|
||||
public static final String IS_CAREGIVER_KEY = "is_caregiver_key";
|
||||
public static final String TOKEN_KEY = "token_key";
|
||||
public static final String CG_XID_KEY = "cg_xid_key";
|
||||
public static final String CG_TOKEN_KEY = "cg_xid_key";
|
||||
|
||||
private int caregiver_status;
|
||||
private boolean is_caregiver;
|
||||
private int caregiver_xid;
|
||||
private String token;
|
||||
|
||||
private AccountPresenter accountPresenter;
|
||||
private ProgressDialog progressDialog;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
binding = FragmentAccReActivBinding.inflate(inflater, container, false);
|
||||
|
||||
accountPresenter = AccountPresenter.getAccountPresenter();
|
||||
progressDialog = new ProgressDialog(requireContext());
|
||||
|
||||
Bundle bundle = getArguments();
|
||||
if (bundle != null){
|
||||
try {
|
||||
caregiver_status = Integer.parseInt(bundle.getString(CG_STATUS_KEY, "3"));
|
||||
}catch (Exception e){
|
||||
caregiver_status = 3; // default
|
||||
}
|
||||
is_caregiver = bundle.getBoolean(IS_CAREGIVER_KEY, false);
|
||||
caregiver_xid = bundle.getInt(CG_XID_KEY, -1);
|
||||
token = bundle.getString(TOKEN_KEY, null);
|
||||
}
|
||||
|
||||
initViews();
|
||||
|
||||
clickEvents();
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
|
||||
// setting message
|
||||
String message;
|
||||
if (AccountPresenter.ACC_DEACTIVATE_BY_USER == caregiver_status){
|
||||
// deactivated by cg
|
||||
if (is_caregiver){
|
||||
message = getString(R.string.re_activate_msg_cg_by_cg);
|
||||
|
||||
binding.reActivateBtn.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
message = getString(R.string.re_activate_msg_patient_by_cg);
|
||||
|
||||
binding.reActivateBtn.setVisibility(View.GONE);
|
||||
}
|
||||
}else{
|
||||
binding.reActivateBtn.setVisibility(View.GONE);
|
||||
|
||||
// deactivated by admin
|
||||
if (is_caregiver){
|
||||
message = getString(R.string.re_activate_msg_cg_by_admin);
|
||||
}else {
|
||||
message = getString(R.string.re_activate_msg_patient_by_admin);
|
||||
}
|
||||
}
|
||||
|
||||
binding.message.setText(message);
|
||||
}
|
||||
|
||||
private void clickEvents() {
|
||||
binding.call.setOnClickListener(v -> {
|
||||
callNumber(getString(R.string.support_contact));
|
||||
});
|
||||
|
||||
binding.email.setOnClickListener(v -> {
|
||||
contactMail();
|
||||
});
|
||||
|
||||
binding.logInAnotherAcc.setOnClickListener(v -> {
|
||||
AppUtil.cgSignOut(requireContext());
|
||||
AppUtil.patientSignOut(requireContext());
|
||||
CaregiverDataCache.setCareGiverData(null);
|
||||
PatientDataCache.setPatientData(null);
|
||||
|
||||
Navigation.findNavController(v).navigate(R.id.action_reActivateFragment_to_splashFragment);
|
||||
});
|
||||
|
||||
binding.reActivateBtn.setOnClickListener(v -> {
|
||||
if (caregiver_xid == -1 || token == null){
|
||||
Toast.makeText(requireContext(), "Cannot re-activate your account", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
progressDialog.setTitle("Please wait....");
|
||||
progressDialog.setMessage("while we gather you information and re-activate your account.");
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show();
|
||||
|
||||
accountPresenter.accountReDeActivate(AccountPresenter.ACC_ACTIVE,
|
||||
caregiver_xid, "Bearer " + token, this);
|
||||
});
|
||||
}
|
||||
|
||||
private void callNumber(String phone_number){
|
||||
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.fromParts("tel",
|
||||
phone_number,
|
||||
null));
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
private void messageNumber(String phone_number){
|
||||
Uri uri = Uri.parse("smsto:" + phone_number);
|
||||
Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
|
||||
// intent.putExtra("sms_body", "The SMS text");
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
private void contactMail() {
|
||||
String contact_email = getString(R.string.contact_email);
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_SENDTO);
|
||||
intent.setData(Uri.fromParts("mailto", contact_email, null));
|
||||
|
||||
if (intent.resolveActivity(requireActivity().getPackageManager()) != null) {
|
||||
startActivity(intent);
|
||||
}else{
|
||||
Toast.makeText(requireContext(), "No email app found.", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountDeReActivate() {
|
||||
progressDialog.dismiss();
|
||||
|
||||
Toast.makeText(requireContext(), "Account re-activated.", Toast.LENGTH_SHORT).show();
|
||||
NavOptions navOptions = new NavOptions.Builder()
|
||||
.setPopUpTo(R.id.splashFragment, true)
|
||||
.build();
|
||||
|
||||
Navigation.findNavController(binding.getRoot()).navigate(R.id.action_reActivateFragment_to_splashFragment, null, navOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountDeReActivateFailed(Throwable throwable, String message) {
|
||||
progressDialog.dismiss();
|
||||
|
||||
Toast.makeText(requireContext(), "Couldn't re-activate your account.", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.ssb.simplitend.welcome.welcomepatient.fragments.register;
|
||||
|
||||
import static com.ssb.simplitend.welcome.welcomecg.fragments.CgConnectFragment.CAREGIVER_EMAIL;
|
||||
import static com.ssb.simplitend.welcome.welcomepatient.fragments.register.ReActivateFragment.CG_STATUS_KEY;
|
||||
import static com.ssb.simplitend.welcome.welcomepatient.fragments.register.ReActivateFragment.CG_XID_KEY;
|
||||
import static com.ssb.simplitend.welcome.welcomepatient.fragments.register.ReActivateFragment.IS_CAREGIVER_KEY;
|
||||
import static com.ssb.simplitend.welcome.welcomepatient.fragments.register.ReActivateFragment.TOKEN_KEY;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
@@ -24,6 +28,7 @@ import com.ssb.simplitend.apputils.PatientDataCache;
|
||||
import com.ssb.simplitend.apputils.RetrofitHelper;
|
||||
import com.ssb.simplitend.apputils.CaregiverDataCache;
|
||||
import com.ssb.simplitend.caregiverdashboard.activities.CaregiverDashActivity;
|
||||
import com.ssb.simplitend.caregiverdashboard.activities.deactivateacc.AccountPresenter;
|
||||
import com.ssb.simplitend.databinding.SplashFragmentBinding;
|
||||
import com.ssb.simplitend.patient_dashboard.DashBoardActivity;
|
||||
import com.ssb.simplitend.patientprofile.PatientProfileAPIService;
|
||||
@@ -149,6 +154,22 @@ public class SplashFragment extends Fragment
|
||||
.show();
|
||||
}
|
||||
|
||||
private void gotoReActivateScreen(String cg_status, String token, int cg_xid, boolean is_caregiver){
|
||||
NavOptions navOptions = new NavOptions.Builder()
|
||||
.setPopUpTo(R.id.splashFragment, true)
|
||||
.build();
|
||||
|
||||
Bundle bundle = new Bundle();
|
||||
|
||||
bundle.putString(CG_STATUS_KEY, cg_status);
|
||||
bundle.putBoolean(IS_CAREGIVER_KEY, is_caregiver);
|
||||
bundle.putInt(CG_XID_KEY, cg_xid);
|
||||
bundle.putString(TOKEN_KEY, token);
|
||||
|
||||
Navigation.findNavController(binding.getRoot())
|
||||
.navigate(R.id.action_splashFragment_to_reActivateFragment, bundle, navOptions);
|
||||
}
|
||||
|
||||
private void gotoPatientProfileProgress(){
|
||||
NavOptions navOptions = new NavOptions.Builder()
|
||||
.setPopUpTo(R.id.splashFragment, true)
|
||||
@@ -194,6 +215,15 @@ public class SplashFragment extends Fragment
|
||||
// caching data
|
||||
CaregiverDataCache.setCareGiverData(careGiverData);
|
||||
|
||||
if (!careGiverData.caregiver_status.equals(AccountPresenter.ACC_ACTIVE_STR)){
|
||||
// account is not active
|
||||
|
||||
gotoReActivateScreen(careGiverData.caregiver_status, AppUtil.getCgToken(requireContext()),
|
||||
careGiverData.caregiver_xid, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
binding.retry.setVisibility(View.GONE);
|
||||
binding.loadAnim.setVisibility(View.GONE);
|
||||
|
||||
@@ -239,6 +269,15 @@ public class SplashFragment extends Fragment
|
||||
// caching data
|
||||
PatientDataCache.setPatientData(patientData);
|
||||
|
||||
if (!patientData.caregiver_status.equals(AccountPresenter.ACC_ACTIVE_STR)){
|
||||
// account is not active
|
||||
|
||||
gotoReActivateScreen(patientData.caregiver_status,
|
||||
AppUtil.getPatientToken(requireContext()),
|
||||
-1, false);
|
||||
return;
|
||||
}
|
||||
|
||||
binding.retry.setVisibility(View.GONE);
|
||||
binding.loadAnim.setVisibility(View.GONE);
|
||||
|
||||
|
||||
10
app/src/main/res/drawable/ic_message.xml
Normal file
10
app/src/main/res/drawable/ic_message.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="35dp"
|
||||
android:height="35dp"
|
||||
android:viewportWidth="192"
|
||||
android:viewportHeight="192">
|
||||
<path
|
||||
android:pathData="M81.5,1.5c-9.9,1.5 -16,3.4 -24.7,7.3 -31.4,14.2 -52.1,43 -55.9,77.7 -3.1,28.1 7,56.3 27.7,76.9 21.3,21.4 52,31.8 80.7,27.5 14.4,-2.1 30,-8.2 41.5,-16.1 21.7,-14.9 36.9,-40.5 40.4,-67.8 2.1,-17.1 -1.7,-38.2 -9.8,-54.2 -13.9,-27.5 -40.6,-46.7 -71.4,-51.4 -11.2,-1.7 -17.7,-1.6 -28.5,0.1zM149.4,62.2c-25.8,27.6 -42.4,44.2 -45.6,45.9 -4.5,2.3 -10.8,2.4 -15.3,0.3 -2.6,-1.2 -31.5,-30.2 -49.9,-50.2l-3,-3.2 60.3,-0 60.3,-0 -6.8,7.2zM69,95.6c0,0.5 -8.1,9.2 -18,19.4l-17.9,18.5 0,-37.5 -0.1,-37.5 18,18.1c9.9,10 18,18.5 18,19zM159,96.2l-0.1,37.3 -17.9,-18.5c-9.9,-10.2 -17.8,-18.8 -17.7,-19.2 0.3,-0.9 34.7,-36.8 35.3,-36.8 0.2,-0 0.4,16.8 0.4,37.2zM78.1,104.5c6.9,6.6 11,8.5 18.1,8.5 6.8,-0 12.6,-2.9 18.2,-9.1 2.4,-2.7 4.8,-4.9 5.3,-4.8 0.4,-0 8.8,8.5 18.6,18.7l17.7,18.7 -30,0.3c-16.5,0.1 -43.5,0.1 -60.1,-0l-30.1,-0.3 17.9,-18.7c9.8,-10.3 18,-18.8 18.2,-18.8 0.2,-0 3,2.5 6.2,5.5z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/ic_support_phone.xml
Normal file
10
app/src/main/res/drawable/ic_support_phone.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="35dp"
|
||||
android:height="35dp"
|
||||
android:viewportWidth="192"
|
||||
android:viewportHeight="192">
|
||||
<path
|
||||
android:pathData="M81.5,1.5c-9.9,1.5 -16,3.4 -24.7,7.3 -31.4,14.2 -52.1,43 -55.9,77.7 -3.1,28.1 7,56.3 27.7,76.9 20.6,20.7 48.8,30.8 76.9,27.7 28.7,-3.2 53.9,-18 69.2,-40.6 26.2,-38.9 21.7,-89 -11.1,-122 -14.6,-14.7 -32.8,-23.9 -53.6,-27.1 -11.2,-1.7 -17.7,-1.6 -28.5,0.1zM64.4,40.2c5.5,5.2 16.6,22.5 16.6,25.7 0,1.5 -1.4,4.9 -3.1,7.4 -4.5,6.8 -4.8,11.4 -1.4,17.3 3.6,6.1 18.8,21.3 24.9,24.9 5.9,3.4 10.5,3.1 17.3,-1.4 2.5,-1.7 5.9,-3.1 7.4,-3.1 3.3,-0 22.5,12.5 26.4,17.2 5.8,6.9 1.4,17.5 -9.4,23 -8.6,4.4 -13.5,3.9 -26.7,-2.6 -17.3,-8.5 -28.4,-16.5 -42.4,-30.5 -14,-14.1 -22.7,-26.1 -30.9,-43 -6.2,-12.7 -6.7,-17.7 -2.3,-26.2 5.8,-11.4 16.6,-15.4 23.6,-8.7z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
||||
@@ -114,7 +114,7 @@
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textAlignment="center"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginHorizontal="5dp"
|
||||
android:layout_marginTop="10dp"
|
||||
|
||||
/>
|
||||
@@ -133,7 +133,7 @@
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textAlignment="center"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginHorizontal="3dp"
|
||||
|
||||
/>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/card"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
@@ -39,7 +40,7 @@
|
||||
android:contentDescription="@string/onboard_image"
|
||||
app:tint="@color/color_primary" />
|
||||
|
||||
<com.skydoves.powerspinner.PowerSpinnerView
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -51,6 +52,8 @@
|
||||
android:textColor="@color/black"
|
||||
android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
|
||||
android:textColorHint="@color/black"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
|
||||
app:spinner_arrow_drawable="@null"
|
||||
|
||||
@@ -61,19 +64,9 @@
|
||||
android:layout_marginVertical="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:padding="10dp"
|
||||
|
||||
app:spinner_divider_show="true"
|
||||
app:spinner_divider_size="0.4dp"
|
||||
app:spinner_divider_color="@color/black"
|
||||
app:spinner_item_height="46dp"
|
||||
app:spinner_popup_width="@dimen/_200sdp"
|
||||
app:spinner_popup_animation="dropdown"
|
||||
app:spinner_popup_background="@drawable/edit_text_bg_2"
|
||||
app:spinner_popup_elevation="14dp"
|
||||
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
160
app/src/main/res/layout/fragment_acc_re_activ.xml
Normal file
160
app/src/main/res/layout/fragment_acc_re_activ.xml
Normal file
@@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="@color/white"
|
||||
android:scrollbars="none">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="50dp"
|
||||
|
||||
android:contentDescription="@string/welcome_msg"
|
||||
android:transitionName="main_icon"
|
||||
|
||||
app:srcCompat="@drawable/main_icon"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:fontFamily="@font/nunito_bold"
|
||||
android:text="@string/your_account_has_been_deactivated"
|
||||
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_16ssp"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
tools:text="@string/re_activate_msg_cg_by_cg"
|
||||
|
||||
android:textAlignment="center"
|
||||
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginTop="35dp"
|
||||
android:fontFamily="@font/nunito_bold"
|
||||
|
||||
android:text="@string/contact_support"
|
||||
android:textColor="@color/black"
|
||||
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/call"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
|
||||
android:drawablePadding="15dp"
|
||||
android:gravity="center"
|
||||
android:padding="5dp"
|
||||
|
||||
android:text="@string/support_contact"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
|
||||
app:drawableStartCompat="@drawable/ic_support_phone"
|
||||
|
||||
app:drawableTint="@color/color_primary_dark" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/email"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
|
||||
android:drawablePadding="15dp"
|
||||
android:gravity="center"
|
||||
android:padding="5dp"
|
||||
|
||||
android:text="@string/contact_email"
|
||||
android:textColor="@color/black"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
app:drawableStartCompat="@drawable/ic_message"
|
||||
|
||||
app:drawableTint="@color/color_primary_dark" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/re_activate_btn"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/re_activate_account"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
android:textColor="@color/white"
|
||||
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginTop="35dp"
|
||||
|
||||
android:paddingVertical="15dp"
|
||||
|
||||
app:cornerRadius="25dp"
|
||||
app:backgroundTint="@color/color_primary"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/log_in_another_acc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/login_with_another_account"
|
||||
android:fontFamily="@font/nunito_regular"
|
||||
android:textColor="@color/color_primary"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_gravity="end"
|
||||
|
||||
android:padding="5dp"
|
||||
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
@@ -47,6 +47,9 @@
|
||||
<action
|
||||
android:id="@+id/action_signInFragment_to_contactListFragment"
|
||||
app:destination="@id/contactListFragment" />
|
||||
<action
|
||||
android:id="@+id/action_signInFragment_to_reActivateFragment"
|
||||
app:destination="@id/reActivateFragment" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/forgotPinFragment"
|
||||
@@ -210,6 +213,9 @@
|
||||
<action
|
||||
android:id="@+id/action_splashFragment_to_cgConnectFragment"
|
||||
app:destination="@id/cgConnectFragment" />
|
||||
<action
|
||||
android:id="@+id/action_splashFragment_to_reActivateFragment"
|
||||
app:destination="@id/reActivateFragment" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/medicalInfoFragment"
|
||||
@@ -271,6 +277,9 @@
|
||||
<action
|
||||
android:id="@+id/action_cgSignInFragment_to_cgConnectFragment"
|
||||
app:destination="@id/cgConnectFragment" />
|
||||
<action
|
||||
android:id="@+id/action_cgSignInFragment_to_reActivateFragment"
|
||||
app:destination="@id/reActivateFragment" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/cgRegisterFragment"
|
||||
@@ -304,4 +313,12 @@
|
||||
android:id="@+id/cgChangePwdFragment"
|
||||
android:name="com.ssb.simplitend.welcome.welcomecg.fragments.CgChangePwdFragment"
|
||||
android:label="CgChangePwdFragment" />
|
||||
<fragment
|
||||
android:id="@+id/reActivateFragment"
|
||||
android:name="com.ssb.simplitend.welcome.welcomepatient.fragments.register.ReActivateFragment"
|
||||
android:label="ReActivateFragment" >
|
||||
<action
|
||||
android:id="@+id/action_reActivateFragment_to_splashFragment"
|
||||
app:destination="@id/splashFragment" />
|
||||
</fragment>
|
||||
</navigation>
|
||||
@@ -350,7 +350,7 @@
|
||||
<string name="enter_your_query_of_concern">Enter your query of concern</string>
|
||||
<string name="description">Description</string>
|
||||
<string name="setup_alert_notification">Setup Alert Notification</string>
|
||||
<string name="delete_account">Delete Account</string>
|
||||
<string name="delete_account">Deactivate Account</string>
|
||||
<string name="logout">Logout</string>
|
||||
<string name="sad_to_see_you_go">Sad to see you go</string>
|
||||
<string name="lorem_ipsum_has_been_the_industry_s_standard_dummy_text_ever_since_the_1500s_when_an_unknown_printer_took_a_galley_of_type_and_scrambled_it_to_make_a_type">Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type</string>
|
||||
@@ -396,5 +396,14 @@
|
||||
<string name="contact_email">contact.us@simplitent.com</string>
|
||||
<string name="instructions_title">Instructions:</string>
|
||||
<string name="you_are_about_to_change_emergency_number_from_this_contact_to_911_please_confirm">You are about to change emergency number from this contact to 911. Please confirm</string>
|
||||
<string name="your_account_has_been_deactivated">Your account has been deactivated</string>
|
||||
<string name="re_activate_msg_cg_by_cg">To reactivate your account, please click on the re-activate button below. You will be able to use your account again.</string>
|
||||
<string name="re_activate_msg_cg_by_admin">Your account is disabled/deactivated by admin. To reactivate your account, please contact admin.</string>
|
||||
<string name="re_activate_msg_patient_by_cg">Your caregiver has deactivated your account. To reactivate account please inform caregiver to activate the account and continue for uninterrupted services.</string>
|
||||
<string name="re_activate_msg_patient_by_admin">Your account is disabled/deactivated by admin. To reactivate your account, please contact admin.</string>
|
||||
<string name="contact_support">Contact support</string>
|
||||
<string name="support_contact">+1 (732)-123-1234</string>
|
||||
<string name="re_activate_account">Re-Activate Account</string>
|
||||
<string name="login_with_another_account"><u>Login with another account?</u></string>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user