liuzhenxing 3 years ago
parent
commit
124f38729f

+ 7 - 16
app/src/main/java/com/xplora/xplauncher/activity/MainActivity.java

@@ -17,6 +17,7 @@ import com.xplora.xplauncher.adapter.RecyclerAdapter;
 import com.xplora.xplauncher.adapter.ViewPagerAdapter;
 import com.xplora.xplauncher.broadcast.TimeBroadcastReceiver;
 import com.xplora.xplauncher.data.DataManager;
+import com.xplora.xplauncher.data.MetaData;
 import com.xplora.xplauncher.model.AppModel;
 import com.xplora.xplauncher.model.ContactModel;
 import com.xplora.xplauncher.utils.Constant;
@@ -158,22 +159,12 @@ public class MainActivity extends BaseActivity {
 
     ContactsRecyclerAdapter.ContactItemOnClickListener onContactItemOnClickListener = new ContactsRecyclerAdapter.ContactItemOnClickListener() {
         @Override
-        public void onClick(Constant.E_PAGER_TYPE pagerType, int viewIndex, int appIndex, AppModel appModel) {
-            if (mDeleteBtnStatus == 1) {
-                changeDeleteStatus();
-            } else if (appModel.isEmptyStatus()) {
-                //添加快捷应用
-                startAppListActivity(viewIndex, appIndex);
-            } else {
-                startAppActivity(appModel);
-            }
-        }
-
-        @Override
-        public void onLongClick(Constant.E_PAGER_TYPE pagerType, int viewIndex, int appIndex, AppModel appModel) {
-            if (pagerType == Constant.E_PAGER_TYPE.COMMON) {
-                changeDeleteStatus();
-            }
+        public void onClick(ContactModel contactModel) {
+//            //呼出
+//            Intent intent = new Intent();
+//            intent = intent.setClass(this, InCallActivity.class);
+//            intent.putExtra(MetaData.KEY_CONTACT_USERID, contactModel.getUserId());
+//            startActivity(intent);
         }
     };
 

+ 7 - 19
app/src/main/java/com/xplora/xplauncher/adapter/ContactsRecyclerAdapter.java

@@ -47,10 +47,6 @@ public class ContactsRecyclerAdapter extends RecyclerView.Adapter<ContactItemVie
     }
 
     public void setAppViewHolder(@NonNull ContactItemView viewHolder, int index, ContactModel model) {
-
-        //viewHolder.mContactIcon.setImageDrawable(mContext.getDrawable(recentModel.getCallType()));
-        //viewHolder.mContactHead.setImageDrawable(mContext.getDrawable(recentModel.getContactIcon()));
-
         if (viewHolder.mContactIcon != null) {
             int callTypeImage = ResUtils.getImageId("call_type_", model.getCallType());
             viewHolder.mContactIcon.setImageResource(callTypeImage);
@@ -66,19 +62,12 @@ public class ContactsRecyclerAdapter extends RecyclerView.Adapter<ContactItemVie
             viewHolder.mContactName.setText(model.getName());
         }
 
-//        viewHolder.mAppIcon.setOnClickListener(new View.OnClickListener() {
-//            @Override
-//            public void onClick(View v) {
-//                mAppItemOnClickListener.onClick(mPagerType, mViewIndex, index, mAppsList.get(index));
-//            }
-//        });
-//        viewHolder.mAppIcon.setOnLongClickListener(new View.OnLongClickListener() {
-//            @Override
-//            public boolean onLongClick(View v) {
-//                mAppItemOnClickListener.onLongClick(mPagerType, mViewIndex, index, mAppsList.get(index));
-//                return true;
-//            }
-//        });
+        viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                mItemOnClickListener.onClick(mDataList.get(index));
+            }
+        });
     }
 
     @Override
@@ -104,7 +93,6 @@ public class ContactsRecyclerAdapter extends RecyclerView.Adapter<ContactItemVie
     }
 
     public interface ContactItemOnClickListener {
-        void onClick(Constant.E_PAGER_TYPE pagerType, int viewIndex, int appIndex, AppModel appModel);
-        void onLongClick(Constant.E_PAGER_TYPE pagerType, int viewIndex, int appIndex, AppModel appModel);
+        void onClick(ContactModel contactModel);
     }
 }