| | |
| | |
|
| | | public class SurveillanceFragment {
|
| | |
|
| | | public static class SurveillanceBottomListViewAdapter extends EasyRecyclerViewAdapter {
|
| | | public static class SurveillanceBottomVisitorListViewAdapter extends EasyRecyclerViewAdapter {
|
| | | private Context context;
|
| | | public SurveillanceBottomListViewAdapter(Context context) {
|
| | | public SurveillanceBottomVisitorListViewAdapter(Context context) {
|
| | | this.context = context;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | RelativeLayout mLayout = holder.findViewById(R.id.fragment_home_bottom_register_cell_relative_layout);
|
| | | ViewGroup.LayoutParams layoutParams = mLayout.getLayoutParams();
|
| | | layoutParams.height = WindowsUtil.dip2px(context, 127);
|
| | | layoutParams.width = WindowsUtil.dip2px(context, 122);
|
| | | layoutParams.height = (int)MainActivity.getInstance().getResources().getDimension(R.dimen.h127dp);//WindowsUtil.dip2px(context, 127);
|
| | | layoutParams.width = (int)MainActivity.getInstance().getResources().getDimension(R.dimen.h122dp);//WindowsUtil.dip2px(context, 122);
|
| | | mLayout.setLayoutParams(layoutParams);
|
| | |
|
| | | final Object data = this.getItem(position);
|
| | |
| | | @Override
|
| | | public void onClick(View view) {
|
| | | MainActivity.selectPage(1);
|
| | | RegisterFragment.getInstance().setRegisterInfo(getVo(item));
|
| | | if(item.getBitmap() != null) {
|
| | | RegisterFragment.getInstance().setChoosePhoto(item.getBitmap());
|
| | | RegisterFragment.getInstance().setSurveillanceQueryItem(item);
|
| | | }
|
| | | //RegisterFragment.getInstance().setRegisterInfo(getVo(item));//java.lang.OutOfMemoryError: Failed to allocate a 25338980 byte allocation with 15827186 free bytes and 15MB until OOM
|
| | | //if(item.getBitmap() != null) {
|
| | | // RegisterFragment.getInstance().setChoosePhoto(item.getBitmap());
|
| | | // RegisterFragment.getInstance().setSurveillanceQueryItem(item);
|
| | | //}
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public static class SurveillanceBottomAttendanceListViewAdapter extends EasyRecyclerViewAdapter {
|
| | | private Context context;
|
| | | public SurveillanceBottomAttendanceListViewAdapter(Context context) {
|
| | | this.context = context;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int[] getItemLayouts() {
|
| | | return new int[]{R.layout.fragment_surveillance_bottom_attendance_cell, R.layout.fragment_surveillance_bottom_attendance_blank_cell};
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void onBindRecycleViewHolder(EasyRecyclerViewHolder viewHolder, int position) {
|
| | | RelativeLayout mLayout = viewHolder.findViewById(R.id.fragment_supervisory_bottom_attendance_cell_relative_layout);
|
| | | ViewGroup.LayoutParams layoutParams = mLayout.getLayoutParams();
|
| | | layoutParams.height = WindowsUtil.dip2px(context, 127);
|
| | | layoutParams.width = WindowsUtil.dip2px(context, 122);
|
| | | mLayout.setLayoutParams(layoutParams);
|
| | |
|
| | | ImageView fragment_home_bottom_attendance_cell_photo = (ImageView) mLayout.findViewById(R.id.fragment_home_bottom_attendance_cell_photo);
|
| | | TextView fragment_home_bottom_attendance_cell_name = (TextView) mLayout.findViewById(R.id.fragment_home_bottom_attendance_cell_name);
|
| | | TextView fragment_home_bottom_attendance_cell_status = (TextView) mLayout.findViewById(R.id.fragment_home_bottom_attendance_cell_status);
|
| | |
|
| | | Object data = this.getItem(position);
|
| | |
|
| | | fragment_home_bottom_attendance_cell_name.setText("");
|
| | | if (data instanceof SurveillanceQueryItem) {
|
| | | final SurveillanceQueryItem item = (SurveillanceQueryItem)data;
|
| | | fragment_home_bottom_attendance_cell_name.setText(item.getUsername());
|
| | |
|
| | | if (item.getImagePath() != null && !item.getImagePath().equals("")) {
|
| | | fragment_home_bottom_attendance_cell_photo.setImageURI(Uri.parse(AppApi.IMAGE_URL_BASE +item.getImagePath()));
|
| | | } else {
|
| | | if (item.getBitmap() != null) {
|
| | | fragment_home_bottom_attendance_cell_photo.setImageBitmap(item.getBitmap());
|
| | | } else {
|
| | | fragment_home_bottom_attendance_cell_photo.setImageResource(R.drawable.u45);
|
| | | }
|
| | | }
|
| | | fragment_home_bottom_attendance_cell_status.setText(item.getStatus());
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int getRecycleViewItemType(int position) {
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private CheckInQueryItem getVo(SurveillanceQueryItem item) {
|
| | | return JSON.parseObject(JSON.toJSONString(item), CheckInQueryItem.class);
|
| | | }
|
| | | }
|
| | | }
|