|
@@ -2,31 +2,24 @@ package com.xplora.xplauncher.adapter;
|
|
|
|
|
|
import android.annotation.SuppressLint;
|
|
|
import android.content.Context;
|
|
|
-import android.content.pm.ResolveInfo;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
-import android.widget.Button;
|
|
|
-import android.widget.ImageView;
|
|
|
-import android.widget.TextView;
|
|
|
+
|
|
|
import androidx.annotation.NonNull;
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
|
|
import com.xplora.xplauncher.R;
|
|
|
import com.xplora.xplauncher.model.AppModel;
|
|
|
import com.xplora.xplauncher.model.ContactModel;
|
|
|
-import com.xplora.xplauncher.model.RecentModel;
|
|
|
import com.xplora.xplauncher.utils.Constant;
|
|
|
import com.xplora.xplauncher.utils.ResUtils;
|
|
|
-import com.xplora.xplauncher.view.AppItemView;
|
|
|
-import com.xplora.xplauncher.view.RecentItemView;
|
|
|
+import com.xplora.xplauncher.view.ContactItemView;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
-import javax.xml.transform.Result;
|
|
|
-
|
|
|
-public class ContactsRecyclerAdapter extends RecyclerView.Adapter<RecentItemView> {
|
|
|
+public class ContactsRecyclerAdapter extends RecyclerView.Adapter<ContactItemView> {
|
|
|
private Context mContext;
|
|
|
private int mViewType = 0;
|
|
|
private List<ContactModel> mDataList = new ArrayList<>();
|
|
@@ -40,20 +33,20 @@ public class ContactsRecyclerAdapter extends RecyclerView.Adapter<RecentItemView
|
|
|
|
|
|
@NonNull
|
|
|
@Override
|
|
|
- public RecentItemView onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
|
|
|
+ public ContactItemView onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
|
|
|
int layoutId = mViewType == 0 ? R.layout.item_recent : R.layout.item_contact;
|
|
|
View view = LayoutInflater.from(viewGroup.getContext()).inflate(layoutId, viewGroup, false);
|
|
|
- RecentItemView holder = new RecentItemView(view);
|
|
|
+ ContactItemView holder = new ContactItemView(view);
|
|
|
return holder;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void onBindViewHolder(@NonNull RecentItemView viewHolder, @SuppressLint("RecyclerView") int i) {
|
|
|
+ public void onBindViewHolder(@NonNull ContactItemView viewHolder, @SuppressLint("RecyclerView") int i) {
|
|
|
ContactModel model = mDataList.get(i);
|
|
|
setAppViewHolder(viewHolder, i, model);
|
|
|
}
|
|
|
|
|
|
- public void setAppViewHolder(@NonNull RecentItemView viewHolder, int index, ContactModel model) {
|
|
|
+ public void setAppViewHolder(@NonNull ContactItemView viewHolder, int index, ContactModel model) {
|
|
|
|
|
|
//viewHolder.mContactIcon.setImageDrawable(mContext.getDrawable(recentModel.getCallType()));
|
|
|
//viewHolder.mContactHead.setImageDrawable(mContext.getDrawable(recentModel.getContactIcon()));
|
|
@@ -87,7 +80,7 @@ public class ContactsRecyclerAdapter extends RecyclerView.Adapter<RecentItemView
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void onViewRecycled(@NonNull RecentItemView holder) {
|
|
|
+ public void onViewRecycled(@NonNull ContactItemView holder) {
|
|
|
super.onViewRecycled(holder);
|
|
|
}
|
|
|
|