| | |
| | |
|
| | | import cn.com.basic.face.base.BaseApplication;
|
| | | import cn.com.basic.face.base.MainActivity;
|
| | | import cn.com.basic.face.dialog.AttenderRegisterSelectPhotoDialog;
|
| | | import cn.com.basic.face.dialog.AttenderRegisterUploadPhotoDialog;
|
| | | import cn.com.basic.face.dialog.VisitorRegisterSelectPhotoDialog;
|
| | | import cn.com.basic.face.dialog.VisitorRegisterUploadPhotoDialog;
|
| | | import cn.com.basic.face.discern.common.CommonVariables;
|
| | | import cn.com.basic.face.discern.query.item.CheckInQueryItem;
|
| | | import cn.com.basic.face.discern.query.item.SurveillanceQueryItem;
|
| | |
| | | return JSON.parseObject(JSON.toJSONString(item), CheckInQueryItem.class);
|
| | | }
|
| | | }
|
| | |
|
| | | public static class VisitorRegisterSelectPhotoSelectListViewAdapter extends EasyRecyclerViewAdapter {
|
| | | private Context context;
|
| | | public VisitorRegisterSelectPhotoSelectListViewAdapter(Context context) {
|
| | | this.context = context;
|
| | | }
|
| | | public static int selectPhotoOrUploadPhoto;
|
| | |
|
| | | @Override
|
| | | public int[] getItemLayouts() {
|
| | | return new int[]{R.layout.fragment_surveillance_photo_cell, R.layout.fragment_surveillance_photo_blank_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);
|
| | | SurveillanceQueryItem item1 = ((SurveillanceQueryItem)getList().get(position));
|
| | | if (!(item1.getRegisterOrCheckIn() == Constant.Surveillance.VISIT_REGISTER_ITEM_TYPE
|
| | | || item1.getRegisterOrCheckIn() == CommonVariables.Surveillance.OFFLINE_SURVEILLANCE_ITEM_TYPE)) {
|
| | | return;
|
| | | }
|
| | |
|
| | | 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);
|
| | |
|
| | | if (data instanceof SurveillanceQueryItem) {
|
| | | final SurveillanceQueryItem item = (SurveillanceQueryItem)data;
|
| | | fragment_surveillance_photo_cell_select.setVisibility(item.isSurveillancePhotoSelected()
|
| | | ? View.VISIBLE : View.INVISIBLE
|
| | | );
|
| | |
|
| | | fragment_surveillance_photo_cell_photo.setOnClickListener(new View.OnClickListener() {
|
| | | @Override
|
| | | public void onClick(View v) {
|
| | | VisitorRegisterFragment.getInstance().set_fragment_visitor_register_surveillance_photo(item);
|
| | | VisitorRegisterSelectPhotoDialog.selectedId = item.getIdForSelect();
|
| | | for (SurveillanceQueryItem queryItem : (List<SurveillanceQueryItem>)getList()) {
|
| | | queryItem.setSurveillancePhotoSelected(false);
|
| | | }
|
| | | item.setSurveillancePhotoSelected(true);
|
| | | notifyDataSetChanged();
|
| | | }
|
| | | });
|
| | |
|
| | | if (item.getImagePath() != null && !item.getImagePath().equals("") && BaseApplication.getInstance().networkAvailable()) {
|
| | | 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(BitmapUtil.getRoundedCornerBitmap(item.getBitmap(),
|
| | | (int)MainActivity.getInstance().getResources().getDimension(R.dimen.w10dp)));
|
| | | } else {
|
| | | fragment_surveillance_photo_cell_photo.setImageResource(R.drawable.u45);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int getRecycleViewItemType(int position) {
|
| | | if (!(((SurveillanceQueryItem)getList().get(position)).getRegisterOrCheckIn() == Constant.Surveillance.VISIT_REGISTER_ITEM_TYPE
|
| | | || ((SurveillanceQueryItem)getList().get(position)).getRegisterOrCheckIn() == CommonVariables.Surveillance.OFFLINE_SURVEILLANCE_ITEM_TYPE
|
| | | )) {
|
| | | return 1;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private CheckInQueryItem getVo(SurveillanceQueryItem item) {
|
| | | return JSON.parseObject(JSON.toJSONString(item), CheckInQueryItem.class);
|
| | | }
|
| | | }
|
| | |
|
| | | public static class VisitorRegisterUploadPhotoSelectListViewAdapter extends EasyRecyclerViewAdapter {
|
| | | private Context context;
|
| | | public VisitorRegisterUploadPhotoSelectListViewAdapter(Context context) {
|
| | | this.context = context;
|
| | | }
|
| | | public static int selectPhotoOrUploadPhoto;
|
| | |
|
| | | @Override
|
| | | public int[] getItemLayouts() {
|
| | | return new int[]{R.layout.fragment_surveillance_photo_cell, R.layout.fragment_surveillance_photo_blank_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);
|
| | | SurveillanceQueryItem item1 = ((SurveillanceQueryItem)getList().get(position));
|
| | | if (!(item1.getRegisterOrCheckIn() == Constant.Surveillance.VISIT_REGISTER_ITEM_TYPE
|
| | | || item1.getRegisterOrCheckIn() == CommonVariables.Surveillance.OFFLINE_SURVEILLANCE_ITEM_TYPE)) {
|
| | | return;
|
| | | }
|
| | |
|
| | | 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);
|
| | |
|
| | | if (data instanceof SurveillanceQueryItem) {
|
| | | final SurveillanceQueryItem item = (SurveillanceQueryItem)data;
|
| | | fragment_surveillance_photo_cell_select.setVisibility(item.isSurveillancePhotoSelected()
|
| | | ? View.VISIBLE : View.INVISIBLE
|
| | | );
|
| | |
|
| | | fragment_surveillance_photo_cell_photo.setOnClickListener(new View.OnClickListener() {
|
| | | @Override
|
| | | public void onClick(View v) {
|
| | | VisitorRegisterFragment.getInstance().set_fragment_visitor_register_upload_custom_photo(item);
|
| | | VisitorRegisterUploadPhotoDialog.selectedId = item.getIdForSelect();
|
| | | for (SurveillanceQueryItem queryItem : (List<SurveillanceQueryItem>)getList()) {
|
| | | queryItem.setSurveillancePhotoSelected(false);
|
| | | }
|
| | | item.setSurveillancePhotoSelected(true);
|
| | | notifyDataSetChanged();
|
| | | }
|
| | | });
|
| | |
|
| | | if (item.getImagePath() != null && !item.getImagePath().equals("") && BaseApplication.getInstance().networkAvailable()) {
|
| | | 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(BitmapUtil.getRoundedCornerBitmap(item.getBitmap(),
|
| | | (int)MainActivity.getInstance().getResources().getDimension(R.dimen.w10dp)));
|
| | | } else {
|
| | | fragment_surveillance_photo_cell_photo.setImageResource(R.drawable.u45);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int getRecycleViewItemType(int position) {
|
| | | if (!(((SurveillanceQueryItem)getList().get(position)).getRegisterOrCheckIn() == Constant.Surveillance.VISIT_REGISTER_ITEM_TYPE
|
| | | || ((SurveillanceQueryItem)getList().get(position)).getRegisterOrCheckIn() == CommonVariables.Surveillance.OFFLINE_SURVEILLANCE_ITEM_TYPE
|
| | | )) {
|
| | | return 1;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private CheckInQueryItem getVo(SurveillanceQueryItem item) {
|
| | | return JSON.parseObject(JSON.toJSONString(item), CheckInQueryItem.class);
|
| | | }
|
| | | }
|
| | |
|
| | | public static class AttenderRegisterSelectPhotoSelectListViewAdapter extends EasyRecyclerViewAdapter {
|
| | | private Context context;
|
| | | public AttenderRegisterSelectPhotoSelectListViewAdapter(Context context) {
|
| | | this.context = context;
|
| | | }
|
| | | public static int selectPhotoOrUploadPhoto;
|
| | |
|
| | | @Override
|
| | | public int[] getItemLayouts() {
|
| | | return new int[]{R.layout.fragment_surveillance_photo_cell, R.layout.fragment_surveillance_photo_blank_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);
|
| | | SurveillanceQueryItem item1 = ((SurveillanceQueryItem)getList().get(position));
|
| | | if (!(item1.getRegisterOrCheckIn() == Constant.Surveillance.VISIT_REGISTER_ITEM_TYPE
|
| | | || item1.getRegisterOrCheckIn() == CommonVariables.Surveillance.OFFLINE_SURVEILLANCE_ITEM_TYPE)) {
|
| | | return;
|
| | | }
|
| | |
|
| | | 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);
|
| | |
|
| | | if (data instanceof SurveillanceQueryItem) {
|
| | | final SurveillanceQueryItem item = (SurveillanceQueryItem)data;
|
| | | fragment_surveillance_photo_cell_select.setVisibility(item.isSurveillancePhotoSelected()
|
| | | ? View.VISIBLE : View.INVISIBLE
|
| | | );
|
| | |
|
| | | fragment_surveillance_photo_cell_photo.setOnClickListener(new View.OnClickListener() {
|
| | | @Override
|
| | | public void onClick(View v) {
|
| | | AttenderRegisterFragment.getInstance().set_fragment_attender_register_surveillance_photo(item);
|
| | | AttenderRegisterSelectPhotoDialog.selectedId = item.getIdForSelect();
|
| | | for (SurveillanceQueryItem queryItem : (List<SurveillanceQueryItem>)getList()) {
|
| | | queryItem.setSurveillancePhotoSelected(false);
|
| | | }
|
| | | item.setSurveillancePhotoSelected(true);
|
| | | notifyDataSetChanged();
|
| | | }
|
| | | });
|
| | |
|
| | | if (item.getImagePath() != null && !item.getImagePath().equals("") && BaseApplication.getInstance().networkAvailable()) {
|
| | | 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(BitmapUtil.getRoundedCornerBitmap(item.getBitmap(),
|
| | | (int)MainActivity.getInstance().getResources().getDimension(R.dimen.w10dp)));
|
| | | } else {
|
| | | fragment_surveillance_photo_cell_photo.setImageResource(R.drawable.u45);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int getRecycleViewItemType(int position) {
|
| | | if (!(((SurveillanceQueryItem)getList().get(position)).getRegisterOrCheckIn() == Constant.Surveillance.VISIT_REGISTER_ITEM_TYPE
|
| | | || ((SurveillanceQueryItem)getList().get(position)).getRegisterOrCheckIn() == CommonVariables.Surveillance.OFFLINE_SURVEILLANCE_ITEM_TYPE
|
| | | )) {
|
| | | return 1;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private CheckInQueryItem getVo(SurveillanceQueryItem item) {
|
| | | return JSON.parseObject(JSON.toJSONString(item), CheckInQueryItem.class);
|
| | | }
|
| | | }
|
| | |
|
| | | public static class AttenderRegisterUploadPhotoSelectListViewAdapter extends EasyRecyclerViewAdapter {
|
| | | private Context context;
|
| | | public AttenderRegisterUploadPhotoSelectListViewAdapter(Context context) {
|
| | | this.context = context;
|
| | | }
|
| | | public static int selectPhotoOrUploadPhoto;
|
| | |
|
| | | @Override
|
| | | public int[] getItemLayouts() {
|
| | | return new int[]{R.layout.fragment_surveillance_photo_cell, R.layout.fragment_surveillance_photo_blank_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);
|
| | | SurveillanceQueryItem item1 = ((SurveillanceQueryItem)getList().get(position));
|
| | | if (!(item1.getRegisterOrCheckIn() == Constant.Surveillance.VISIT_REGISTER_ITEM_TYPE
|
| | | || item1.getRegisterOrCheckIn() == CommonVariables.Surveillance.OFFLINE_SURVEILLANCE_ITEM_TYPE)) {
|
| | | return;
|
| | | }
|
| | |
|
| | | 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);
|
| | |
|
| | | if (data instanceof SurveillanceQueryItem) {
|
| | | final SurveillanceQueryItem item = (SurveillanceQueryItem)data;
|
| | | fragment_surveillance_photo_cell_select.setVisibility(item.isSurveillancePhotoSelected()
|
| | | ? View.VISIBLE : View.INVISIBLE
|
| | | );
|
| | |
|
| | | fragment_surveillance_photo_cell_photo.setOnClickListener(new View.OnClickListener() {
|
| | | @Override
|
| | | public void onClick(View v) {
|
| | | AttenderRegisterFragment.getInstance().set_fragment_attender_register_upload_custom_photo(item);
|
| | | AttenderRegisterUploadPhotoDialog.selectedId = item.getIdForSelect();
|
| | | for (SurveillanceQueryItem queryItem : (List<SurveillanceQueryItem>)getList()) {
|
| | | queryItem.setSurveillancePhotoSelected(false);
|
| | | }
|
| | | item.setSurveillancePhotoSelected(true);
|
| | | notifyDataSetChanged();
|
| | | }
|
| | | });
|
| | |
|
| | | if (item.getImagePath() != null && !item.getImagePath().equals("") && BaseApplication.getInstance().networkAvailable()) {
|
| | | 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(BitmapUtil.getRoundedCornerBitmap(item.getBitmap(),
|
| | | (int)MainActivity.getInstance().getResources().getDimension(R.dimen.w10dp)));
|
| | | } else {
|
| | | fragment_surveillance_photo_cell_photo.setImageResource(R.drawable.u45);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int getRecycleViewItemType(int position) {
|
| | | if (!(((SurveillanceQueryItem)getList().get(position)).getRegisterOrCheckIn() == Constant.Surveillance.VISIT_REGISTER_ITEM_TYPE
|
| | | || ((SurveillanceQueryItem)getList().get(position)).getRegisterOrCheckIn() == CommonVariables.Surveillance.OFFLINE_SURVEILLANCE_ITEM_TYPE
|
| | | )) {
|
| | | return 1;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private CheckInQueryItem getVo(SurveillanceQueryItem item) {
|
| | | return JSON.parseObject(JSON.toJSONString(item), CheckInQueryItem.class);
|
| | | }
|
| | | }
|
| | | }
|