Java Code Examples for org.telegram.messenger.MediaController#allMediaAlbums()
The following examples show how to use
org.telegram.messenger.MediaController#allMediaAlbums() .
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: PhotoAlbumPickerActivity.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
@Override public boolean onFragmentCreate() { if (selectPhotoType != 0 || !allowSearchImages) { albumsSorted = MediaController.allPhotoAlbums; } else { albumsSorted = MediaController.allMediaAlbums; } loading = albumsSorted == null; MediaController.loadGalleryPhotosAlbums(classGuid); NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.albumsDidLoad); NotificationCenter.getInstance(currentAccount).addObserver(this, NotificationCenter.closeChats); return super.onFragmentCreate(); }
Example 2
Source File: ChatAttachAlertPhotoLayout.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
private void updateAlbumsDropDown() { dropDownContainer.removeAllSubItems(); if (mediaEnabled) { ArrayList<MediaController.AlbumEntry> albums; if (parentAlert.baseFragment instanceof ChatActivity) { albums = MediaController.allMediaAlbums; } else { albums = MediaController.allPhotoAlbums; } dropDownAlbums = new ArrayList<>(albums); Collections.sort(dropDownAlbums, (o1, o2) -> { if (o1.bucketId == 0 && o2.bucketId != 0) { return -1; } else if (o1.bucketId != 0 && o2.bucketId == 0) { return 1; } int index1 = albums.indexOf(o1); int index2 = albums.indexOf(o2); if (index1 > index2) { return 1; } else if (index1 < index2) { return -1; } else { return 0; } }); } else { dropDownAlbums = new ArrayList<>(); } if (dropDownAlbums.isEmpty()) { dropDown.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null); } else { dropDown.setCompoundDrawablesWithIntrinsicBounds(null, null, dropDownDrawable, null); for (int a = 0, N = dropDownAlbums.size(); a < N; a++) { dropDownContainer.addSubItem(10 + a, dropDownAlbums.get(a).bucketName); } } }
Example 3
Source File: PhotoAlbumPickerActivity.java From Telegram with GNU General Public License v2.0 | 5 votes |
@Override public boolean onFragmentCreate() { if (selectPhotoType != 0 || !allowSearchImages) { albumsSorted = MediaController.allPhotoAlbums; } else { albumsSorted = MediaController.allMediaAlbums; } loading = albumsSorted == null; MediaController.loadGalleryPhotosAlbums(classGuid); NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.albumsDidLoad); NotificationCenter.getInstance(currentAccount).addObserver(this, NotificationCenter.closeChats); return super.onFragmentCreate(); }
Example 4
Source File: ChatAttachAlertPhotoLayout.java From Telegram with GNU General Public License v2.0 | 5 votes |
private void updateAlbumsDropDown() { dropDownContainer.removeAllSubItems(); if (mediaEnabled) { ArrayList<MediaController.AlbumEntry> albums; if (parentAlert.baseFragment instanceof ChatActivity) { albums = MediaController.allMediaAlbums; } else { albums = MediaController.allPhotoAlbums; } dropDownAlbums = new ArrayList<>(albums); Collections.sort(dropDownAlbums, (o1, o2) -> { if (o1.bucketId == 0 && o2.bucketId != 0) { return -1; } else if (o1.bucketId != 0 && o2.bucketId == 0) { return 1; } int index1 = albums.indexOf(o1); int index2 = albums.indexOf(o2); if (index1 > index2) { return 1; } else if (index1 < index2) { return -1; } else { return 0; } }); } else { dropDownAlbums = new ArrayList<>(); } if (dropDownAlbums.isEmpty()) { dropDown.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null); } else { dropDown.setCompoundDrawablesWithIntrinsicBounds(null, null, dropDownDrawable, null); for (int a = 0, N = dropDownAlbums.size(); a < N; a++) { dropDownContainer.addSubItem(10 + a, dropDownAlbums.get(a).bucketName); } } }