| | |
| | | package com.bsk.zhangbo.demoforbsk.adapter; |
| | | |
| | | import android.content.Context; |
| | | import android.support.v7.widget.GridLayoutManager; |
| | | import android.support.v7.widget.RecyclerView; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.ImageView; |
| | | import android.widget.RelativeLayout; |
| | | import android.widget.TextView; |
| | | |
| | | import com.bsk.zhangbo.demoforbsk.R; |
| | | import com.bsk.zhangbo.demoforbsk.ui.activity.MainActivity; |
| | | import com.bsk.zhangbo.demoforbsk.util.WindowsUtil; |
| | | import com.camnter.easyrecyclerview.adapter.EasyRecyclerViewAdapter; |
| | | import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; |
| | |
| | | int recycleViewItemType = getRecycleViewItemType(position); |
| | | switch (recycleViewItemType){ |
| | | case 0: |
| | | |
| | | RegisterViewHolder(viewHolder,position); |
| | | break; |
| | | case 1: |
| | |
| | | */ |
| | | private void RegisterViewHolder(EasyRecyclerViewHolder holder,int posistion){ |
| | | |
| | | |
| | | RelativeLayout mLayout = holder.findViewById(R.id.item_register_base); |
| | | ViewGroup.LayoutParams layoutParams = mLayout.getLayoutParams(); |
| | | layoutParams.height = WindowsUtil.dip2px(context, 127); |
| | | layoutParams.width = WindowsUtil.dip2px(context, 104); |
| | | mLayout.setLayoutParams(layoutParams); |
| | | |
| | | final Object data = this.getItem(posistion); |
| | | |
| | | ImageView photoIv = (ImageView) mLayout.findViewById(R.id.item_register_bcg); |
| | | TextView toRegisterTv = (TextView) mLayout.findViewById(R.id.item_register_to_register); |
| | | toRegisterTv.setOnClickListener(new View.OnClickListener(){ |
| | | @Override |
| | | public void onClick(View view) { |
| | | MainActivity.selectPage(1); |
| | | System.out.println(data.toString()); |
| | | } |
| | | }); |
| | | |
| | | // ImageView mSdv = holder.findViewById(R.id.item_register_bcg); |
| | | // ViewGroup.LayoutParams mSdvLayoutParams = mSdv.getLayoutParams(); |
| | |
| | | // mSdvLayoutParams.width = WindowsUtil.dip2px(context, 60); |
| | | // mSdv.setLayoutParams(mSdvLayoutParams); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 第二列用户情况 |
| | | * @param holder |
| | |
| | | */ |
| | | private void UserViewHolder(EasyRecyclerViewHolder holder,int posistion){ |
| | | |
| | | |
| | | |
| | | RelativeLayout mLayout = holder.findViewById(R.id.item_user_base); |
| | | ViewGroup.LayoutParams layoutParams = mLayout.getLayoutParams(); |
| | | layoutParams.height = WindowsUtil.dip2px(context, 127); |
| | | layoutParams.width = WindowsUtil.dip2px(context, 104); |
| | | mLayout.setLayoutParams(layoutParams); |
| | | |
| | | ImageView photoIv = (ImageView) mLayout.findViewById(R.id.item_user_bcg); |
| | | TextView warningTv = (TextView) mLayout.findViewById(R.id.item_user_warning); |
| | | TextView nameTv = (TextView) mLayout.findViewById(R.id.item_user_name); |
| | | TextView statusTv = (TextView) mLayout.findViewById(R.id.item_user_status); |
| | | //statusTv.setText(""); |
| | | |
| | | Object data = this.getItem(posistion); |
| | | |
| | | |
| | | // ImageView mSdv = holder.findViewById(R.id.item_user_bcg); |
| | | // ViewGroup.LayoutParams mSdvLayoutParams = mSdv.getLayoutParams(); |