| | |
| | | return JSON.parseObject(JSON.toJSONString(item), CheckInQueryItem.class);
|
| | | }
|
| | | }
|
| | |
|
| | | public static class SurveillancePhotoSelectListViewAdapter extends EasyRecyclerViewAdapter {
|
| | | private Context context;
|
| | | public SurveillancePhotoSelectListViewAdapter(Context context) {
|
| | | this.context = context;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int[] getItemLayouts() {
|
| | | return new int[]{R.layout.fragment_surveillance_photo_cell};
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void onBindRecycleViewHolder(EasyRecyclerViewHolder viewHolder, int position) {
|
| | | RelativeLayout mLayout = viewHolder.findViewById(R.id.fragment_surveillance_photo_cell_relative_layout);
|
| | | ViewGroup.LayoutParams layoutParams = mLayout.getLayoutParams();
|
| | | layoutParams.height = (int)MainActivity.getInstance().getResources().getDimension(R.dimen.h127dp);
|
| | | layoutParams.width = (int)MainActivity.getInstance().getResources().getDimension(R.dimen.h122dp);
|
| | | mLayout.setLayoutParams(layoutParams);
|
| | |
|
| | | ImageView fragment_surveillance_photo_cell_photo = (ImageView) mLayout.findViewById(R.id.fragment_surveillance_photo_cell_photo);
|
| | | final View fragment_surveillance_photo_cell_select = mLayout.findViewById(R.id.fragment_surveillance_photo_cell_select);
|
| | |
|
| | | Object data = this.getItem(position);
|
| | |
|
| | |
|
| | | fragment_surveillance_photo_cell_photo.setOnClickListener(new View.OnClickListener() {
|
| | | @Override
|
| | | public void onClick(View v) {
|
| | | fragment_surveillance_photo_cell_select.setVisibility(fragment_surveillance_photo_cell_select.getVisibility() == View.VISIBLE
|
| | | ? View.INVISIBLE : View.VISIBLE
|
| | | );
|
| | | }
|
| | | });
|
| | |
|
| | | if (data instanceof SurveillanceQueryItem) {
|
| | | final SurveillanceQueryItem item = (SurveillanceQueryItem)data;
|
| | |
|
| | | if (item.getImagePath() != null && !item.getImagePath().equals("")) {
|
| | | fragment_surveillance_photo_cell_photo.setImageURI(Uri.parse(AppApi.IMAGE_URL_BASE +item.getImagePath()));
|
| | | } else {
|
| | | if (item.getBitmap() != null) {
|
| | | fragment_surveillance_photo_cell_photo.setImageBitmap(item.getBitmap());
|
| | | } else {
|
| | | fragment_surveillance_photo_cell_photo.setImageResource(R.drawable.u45);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int getRecycleViewItemType(int position) {
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private CheckInQueryItem getVo(SurveillanceQueryItem item) {
|
| | | return JSON.parseObject(JSON.toJSONString(item), CheckInQueryItem.class);
|
| | | }
|
| | | }
|
| | | }
|