@Override public void willHidePhotoViewer() { int count = attachPhotoRecyclerView.getChildCount(); for (int a = 0; a < count; a++) { View view = attachPhotoRecyclerView.getChildAt(a); if (view instanceof PhotoAttachPhotoCell) { PhotoAttachPhotoCell cell = (PhotoAttachPhotoCell) view; if (cell.getCheckBox().getVisibility() != VISIBLE) { cell.getCheckBox().setVisibility(VISIBLE); } } } }
@Override public void willSwitchFromPhoto( MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { PhotoAttachPhotoCell cell = getCellForIndex(index); if (cell != null) { cell.getCheckBox().setVisibility(View.VISIBLE); } }
@Override public PhotoViewer.PlaceProviderObject getPlaceForPhoto( MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { PhotoAttachPhotoCell cell = getCellForIndex(index); if (cell != null) { int coords[] = new int[2]; cell.getImageView().getLocationInWindow(coords); PhotoViewer.PlaceProviderObject object = new PhotoViewer.PlaceProviderObject(); object.viewX = coords[0]; object.viewY = coords[1] - (Build.VERSION.SDK_INT >= 21 ? AndroidUtilities.statusBarHeight : 0); object.parentView = attachPhotoRecyclerView; object.imageReceiver = cell.getImageView().getImageReceiver(); object.thumb = object.imageReceiver.getBitmap(); object.scale = ViewProxy.getScaleX(cell.getImageView()); object.clipBottomAddition = (Build.VERSION.SDK_INT >= 21 ? 0 : -AndroidUtilities.statusBarHeight); cell.getCheckBox().setVisibility(View.GONE); return object; } return null; }