Java Code Examples for org.telegram.ui.Cells.PhotoAttachPhotoCell#showCheck()

The following examples show how to use org.telegram.ui.Cells.PhotoAttachPhotoCell#showCheck() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChatAttachAlert.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@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);
        if (Build.VERSION.SDK_INT < 26) {
            coords[0] -= getLeftInset();
        }
        PhotoViewer.PlaceProviderObject object = new PhotoViewer.PlaceProviderObject();
        object.viewX = coords[0];
        object.viewY = coords[1];
        object.parentView = attachPhotoRecyclerView;
        object.imageReceiver = cell.getImageView().getImageReceiver();
        object.thumb = object.imageReceiver.getBitmapSafe();
        object.scale = cell.getImageView().getScaleX();
        cell.showCheck(false);
        return object;
    }
    return null;
}
 
Example 2
Source File: ChatAttachAlert.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@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);
        if (Build.VERSION.SDK_INT < 26) {
            coords[0] -= getLeftInset();
        }
        PhotoViewer.PlaceProviderObject object = new PhotoViewer.PlaceProviderObject();
        object.viewX = coords[0];
        object.viewY = coords[1];
        object.parentView = attachPhotoRecyclerView;
        object.imageReceiver = cell.getImageView().getImageReceiver();
        object.thumb = object.imageReceiver.getBitmapSafe();
        object.scale = cell.getImageView().getScaleX();
        cell.showCheck(false);
        return object;
    }
    return null;
}
 
Example 3
Source File: ChatAttachAlertPhotoLayout.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
@Override
public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index, boolean needPreview) {
    PhotoAttachPhotoCell cell = getCellForIndex(index);
    if (cell != null) {
        int[] coords = new int[2];
        cell.getImageView().getLocationInWindow(coords);
        if (Build.VERSION.SDK_INT < 26) {
            coords[0] -= parentAlert.getLeftInset();
        }
        PhotoViewer.PlaceProviderObject object = new PhotoViewer.PlaceProviderObject();
        object.viewX = coords[0];
        object.viewY = coords[1];
        object.parentView = gridView;
        object.imageReceiver = cell.getImageView().getImageReceiver();
        object.thumb = object.imageReceiver.getBitmapSafe();
        object.scale = cell.getScale();
        cell.showCheck(false);
        return object;
    }
    return null;
}
 
Example 4
Source File: PhotoPickerActivity.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
@Override
public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index, boolean needPreview) {
    PhotoAttachPhotoCell cell = getCellForIndex(index);
    if (cell != null) {
        BackupImageView imageView = cell.getImageView();
        int[] coords = new int[2];
        imageView.getLocationInWindow(coords);
        PhotoViewer.PlaceProviderObject object = new PhotoViewer.PlaceProviderObject();
        object.viewX = coords[0];
        object.viewY = coords[1] - (Build.VERSION.SDK_INT >= 21 ? 0 : AndroidUtilities.statusBarHeight);
        object.parentView = listView;
        object.imageReceiver = imageView.getImageReceiver();
        object.thumb = object.imageReceiver.getBitmapSafe();
        object.scale = cell.getScale();
        cell.showCheck(false);
        return object;
    }
    return null;
}
 
Example 5
Source File: PhotoPickerActivity.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) {
    int count = listView.getChildCount();
    for (int a = 0; a < count; a++) {
        View view = listView.getChildAt(a);
        if (view.getTag() == null) {
            continue;
        }
        PhotoAttachPhotoCell cell = (PhotoAttachPhotoCell) view;
        int num = (Integer) view.getTag();
        if (selectedAlbum != null) {
            if (num < 0 || num >= selectedAlbum.photos.size()) {
                continue;
            }
        } else {
            if (num < 0 || num >= searchResult.size()) {
                continue;
            }
        }
        if (num == index) {
            cell.showCheck(true);
            break;
        }
    }
}
 
Example 6
Source File: PhotoPickerActivity.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) {
    int count = listView.getChildCount();
    for (int a = 0; a < count; a++) {
        View view = listView.getChildAt(a);
        if (view.getTag() == null) {
            continue;
        }
        PhotoAttachPhotoCell cell = (PhotoAttachPhotoCell) view;
        int num = (Integer) view.getTag();
        if (selectedAlbum != null) {
            if (num < 0 || num >= selectedAlbum.photos.size()) {
                continue;
            }
        } else {
            if (num < 0 || num >= searchResult.size()) {
                continue;
            }
        }
        if (num == index) {
            cell.showCheck(true);
            break;
        }
    }
}
 
Example 7
Source File: ChatAttachAlertPhotoLayout.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
@Override
public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index, boolean needPreview) {
    PhotoAttachPhotoCell cell = getCellForIndex(index);
    if (cell != null) {
        int[] coords = new int[2];
        cell.getImageView().getLocationInWindow(coords);
        if (Build.VERSION.SDK_INT < 26) {
            coords[0] -= parentAlert.getLeftInset();
        }
        PhotoViewer.PlaceProviderObject object = new PhotoViewer.PlaceProviderObject();
        object.viewX = coords[0];
        object.viewY = coords[1];
        object.parentView = gridView;
        object.imageReceiver = cell.getImageView().getImageReceiver();
        object.thumb = object.imageReceiver.getBitmapSafe();
        object.scale = cell.getScale();
        cell.showCheck(false);
        return object;
    }
    return null;
}
 
Example 8
Source File: PhotoPickerActivity.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
@Override
public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index, boolean needPreview) {
    PhotoAttachPhotoCell cell = getCellForIndex(index);
    if (cell != null) {
        BackupImageView imageView = cell.getImageView();
        int[] coords = new int[2];
        imageView.getLocationInWindow(coords);
        PhotoViewer.PlaceProviderObject object = new PhotoViewer.PlaceProviderObject();
        object.viewX = coords[0];
        object.viewY = coords[1] - (Build.VERSION.SDK_INT >= 21 ? 0 : AndroidUtilities.statusBarHeight);
        object.parentView = listView;
        object.imageReceiver = imageView.getImageReceiver();
        object.thumb = object.imageReceiver.getBitmapSafe();
        object.scale = cell.getScale();
        cell.showCheck(false);
        return object;
    }
    return null;
}
 
Example 9
Source File: ChatAttachAlertPhotoLayout.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void willHidePhotoViewer() {
    int count = gridView.getChildCount();
    for (int a = 0; a < count; a++) {
        View view = gridView.getChildAt(a);
        if (view instanceof PhotoAttachPhotoCell) {
            PhotoAttachPhotoCell cell = (PhotoAttachPhotoCell) view;
            cell.showCheck(true);
        }
    }
}
 
Example 10
Source File: ChatAttachAlertPhotoLayout.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) {
    PhotoAttachPhotoCell cell = getCellForIndex(index);
    if (cell != null) {
        cell.showCheck(true);
    }
}
 
Example 11
Source File: PhotoPickerActivity.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void willHidePhotoViewer() {
    int count = listView.getChildCount();
    for (int a = 0; a < count; a++) {
        View view = listView.getChildAt(a);
        if (view instanceof PhotoAttachPhotoCell) {
            PhotoAttachPhotoCell cell = (PhotoAttachPhotoCell) view;
            cell.showCheck(true);
        }
    }
}
 
Example 12
Source File: ChatAttachAlertPhotoLayout.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void willHidePhotoViewer() {
    int count = gridView.getChildCount();
    for (int a = 0; a < count; a++) {
        View view = gridView.getChildAt(a);
        if (view instanceof PhotoAttachPhotoCell) {
            PhotoAttachPhotoCell cell = (PhotoAttachPhotoCell) view;
            cell.showCheck(true);
        }
    }
}
 
Example 13
Source File: ChatAttachAlertPhotoLayout.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) {
    PhotoAttachPhotoCell cell = getCellForIndex(index);
    if (cell != null) {
        cell.showCheck(true);
    }
}
 
Example 14
Source File: PhotoPickerActivity.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void willHidePhotoViewer() {
    int count = listView.getChildCount();
    for (int a = 0; a < count; a++) {
        View view = listView.getChildAt(a);
        if (view instanceof PhotoAttachPhotoCell) {
            PhotoAttachPhotoCell cell = (PhotoAttachPhotoCell) view;
            cell.showCheck(true);
        }
    }
}
 
Example 15
Source File: ChatAttachAlert.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@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;
            cell.showCheck(true);
        }
    }
}
 
Example 16
Source File: ChatAttachAlert.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) {
    PhotoAttachPhotoCell cell = getCellForIndex(index);
    if (cell != null) {
        cell.showCheck(true);
    }
}
 
Example 17
Source File: ChatAttachAlert.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@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;
            cell.showCheck(true);
        }
    }
}
 
Example 18
Source File: ChatAttachAlert.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) {
    PhotoAttachPhotoCell cell = getCellForIndex(index);
    if (cell != null) {
        cell.showCheck(true);
    }
}