.
This commit is contained in:
@@ -1,21 +1,14 @@
|
||||
package com.app.simplitend.patient_dashboard.fragments;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.role.RoleManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.telecom.TelecomManager;
|
||||
import android.view.View;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TableLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
@@ -24,7 +17,7 @@ import com.app.simplitend.apputils.AppUtil;
|
||||
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.mvvm.AddContactAdapter;
|
||||
import com.app.simplitend.welcome.welcomepatient.fragments.contacts.AddContactAdapter;
|
||||
import com.app.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactData;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
|
||||
|
||||
@@ -42,4 +42,5 @@ public class CareGiverData{
|
||||
public String caregiver_status, one_signal_player_id, link_id;
|
||||
|
||||
public PatientData patientDetails;
|
||||
public int is_contact_view_updated;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.app.simplitend.welcome.welcomepatient.fragments.contacts.mvvm;
|
||||
package com.app.simplitend.welcome.welcomepatient.fragments.contacts;
|
||||
|
||||
import static com.app.simplitend.welcome.welcomepatient.fragments.contacts.CreateContactFragment.TO_EDIT_KEY;
|
||||
|
||||
@@ -17,7 +17,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.app.simplitend.apputils.RetrofitHelper;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.app.simplitend.R;
|
||||
import com.app.simplitend.apputils.AppUtil;
|
||||
import com.app.simplitend.databinding.AddContactViewholderBinding;
|
||||
import com.app.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactData;
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.PopupMenu;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -17,14 +18,16 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.navigation.Navigation;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.app.simplitend.R;
|
||||
import com.app.simplitend.apputils.AppUtil;
|
||||
import com.app.simplitend.apputils.CaregiverDataCache;
|
||||
import com.app.simplitend.apputils.PatientDataCache;
|
||||
import com.app.simplitend.databinding.AddContactFragmentBinding;
|
||||
import com.app.simplitend.databinding.DoneBottomsheetBinding;
|
||||
import com.app.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.AddContactAdapter;
|
||||
import com.app.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.ContactViewModel;
|
||||
import com.app.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.FiftyContactsAdapter;
|
||||
import com.app.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactData;
|
||||
import com.app.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactListResponse;
|
||||
import com.app.simplitend.welcome.welcomepatient.mvvm.WelcomeContracts;
|
||||
@@ -33,7 +36,7 @@ import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AddContactFragment extends Fragment implements WelcomeContracts.ContactListContracts, AddContactAdapter.ContactClickListener {
|
||||
public class AddContactFragment extends Fragment implements WelcomeContracts.ContactListContracts, AddContactAdapter.ContactClickListener, WelcomeContracts.UpdateTo50ContactsCallback {
|
||||
|
||||
// view binding
|
||||
protected AddContactFragmentBinding binding;
|
||||
@@ -41,8 +44,7 @@ public class AddContactFragment extends Fragment implements WelcomeContracts.Con
|
||||
public static final String CONTACT_INFO_F = "contact_info_f";
|
||||
|
||||
protected AddContactAdapter contactAdapter;
|
||||
|
||||
private ProgressDialog progressDialog;
|
||||
protected FiftyContactsAdapter fiftyContactsAdapter;
|
||||
|
||||
private ContactViewModel contactViewModel;
|
||||
|
||||
@@ -51,6 +53,8 @@ public class AddContactFragment extends Fragment implements WelcomeContracts.Con
|
||||
|
||||
private boolean isSetupComplete;
|
||||
|
||||
private PopupMenu popupMenu;
|
||||
|
||||
public AddContactFragment(){
|
||||
// required empty const.
|
||||
}
|
||||
@@ -69,21 +73,92 @@ public class AddContactFragment extends Fragment implements WelcomeContracts.Con
|
||||
if (isSetupComplete) {
|
||||
binding.titleTxt.setText("Contacts");
|
||||
}
|
||||
|
||||
initViews();
|
||||
|
||||
clickEvents();
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
progressDialog = new ProgressDialog(requireContext());
|
||||
if (AppUtil.isPatientLoggedIn(requireContext())){
|
||||
// senior
|
||||
PatientDataCache.getPatientData(requireContext(), patientData -> {
|
||||
if (patientData != null){
|
||||
|
||||
binding.contactRv.setLayoutManager(new GridLayoutManager(requireContext(), 2));
|
||||
contactAdapter = new AddContactAdapter();
|
||||
binding.contactRv.setAdapter(contactAdapter);
|
||||
initViews(patientData.is_contact_view_updated == 1);
|
||||
|
||||
clickEvents();
|
||||
}
|
||||
}, true);
|
||||
}else{
|
||||
// caregiver
|
||||
CaregiverDataCache.getCaregiverData(requireContext(), careGiverData -> {
|
||||
if (careGiverData != null){
|
||||
|
||||
initViews(careGiverData.is_contact_view_updated == 1);
|
||||
|
||||
clickEvents();
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void initViews(boolean is_contact_view_updated) {
|
||||
|
||||
if (isSetupComplete) {
|
||||
|
||||
if (!is_contact_view_updated) {
|
||||
binding.openMenuBtn.setVisibility(View.VISIBLE);
|
||||
|
||||
popupMenu = new PopupMenu(requireContext(), binding.openMenuBtn);
|
||||
popupMenu.inflate(R.menu.contacts_menu);
|
||||
|
||||
binding.openMenuBtn.setOnClickListener(v -> {
|
||||
popupMenu.show();
|
||||
});
|
||||
|
||||
popupMenu.setOnMenuItemClickListener(menuItem -> {
|
||||
AppUtil.showAlert(requireContext(),
|
||||
"Are you sure?", "Do you want to change the contact list to 50 contacts?",
|
||||
"Yes", ((dialogInterface, i) -> {
|
||||
// yes
|
||||
if (AppUtil.isPatientLoggedIn(requireContext())){
|
||||
// senior
|
||||
PatientDataCache.getPatientData(requireContext(), patientData -> {
|
||||
if (patientData != null){
|
||||
binding.progressBar.setVisibility(View.VISIBLE);
|
||||
|
||||
contactViewModel.updateTo50Contacts(this, patientData.patientId,
|
||||
false, "Bearer " + AppUtil.getPatientToken(requireContext()));
|
||||
}
|
||||
}, true);
|
||||
}else{
|
||||
// caregiver
|
||||
CaregiverDataCache.getCaregiverData(requireContext(), careGiverData -> {
|
||||
if (careGiverData != null){
|
||||
binding.progressBar.setVisibility(View.VISIBLE);
|
||||
|
||||
contactViewModel.updateTo50Contacts(this, careGiverData.caregiver_xid,
|
||||
true, "Bearer " + AppUtil.getCgToken(requireContext()));
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
}), "No", null);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (is_contact_view_updated){
|
||||
binding.contactRv.setLayoutManager(new LinearLayoutManager(requireContext()));
|
||||
fiftyContactsAdapter = new FiftyContactsAdapter();
|
||||
binding.contactRv.setAdapter(fiftyContactsAdapter);
|
||||
}else{
|
||||
binding.contactRv.setLayoutManager(new GridLayoutManager(requireContext(), 2));
|
||||
contactAdapter = new AddContactAdapter();
|
||||
binding.contactRv.setAdapter(contactAdapter);
|
||||
}
|
||||
|
||||
loadContacts();
|
||||
|
||||
@@ -95,8 +170,12 @@ public class AddContactFragment extends Fragment implements WelcomeContracts.Con
|
||||
contactViewModel.getRemoteContactList(this,
|
||||
"Bearer " + AppUtil.getPatientToken(requireContext()));
|
||||
|
||||
contactAdapter.setContactClickListener(this);
|
||||
|
||||
if (contactAdapter != null) {
|
||||
contactAdapter.setContactClickListener(this);
|
||||
}else if (fiftyContactsAdapter != null){
|
||||
fiftyContactsAdapter.setContactClickListener(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void clickEvents() {
|
||||
@@ -145,13 +224,19 @@ public class AddContactFragment extends Fragment implements WelcomeContracts.Con
|
||||
// do nothing
|
||||
}
|
||||
|
||||
for (int i = contactList.size(); i<10; i++){
|
||||
contactList.add(new ContactData(-1));
|
||||
}
|
||||
|
||||
binding.progressBar.setVisibility(View.GONE);
|
||||
|
||||
contactAdapter.submitList(contactList);
|
||||
if (contactAdapter != null) {
|
||||
for (int i = contactList.size(); i<10; i++){
|
||||
contactList.add(new ContactData(-1));
|
||||
}
|
||||
contactAdapter.submitList(contactList);
|
||||
} else if (fiftyContactsAdapter != null) {
|
||||
for (int i = contactList.size(); i<50; i++){
|
||||
contactList.add(new ContactData(-1));
|
||||
}
|
||||
fiftyContactsAdapter.submitList(contactList);
|
||||
}
|
||||
|
||||
binding.nextBtn.setVisibility(View.VISIBLE);
|
||||
}
|
||||
@@ -264,4 +349,49 @@ public class AddContactFragment extends Fragment implements WelcomeContracts.Con
|
||||
bsd.show();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdatedTo50Contacts() {
|
||||
try {
|
||||
Toast.makeText(requireContext(), "Contact list updated", Toast.LENGTH_SHORT).show();
|
||||
|
||||
binding.contactRv.setLayoutManager(new LinearLayoutManager(requireContext()));
|
||||
fiftyContactsAdapter = new FiftyContactsAdapter();
|
||||
binding.contactRv.setAdapter(fiftyContactsAdapter);
|
||||
|
||||
contactAdapter = null;
|
||||
|
||||
loadContacts();
|
||||
|
||||
binding.openMenuBtn.setVisibility(View.GONE);
|
||||
|
||||
if (AppUtil.isPatientLoggedIn(requireContext())){
|
||||
PatientDataCache.getPatientData(requireContext(), patientData -> {
|
||||
if (patientData != null){
|
||||
patientData.is_contact_view_updated = 1;
|
||||
PatientDataCache.setPatientData(patientData);
|
||||
}
|
||||
}, true);
|
||||
}else{
|
||||
CaregiverDataCache.getCaregiverData(requireContext(), careGiverData -> {
|
||||
if (careGiverData != null){
|
||||
careGiverData.is_contact_view_updated = 1;
|
||||
CaregiverDataCache.setCareGiverData(careGiverData);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateTo50ContactFailed(String message) {
|
||||
binding.progressBar.setVisibility(View.GONE);
|
||||
try {
|
||||
Toast.makeText(requireContext(), "" + message, Toast.LENGTH_SHORT).show();
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -260,6 +260,10 @@ public class ContactViewModel extends AndroidViewModel {
|
||||
return returnString.toString();
|
||||
}
|
||||
|
||||
public void updateTo50Contacts(@NonNull WelcomeContracts.UpdateTo50ContactsCallback contactsCallback, int id, boolean isCaregiver, @NonNull String token){
|
||||
contactRepository.updateTo50Contacts(contactsCallback, id, isCaregiver, token);
|
||||
}
|
||||
|
||||
|
||||
// interfaces
|
||||
public interface GotoAddContactInterface{
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.app.simplitend.welcome.welcomepatient.fragments.contacts.mvvm;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.DiffUtil;
|
||||
import androidx.recyclerview.widget.ListAdapter;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.app.simplitend.R;
|
||||
import com.app.simplitend.apputils.RetrofitHelper;
|
||||
import com.app.simplitend.databinding.FiftyContactViewholderBinding;
|
||||
import com.app.simplitend.welcome.welcomepatient.fragments.contacts.AddContactAdapter;
|
||||
import com.app.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models.ContactData;
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
public class FiftyContactsAdapter extends ListAdapter<ContactData, FiftyContactsAdapter.ContactViewHolder> {
|
||||
|
||||
private static final DiffUtil.ItemCallback<ContactData> DIFF_UTIL = new DiffUtil.ItemCallback<ContactData>() {
|
||||
@Override
|
||||
public boolean areItemsTheSame(@NonNull ContactData oldItem, @NonNull ContactData newItem) {
|
||||
return oldItem.first_name.equals(newItem.first_name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areContentsTheSame(@NonNull ContactData oldItem, @NonNull ContactData newItem) {
|
||||
return oldItem.equals(newItem);
|
||||
}
|
||||
};
|
||||
|
||||
private AddContactAdapter.ContactClickListener contactClickListener;
|
||||
|
||||
public FiftyContactsAdapter() {
|
||||
super(DIFF_UTIL);
|
||||
}
|
||||
|
||||
public void setContactClickListener(AddContactAdapter.ContactClickListener contactClickListener) {
|
||||
this.contactClickListener = contactClickListener;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ContactViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
FiftyContactViewholderBinding binding = FiftyContactViewholderBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
|
||||
return new ContactViewHolder(binding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ContactViewHolder holder, int position) {
|
||||
holder.setData(getItem(position), position);
|
||||
|
||||
holder.binding.card.setOnClickListener(v -> {
|
||||
if (contactClickListener != null){
|
||||
contactClickListener.onContactClick(getItem(position), position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static class ContactViewHolder extends RecyclerView.ViewHolder {
|
||||
public FiftyContactViewholderBinding binding;
|
||||
|
||||
public ContactViewHolder(FiftyContactViewholderBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
|
||||
public void setData(ContactData contact, int position) {
|
||||
if (contact.id == -1){
|
||||
// no contact yet added
|
||||
binding.addImg.setVisibility(View.VISIBLE);
|
||||
binding.image.setVisibility(View.GONE);
|
||||
|
||||
binding.name.setText(itemView.getContext().getString(R.string.add_contact));
|
||||
|
||||
binding.card.setCardBackgroundColor(itemView.getContext().getColor(R.color.color_accent));
|
||||
|
||||
binding.cgIc.setVisibility(View.GONE);
|
||||
binding.docIc.setVisibility(View.GONE);
|
||||
binding.sos.setVisibility(View.GONE);
|
||||
|
||||
}else{
|
||||
binding.name.setText(contact.first_name);
|
||||
|
||||
if (contact.contact_photo == null || contact.contact_photo.isEmpty()){
|
||||
binding.addImg.setVisibility(View.VISIBLE);
|
||||
binding.image.setVisibility(View.GONE);
|
||||
}else{
|
||||
binding.addImg.setVisibility(View.GONE);
|
||||
binding.image.setVisibility(View.VISIBLE);
|
||||
|
||||
Glide.with(itemView.getContext())
|
||||
.load(RetrofitHelper.IMAGE_BASE_URL + contact.contact_photo)
|
||||
.placeholder(android.R.color.darker_gray)
|
||||
.error(R.drawable.ic_contact)
|
||||
.fitCenter().into(binding.image);
|
||||
}
|
||||
|
||||
binding.card.setCardBackgroundColor(itemView.getContext().getColor(R.color.white_bg));
|
||||
|
||||
if (contact.care_giver_data.id != null){
|
||||
// this contact is caregiver
|
||||
binding.cgIc.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
binding.cgIc.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (contact.is_sos != null && contact.is_sos.equals("1")){
|
||||
binding.sos.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
binding.sos.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (contact.is_doctor != null && contact.is_doctor.equals("1")){
|
||||
binding.docIc.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
binding.docIc.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -282,4 +282,30 @@ public class UserContactRepository {
|
||||
}
|
||||
}
|
||||
|
||||
public void updateTo50Contacts(@NonNull WelcomeContracts.UpdateTo50ContactsCallback contactsCallback, int id, boolean isCaregiver, @NonNull String token){
|
||||
Map<String, Integer> body = new HashMap<>();
|
||||
body.put("id", id);
|
||||
body.put("is_caregiver_or_patient", isCaregiver?2:1);
|
||||
apiService.updateTo50Contacts(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.code() == 200 && response.body().error_code == 0){
|
||||
// success
|
||||
contactsCallback.onUpdatedTo50Contacts();
|
||||
}else{
|
||||
contactsCallback.onUpdateTo50ContactFailed(response.body().message);
|
||||
}
|
||||
}else{
|
||||
contactsCallback.onUpdateTo50ContactFailed("Something went wrong");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<CallResponse<Object>> call, Throwable t) {
|
||||
contactsCallback.onUpdateTo50ContactFailed("Something went wrong");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -59,4 +59,9 @@ public interface WelcomeApiService {
|
||||
@Multipart
|
||||
@POST("api/auth/change-patient-pin")
|
||||
Call<CallResponse<PatientData>> updatePin(@PartMap Map<String, RequestBody> body);
|
||||
|
||||
@Multipart
|
||||
@POST("api/change-view-of-contact-list")
|
||||
Call<CallResponse<Object>> updateTo50Contacts(@PartMap Map<String, Integer> body,
|
||||
@Header("Authorization") String token);
|
||||
}
|
||||
|
||||
@@ -74,4 +74,10 @@ public interface WelcomeContracts {
|
||||
void onPinUpdateFailed(Throwable t, String message);
|
||||
}
|
||||
|
||||
interface UpdateTo50ContactsCallback{
|
||||
void onUpdatedTo50Contacts();
|
||||
|
||||
void onUpdateTo50ContactFailed(String message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ public class PatientData {
|
||||
|
||||
public String caregiver_name, caregiver_profile_photo, caregiverId, link_id, caregiver_iamprincipal_id;
|
||||
|
||||
public int is_contact_view_updated;
|
||||
|
||||
// progress flags
|
||||
public int isCareGiverLink
|
||||
, isPatientReminderData
|
||||
|
||||
10
app/src/main/res/drawable/ic_three_dots.xml
Normal file
10
app/src/main/res/drawable/ic_three_dots.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="29.96dp"
|
||||
android:height="122.88dp"
|
||||
android:viewportWidth="29.96"
|
||||
android:viewportHeight="122.88">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M15,0A15,15 0,1 1,0 15,15 15,0 0,1 15,0ZM15,92.93a15,15 0,1 1,-15 15,15 15,0 0,1 15,-15ZM15,46.46a15,15 0,1 1,-15 15,15 15,0 0,1 15,-15Z"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
@@ -23,6 +23,7 @@
|
||||
android:id="@+id/back_btn"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:contentDescription="@string/back_button"
|
||||
android:padding="5dp"
|
||||
android:layout_centerVertical="true"
|
||||
|
||||
@@ -12,16 +12,35 @@
|
||||
android:layout_above="@id/next_btn"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_btn"
|
||||
android:layout_width="35sp"
|
||||
android:layout_height="35sp"
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="15dp"
|
||||
android:contentDescription="@string/back_button"
|
||||
android:padding="5dp"
|
||||
android:paddingStart="-15dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:src="@drawable/arrow_back" />
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_btn"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:contentDescription="@string/back_button"
|
||||
android:padding="5dp"
|
||||
android:paddingStart="-15dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@drawable/arrow_back" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/open_menu_btn"
|
||||
android:visibility="gone"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:src="@drawable/ic_three_dots"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_txt"
|
||||
|
||||
102
app/src/main/res/layout/fifty_contact_viewholder.xml
Normal file
102
app/src/main/res/layout/fifty_contact_viewholder.xml
Normal file
@@ -0,0 +1,102 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
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
|
||||
android:id="@+id/card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
app:cardCornerRadius="5dp"
|
||||
app:strokeColor="@color/color_accent"
|
||||
app:strokeWidth="1dp"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginVertical="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/add_img"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:visibility="gone"
|
||||
android:src="@drawable/ic_contact"
|
||||
/>
|
||||
|
||||
<de.hdodenhof.circleimageview.CircleImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
app:civ_border_width="0.5dp"
|
||||
app:civ_border_color="@color/color_primary"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
tools:text="Aditya gaikwad"
|
||||
android:fontFamily="@font/nunito_regular"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_12ssp"
|
||||
|
||||
android:layout_marginStart="10dp"
|
||||
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cg_ic"
|
||||
android:visibility="gone"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:contentDescription="@string/make_sos"
|
||||
|
||||
app:srcCompat="@drawable/ic_add_red"
|
||||
|
||||
android:layout_marginStart="10dp"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/doc_ic"
|
||||
android:visibility="gone"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:contentDescription="@string/make_sos"
|
||||
|
||||
app:srcCompat="@drawable/ic_doctor"
|
||||
|
||||
android:layout_marginStart="10dp"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sos"
|
||||
android:visibility="gone"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:contentDescription="@string/make_sos"
|
||||
|
||||
app:srcCompat="@drawable/ic_sos"
|
||||
|
||||
android:layout_marginStart="10dp"
|
||||
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</LinearLayout>
|
||||
7
app/src/main/res/menu/contacts_menu.xml
Normal file
7
app/src/main/res/menu/contacts_menu.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@+id/update_to_50_contacts"
|
||||
android:title="@string/update_to_50_contacts"
|
||||
/>
|
||||
|
||||
</menu>
|
||||
@@ -491,5 +491,6 @@
|
||||
<string name="unlock_enhanced_features_and_improved_performance_with_our_latest_app_update">Unlock enhanced features and improved performance with our latest app update</string>
|
||||
<string name="update_app">Update app</string>
|
||||
<string name="skip_underline"><u>skip</u></string>
|
||||
<string name="update_to_50_contacts">Update to 50 contacts</string>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user