From 55ccb7c9e237c7dfb7f75aac4f4563cb5961bc2b Mon Sep 17 00:00:00 2001 From: DrKLO Date: Thu, 12 Jun 2014 05:13:15 +0400 Subject: [PATCH] New photo picker in chats --- TMessagesProj/build.gradle | 4 +- .../telegram/messenger/MediaController.java | 121 +++- .../messenger/MessagesController.java | 4 +- .../org/telegram/ui/Cells/ChatMediaCell.java | 4 + .../java/org/telegram/ui/ChatActivity.java | 61 +- .../org/telegram/ui/ChatProfileActivity.java | 24 +- .../org/telegram/ui/ContactsActivity.java | 2 +- .../telegram/ui/CountrySelectActivity.java | 2 +- .../telegram/ui/DocumentSelectActivity.java | 2 +- .../org/telegram/ui/GroupCreateActivity.java | 2 +- .../telegram/ui/GroupCreateFinalActivity.java | 2 +- .../org/telegram/ui/IdenticonActivity.java | 2 +- .../telegram/ui/LanguageSelectActivity.java | 2 +- .../org/telegram/ui/LocationActivity.java | 2 +- .../java/org/telegram/ui/LoginActivity.java | 2 +- .../java/org/telegram/ui/MediaActivity.java | 27 +- .../org/telegram/ui/MessagesActivity.java | 4 +- .../org/telegram/ui/PhotoPickerActivity.java | 573 ++++++++++++++++++ .../java/org/telegram/ui/PhotoViewer.java | 272 +++++++-- .../org/telegram/ui/SettingsActivity.java | 24 +- .../org/telegram/ui/SettingsBlockedUsers.java | 2 +- .../ui/SettingsNotificationsActivity.java | 2 +- .../org/telegram/ui/UserProfileActivity.java | 24 +- .../ui/Views/ActionBar/ActionBar.java | 5 - .../ui/Views/ActionBar/ActionBarActivity.java | 29 +- .../ui/Views/ActionBar/ActionBarLayer.java | 35 +- .../ui/Views/ActionBar/ActionBarMenu.java | 4 +- .../ui/Views/ActionBar/ActionBarMenuItem.java | 4 +- .../ui/Views/ActionBar/BaseFragment.java | 1 + .../org/telegram/ui/Views/ImageReceiver.java | 2 +- .../src/main/res/drawable-hdpi/gallery.png | Bin 0 -> 405 bytes .../res/drawable-hdpi/ic_ab_other_white2.png | Bin 0 -> 202 bytes .../src/main/res/drawable-hdpi/nophotos.9.png | Bin 0 -> 991 bytes .../src/main/res/drawable-hdpi/photo_back.png | Bin 0 -> 384 bytes .../main/res/drawable-hdpi/photobadge.9.png | Bin 0 -> 138 bytes .../main/res/drawable-hdpi/photoborder.9.png | Bin 0 -> 163 bytes .../res/drawable-hdpi/selectphoto_large.png | Bin 0 -> 442 bytes .../res/drawable-hdpi/selectphoto_small.png | Bin 0 -> 332 bytes .../selectphoto_small_active.png | Bin 0 -> 332 bytes .../drawable-hdpi/selectphoto_small_grey.png | Bin 0 -> 399 bytes .../src/main/res/drawable-ldpi/gallery.png | Bin 0 -> 262 bytes .../res/drawable-ldpi/ic_ab_other_white2.png | Bin 0 -> 166 bytes .../src/main/res/drawable-ldpi/nophotos.9.png | Bin 0 -> 520 bytes .../src/main/res/drawable-ldpi/photo_back.png | Bin 0 -> 212 bytes .../main/res/drawable-ldpi/photobadge.9.png | Bin 0 -> 108 bytes .../main/res/drawable-ldpi/photoborder.9.png | Bin 0 -> 125 bytes .../res/drawable-ldpi/selectphoto_large.png | Bin 0 -> 279 bytes .../res/drawable-ldpi/selectphoto_small.png | Bin 0 -> 231 bytes .../selectphoto_small_active.png | Bin 0 -> 235 bytes .../drawable-ldpi/selectphoto_small_grey.png | Bin 0 -> 265 bytes .../src/main/res/drawable-mdpi/gallery.png | Bin 0 -> 310 bytes .../res/drawable-mdpi/ic_ab_other_white2.png | Bin 0 -> 182 bytes .../src/main/res/drawable-mdpi/nophotos.9.png | Bin 0 -> 674 bytes .../src/main/res/drawable-mdpi/photo_back.png | Bin 0 -> 245 bytes .../main/res/drawable-mdpi/photobadge.9.png | Bin 0 -> 112 bytes .../main/res/drawable-mdpi/photoborder.9.png | Bin 0 -> 140 bytes .../res/drawable-mdpi/selectphoto_large.png | Bin 0 -> 319 bytes .../res/drawable-mdpi/selectphoto_small.png | Bin 0 -> 262 bytes .../selectphoto_small_active.png | Bin 0 -> 262 bytes .../drawable-mdpi/selectphoto_small_grey.png | Bin 0 -> 316 bytes .../src/main/res/drawable-xhdpi/gallery.png | Bin 0 -> 515 bytes .../res/drawable-xhdpi/ic_ab_other_white2.png | Bin 0 -> 238 bytes .../main/res/drawable-xhdpi/nophotos.9.png | Bin 0 -> 1395 bytes .../main/res/drawable-xhdpi/photo_back.png | Bin 0 -> 480 bytes .../main/res/drawable-xhdpi/photobadge.9.png | Bin 0 -> 161 bytes .../main/res/drawable-xhdpi/photoborder.9.png | Bin 0 -> 229 bytes .../res/drawable-xhdpi/selectphoto_large.png | Bin 0 -> 540 bytes .../res/drawable-xhdpi/selectphoto_small.png | Bin 0 -> 696 bytes .../selectphoto_small_active.png | Bin 0 -> 401 bytes .../drawable-xhdpi/selectphoto_small_grey.png | Bin 0 -> 461 bytes .../src/main/res/drawable-xxhdpi/gallery.png | Bin 0 -> 705 bytes .../drawable-xxhdpi/ic_ab_other_white2.png | Bin 0 -> 300 bytes .../main/res/drawable-xxhdpi/nophotos.9.png | Bin 0 -> 2000 bytes .../main/res/drawable-xxhdpi/photo_back.png | Bin 0 -> 637 bytes .../main/res/drawable-xxhdpi/photobadge.9.png | Bin 0 -> 210 bytes .../res/drawable-xxhdpi/photoborder.9.png | Bin 0 -> 277 bytes .../res/drawable-xxhdpi/selectphoto_large.png | Bin 0 -> 698 bytes .../res/drawable-xxhdpi/selectphoto_small.png | Bin 0 -> 1033 bytes .../selectphoto_small_active.png | Bin 0 -> 570 bytes .../selectphoto_small_grey.png | Bin 0 -> 586 bytes .../main/res/drawable/bar_selector_picker.xml | 27 + .../main/res/layout/media_photo_layout.xml | 13 +- .../main/res/layout/media_video_layout.xml | 3 +- .../res/layout/photo_picker_album_layout.xml | 45 ++ .../res/layout/photo_picker_bottom_layout.xml | 69 +++ .../main/res/layout/photo_picker_layout.xml | 54 ++ .../res/layout/photo_picker_photo_layout.xml | 26 + .../src/main/res/values-ar/strings.xml | 2 + .../src/main/res/values-de/strings.xml | 2 + .../src/main/res/values-es/strings.xml | 2 + .../src/main/res/values-it/strings.xml | 2 + .../src/main/res/values-nl/strings.xml | 2 + TMessagesProj/src/main/res/values/strings.xml | 2 + 93 files changed, 1349 insertions(+), 144 deletions(-) create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/PhotoPickerActivity.java create mode 100755 TMessagesProj/src/main/res/drawable-hdpi/gallery.png create mode 100755 TMessagesProj/src/main/res/drawable-hdpi/ic_ab_other_white2.png create mode 100644 TMessagesProj/src/main/res/drawable-hdpi/nophotos.9.png create mode 100755 TMessagesProj/src/main/res/drawable-hdpi/photo_back.png create mode 100644 TMessagesProj/src/main/res/drawable-hdpi/photobadge.9.png create mode 100644 TMessagesProj/src/main/res/drawable-hdpi/photoborder.9.png create mode 100755 TMessagesProj/src/main/res/drawable-hdpi/selectphoto_large.png create mode 100755 TMessagesProj/src/main/res/drawable-hdpi/selectphoto_small.png create mode 100755 TMessagesProj/src/main/res/drawable-hdpi/selectphoto_small_active.png create mode 100755 TMessagesProj/src/main/res/drawable-hdpi/selectphoto_small_grey.png create mode 100755 TMessagesProj/src/main/res/drawable-ldpi/gallery.png create mode 100755 TMessagesProj/src/main/res/drawable-ldpi/ic_ab_other_white2.png create mode 100644 TMessagesProj/src/main/res/drawable-ldpi/nophotos.9.png create mode 100755 TMessagesProj/src/main/res/drawable-ldpi/photo_back.png create mode 100644 TMessagesProj/src/main/res/drawable-ldpi/photobadge.9.png create mode 100644 TMessagesProj/src/main/res/drawable-ldpi/photoborder.9.png create mode 100755 TMessagesProj/src/main/res/drawable-ldpi/selectphoto_large.png create mode 100755 TMessagesProj/src/main/res/drawable-ldpi/selectphoto_small.png create mode 100755 TMessagesProj/src/main/res/drawable-ldpi/selectphoto_small_active.png create mode 100755 TMessagesProj/src/main/res/drawable-ldpi/selectphoto_small_grey.png create mode 100755 TMessagesProj/src/main/res/drawable-mdpi/gallery.png create mode 100755 TMessagesProj/src/main/res/drawable-mdpi/ic_ab_other_white2.png create mode 100644 TMessagesProj/src/main/res/drawable-mdpi/nophotos.9.png create mode 100755 TMessagesProj/src/main/res/drawable-mdpi/photo_back.png create mode 100644 TMessagesProj/src/main/res/drawable-mdpi/photobadge.9.png create mode 100644 TMessagesProj/src/main/res/drawable-mdpi/photoborder.9.png create mode 100755 TMessagesProj/src/main/res/drawable-mdpi/selectphoto_large.png create mode 100755 TMessagesProj/src/main/res/drawable-mdpi/selectphoto_small.png create mode 100755 TMessagesProj/src/main/res/drawable-mdpi/selectphoto_small_active.png create mode 100755 TMessagesProj/src/main/res/drawable-mdpi/selectphoto_small_grey.png create mode 100755 TMessagesProj/src/main/res/drawable-xhdpi/gallery.png create mode 100755 TMessagesProj/src/main/res/drawable-xhdpi/ic_ab_other_white2.png create mode 100644 TMessagesProj/src/main/res/drawable-xhdpi/nophotos.9.png create mode 100755 TMessagesProj/src/main/res/drawable-xhdpi/photo_back.png create mode 100644 TMessagesProj/src/main/res/drawable-xhdpi/photobadge.9.png create mode 100644 TMessagesProj/src/main/res/drawable-xhdpi/photoborder.9.png create mode 100755 TMessagesProj/src/main/res/drawable-xhdpi/selectphoto_large.png create mode 100755 TMessagesProj/src/main/res/drawable-xhdpi/selectphoto_small.png create mode 100755 TMessagesProj/src/main/res/drawable-xhdpi/selectphoto_small_active.png create mode 100755 TMessagesProj/src/main/res/drawable-xhdpi/selectphoto_small_grey.png create mode 100755 TMessagesProj/src/main/res/drawable-xxhdpi/gallery.png create mode 100755 TMessagesProj/src/main/res/drawable-xxhdpi/ic_ab_other_white2.png create mode 100644 TMessagesProj/src/main/res/drawable-xxhdpi/nophotos.9.png create mode 100755 TMessagesProj/src/main/res/drawable-xxhdpi/photo_back.png create mode 100644 TMessagesProj/src/main/res/drawable-xxhdpi/photobadge.9.png create mode 100644 TMessagesProj/src/main/res/drawable-xxhdpi/photoborder.9.png create mode 100755 TMessagesProj/src/main/res/drawable-xxhdpi/selectphoto_large.png create mode 100755 TMessagesProj/src/main/res/drawable-xxhdpi/selectphoto_small.png create mode 100755 TMessagesProj/src/main/res/drawable-xxhdpi/selectphoto_small_active.png create mode 100755 TMessagesProj/src/main/res/drawable-xxhdpi/selectphoto_small_grey.png create mode 100644 TMessagesProj/src/main/res/drawable/bar_selector_picker.xml create mode 100644 TMessagesProj/src/main/res/layout/photo_picker_album_layout.xml create mode 100644 TMessagesProj/src/main/res/layout/photo_picker_bottom_layout.xml create mode 100644 TMessagesProj/src/main/res/layout/photo_picker_layout.xml create mode 100644 TMessagesProj/src/main/res/layout/photo_picker_photo_layout.xml diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 73b4abe33..aac3f3014 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -81,7 +81,7 @@ android { defaultConfig { minSdkVersion 8 targetSdkVersion 19 - versionCode 244 - versionName "1.4.15" + versionCode 245 + versionName "1.5.0" } } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java index e93cef0f6..3cdcc0253 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java @@ -79,6 +79,48 @@ public class MediaController implements NotificationCenter.NotificationCenterDel long pcmOffset; } + private static final String[] projectionPhotos = { + MediaStore.Images.Media._ID, + MediaStore.Images.Media.BUCKET_ID, + MediaStore.Images.Media.BUCKET_DISPLAY_NAME, + MediaStore.Images.Media.DATA, + MediaStore.Images.Media.DATE_TAKEN, + MediaStore.Images.Media.ORIENTATION + }; + + public static class AlbumEntry { + public int bucketId; + public String bucketName; + public PhotoEntry coverPhoto; + public ArrayList photos = new ArrayList(); + + public AlbumEntry(int bucketId, String bucketName, PhotoEntry coverPhoto) { + this.bucketId = bucketId; + this.bucketName = bucketName; + this.coverPhoto = coverPhoto; + } + + public void addPhoto(PhotoEntry photoEntry) { + photos.add(photoEntry); + } + } + + public static class PhotoEntry { + public int bucketId; + public int imageId; + public long dateTaken; + public String path; + public int orientation; + + public PhotoEntry(int bucketId, int imageId, long dateTaken, String path, int orientation) { + this.bucketId = bucketId; + this.imageId = imageId; + this.dateTaken = dateTaken; + this.path = path; + this.orientation = orientation; + } + } + public final static int audioProgressDidChanged = 50001; public final static int audioDidReset = 50002; public final static int recordProgressChanged = 50003; @@ -86,6 +128,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel public final static int recordStartError = 50005; public final static int recordStopped = 50006; public final static int screenshotTook = 50007; + public final static int albumsDidLoaded = 50008; private HashMap>> loadingFileObservers = new HashMap>>(); private HashMap observersByTag = new HashMap(); @@ -412,7 +455,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel } public void stopMediaObserver() { - if (android.os.Build.VERSION.SDK_INT < 10) { //disable while it's not perferct + if (android.os.Build.VERSION.SDK_INT > 0) { //disable while it's not perferct return; } if (stopMediaObserverRunnable == null) { @@ -1533,4 +1576,80 @@ public class MediaController implements NotificationCenter.NotificationCenterDel } return null; } + + public static void loadGalleryPhotosAlbums(final int guid) { + Utilities.globalQueue.postRunnable(new Runnable() { + @Override + public void run() { + final ArrayList albumsSorted = new ArrayList(); + HashMap albums = new HashMap(); + AlbumEntry allPhotosAlbum = null; + String cameraFolder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath() + "/" + "Camera/"; + Integer cameraAlbumId = null; + + Cursor cursor = null; + try { + cursor = MediaStore.Images.Media.query(ApplicationLoader.applicationContext.getContentResolver(), MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projectionPhotos, "", null, MediaStore.Images.Media.DATE_TAKEN + " DESC"); + if (cursor != null) { + int imageIdColumn = cursor.getColumnIndex(MediaStore.Images.Media._ID); + int bucketIdColumn = cursor.getColumnIndex(MediaStore.Images.Media.BUCKET_ID); + int bucketNameColumn = cursor.getColumnIndex(MediaStore.Images.Media.BUCKET_DISPLAY_NAME); + int dataColumn = cursor.getColumnIndex(MediaStore.Images.Media.DATA); + int dateColumn = cursor.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN); + int orientationColumn = cursor.getColumnIndex(MediaStore.Images.Media.ORIENTATION); + + while (cursor.moveToNext()) { + int imageId = cursor.getInt(imageIdColumn); + int bucketId = cursor.getInt(bucketIdColumn); + String bucketName = cursor.getString(bucketNameColumn); + String path = cursor.getString(dataColumn); + long dateTaken = cursor.getLong(dateColumn); + int orientation = cursor.getInt(orientationColumn); + + PhotoEntry photoEntry = new PhotoEntry(bucketId, imageId, dateTaken, path, orientation); + + if (allPhotosAlbum == null) { + allPhotosAlbum = new AlbumEntry(0, LocaleController.getString("AllPhotos", R.string.AllPhotos), photoEntry); + albumsSorted.add(0, allPhotosAlbum); + } + if (allPhotosAlbum != null) { + allPhotosAlbum.addPhoto(photoEntry); + } + + AlbumEntry albumEntry = albums.get(bucketId); + if (albumEntry == null) { + albumEntry = new AlbumEntry(bucketId, bucketName, photoEntry); + albums.put(bucketId, albumEntry); + if (cameraAlbumId == null && cameraFolder != null && path != null && path.startsWith(cameraFolder)) { + albumsSorted.add(0, albumEntry); + cameraAlbumId = bucketId; + } else { + albumsSorted.add(albumEntry); + } + } + + albumEntry.addPhoto(photoEntry); + } + } + } catch (Exception e) { + FileLog.e("tmessages", e); + } finally { + if (cursor != null) { + try { + cursor.close(); + } catch (Exception e) { + FileLog.e("tmessages", e); + } + } + } + final Integer cameraAlbumIdFinal = cameraAlbumId; + Utilities.RunOnUIThread(new Runnable() { + @Override + public void run() { + NotificationCenter.getInstance().postNotificationName(albumsDidLoaded, guid, albumsSorted, cameraAlbumIdFinal); + } + }); + } + }); + } } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java index 0c472b085..56e2bb0b4 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java @@ -4516,9 +4516,9 @@ public class MessagesController implements NotificationCenter.NotificationCenter if (choosenSoundPath != null && !choosenSoundPath.equals("NoSound")) { if (choosenSoundPath.equals(defaultPath)) { - mBuilder.setSound(Settings.System.DEFAULT_NOTIFICATION_URI); + mBuilder.setSound(Settings.System.DEFAULT_NOTIFICATION_URI, AudioManager.STREAM_NOTIFICATION); } else { - mBuilder.setSound(Uri.parse(choosenSoundPath)); + mBuilder.setSound(Uri.parse(choosenSoundPath), AudioManager.STREAM_NOTIFICATION); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMediaCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMediaCell.java index abe78fb79..552f17f96 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMediaCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMediaCell.java @@ -387,6 +387,10 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD w = (int) (currentPhotoObject.photoOwner.w / hScale); } } + int timeWidthTotal = timeWidth + Utilities.dp(14 + (currentMessageObject.isOut() ? 20 : 0)); + if (w < timeWidthTotal) { + w = timeWidthTotal; + } photoWidth = w; photoHeight = h; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index c2eeac5ad..8d0f4aa10 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -101,7 +101,10 @@ import java.util.Comparator; import java.util.HashMap; import java.util.concurrent.Semaphore; -public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLayout.SizeNotifierRelativeLayoutDelegate, NotificationCenter.NotificationCenterDelegate, MessagesActivity.MessagesActivityDelegate, DocumentSelectActivity.DocumentSelectActivityDelegate, PhotoViewer.PhotoViewerProvider { +public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLayout.SizeNotifierRelativeLayoutDelegate, + NotificationCenter.NotificationCenterDelegate, MessagesActivity.MessagesActivityDelegate, + DocumentSelectActivity.DocumentSelectActivityDelegate, PhotoViewer.PhotoViewerProvider, + PhotoPickerActivity.PhotoPickerActivityDelegate { private View timeItem; private View menuItem; @@ -414,7 +417,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBarLayer.setDisplayHomeAsUpEnabled(true); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); actionBarLayer.setActionBarMenuOnItemClick(new ActionBarLayer.ActionBarMenuOnItemClick() { @Override public void onItemClick(int id) { @@ -438,13 +441,9 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa FileLog.e("tmessages", e); } } else if (id == attach_gallery) { - try { - Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); - photoPickerIntent.setType("image/*"); - getParentActivity().startActivityForResult(photoPickerIntent, 1); - } catch (Exception e) { - FileLog.e("tmessages", e); - } + PhotoPickerActivity fragment = new PhotoPickerActivity(); + fragment.setDelegate(ChatActivity.this); + presentFragment(fragment); } else if (id == attach_video) { try { Intent pickIntent = new Intent(); @@ -1987,7 +1986,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa View firstVisView = chatListView.getChildAt(chatListView.getChildCount() - 1); int top = ((firstVisView == null) ? 0 : firstVisView.getTop()) - chatListView.getPaddingTop(); chatAdapter.notifyDataSetChanged(); - chatListView.setSelectionFromTop(firstVisPos + newRowsCount, top); + chatListView.setSelectionFromTop(firstVisPos + newRowsCount - (endReached ? 1 : 0), top); } if (paused) { @@ -2676,6 +2675,24 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } } + @Override + public void didSelectPhotos(ArrayList photos) { + for (String path : photos) { + processSendingPhoto(path, null); + } + } + + @Override + public void startPhotoSelectActivity() { + try { + Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); + photoPickerIntent.setType("image/*"); + getParentActivity().startActivityForResult(photoPickerIntent, 1); + } catch (Exception e) { + FileLog.e("tmessages", e); + } + } + @Override public void onBeginSlide() { super.onBeginSlide(); @@ -3327,7 +3344,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } @Override - public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation) { + public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { if (messageObject == null) { return null; } @@ -3372,9 +3389,25 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } @Override - public void willHidePhotoViewer() { - updateVisibleRows(); - } + public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { } + + @Override + public void willHidePhotoViewer() { } + + @Override + public boolean isPhotoChecked(int index) { return false; } + + @Override + public void setPhotoChecked(int index) { } + + @Override + public void cancelButtonPressed() { } + + @Override + public void sendButtonPressed(int index) { } + + @Override + public int getSelectedCount() { return 0; } private class ChatAdapter extends BaseAdapter { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java index 76e5d9bb5..767afa2a8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java @@ -144,7 +144,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBarLayer.setDisplayHomeAsUpEnabled(true); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); actionBarLayer.setTitle(LocaleController.getString("GroupInfo", R.string.GroupInfo)); actionBarLayer.setActionBarMenuOnItemClick(new ActionBarLayer.ActionBarMenuOnItemClick() { @Override @@ -337,7 +337,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen } @Override - public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation) { + public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { if (fileLocation == null) { return null; } @@ -368,9 +368,25 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen } @Override - public void willHidePhotoViewer() { + public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { } - } + @Override + public void willHidePhotoViewer() { } + + @Override + public boolean isPhotoChecked(int index) { return false; } + + @Override + public void setPhotoChecked(int index) { } + + @Override + public void cancelButtonPressed() { } + + @Override + public void sendButtonPressed(int index) { } + + @Override + public int getSelectedCount() { return 0; } public void didReceivedNotification(int id, Object... args) { if (id == MessagesController.updateInterfaces) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java index 3b778713c..7234524ab 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java @@ -115,7 +115,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBarLayer.setDisplayHomeAsUpEnabled(true); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); if (destroyAfterSelect) { actionBarLayer.setTitle(LocaleController.getString("SelectContact", R.string.SelectContact)); } else { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java index 372326e42..ed7cd03d5 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java @@ -118,7 +118,7 @@ public class CountrySelectActivity extends BaseFragment { @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBarLayer.setDisplayHomeAsUpEnabled(true); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); actionBarLayer.setTitle(LocaleController.getString("ChooseCountry", R.string.ChooseCountry)); actionBarLayer.setActionBarMenuOnItemClick(new ActionBarLayer.ActionBarMenuOnItemClick() { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/DocumentSelectActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/DocumentSelectActivity.java index 4c7c0edb2..508b98ba7 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/DocumentSelectActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/DocumentSelectActivity.java @@ -126,7 +126,7 @@ public class DocumentSelectActivity extends BaseFragment { } if (fragmentView == null) { - actionBarLayer.setDisplayHomeAsUpEnabled(true); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); actionBarLayer.setTitle(LocaleController.getString("SelectFile", R.string.SelectFile)); actionBarLayer.setActionBarMenuOnItemClick(new ActionBarLayer.ActionBarMenuOnItemClick() { @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java index 0dc953a84..183be989e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java @@ -123,7 +123,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBarLayer.setDisplayHomeAsUpEnabled(true); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); actionBarLayer.setTitle(LocaleController.getString("NewGroup", R.string.NewGroup)); actionBarLayer.setSubtitle(String.format("%d/200 %s", selectedContacts.size(), LocaleController.getString("Members", R.string.Members))); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java index 2262bc953..3a4f6500d 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java @@ -118,7 +118,7 @@ public class GroupCreateFinalActivity extends BaseFragment implements Notificati @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBarLayer.setDisplayHomeAsUpEnabled(true); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); actionBarLayer.setTitle(LocaleController.getString("NewGroup", R.string.NewGroup)); actionBarLayer.setActionBarMenuOnItemClick(new ActionBarLayer.ActionBarMenuOnItemClick() { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java index a8bfda4af..2222804cc 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java @@ -45,7 +45,7 @@ public class IdenticonActivity extends BaseFragment { @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBarLayer.setDisplayHomeAsUpEnabled(true); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); actionBarLayer.setTitle(LocaleController.getString("EncryptionKey", R.string.EncryptionKey)); actionBarLayer.setTitleIcon(R.drawable.ic_lock_white, Utilities.dp(4)); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java index 6475797ec..4bc7578ca 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java @@ -48,7 +48,7 @@ public class LanguageSelectActivity extends BaseFragment { @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBarLayer.setDisplayHomeAsUpEnabled(true); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); actionBarLayer.setTitle(LocaleController.getString("Language", R.string.Language)); actionBarLayer.setActionBarMenuOnItemClick(new ActionBarLayer.ActionBarMenuOnItemClick() { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java index d246d92f3..3fcd31c35 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java @@ -80,7 +80,7 @@ public class LocationActivity extends BaseFragment implements NotificationCenter @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBarLayer.setDisplayHomeAsUpEnabled(true); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); if (messageObject != null) { actionBarLayer.setTitle(LocaleController.getString("ChatLocation", R.string.ChatLocation)); } else { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java index e779d8ab9..0bb5d68a3 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java @@ -56,7 +56,7 @@ public class LoginActivity extends BaseFragment implements SlideView.SlideViewDe @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBarLayer.setDisplayUseLogoEnabled(true); + actionBarLayer.setDisplayUseLogoEnabled(true, R.drawable.ic_ab_back); actionBarLayer.setTitle(LocaleController.getString("AppName", R.string.AppName)); actionBarLayer.setActionBarMenuOnItemClick(new ActionBarLayer.ActionBarMenuOnItemClick() { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java index 22323f834..bcd226a0e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java @@ -46,7 +46,6 @@ public class MediaActivity extends BaseFragment implements NotificationCenter.No private HashMap messagesDict = new HashMap(); private long dialog_id; private int totalCount = 0; - private int orientation = 0; private int itemWidth = 100; private boolean loading = false; private boolean endReached = false; @@ -87,7 +86,7 @@ public class MediaActivity extends BaseFragment implements NotificationCenter.No @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBarLayer.setDisplayHomeAsUpEnabled(true); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); actionBarLayer.setTitle(LocaleController.getString("SharedMedia", R.string.SharedMedia)); actionBarLayer.setActionBarMenuOnItemClick(new ActionBarLayer.ActionBarMenuOnItemClick() { @Override @@ -264,7 +263,7 @@ public class MediaActivity extends BaseFragment implements NotificationCenter.No } @Override - public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation) { + public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { if (messageObject == null) { return null; } @@ -296,9 +295,25 @@ public class MediaActivity extends BaseFragment implements NotificationCenter.No } @Override - public void willHidePhotoViewer() { + public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { } - } + @Override + public void willHidePhotoViewer() { } + + @Override + public boolean isPhotoChecked(int index) { return false; } + + @Override + public void setPhotoChecked(int index) { } + + @Override + public void cancelButtonPressed() { } + + @Override + public void sendButtonPressed(int index) { } + + @Override + public int getSelectedCount() { return 0; } private void fixLayout() { if (listView != null) { @@ -310,12 +325,10 @@ public class MediaActivity extends BaseFragment implements NotificationCenter.No int rotation = manager.getDefaultDisplay().getRotation(); if (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90) { - orientation = 1; listView.setNumColumns(6); itemWidth = getParentActivity().getResources().getDisplayMetrics().widthPixels / 6 - Utilities.dp(2) * 5; listView.setColumnWidth(itemWidth); } else { - orientation = 0; listView.setNumColumns(4); itemWidth = getParentActivity().getResources().getDisplayMetrics().widthPixels / 4 - Utilities.dp(2) * 3; listView.setColumnWidth(itemWidth); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java index cfe02edf0..a41925070 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java @@ -164,10 +164,10 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter } }); if (onlySelect) { - actionBarLayer.setDisplayHomeAsUpEnabled(true); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); actionBarLayer.setTitle(LocaleController.getString("SelectChat", R.string.SelectChat)); } else { - actionBarLayer.setDisplayUseLogoEnabled(true); + actionBarLayer.setDisplayUseLogoEnabled(true, R.drawable.ic_ab_logo); actionBarLayer.setTitle(LocaleController.getString("AppName", R.string.AppName)); menu.addItem(messages_list_menu_new_messages, R.drawable.ic_ab_compose); ActionBarMenuItem item = menu.addItem(0, R.drawable.ic_ab_other); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PhotoPickerActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/PhotoPickerActivity.java new file mode 100644 index 000000000..3b06142e3 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/PhotoPickerActivity.java @@ -0,0 +1,573 @@ +/* + * This is the source code of Telegram for Android v. 1.4.x. + * It is licensed under GNU GPL v. 2 or later. + * You should have received a copy of the license in this archive (see LICENSE). + * + * Copyright Nikolai Kudashov, 2013-2014. + */ + +package org.telegram.ui; + +import android.app.Activity; +import android.content.Context; +import android.os.Build; +import android.view.LayoutInflater; +import android.view.Surface; +import android.view.View; +import android.view.ViewGroup; +import android.view.ViewTreeObserver; +import android.view.WindowManager; +import android.widget.AdapterView; +import android.widget.BaseAdapter; +import android.widget.Button; +import android.widget.GridView; +import android.widget.ImageView; +import android.widget.TextView; + +import org.telegram.messenger.LocaleController; +import org.telegram.messenger.MediaController; +import org.telegram.messenger.MessagesController; +import org.telegram.messenger.NotificationCenter; +import org.telegram.messenger.R; +import org.telegram.messenger.TLRPC; +import org.telegram.messenger.Utilities; +import org.telegram.objects.MessageObject; +import org.telegram.ui.Views.ActionBar.ActionBarLayer; +import org.telegram.ui.Views.ActionBar.ActionBarMenu; +import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.Views.BackupImageView; + +import java.util.ArrayList; +import java.util.HashMap; + +public class PhotoPickerActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate, PhotoViewer.PhotoViewerProvider { + + public static interface PhotoPickerActivityDelegate { + public abstract void didSelectPhotos(ArrayList photos); + public abstract void startPhotoSelectActivity(); + } + + private ArrayList albumsSorted = null; + private HashMap selectedPhotos = new HashMap(); + private Integer cameraAlbumId = null; + private boolean loading = false; + private MediaController.AlbumEntry selectedAlbum = null; + + private GridView listView; + private ListAdapter listAdapter; + private View progressView; + private TextView emptyView; + private View doneButton; + private TextView doneButtonTextView; + private TextView doneButtonBadgeTextView; + private int itemWidth = 100; + + private PhotoPickerActivityDelegate delegate; + + @Override + public boolean onFragmentCreate() { + loading = true; + MediaController.loadGalleryPhotosAlbums(classGuid); + NotificationCenter.getInstance().addObserver(this, MediaController.albumsDidLoaded); + NotificationCenter.getInstance().addObserver(this, MessagesController.closeChats); + return super.onFragmentCreate(); + } + + @Override + public void onFragmentDestroy() { + NotificationCenter.getInstance().removeObserver(this, MediaController.albumsDidLoaded); + NotificationCenter.getInstance().removeObserver(this, MessagesController.closeChats); + super.onFragmentDestroy(); + } + + @Override + public View createView(LayoutInflater inflater, ViewGroup container) { + if (fragmentView == null) { + actionBarLayer.setBackgroundColor(0xff333333); + actionBarLayer.setItemsBackground(R.drawable.bar_selector_picker); + actionBarLayer.setDisplayUseLogoEnabled(true, R.drawable.gallery); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.photo_back); + actionBarLayer.setTitle(LocaleController.getString("Gallery", R.string.Gallery)); + actionBarLayer.setActionBarMenuOnItemClick(new ActionBarLayer.ActionBarMenuOnItemClick() { + @Override + public void onItemClick(int id) { + if (id == -1) { + if (selectedAlbum != null) { + selectedAlbum = null; + actionBarLayer.setTitle(LocaleController.getString("Gallery", R.string.Gallery)); + fixLayoutInternal(); + } else { + if (Build.VERSION.SDK_INT < 11) { + listView.setAdapter(null); + listView = null; + listAdapter = null; + } + finishFragment(); + } + } else if (id == 1) { + if (delegate != null) { + finishFragment(); + delegate.startPhotoSelectActivity(); + } + } + } + }); + + ActionBarMenu menu = actionBarLayer.createMenu(); + menu.addItem(1, R.drawable.ic_ab_other_white2); + + fragmentView = inflater.inflate(R.layout.photo_picker_layout, container, false); + + emptyView = (TextView)fragmentView.findViewById(R.id.searchEmptyView); + emptyView.setText(LocaleController.getString("NoPhotos", R.string.NoPhotos)); + listView = (GridView)fragmentView.findViewById(R.id.media_grid); + progressView = fragmentView.findViewById(R.id.progressLayout); + + Button cancelButton = (Button)fragmentView.findViewById(R.id.cancel_button); + cancelButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + finishFragment(); + } + }); + doneButton = fragmentView.findViewById(R.id.done_button); + doneButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + sendSelectedPhotos(); + } + }); + + cancelButton.setText(LocaleController.getString("Cancel", R.string.Cancel).toUpperCase()); + doneButtonTextView = (TextView)doneButton.findViewById(R.id.done_button_text); + doneButtonTextView.setText(LocaleController.getString("Send", R.string.Send).toUpperCase()); + doneButtonBadgeTextView = (TextView)doneButton.findViewById(R.id.done_button_badge); + + listView.setAdapter(listAdapter = new ListAdapter(getParentActivity())); + listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView adapterView, View view, int i, long l) { + if (selectedAlbum == null) { + if (i < 0 || i >= albumsSorted.size()) { + return; + } + selectedAlbum = albumsSorted.get(i); + actionBarLayer.setTitle(selectedAlbum.bucketName); + fixLayoutInternal(); + } else { + if (i < 0 || i >= selectedAlbum.photos.size()) { + return; + } + PhotoViewer.getInstance().openPhotoForSelect(selectedAlbum.photos, i, PhotoPickerActivity.this); + } + } + }); + if (loading && albumsSorted != null && albumsSorted.isEmpty()) { + progressView.setVisibility(View.VISIBLE); + listView.setEmptyView(null); + } else { + progressView.setVisibility(View.GONE); + listView.setEmptyView(emptyView); + } + updateSelectedCount(); + } else { + ViewGroup parent = (ViewGroup)fragmentView.getParent(); + if (parent != null) { + parent.removeView(fragmentView); + } + } + return fragmentView; + } + + @Override + public void onResume() { + super.onResume(); + if (listAdapter != null) { + listAdapter.notifyDataSetChanged(); + } + fixLayout(); + } + + @Override + public void onConfigurationChanged(android.content.res.Configuration newConfig) { + super.onConfigurationChanged(newConfig); + fixLayout(); + } + + @SuppressWarnings("unchecked") + @Override + public void didReceivedNotification(int id, Object... args) { + if (id == MediaController.albumsDidLoaded) { + int guid = (Integer)args[0]; + if (classGuid == guid) { + albumsSorted = (ArrayList)args[1]; + if (args[2] != null) { + cameraAlbumId = (Integer) args[2]; + } + if (progressView != null) { + progressView.setVisibility(View.GONE); + } + if (listView != null && listView.getEmptyView() == null) { + listView.setEmptyView(emptyView); + } + if (listAdapter != null) { + listAdapter.notifyDataSetChanged(); + } + } + } else if (id == MessagesController.closeChats) { + removeSelfFromStack(); + } + } + + @Override + public boolean onBackPressed() { + if (selectedAlbum != null) { + selectedAlbum = null; + actionBarLayer.setTitle(LocaleController.getString("Gallery", R.string.Gallery)); + fixLayoutInternal(); + return false; + } + return super.onBackPressed(); + } + + @Override + public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { + if (selectedAlbum == null) { + return null; + } + int count = listView.getChildCount(); + + for (int a = 0; a < count; a++) { + View view = listView.getChildAt(a); + BackupImageView imageView = (BackupImageView)view.findViewById(R.id.media_photo_image); + if (imageView != null) { + int num = (Integer)imageView.getTag(); + if (num < 0 || num >= selectedAlbum.photos.size()) { + continue; + } + if (num == index) { + int coords[] = new int[2]; + imageView.getLocationInWindow(coords); + PhotoViewer.PlaceProviderObject object = new PhotoViewer.PlaceProviderObject(); + object.viewX = coords[0]; + object.viewY = coords[1] - Utilities.statusBarHeight; + object.parentView = listView; + object.imageReceiver = imageView.imageReceiver; + object.thumb = object.imageReceiver.getBitmap(); + View frameView = view.findViewById(R.id.photo_frame); + frameView.setVisibility(View.GONE); + ImageView checkImageView = (ImageView)view.findViewById(R.id.photo_check); + checkImageView.setVisibility(View.GONE); + return object; + } + } + } + return null; + } + + @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); + int num = (Integer)view.getTag(); + if (num < 0 || num >= selectedAlbum.photos.size()) { + continue; + } + if (num == index) { + View frameView = view.findViewById(R.id.photo_frame); + frameView.setVisibility(View.VISIBLE); + ImageView checkImageView = (ImageView)view.findViewById(R.id.photo_check); + checkImageView.setVisibility(View.VISIBLE); + break; + } + } + } + + @Override + public void willHidePhotoViewer() { + if (listAdapter != null) { + listAdapter.notifyDataSetChanged(); + } + } + + @Override + public boolean isPhotoChecked(int index) { + if (selectedAlbum == null || index < 0 || index >= selectedAlbum.photos.size()) { + return false; + } + MediaController.PhotoEntry photoEntry = selectedAlbum.photos.get(index); + return selectedPhotos.containsKey(photoEntry.imageId); + } + + @Override + public void setPhotoChecked(int index) { + if (selectedAlbum == null || index < 0 || index >= selectedAlbum.photos.size()) { + return; + } + MediaController.PhotoEntry photoEntry = selectedAlbum.photos.get(index); + if (selectedPhotos.containsKey(photoEntry.imageId)) { + selectedPhotos.remove(photoEntry.imageId); + } else { + selectedPhotos.put(photoEntry.imageId, photoEntry); + } + int count = listView.getChildCount(); + + for (int a = 0; a < count; a++) { + View view = listView.getChildAt(a); + int num = (Integer)view.getTag(); + if (num == index) { + updateSelectedPhoto(view, photoEntry); + break; + } + } + updateSelectedCount(); + } + + @Override + public void cancelButtonPressed() { + finishFragment(); + } + + @Override + public void sendButtonPressed(int index) { + if (selectedPhotos.isEmpty()) { + if (index < 0 || index >= selectedAlbum.photos.size()) { + return; + } + MediaController.PhotoEntry photoEntry = selectedAlbum.photos.get(index); + selectedPhotos.put(photoEntry.imageId, photoEntry); + } + sendSelectedPhotos(); + } + + @Override + public int getSelectedCount() { + return selectedPhotos.size(); + } + + public void setDelegate(PhotoPickerActivityDelegate delegate) { + this.delegate = delegate; + } + + private void sendSelectedPhotos() { + if (selectedPhotos.isEmpty() || delegate == null) { + return; + } + ArrayList photos = new ArrayList(); + for (HashMap.Entry entry : selectedPhotos.entrySet()) { + MediaController.PhotoEntry photoEntry = entry.getValue(); + if (photoEntry.path != null) { + photos.add(photoEntry.path); + } + } + delegate.didSelectPhotos(photos); + finishFragment(); + } + + private void fixLayout() { + if (listView != null) { + ViewTreeObserver obs = listView.getViewTreeObserver(); + obs.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { + @Override + public boolean onPreDraw() { + fixLayoutInternal(); + if (listView != null) { + listView.getViewTreeObserver().removeOnPreDrawListener(this); + } + return false; + } + }); + } + } + + private void fixLayoutInternal() { + if (getParentActivity() == null) { + return; + } + WindowManager manager = (WindowManager)ApplicationLoader.applicationContext.getSystemService(Activity.WINDOW_SERVICE); + int rotation = manager.getDefaultDisplay().getRotation(); + + int columnsCount = 2; + if (selectedAlbum != null) { + if (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90) { + columnsCount = 5; + } else { + columnsCount = 3; + } + } else { + if (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90) { + columnsCount = 4; + } + } + listView.setNumColumns(columnsCount); + itemWidth = (getParentActivity().getResources().getDisplayMetrics().widthPixels - ((columnsCount + 1) * Utilities.dp(4))) / columnsCount; + listView.setColumnWidth(itemWidth); + + listAdapter.notifyDataSetChanged(); + } + + private void updateSelectedCount() { + if (selectedPhotos.isEmpty()) { + doneButtonTextView.setTextColor(0xff999999); + doneButtonTextView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.selectphoto_small_grey, 0, 0, 0); + doneButtonBadgeTextView.setVisibility(View.GONE); + doneButton.setEnabled(false); + } else { + doneButtonTextView.setTextColor(0xffffffff); + doneButtonTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); + doneButtonBadgeTextView.setVisibility(View.VISIBLE); + doneButtonBadgeTextView.setText("" + selectedPhotos.size()); + doneButton.setEnabled(true); + } + } + + private void updateSelectedPhoto(View view, MediaController.PhotoEntry photoEntry) { + View frameView = view.findViewById(R.id.photo_frame); + ImageView checkImageView = (ImageView)view.findViewById(R.id.photo_check); + if (selectedPhotos.containsKey(photoEntry.imageId)) { + frameView.setBackgroundResource(R.drawable.photoborder); + checkImageView.setImageResource(R.drawable.selectphoto_small_active); + checkImageView.setBackgroundColor(0xff42d1f6); + } else { + frameView.setBackgroundDrawable(null); + checkImageView.setImageResource(R.drawable.selectphoto_small); + checkImageView.setBackgroundColor(0x501c1c1c); + } + } + + private class ListAdapter extends BaseAdapter { + private Context mContext; + + public ListAdapter(Context context) { + mContext = context; + } + + @Override + public boolean areAllItemsEnabled() { + return true; + } + + @Override + public boolean isEnabled(int i) { + return true; + } + + @Override + public int getCount() { + if (selectedAlbum != null) { + return selectedAlbum.photos.size(); + } + return albumsSorted != null ? albumsSorted.size() : 0; + } + + @Override + public Object getItem(int i) { + return null; + } + + @Override + public long getItemId(int i) { + return i; + } + + @Override + public boolean hasStableIds() { + return true; + } + + @Override + public View getView(int i, View view, ViewGroup viewGroup) { + int type = getItemViewType(i); + if (type == 0) { + if (view == null) { + LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + view = li.inflate(R.layout.photo_picker_album_layout, viewGroup, false); + } + ViewGroup.LayoutParams params = view.getLayoutParams(); + params.width = itemWidth; + params.height = itemWidth; + view.setLayoutParams(params); + + MediaController.AlbumEntry albumEntry = albumsSorted.get(i); + BackupImageView imageView = (BackupImageView)view.findViewById(R.id.media_photo_image); + if (albumEntry.coverPhoto != null && albumEntry.coverPhoto.path != null) { + imageView.setImage(albumEntry.coverPhoto.path, "150_150", R.drawable.nophotos); + } else { + imageView.setImageResource(R.drawable.nophotos); + } + TextView textView = (TextView)view.findViewById(R.id.album_name); + textView.setText(albumEntry.bucketName); + if (cameraAlbumId != null && albumEntry.bucketId == cameraAlbumId) { + + } else { + + } + textView = (TextView)view.findViewById(R.id.album_count); + textView.setText("" + albumEntry.photos.size()); + } else if (type == 1) { + if (view == null) { + LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + view = li.inflate(R.layout.photo_picker_photo_layout, viewGroup, false); + ImageView checkImageView = (ImageView)view.findViewById(R.id.photo_check); + checkImageView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + MediaController.PhotoEntry photoEntry = selectedAlbum.photos.get((Integer)((View)v.getParent()).getTag()); + if (selectedPhotos.containsKey(photoEntry.imageId)) { + selectedPhotos.remove(photoEntry.imageId); + } else { + selectedPhotos.put(photoEntry.imageId, photoEntry); + } + updateSelectedPhoto((View)v.getParent(), photoEntry); + updateSelectedCount(); + } + }); + } + ViewGroup.LayoutParams params = view.getLayoutParams(); + params.width = itemWidth; + params.height = itemWidth; + view.setLayoutParams(params); + + MediaController.PhotoEntry photoEntry = selectedAlbum.photos.get(i); + BackupImageView imageView = (BackupImageView)view.findViewById(R.id.media_photo_image); + imageView.setTag(i); + view.setTag(i); + if (photoEntry.path != null) { + imageView.setImage(photoEntry.path, "100_100", R.drawable.nophotos); + } else { + imageView.setImageResource(R.drawable.nophotos); + } + updateSelectedPhoto(view, photoEntry); + boolean showing = PhotoViewer.getInstance().isShowingImage(photoEntry.path); + imageView.imageReceiver.setVisible(!showing, false); + View frameView = view.findViewById(R.id.photo_frame); + frameView.setVisibility(showing ? View.GONE : View.VISIBLE); + ImageView checkImageView = (ImageView)view.findViewById(R.id.photo_check); + checkImageView.setVisibility(showing ? View.GONE : View.VISIBLE); + } + return view; + } + + @Override + public int getItemViewType(int i) { + if (selectedAlbum != null) { + return 1; + } + return 0; + } + + @Override + public int getViewTypeCount() { + return 2; + } + + @Override + public boolean isEmpty() { + if (selectedAlbum != null) { + return selectedAlbum.photos.isEmpty(); + } + return albumsSorted == null || albumsSorted.isEmpty(); + } + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java index 8e7646c8f..493cacd99 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java @@ -12,6 +12,7 @@ import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; +import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.Intent; @@ -26,6 +27,7 @@ import android.text.TextUtils; import android.view.GestureDetector; import android.view.Gravity; import android.view.MotionEvent; +import android.view.Surface; import android.view.VelocityTracker; import android.view.View; import android.view.ViewGroup; @@ -33,6 +35,7 @@ import android.view.ViewTreeObserver; import android.view.WindowManager; import android.view.animation.AlphaAnimation; import android.view.animation.DecelerateInterpolator; +import android.widget.Button; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.ProgressBar; @@ -64,6 +67,7 @@ import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.Locale; public class PhotoViewer implements NotificationCenter.NotificationCenterDelegate, GestureDetector.OnGestureListener, GestureDetector.OnDoubleTapListener { private int classGuid; @@ -86,6 +90,10 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat private ActionBarMenuItem menuItem; private ColorDrawable backgroundDrawable = new ColorDrawable(0xff000000); private OverlayView currentOverlay; + private ImageView checkImageView; + private View pickerView; + private TextView doneButtonTextView; + private TextView doneButtonBadgeTextView; private boolean canShowBottom = true; private boolean overlayViewVisible = true; @@ -100,6 +108,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat private TLRPC.FileLocation currentFileLocation; private String currentFileName; private PlaceProviderObject currentPlaceObject; + private String currentPathObject; private Bitmap currentThumb = null; private int avatarsUserId; @@ -152,6 +161,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat private HashMap imagesByIds = new HashMap(); private ArrayList imagesArrLocations = new ArrayList(); private ArrayList imagesArrLocationsSizes = new ArrayList(); + private ArrayList imagesArrLocals = new ArrayList(); private final static int gallery_menu_save = 1; private final static int gallery_menu_showall = 2; @@ -199,8 +209,14 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat } public static interface PhotoViewerProvider { - public PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation); + public PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index); + public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index); public void willHidePhotoViewer(); + public boolean isPhotoChecked(int index); + public void setPhotoChecked(int index); + public void cancelButtonPressed(); + public void sendButtonPressed(int index); + public int getSelectedCount(); } private static class FrameLayoutTouchListener extends FrameLayout { @@ -406,13 +422,13 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat actionBar = new ActionBar(activity); containerView.addView(actionBar); actionBar.setBackgroundColor(0xdd000000); - actionBar.setItemsBackground(R.drawable.bar_selector_white); FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams)actionBar.getLayoutParams(); layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; actionBar.setLayoutParams(layoutParams); actionBarLayer = actionBar.createLayer(); - actionBarLayer.setDisplayHomeAsUpEnabled(true); - actionBarLayer.setTitle(LocaleController.getString("Gallery", R.string.Gallery)); + actionBarLayer.setItemsBackground(R.drawable.bar_selector_white); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.photo_back); + actionBarLayer.setTitle(LocaleController.formatString("Of", R.string.Of, 1, 1)); actionBar.setCurrentActionBarLayer(actionBarLayer); actionBarLayer.setActionBarMenuOnItemClick(new ActionBarLayer.ActionBarMenuOnItemClick() { @@ -593,6 +609,34 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat layoutParams.topMargin = Utilities.dp(26); dateTextView.setLayoutParams(layoutParams); + pickerView = parentActivity.getLayoutInflater().inflate(R.layout.photo_picker_bottom_layout, null); + bottomLayout.addView(pickerView); + Button cancelButton = (Button)pickerView.findViewById(R.id.cancel_button); + cancelButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if (placeProvider != null) { + placeProvider.cancelButtonPressed(); + closePhoto(false); + } + } + }); + View doneButton = pickerView.findViewById(R.id.done_button); + doneButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if (placeProvider != null) { + placeProvider.sendButtonPressed(currentIndex); + closePhoto(false); + } + } + }); + + cancelButton.setText(LocaleController.getString("Cancel", R.string.Cancel).toUpperCase()); + doneButtonTextView = (TextView)doneButton.findViewById(R.id.done_button_text); + doneButtonTextView.setText(LocaleController.getString("Send", R.string.Send).toUpperCase()); + doneButtonBadgeTextView = (TextView)doneButton.findViewById(R.id.done_button_badge); + progressBar = new ProgressBar(containerView.getContext(), null, android.R.attr.progressBarStyleHorizontal); progressBar.setVisibility(View.GONE); progressBar.setMax(100); @@ -617,6 +661,39 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat currentOverlay = new OverlayView(containerView.getContext()); containerView.addView(currentOverlay); currentOverlay.setVisibility(View.GONE); + + checkImageView = new ImageView(containerView.getContext()); + containerView.addView(checkImageView); + checkImageView.setVisibility(View.GONE); + checkImageView.setScaleType(ImageView.ScaleType.CENTER); + checkImageView.setImageResource(R.drawable.selectphoto_large); + layoutParams = (FrameLayout.LayoutParams)checkImageView.getLayoutParams(); + layoutParams.width = Utilities.dp(46); + layoutParams.height = Utilities.dp(46); + layoutParams.gravity = Gravity.RIGHT; + layoutParams.rightMargin = Utilities.dp(10); + WindowManager manager = (WindowManager)ApplicationLoader.applicationContext.getSystemService(Activity.WINDOW_SERVICE); + int rotation = manager.getDefaultDisplay().getRotation(); + if (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90) { + layoutParams.topMargin = Utilities.dp(48); + } else { + layoutParams.topMargin = Utilities.dp(58); + } + checkImageView.setLayoutParams(layoutParams); + checkImageView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (placeProvider != null) { + placeProvider.setPhotoChecked(currentIndex); + if (placeProvider.isPhotoChecked(currentIndex)) { + checkImageView.setBackgroundColor(0xff42d1f6); + } else { + checkImageView.setBackgroundColor(0x801c1c1c); + } + updateSelectedCount(); + } + } + }); } private void toggleOverlayView(boolean show) { @@ -828,8 +905,25 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat return null; } + private void updateSelectedCount() { + if (placeProvider == null) { + return; + } + int count = placeProvider.getSelectedCount(); + if (count == 0) { + doneButtonTextView.setTextColor(0xffffffff); + doneButtonTextView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.selectphoto_small, 0, 0, 0); + doneButtonBadgeTextView.setVisibility(View.GONE); + } else { + doneButtonTextView.setTextColor(0xffffffff); + doneButtonTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); + doneButtonBadgeTextView.setVisibility(View.VISIBLE); + doneButtonBadgeTextView.setText("" + count); + } + } + private void updateActionOverlays() { - if (currentMessageObject == null) { + if (currentMessageObject == null || currentFileName == null) { currentOverlay.setVisibility(View.GONE); return; } @@ -868,10 +962,11 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat } } - private void onPhotoShow(final MessageObject messageObject, final TLRPC.FileLocation fileLocation, final ArrayList messages, int index, final PlaceProviderObject object) { + private void onPhotoShow(final MessageObject messageObject, final TLRPC.FileLocation fileLocation, final ArrayList messages, final ArrayList photos, int index, final PlaceProviderObject object) { classGuid = ConnectionsManager.getInstance().generateClassGuid(); currentMessageObject = null; currentFileLocation = null; + currentPathObject = null; currentIndex = -1; currentFileName = null; avatarsUserId = 0; @@ -882,13 +977,19 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat loadingMoreImages = false; cacheEndReached = false; opennedFromMedia = false; + canShowBottom = true; imagesArr.clear(); imagesArrLocations.clear(); imagesArrLocationsSizes.clear(); + imagesArrLocals.clear(); imagesByIds.clear(); imagesArrTemp.clear(); imagesByIdsTemp.clear(); currentThumb = object.thumb; + menuItem.setVisibility(View.VISIBLE); + bottomLayout.setVisibility(View.VISIBLE); + checkImageView.setVisibility(View.GONE); + pickerView.setVisibility(View.GONE); if (messageObject != null && messages == null) { imagesArr.add(messageObject); @@ -912,17 +1013,15 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat } else { menuItem.hideSubItem(gallery_menu_showall); } - bottomLayout.setVisibility(View.VISIBLE); - canShowBottom = true; setImageIndex(0, true); } else if (fileLocation != null) { avatarsUserId = object.user_id; imagesArrLocations.add(fileLocation); imagesArrLocationsSizes.add(object.size); bottomLayout.setVisibility(View.GONE); + canShowBottom = false; menuItem.hideSubItem(gallery_menu_showall); setImageIndex(0, true); - canShowBottom = false; } else if (messages != null) { imagesArr.addAll(messages); Collections.reverse(imagesArr); @@ -950,6 +1049,13 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat } opennedFromMedia = true; setImageIndex(index, true); + } else if (photos != null) { + checkImageView.setVisibility(View.VISIBLE); + menuItem.setVisibility(View.GONE); + imagesArrLocals.addAll(photos); + setImageIndex(index, true); + pickerView.setVisibility(View.VISIBLE); + updateSelectedCount(); } if (currentDialogId != 0 && totalImagesCount == 0) { @@ -966,6 +1072,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat if (!init) { currentThumb = null; } + placeProvider.willSwitchFromPhoto(currentMessageObject, currentFileLocation, currentIndex); int prevIndex = currentIndex; currentIndex = index; currentFileName = getFileName(index, null); @@ -991,8 +1098,15 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat updateActionOverlays(); } else if (!imagesArrLocations.isEmpty()) { currentFileLocation = imagesArrLocations.get(index); - if (imagesArrLocations.size() > 1) { - actionBarLayer.setTitle(LocaleController.formatString("Of", R.string.Of, currentIndex + 1, imagesArrLocations.size())); + actionBarLayer.setTitle(LocaleController.formatString("Of", R.string.Of, currentIndex + 1, imagesArrLocations.size())); + } else if (!imagesArrLocals.isEmpty()) { + currentPathObject = imagesArrLocals.get(index).path; + actionBarLayer.setTitle(LocaleController.formatString("Of", R.string.Of, currentIndex + 1, imagesArrLocals.size())); + + if (placeProvider.isPhotoChecked(currentIndex)) { + checkImageView.setBackgroundColor(0xff42d1f6); + } else { + checkImageView.setBackgroundColor(0x801c1c1c); } } @@ -1001,7 +1115,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat currentPlaceObject.imageReceiver.setVisible(true, true); } } - currentPlaceObject = placeProvider.getPlaceForPhoto(currentMessageObject, currentFileLocation); + currentPlaceObject = placeProvider.getPlaceForPhoto(currentMessageObject, currentFileLocation, currentIndex); if (!init) { if (currentPlaceObject != null) { currentPlaceObject.imageReceiver.setVisible(false, true); @@ -1033,7 +1147,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat canDragDown = true; changingPage = false; switchImageAfterAnimation = 0; - canZoom = !currentFileName.endsWith("mp4"); + canZoom = currentFileName == null || !currentFileName.endsWith("mp4"); updateMinMax(scale); if (prevIndex == -1) { @@ -1080,45 +1194,60 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat } else { progressBar.setVisibility(View.GONE); } + updateActionOverlays(); } private void setIndexToImage(ImageReceiver imageReceiver, int index) { - int size[] = new int[1]; - TLRPC.FileLocation fileLocation = getFileLocation(index, size); - - if (fileLocation != null) { - MessageObject messageObject = null; - if (!imagesArr.isEmpty()) { - messageObject = imagesArr.get(index); + if (!imagesArrLocals.isEmpty()) { + if (index >= 0 && index < imagesArrLocals.size()) { + MediaController.PhotoEntry photoEntry = imagesArrLocals.get(index); + Bitmap placeHolder = null; + if (currentThumb != null && imageReceiver == centerImage) { + placeHolder = currentThumb; + } + int size = (int)(800 / Utilities.density); + imageReceiver.setImage(photoEntry.path, String.format(Locale.US, "%d_%d", size, size), placeHolder != null ? new BitmapDrawable(null, placeHolder) : null); + } else { + imageReceiver.setImageBitmap((Bitmap) null); } + } else { + int size[] = new int[1]; + TLRPC.FileLocation fileLocation = getFileLocation(index, size); - if (messageObject != null && messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaVideo) { - if (messageObject.imagePreview != null) { - imageReceiver.setImageBitmap(messageObject.imagePreview); - } else if (messageObject.messageOwner.media.video.thumb != null) { + if (fileLocation != null) { + MessageObject messageObject = null; + if (!imagesArr.isEmpty()) { + messageObject = imagesArr.get(index); + } + + if (messageObject != null && messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaVideo) { + if (messageObject.imagePreview != null) { + imageReceiver.setImageBitmap(messageObject.imagePreview); + } else if (messageObject.messageOwner.media.video.thumb != null) { + Bitmap placeHolder = null; + if (currentThumb != null && imageReceiver == centerImage) { + placeHolder = currentThumb; + } + imageReceiver.setImage(fileLocation, null, placeHolder != null ? new BitmapDrawable(null, placeHolder) : null, size[0]); + } else { + imageReceiver.setImageBitmap(parentActivity.getResources().getDrawable(R.drawable.photoview_placeholder)); + } + } else { Bitmap placeHolder = null; + if (messageObject != null) { + placeHolder = messageObject.imagePreview; + } if (currentThumb != null && imageReceiver == centerImage) { placeHolder = currentThumb; } imageReceiver.setImage(fileLocation, null, placeHolder != null ? new BitmapDrawable(null, placeHolder) : null, size[0]); + } + } else { + if (size[0] == 0) { + imageReceiver.setImageBitmap((Bitmap) null); } else { imageReceiver.setImageBitmap(parentActivity.getResources().getDrawable(R.drawable.photoview_placeholder)); } - } else { - Bitmap placeHolder = null; - if (messageObject != null) { - placeHolder = messageObject.imagePreview; - } - if (currentThumb != null && imageReceiver == centerImage) { - placeHolder = currentThumb; - } - imageReceiver.setImage(fileLocation, null, placeHolder != null ? new BitmapDrawable(null, placeHolder) : null, size[0]); - } - } else { - if (size[0] == 0) { - imageReceiver.setImageBitmap((Bitmap) null); - } else { - imageReceiver.setImageBitmap(parentActivity.getResources().getDrawable(R.drawable.photoview_placeholder)); } } } @@ -1131,28 +1260,36 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat return !disableShowCheck && object != null && currentFileLocation != null && object.local_id == currentFileLocation.local_id && object.volume_id == currentFileLocation.volume_id && object.dc_id == currentFileLocation.dc_id; } + public boolean isShowingImage(String object) { + return !disableShowCheck && object != null && currentPathObject != null && object.equals(currentPathObject); + } + public void openPhoto(final MessageObject messageObject, final PhotoViewerProvider provider) { - openPhoto(messageObject, null, null, 0, provider); + openPhoto(messageObject, null, null, null, 0, provider); } public void openPhoto(final TLRPC.FileLocation fileLocation, final PhotoViewerProvider provider) { - openPhoto(null, fileLocation, null, 0, provider); + openPhoto(null, fileLocation, null, null, 0, provider); } public void openPhoto(final ArrayList messages, final int index, final PhotoViewerProvider provider) { - openPhoto(messages.get(index), null, messages, index, provider); + openPhoto(messages.get(index), null, messages, null, index, provider); } - public void openPhoto(final MessageObject messageObject, final TLRPC.FileLocation fileLocation, final ArrayList messages, final int index, final PhotoViewerProvider provider) { - if (parentActivity == null || isVisible || provider == null || animationInProgress || messageObject == null && fileLocation == null && messages == null) { + public void openPhotoForSelect(final ArrayList photos, final int index, final PhotoViewerProvider provider) { + openPhoto(null, null, null, photos, index, provider); + } + + public void openPhoto(final MessageObject messageObject, final TLRPC.FileLocation fileLocation, final ArrayList messages, final ArrayList photos, final int index, final PhotoViewerProvider provider) { + if (parentActivity == null || isVisible || provider == null || animationInProgress || messageObject == null && fileLocation == null && messages == null && photos == null) { return; } - final PlaceProviderObject object = provider.getPlaceForPhoto(messageObject, fileLocation); + final PlaceProviderObject object = provider.getPlaceForPhoto(messageObject, fileLocation, index); if (object == null) { return; } - actionBarLayer.setTitle(LocaleController.getString("Gallery", R.string.Gallery)); + actionBarLayer.setTitle(LocaleController.formatString("Of", R.string.Of, 1, 1)); NotificationCenter.getInstance().addObserver(this, FileLoader.FileDidFailedLoad); NotificationCenter.getInstance().addObserver(this, FileLoader.FileDidLoaded); NotificationCenter.getInstance().addObserver(this, FileLoader.FileLoadProgressChanged); @@ -1169,7 +1306,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat } disableShowCheck = true; - onPhotoShow(messageObject, fileLocation, messages, index, object); + onPhotoShow(messageObject, fileLocation, messages, photos, index, object); isVisible = true; backgroundDrawable.setAlpha(255); toggleActionBar(true, false); @@ -1208,6 +1345,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat float xPos = (Utilities.displaySize.x - width) / 2.0f; float yPos = (Utilities.displaySize.y - Utilities.statusBarHeight - height) / 2.0f; int clipHorizontal = Math.abs(object.imageReceiver.drawRegion.left - object.imageReceiver.imageX); + int clipVertical = Math.abs(object.imageReceiver.drawRegion.top - object.imageReceiver.imageY); int coords2[] = new int[2]; object.parentView.getLocationInWindow(coords2); @@ -1219,6 +1357,8 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat if (clipBottom < 0) { clipBottom = 0; } + clipTop = Math.max(clipTop, clipVertical); + clipBottom = Math.max(clipBottom, clipVertical); AnimatorSet animatorSet = new AnimatorSet(); animatorSet.playTogether( @@ -1233,7 +1373,8 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat ObjectAnimator.ofFloat(actionBar, "alpha", 0.0f, 1.0f), ObjectAnimator.ofFloat(bottomLayout, "alpha", 0.0f, 1.0f), ObjectAnimator.ofFloat(progressBar, "alpha", 0.0f, 1.0f), - ObjectAnimator.ofFloat(currentOverlay, "alpha", 0.0f, 1.0f) + ObjectAnimator.ofFloat(currentOverlay, "alpha", 0.0f, 1.0f), + ObjectAnimator.ofFloat(checkImageView, "alpha", 0.0f, 1.0f) ); animatorSet.setDuration(250); @@ -1284,7 +1425,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat velocityTracker = null; } - final PlaceProviderObject object = placeProvider.getPlaceForPhoto(currentMessageObject, currentFileLocation); + final PlaceProviderObject object = placeProvider.getPlaceForPhoto(currentMessageObject, currentFileLocation, currentIndex); if(android.os.Build.VERSION.SDK_INT >= 11 && animated) { Utilities.lockOrientation(parentActivity); @@ -1321,6 +1462,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat if (object != null) { object.imageReceiver.setVisible(false, true); int clipHorizontal = Math.abs(object.imageReceiver.drawRegion.left - object.imageReceiver.imageX); + int clipVertical = Math.abs(object.imageReceiver.drawRegion.top - object.imageReceiver.imageY); int coords2[] = new int[2]; object.parentView.getLocationInWindow(coords2); @@ -1333,6 +1475,9 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat clipBottom = 0; } + clipTop = Math.max(clipTop, clipVertical); + clipBottom = Math.max(clipBottom, clipVertical); + animatorSet.playTogether( ObjectAnimator.ofFloat(animatingImageView, "scaleX", 1), ObjectAnimator.ofFloat(animatingImageView, "scaleY", 1), @@ -1345,7 +1490,8 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat ObjectAnimator.ofFloat(actionBar, "alpha", 0.0f), ObjectAnimator.ofFloat(bottomLayout, "alpha", 0.0f), ObjectAnimator.ofFloat(progressBar, "alpha", 0.0f), - ObjectAnimator.ofFloat(currentOverlay, "alpha", 0.0f) + ObjectAnimator.ofFloat(currentOverlay, "alpha", 0.0f), + ObjectAnimator.ofFloat(checkImageView, "alpha", 0.0f) ); } else { animatorSet.playTogether( @@ -1355,7 +1501,8 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat ObjectAnimator.ofFloat(bottomLayout, "alpha", 0.0f), ObjectAnimator.ofFloat(progressBar, "alpha", 0.0f), ObjectAnimator.ofFloat(animatingImageView, "translationY", translationY >= 0 ? Utilities.displaySize.y : -Utilities.displaySize.y), - ObjectAnimator.ofFloat(currentOverlay, "alpha", 0.0f) + ObjectAnimator.ofFloat(currentOverlay, "alpha", 0.0f), + ObjectAnimator.ofFloat(checkImageView, "alpha", 0.0f) ); } @@ -1378,6 +1525,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat disableShowCheck = true; currentMessageObject = null; currentFileLocation = null; + currentPathObject = null; currentThumb = null; centerImage.setImageBitmap((Bitmap)null); leftImage.setImageBitmap((Bitmap) null); @@ -1777,17 +1925,37 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat canvas.restore(); } + @SuppressLint("DrawAllocation") private void onLayout(boolean changed, int left, int top, int right, int bottom) { if(changed) { scale = 1; translationX = 0; translationY = 0; updateMinMax(scale); + + if (checkImageView != null) { + checkImageView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { + @Override + public boolean onPreDraw() { + checkImageView.getViewTreeObserver().removeOnPreDrawListener(this); + FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams)checkImageView.getLayoutParams(); + WindowManager manager = (WindowManager)ApplicationLoader.applicationContext.getSystemService(Activity.WINDOW_SERVICE); + int rotation = manager.getDefaultDisplay().getRotation(); + if (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90) { + layoutParams.topMargin = Utilities.dp(48); + } else { + layoutParams.topMargin = Utilities.dp(58); + } + checkImageView.setLayoutParams(layoutParams); + return false; + } + }); + } } } private void onActionClick(View view) { - if (currentMessageObject == null) { + if (currentMessageObject == null || currentFileName == null) { return; } boolean loadFile = false; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java index 65959ac6d..185b896e0 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java @@ -220,7 +220,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBarLayer.setDisplayHomeAsUpEnabled(true); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); actionBarLayer.setTitle(LocaleController.getString("Settings", R.string.Settings)); actionBarLayer.setActionBarMenuOnItemClick(new ActionBarLayer.ActionBarMenuOnItemClick() { @Override @@ -413,7 +413,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter } @Override - public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation) { + public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { if (fileLocation == null) { return null; } @@ -445,9 +445,25 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter } @Override - public void willHidePhotoViewer() { + public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { } - } + @Override + public void willHidePhotoViewer() { } + + @Override + public boolean isPhotoChecked(int index) { return false; } + + @Override + public void setPhotoChecked(int index) { } + + @Override + public void cancelButtonPressed() { } + + @Override + public void sendButtonPressed(int index) { } + + @Override + public int getSelectedCount() { return 0; } public void performAskAQuestion() { final SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java index ced697f97..88912f31f 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java @@ -67,7 +67,7 @@ public class SettingsBlockedUsers extends BaseFragment implements NotificationCe @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBarLayer.setDisplayHomeAsUpEnabled(true); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); actionBarLayer.setTitle(LocaleController.getString("BlockedUsers", R.string.BlockedUsers)); actionBarLayer.setActionBarMenuOnItemClick(new ActionBarLayer.ActionBarMenuOnItemClick() { @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsNotificationsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsNotificationsActivity.java index 4acc174e6..8b3165c57 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsNotificationsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsNotificationsActivity.java @@ -97,7 +97,7 @@ public class SettingsNotificationsActivity extends BaseFragment { @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBarLayer.setDisplayHomeAsUpEnabled(true); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); actionBarLayer.setTitle(LocaleController.getString("NotificationsAndSounds", R.string.NotificationsAndSounds)); actionBarLayer.setActionBarMenuOnItemClick(new ActionBarLayer.ActionBarMenuOnItemClick() { @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java index 597f3e487..33322a47f 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java @@ -134,7 +134,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBarLayer.setDisplayHomeAsUpEnabled(true); + actionBarLayer.setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); if (dialog_id != 0) { actionBarLayer.setTitle(LocaleController.getString("SecretTitle", R.string.SecretTitle)); actionBarLayer.setTitleIcon(R.drawable.ic_lock_white, Utilities.dp(4)); @@ -454,7 +454,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen } @Override - public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation) { + public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { if (fileLocation == null) { return null; } @@ -486,9 +486,25 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen } @Override - public void willHidePhotoViewer() { + public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { } - } + @Override + public void willHidePhotoViewer() { } + + @Override + public boolean isPhotoChecked(int index) { return false; } + + @Override + public void setPhotoChecked(int index) { } + + @Override + public void cancelButtonPressed() { } + + @Override + public void sendButtonPressed(int index) { } + + @Override + public int getSelectedCount() { return 0; } private void createActionBarMenu() { ActionBarMenu menu = actionBarLayer.createMenu(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBar.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBar.java index 13dc763ce..9be684dae 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBar.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBar.java @@ -32,7 +32,6 @@ public class ActionBar extends FrameLayout { private View currentBackOverlay; private View shadowView = null; private int currentBackOverlayWidth; - protected int itemsBackgroundResourceId; public ActionBar(Context context) { super(context); @@ -206,8 +205,4 @@ public class ActionBar extends FrameLayout { currentLayer.onMenuButtonPressed(); } } - - public void setItemsBackground(int resourceId) { - itemsBackgroundResourceId = resourceId; - } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarActivity.java index 7ba3eccf6..183903aba 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarActivity.java @@ -56,6 +56,7 @@ public class ActionBarActivity extends Activity { private long transitionAnimationStartTime; private boolean inActionMode = false; private int startedTrackingPointerId; + private Animation.AnimationListener listener; private class FrameLayoutTouch extends FrameLayout { public FrameLayoutTouch(Context context) { @@ -126,7 +127,6 @@ public class ActionBarActivity extends Activity { shadowView.setVisibility(View.INVISIBLE); actionBar = new ActionBar(this); - actionBar.setItemsBackground(R.drawable.bar_selector); contentView.addView(actionBar); layoutParams = actionBar.getLayoutParams(); layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; @@ -153,6 +153,11 @@ public class ActionBarActivity extends Activity { protected void onResume() { super.onResume(); fixLayout(); + if (transitionAnimationInProgress && listener != null) { + openAnimation.cancel(); + closeAnimation.cancel(); + listener.onAnimationEnd(null); + } if (!fragmentsStack.isEmpty()) { BaseFragment lastFragment = fragmentsStack.get(fragmentsStack.size() - 1); lastFragment.onResume(); @@ -493,7 +498,7 @@ public class ActionBarActivity extends Activity { transitionAnimationStartTime = System.currentTimeMillis(); transitionAnimationInProgress = true; openAnimation.reset(); - openAnimation.setAnimationListener(new Animation.AnimationListener() { + openAnimation.setAnimationListener(listener = new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { @@ -501,10 +506,12 @@ public class ActionBarActivity extends Activity { @Override public void onAnimationEnd(Animation animation) { - transitionAnimationInProgress = false; - transitionAnimationStartTime = 0; - fragment.onOpenAnimationEnd(); - presentFragmentInternalRemoveOld(removeLast, currentFragment); + if (transitionAnimationInProgress) { + transitionAnimationInProgress = false; + transitionAnimationStartTime = 0; + fragment.onOpenAnimationEnd(); + presentFragmentInternalRemoveOld(removeLast, currentFragment); + } } @Override @@ -566,7 +573,7 @@ public class ActionBarActivity extends Activity { transitionAnimationStartTime = System.currentTimeMillis(); transitionAnimationInProgress = true; closeAnimation.reset(); - closeAnimation.setAnimationListener(new Animation.AnimationListener() { + closeAnimation.setAnimationListener(listener = new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { @@ -574,9 +581,11 @@ public class ActionBarActivity extends Activity { @Override public void onAnimationEnd(Animation animation) { - transitionAnimationInProgress = false; - transitionAnimationStartTime = 0; - closeLastFragmentInternalRemoveOld(currentFragment); + if (transitionAnimationInProgress) { + transitionAnimationInProgress = false; + transitionAnimationStartTime = 0; + closeLastFragmentInternalRemoveOld(currentFragment); + } } @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarLayer.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarLayer.java index 7f22c6c7b..4ccde6a1e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarLayer.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarLayer.java @@ -43,11 +43,14 @@ public class ActionBarLayer extends FrameLayout { private TextView subTitleTextView; private ActionBarMenu menu; private ActionBarMenu actionMode; + private int logoResourceId; + private int backResourceId; protected ActionBar parentActionBar; private boolean oldUseLogo; private boolean oldUseBack; private boolean isBackLayoutHidden = false; protected boolean isSearchFieldVisible; + protected int itemsBackgroundResourceId; public ActionBarMenuOnItemClick actionBarMenuOnItemClick; public ActionBarLayer(Context context, ActionBar actionBar) { @@ -60,7 +63,6 @@ public class ActionBarLayer extends FrameLayout { layoutParams.height = LayoutParams.FILL_PARENT; layoutParams.gravity = Gravity.TOP | Gravity.LEFT; backButtonFrameLayout.setLayoutParams(layoutParams); - backButtonFrameLayout.setBackgroundResource(actionBar.itemsBackgroundResourceId); backButtonFrameLayout.setPadding(0, 0, Utilities.dp(4), 0); backButtonFrameLayout.setOnClickListener(new OnClickListener() { @Override @@ -207,28 +209,31 @@ public class ActionBarLayer extends FrameLayout { menu.measure(width, height); } - public void setDisplayUseLogoEnabled(boolean value) { + public void setDisplayUseLogoEnabled(boolean value, int resource) { if (value && logoImageView == null) { + logoResourceId = resource; logoImageView = new ImageView(getContext()); logoImageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE); - logoImageView.setImageResource(R.drawable.ic_ab_logo); backButtonFrameLayout.addView(logoImageView); - positionLogoImage(getMeasuredHeight()); - } else if (logoImageView != null) { + } + if (logoImageView != null) { logoImageView.setVisibility(value ? VISIBLE : GONE); + logoImageView.setImageResource(resource); + positionLogoImage(getMeasuredHeight()); } } - public void setDisplayHomeAsUpEnabled(boolean value) { + public void setDisplayHomeAsUpEnabled(boolean value, int resource) { if (value && backButtonImageView == null) { + backResourceId = resource; backButtonImageView = new ImageView(getContext()); - backButtonImageView.setImageResource(R.drawable.ic_ab_back); backButtonFrameLayout.addView(backButtonImageView); - positionBackImage(getMeasuredHeight()); } if (backButtonImageView != null) { backButtonImageView.setVisibility(value ? VISIBLE : GONE); backButtonFrameLayout.setEnabled(value); + backButtonImageView.setImageResource(resource); + positionBackImage(getMeasuredHeight()); } } @@ -404,22 +409,21 @@ public class ActionBarLayer extends FrameLayout { backButtonFrameLayout.setPadding(0, 0, visible ? 0 : Utilities.dp(4), 0); if (visible) { oldUseLogo = logoImageView != null && logoImageView.getVisibility() == VISIBLE; - setDisplayUseLogoEnabled(true); + setDisplayUseLogoEnabled(true, R.drawable.ic_ab_search); } else { - setDisplayUseLogoEnabled(oldUseLogo); + setDisplayUseLogoEnabled(oldUseLogo, logoResourceId); } if (visible) { oldUseBack = backButtonImageView != null && backButtonImageView.getVisibility() == VISIBLE; - setDisplayHomeAsUpEnabled(true); + setDisplayHomeAsUpEnabled(true, R.drawable.ic_ab_back); } else { - setDisplayHomeAsUpEnabled(oldUseBack); + setDisplayHomeAsUpEnabled(oldUseBack, backResourceId); } if (visible) { backButtonFrameLayout.setVisibility(VISIBLE); } else { backButtonFrameLayout.setVisibility(isBackLayoutHidden ? INVISIBLE : VISIBLE); } - logoImageView.setImageResource(visible ? R.drawable.ic_ab_search : R.drawable.ic_ab_logo); } public void closeSearchField() { @@ -459,4 +463,9 @@ public class ActionBarLayer extends FrameLayout { menu.hideAllPopupMenus(); } } + + public void setItemsBackground(int resourceId) { + itemsBackgroundResourceId = resourceId; + backButtonFrameLayout.setBackgroundResource(itemsBackgroundResourceId); + } } \ No newline at end of file diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarMenu.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarMenu.java index 87abb9c2d..823eb704b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarMenu.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarMenu.java @@ -49,7 +49,7 @@ public class ActionBarMenu extends LinearLayout { addView(view); LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)view.getLayoutParams(); layoutParams.height = FrameLayout.LayoutParams.FILL_PARENT; - view.setBackgroundResource(parentActionBar.itemsBackgroundResourceId); + view.setBackgroundResource(parentActionBarLayer.itemsBackgroundResourceId); view.setLayoutParams(layoutParams); view.setOnClickListener(new OnClickListener() { @Override @@ -61,7 +61,7 @@ public class ActionBarMenu extends LinearLayout { } public ActionBarMenuItem addItem(int id, int icon) { - ActionBarMenuItem menuItem = new ActionBarMenuItem(getContext(), this, parentActionBar); + ActionBarMenuItem menuItem = new ActionBarMenuItem(getContext(), this, parentActionBar, parentActionBarLayer.itemsBackgroundResourceId); menuItem.setTag(id); menuItem.setScaleType(ImageView.ScaleType.CENTER); menuItem.setImageResource(icon); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarMenuItem.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarMenuItem.java index 5d244836a..90b4e8051 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarMenuItem.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarMenuItem.java @@ -46,9 +46,9 @@ public class ActionBarMenuItem extends ImageView { private boolean isSearchField = false; private ActionBarMenuItemSearchListener listener; - public ActionBarMenuItem(Context context, ActionBarMenu menu, ActionBar actionBar) { + public ActionBarMenuItem(Context context, ActionBarMenu menu, ActionBar actionBar, int background) { super(context); - setBackgroundResource(actionBar.itemsBackgroundResourceId); + setBackgroundResource(background); parentMenu = menu; parentActionBar = actionBar; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/BaseFragment.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/BaseFragment.java index 456e5dba6..a30354e39 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/BaseFragment.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/BaseFragment.java @@ -62,6 +62,7 @@ public class BaseFragment { } actionBarLayer = parentActivity.getInternalActionBar().createLayer(); actionBarLayer.setBackgroundResource(R.color.header); + actionBarLayer.setItemsBackground(R.drawable.bar_selector); } } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ImageReceiver.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/ImageReceiver.java index 625466633..1cc3f8218 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ImageReceiver.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/ImageReceiver.java @@ -259,6 +259,6 @@ public class ImageReceiver { } public boolean hasImage() { - return currentImage != null || last_placeholder != null || currentPath != null; + return currentImage != null || last_placeholder != null || currentPath != null || last_httpUrl != null; } } diff --git a/TMessagesProj/src/main/res/drawable-hdpi/gallery.png b/TMessagesProj/src/main/res/drawable-hdpi/gallery.png new file mode 100755 index 0000000000000000000000000000000000000000..6bd0cda8350eeb86eef569ee92d865f36fef4672 GIT binary patch literal 405 zcmV;G0c!qRCwC# z*}V?IP#DJX7C|)ewHYOdScJtT7+ip*Vs-;IF2KSh+=0y?u?RMk-M}pvyBO5dv)QI`;8XtMNZUT!fJdV@BB2RQXhIWO z7<5`RbQN9DNEEaI-lHrUqCW5FiUn-me~MbXq7CrT0yZas)~LuE+5jIufX&IEoz3>p z(PakCIjk$7jmv!|Q6ot7(FNF?CR#bH>7gq-5Nc59oX353(B#AIHFQD?lt*ziXJ;TT zJ`o3&Q(+1%8MywoE{euz=4I!y&9%I5e~mvFR(1JmZBZ9JEsw2)jrKEV)JAua(8kX0`lhXwX~2ZK(+4g)%WX mOf7H%N$e5;kq62fG!HPat>F)UaQFWlkcg+NpUXO@geCw3Wjt&E literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-hdpi/nophotos.9.png b/TMessagesProj/src/main/res/drawable-hdpi/nophotos.9.png new file mode 100644 index 0000000000000000000000000000000000000000..27c40f747d65bdcb29ade7586e9c5d4faf6d616b GIT binary patch literal 991 zcmeAS@N?(olHy`uVBq!ia0vp^k3pD&4M>*vE%sqxU|#0w;uunK>+RiaZ>2znhQ$Aq z&7GW_boO(EeLLu#)YZBD(*OStb&i)FDZQE$m_EI>rM;=mvgpgx7d?J6&zz5bps@Y( zeVg@uHrJiZX0rxOVaYUd=xLB}BnqoBAK~Z_BpPeD2`DQNhZjR#aG+Ddm;_rgoDhze z`Sk0Tl%2i(;T$t>R~hSj?ES40|EvGj*{=y(y&*>Ly8U`hNn^0+(H)(I8zWktKYxB9 z!{pH8$B$i)8a|3B^fBz3xL4w__pzjn65czOz8Pp6W5cZ@>W7#PVP{F1<%qTPat=##OkZBzI|StpP#=lKm({H#`>7bksoKf zewZ%b;k*2@AW*AY&&gBU<&%{1uIHE?)o|03O|}ULUKzsIwnI8)Z=5(#MM%%&lPXuT zwi?Vo-`^&oTHn3;dHC;hPm31D=*iniX}cK~sT}L?@1LywsBVJcEs0wj|K7WIZ=L>f z!R@t`l|U0^q+bQlf_kVu*vZb%|`z5KhVXvo)2K6L8@iA0$d^hjY zj{W=j-@ku{yLW#rm?&}dgk~63M&=}3*J9c|v2H^b; zL%F*?%|Kmk|Ic@jmHhrqmGEWj5EM`*3SUfVkYF@yA{rm%NMboc92SAQ;Ll&fG_(B- dFHinq;NEdN>hR)pCt${9@O1TaS?83{1OOC*i$MSY literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-hdpi/photo_back.png b/TMessagesProj/src/main/res/drawable-hdpi/photo_back.png new file mode 100755 index 0000000000000000000000000000000000000000..c9eb0018d9589c5e00861950d652270b21a9a862 GIT binary patch literal 384 zcmV-`0e}99P)nCF9Tv8D1S2}9vhf|coq;FK=}`WIF<>I=^03he*F`1MdtST!gCaWN8q z5!5*-02Zu*K)eZvIicbp55_}7hXI=nbCDE(g9hPmT#*BEvmBDxZfGRojLkzp{0K?R z6^P~WX#jy_ApQPpHRLU5NG1k00Q@bxEF~Z2gFwRG=RW5sGne< z5gOzSgp$S!C|eM!39p7vKwJmJ|Db#;sPk}Y0D*Hrya0)x2@MDal5-p*fkJ?!Jk3BT e9*6<}0R{jC9zX>c6eVT=0000jv*Ddk`oTF{O>$4HmrU-<(QCtxlVX(((^K%6Q?E=x!+r;prG)10s|vTSAZZra1qZrf_B_%otCEmpY%4W5@A$c?2Xj-qm$ZwmAYuV(FVCIB72w?D@<{9 literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-hdpi/selectphoto_small.png b/TMessagesProj/src/main/res/drawable-hdpi/selectphoto_small.png new file mode 100755 index 0000000000000000000000000000000000000000..7a023ec07d41d355da52905d8f3a66b2d0fe0da1 GIT binary patch literal 332 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBSkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-%+=jq}YQgQ3ebwj=;1Ce8et2o&U zic*UUzG=xFsIK4%TmR_DlPsr4kKVj{6trJWZ5G=L?S0qFD)fK)3;bwxaPHl@O)FC@ zG;y&4t7b=LnQCLym4$yF1a3D_TeJ24&PBKE)y0>&zh3yc>(COWiH4dEffAVkCT>C| z+{&!8dM7gcZRKp_%a|%;%xYDqSEINn!XSBps@2~+3N1;8eQXuAxgOD>T~t4#BVLwEOM;(;@-VYB1;yW c`7D;ez+lm~!eWiK2GFMrp00i_>zopr02qRT5C8xG literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-hdpi/selectphoto_small_active.png b/TMessagesProj/src/main/res/drawable-hdpi/selectphoto_small_active.png new file mode 100755 index 0000000000000000000000000000000000000000..7a023ec07d41d355da52905d8f3a66b2d0fe0da1 GIT binary patch literal 332 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBSkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-%+=jq}YQgQ3ebwj=;1Ce8et2o&U zic*UUzG=xFsIK4%TmR_DlPsr4kKVj{6trJWZ5G=L?S0qFD)fK)3;bwxaPHl@O)FC@ zG;y&4t7b=LnQCLym4$yF1a3D_TeJ24&PBKE)y0>&zh3yc>(COWiH4dEffAVkCT>C| z+{&!8dM7gcZRKp_%a|%;%xYDqSEINn!XSBps@2~+3N1;8eQXuAxgOD>T~t4#BVLwEOM;(;@-VYB1;yW c`7D;ez+lm~!eWiK2GFMrp00i_>zopr02qRT5C8xG literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-hdpi/selectphoto_small_grey.png b/TMessagesProj/src/main/res/drawable-hdpi/selectphoto_small_grey.png new file mode 100755 index 0000000000000000000000000000000000000000..6cf4bcda9dd6524f6fb059f12ffdc7da71e42640 GIT binary patch literal 399 zcmV;A0dW3_P)C4PO>h=Ouiz>u6))lB861j(=Wy!eAh;_CI(h*YLF)e?F4ESd z&1;I}!B1_V^&=@St%#z?D^pdxl9dBF(BFY-d2bK|L6*yU$bo+NzHfbo*2o?imtn~W zvp}lI5~N`#ety`X`exI z`RG}i$e|-LLRO|QTJJ*%Gj-ya8Rb3{gKEm-#WY5_F-p`NxyqpjGQ_x1j8><{pVP}! t8wrsP&Tkx>pm5*z4&*=%WVzk~3;^LAb&76j-o^j`002ovPDHLkV1jSVpSb`4 literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-ldpi/gallery.png b/TMessagesProj/src/main/res/drawable-ldpi/gallery.png new file mode 100755 index 0000000000000000000000000000000000000000..08b2617e07ff309bda44680c73d59e73e2de853d GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^q9Dw{1|(OCFP#RYSkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-%c;pyTSQgJKk&;S4S%v%{BPcZ$W z&6-yD*m%lp9_IahQeIOQ$~gSt?)X13OGB8?HO8Svq9c65R6Yki*F*7*Gq^ka9d9b! z>0QPq{jclHakWaJlMVv^c#eF`c=e|7Mw5v1#)sb>-tZhza@Zr6bun7u+tD-)O-nA7 z;~c#C5`i!N6IJaU8WgTe~ HDWM4f1zKG~ literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-ldpi/ic_ab_other_white2.png b/TMessagesProj/src/main/res/drawable-ldpi/ic_ab_other_white2.png new file mode 100755 index 0000000000000000000000000000000000000000..9ff5bd3e7d90a089050def261f752b4480971066 GIT binary patch literal 166 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjEa{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i<a(30|XUA!{GM6~x9qbY+!10zGibbj>+jTdKuW-xfV L`njxgN@xNAQ1dmk literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-ldpi/nophotos.9.png b/TMessagesProj/src/main/res/drawable-ldpi/nophotos.9.png new file mode 100644 index 0000000000000000000000000000000000000000..05a2c81994cf2534269cdb456a911b61825e7399 GIT binary patch literal 520 zcmeAS@N?(olHy`uVBq!ia0vp^MIg+<1|<9Mw$?H*FrN2xaSW-r_4fAZu15|M4Hx%J zR@f2XD578ev9DuA#r5y;A)l99JL|V)=15p&`aL)-G09g}IgD%bn_6$x_sh3?_4u#4 znzgEcb=g4%%?V7J6BJm36j+6pIB+d-Xky_6vV#;Hfov`nk46y?0;yqwic9f;c)zq$ z(hNZA!D>$EOZU2E+Rb17wCLyBV~-6_7@5pId+GB}pX;x`K7IGS+G_rJh0_<3HhTR2 zYiBCeJ6)Qu{bkY41|8>*Uw7PoyRS5N`)$^r(hAjkGDI$9XWD*Scm4zRB%e=<58TNyTN$_h zzh$|B#FDR7b7!4ZJF&@hu3zyMrVqu1HVbaQEsI(k_Vf3P604`jt>*Hb&~k7qoPJC; zdQR{g_Gc+ZC*vK%7(T@xD7^czf+aHb1e36e$AtgMlB;J_?FouWmt38~eY!AxUsMf; zjt)00bbc<@#u-SkAcF)GN+^SawYKSuU0KN8P39AP#Z;S?XkG!vFoUP7pUXO@geCwy Cj?t6= literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-ldpi/photo_back.png b/TMessagesProj/src/main/res/drawable-ldpi/photo_back.png new file mode 100755 index 0000000000000000000000000000000000000000..14f9ad5e8a8c9a143e2a993c26d403021d6afc49 GIT binary patch literal 212 zcmeAS@N?(olHy`uVBq!ia0vp^Y(UJz0U{m4&*%XumUKs7M+S!VC(K#9UIO`&C9V-A z!TD(=<%vb942~)JNvR5+xryniL8*x;m4zo$ZGei>JY5_^DsCnH`2XLYS!f&MBV&h{ zRvitVBfA?bLw3LcyHPX7|M6}Gi|ik z#3Ibhd^klRjpb1dTS~)uzCG&>z2xVaZ``ysk&%IsjUnvgvEUw=MH7KGGI+ZBxvXM=H7!V zSZ_242zh8p_0LCAn>SV!5+T*lU@B_c~`?PX+V+20|;0EE{h~?krIeHR!u`k~xpjp@ETM Y+l@Y<8$t4}Ku0rpy85}Sb4q9e0OM?6+5i9m literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-ldpi/selectphoto_small.png b/TMessagesProj/src/main/res/drawable-ldpi/selectphoto_small.png new file mode 100755 index 0000000000000000000000000000000000000000..fb868f48434c4c844e7e768be4e6f086d3c17fc3 GIT binary patch literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|mUKs7M+S!VC(K#9UIO`&C9V-A z!TD(=<%vb942~)JNvR5+xryniL8*x;m4zo$ZGeg@JzX3_DsCnH`TyUZ*_7e&2BQx4 zj{OHJ6`D^R&~o_0(y=!&X^O-q!H%0JOgUC7E|F@vED*$VD4S!KW08Z6WXDWTQ^A#94 a3>bI?Jtlm9Fi!#K2nJ7AKbLh*2~7ZLB~Nw$ literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-ldpi/selectphoto_small_active.png b/TMessagesProj/src/main/res/drawable-ldpi/selectphoto_small_active.png new file mode 100755 index 0000000000000000000000000000000000000000..1b18412d62918cdab3373d1b924957c176591716 GIT binary patch literal 235 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|mUKs7M+S!VC(K#9UIO`&C9V-A z!TD(=<%vb942~)JNvR5+xryniL8*x;m4zo$ZGehuJzX3_DsCnH`TyUZ*_1(;dFp`$ z1|98EY%3W)@+y35>uzA0?XrgHh<`(cvcTqpM^+|rtYmv=(jwCQL8>Wlf{cJaTT)sO zucNt#Y{z`&k69{*JB(OnU!TAmtbR=(CXvPHfv7+|^CRCQ5>5IWY8!tTZER~Wc%1Q0 eor8gihkBx2QGD$6BT9U_*nZJp*NvepU<2=*HyiGh##wsSdx^Kl#vOP3z$!O+~WMb0s z=z7`^qA4KGAo@@Bs6dH$AyXlTz|pEoE|kpC=IGHT z%a#<-bep+IRnd8a6pQH@agVKx8x0NH9++gbJg+NZ5J+HPZVh_ybG5Q2(3uRLu6{1- HoD!MHEzopr E05vpn)Bpeg literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-mdpi/ic_ab_other_white2.png b/TMessagesProj/src/main/res/drawable-mdpi/ic_ab_other_white2.png new file mode 100755 index 0000000000000000000000000000000000000000..23433a4b84ef8b082a961aecf93e5398ab103345 GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzmUKs7M+S!VC(K#9UIO`&C9V-A z!TD(=<%vb942~)JNvR5+xryniL8*x;m4zo$ZGehAJY5_^DsCnH`TyVkumh7?8zb9d zK8XVM4HH)83yT@|-w3dtHgl4TG` aV3<0W-+X@X`K>@R89ZJ6T-G@yGywqEk2g2~ literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-mdpi/nophotos.9.png b/TMessagesProj/src/main/res/drawable-mdpi/nophotos.9.png new file mode 100644 index 0000000000000000000000000000000000000000..30f05e378a6f5cb297f5add31a24192a31704377 GIT binary patch literal 674 zcmeAS@N?(olHy`uVBq!ia0vp^GeDSw4M<8HQcz@IV9NA#aSW-r_4e+`u15h94T1Mh za=M7HxEJX2NtZ5s^y6Q5^q-Yo0n@GqTrI!+P0()9u@pi6>ls38Lhj|ibgi0t+k3D4 z%BZzoH?=3;lwk5{@ND2TU{qsNJHRr7Wd?(Af=~jJ4^WuX03>`s1t`og87R!egUUsy zLDdR0@1;Cb*hWK`K7>NBVJtVQH{aBm>$iN-=bv-dM(8IrEPYxuGjDrz)cWh08zV&e z>!Wq{N3HGpdNla}!)|72zV^s#*K^Fe1$hh(Ffbz#8~$@fEWhlzHHz2Zz$a$u{^KvJ z_AYx_!X=SV+1Ts0xMXKc*Yl)X@4quLzj@!tx*Kz?G6}n7{q@(y-NEQ*T!7ou@YW13^eSrfX+C6;9tnkr3+XjUIXpVIUwh54E0gFFYVc-SL_At)+*e#y<~RYZ<3L@XjA3|$kJNCm|;LMt=@$k(s@Q|Nvw_9^eZv>W{H Tt9FL~(;kDTtDnm{r-UW|yM6oA literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-mdpi/photo_back.png b/TMessagesProj/src/main/res/drawable-mdpi/photo_back.png new file mode 100755 index 0000000000000000000000000000000000000000..22a1fe2638d9af27fc1edbe99d8a3dcb63f6b368 GIT binary patch literal 245 zcmeAS@N?(olHy`uVBq!ia0vp^96&6^!VM>ke+wZ*pfG%QS@O1TaS?83{1OON~P#6FJ literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-mdpi/photobadge.9.png b/TMessagesProj/src/main/res/drawable-mdpi/photobadge.9.png new file mode 100644 index 0000000000000000000000000000000000000000..9a2e146fb385eec2383ef9de86d5007258c1ca55 GIT binary patch literal 112 zcmeAS@N?(olHy`uVBq!ia0vp^JU}eU!3HFY*6?ouQs$m6jv*Ddk`o+Q{}(2NB-Fn8 z8#g=n{r|^@6-*1xwul@y@HzZHkaw|E+j_Q1pP64;^7+RdJ8_%g^wY$jSFiLQ02;yI M>FVdQ&MBb@08tbussI20 literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-mdpi/photoborder.9.png b/TMessagesProj/src/main/res/drawable-mdpi/photoborder.9.png new file mode 100644 index 0000000000000000000000000000000000000000..75b58119837f774f9fc72e3f702ed015ae7b3963 GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^N+8U^1|+TAxeo!UU{4pvkcwMxZ*1gbP~dU7=<_&A z?`c|J;!~D%^{^yGwL|tl{%Sj)`F8o~x6@lsZ|>w_*Ytgv>aeeogF`^Up@D&siG^dr o1A%oF3daTZF`ju^!Ey(dumti_m-|$0PK>EOum${Z4XV{a{s;n56KmAg`u62K>^EE9d$M7Mb=C=Kh3;yV&4&sQ!YhE z?6ac$yc|Q?pLC>N(Xo~Ed@)0ZEh$ccZ$X-LZ{e17lUEIb?-?2xm>JeEaQ#wQ$|?x- O9D}E;pUXO@geCw3_jW!2 literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-mdpi/selectphoto_small.png b/TMessagesProj/src/main/res/drawable-mdpi/selectphoto_small.png new file mode 100755 index 0000000000000000000000000000000000000000..051f23a6fa94693404ecb30ae7f2b6f0e1b55072 GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjEa{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i>J@N{tuskoK&=l_3uW?e>M=H7!V zSWC7#h;(dc-e{$(!yvg&yu-HP2B$0A6d%naiyUfR+Ovo(Jbn2}ftRjAhJ~t_K&r(~ zF$L*3FAv*Y4E6&43`u@j5`AZzlvX_38=<3kvmnONM7UcuMY2zyZ-VYb)$0XL6L~g2 zF`lwcLH(#;Pytug51XRT+=g968YkcOEDnA4VLOAu0fs569fu#@OsfF8k-^i|&t;uc GLK6TY<5}_m literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-mdpi/selectphoto_small_active.png b/TMessagesProj/src/main/res/drawable-mdpi/selectphoto_small_active.png new file mode 100755 index 0000000000000000000000000000000000000000..051f23a6fa94693404ecb30ae7f2b6f0e1b55072 GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjEa{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i>J@N{tuskoK&=l_3uW?e>M=H7!V zSWC7#h;(dc-e{$(!yvg&yu-HP2B$0A6d%naiyUfR+Ovo(Jbn2}ftRjAhJ~t_K&r(~ zF$L*3FAv*Y4E6&43`u@j5`AZzlvX_38=<3kvmnONM7UcuMY2zyZ-VYb)$0XL6L~g2 zF`lwcLH(#;Pytug51XRT+=g968YkcOEDnA4VLOAu0fs569fu#@OsfF8k-^i|&t;uc GLK6TY<5}_m literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-mdpi/selectphoto_small_grey.png b/TMessagesProj/src/main/res/drawable-mdpi/selectphoto_small_grey.png new file mode 100755 index 0000000000000000000000000000000000000000..0dcf7670565c3409531ea46df71d30aa2c4d8660 GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjEa{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i=u^K@|xskoK&=l_3uW?e>M=H7!V zSXmgkxAM#~&7P()A&TV)Yi4Gq`N~(!D;`!i-eB&SyF$vvqwO_Qq2YzEmsh4SiXHyF zLhR%b3BPTuN2L6wv1YVQe`qYDJd?@vGxJI}g>@`hfBae=-d&QmB}L&J`y*Y4!xoyR zGAt4oy@MAx8aIYW3A|@clAqvz!c=B8YlMy`!=trNB>FBhnRxGGFyuFhv-0p2>G`20 zvp{uu!xT+{^XyXdT*BHIBOCb7&#^RapCDB;qj1Y9nSWvoED{W>Oja)VsKLGh=raaS LS3j3^P6gnPbQgQ3e?7dz`97I};rC1{W zXtHeGB5WOb|G?2>ZXY;xSOO=0(!Kn3(^)Ev}*b!a!t2PY%_~JKSyd#;6DOkBZM1F1__S z^5+5c^`I+2#U?AJU7L+P?Mn w{2%(mX%52sH_ld0`CqvJ8W=Ys>sTZhI6pa?*Z$n`6&Q;Qp00i_>zopr0NhOE$^ZZW literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/ic_ab_other_white2.png b/TMessagesProj/src/main/res/drawable-xhdpi/ic_ab_other_white2.png new file mode 100755 index 0000000000000000000000000000000000000000..8a5215911651efb8da6aed9f303231bbb6c29bd1 GIT binary patch literal 238 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Ea{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5iuH w(i<#5rh{x)`&yWggRB`s6HxGnadZPC!!v#Ua<;`^mw;4xy85}Sb4q9e0O+?qEC2ui literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/nophotos.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/nophotos.9.png new file mode 100644 index 0000000000000000000000000000000000000000..3d70646b3f08a9eb8fe9df8a9270807233f1500c GIT binary patch literal 1395 zcmeAS@N?(olHy`uVBq!ia0y~yVAKO)4mO~Ofx~}i1_o9uPZ!6Kid%2*=6WjyN;D+? z57rO+qPSRTkrGd@#tN0{%cuVRZ{KXQ+1f}tdZqN{<6njJID&2FtepMW;+%<;eSYVf z9ZyR?o6mgs-#scSifIOS>K-39g&2lItO_v=1&kcxKmx=D3V_)h;%Jf>0ytE2qHDyV zZYGbz4u%$PAn}k%Ko3ZO*)7~)wtybGq&Jc3PN#sqgwq?`qU+jDLhQw97syd?Nn9?Q z;kW*}_u`8hyzPhI9JNT^vu$<(=k=!7-+#Y+`&M`FzI|!>$0Q$bz1!lwL+sAmx4D8X z)2B}_lqm}44ez;LCam{RXkDQ~US8g%bLaeS-M)SL*uQ^uRdsb@dM(}d?XMp_Qri7- z?Yebhzqhw=KXlq5pa(PuMt}ssqWGm2eJeORQ`yhY52!53?$Fk~dt+Hte%ZqUrJtG@4K;f{d#WkLq~HScFDdgFE4M6T(?=`yrq@ZtRJPA>U^=bNWE)Oa%zIpMSf>ZEiEXRASWkxOndK+KM{A-fqn>X zeQmwY)BE?UyLQbw6Tv z--SxEJ^S@*SBKx%+=olfzb)IHnVRYf4B%JX;X9kEYHDQI({FujWy{9)C8CSg5j+<@Z_ z5`o+gg+QWU!fD5k`(J+l-N^+_3{eGpq=0xC5c433eFEYrsQ(%8xqu1kZyq%9R%Ffi z49EatZ8WiUK)e^5P3XWBh!fDn?g4QxHk;7HfDedQ0I?X7*l!??2jW|}{E7@3&@_WU zKQ7Ja2802z9h&?RAYO$po?%{4f<_r~-gpa2szCf6p8+5jumkY~G|jN2`kqiS1sTAN z#oyO~_%t!O3}nDpAby1=t_h7!f`BSv081!+XmY|pTu+P_U;q?dhtTA0pwUav3sg&q zpPQW>5ujv*Ddk`oT_{hQpek@@vy z`Iub4z4n|({%amlcT78|%gkl7uxX*eAC{XB{$Dv_V*ca*ii3;U`lW2LKAXLn>~)y|aiIU=Ebbi8-mdKI;Vst0Hj$&1ONa4 literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/selectphoto_large.png b/TMessagesProj/src/main/res/drawable-xhdpi/selectphoto_large.png new file mode 100755 index 0000000000000000000000000000000000000000..090543233ea639b034d4e389186a05ba058271d5 GIT binary patch literal 540 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Ea{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+AuIMuJd$p45_&FW|p@Xv!g)UWWyBI zCu}#X8rHPPxJ>rm@lnW0;Q_D6ofl5watD|zgd7E8IxdBI9|`y0A7mSL{ST{rK zSG=ie@V<9Ww9sKs=08@I)7e}TRM)FIY}?buVD~fCW8XIh#h>D5-J5hiZDmWCyxx#u zbxkhgji=dM0WSNdF&ur8%@Gh1SJm+7(^G;nH}iap?>Yw z6Z>OvLZ1zk<<4GT!}R;Pf%?2N_jjrsW4-sDeV@Aek>UYs{BcFl~zXnagybdcA>s`71{nqx|{AJeNew-`la{9KU;ofscpMBi(lqYzJ&39Ho>4#S~ z{&ibbbLM3M-|Kwtds~;VochHZU^S X`rS;fUu;?lj9vy$S3j3^P6KAm4sGlO$Q9Om;pBsrobY@0&(YFNn$JoAvtvMgV8yWIzPzCzj%6M%~X7=8hA zy;iGTk4B>(=vO+O&NH;F(X(aj^BxiSgRfSrH!8du^?LoB9tE!n{0mL8x`0)9R|V{VcTK=9cvl2y_)4X6Wd)wQfZgy$1(0TE zXh^^bcq0OSvib!{&P@{G4bLio2y_TGR%h94_Hf#+kT*Q50KVEQxm@miI2?ZV`~BBU zCL=-Hs#bzGJgdNbu~<9;_;2-xu|ztZKG8~8fj3(fWDy9&8@&&s%_&2uYF@>-Bo?Dtx2Scp~tNtnh9Ks1kUS7mCGV5=gwsviu0IBSzuv5J1{5 zVJz;dBM~I?{R^@UIUsdRM}uZID=_K5f~)xw)V7kb}tak1i^q z(*)MsIdF=XMN#?2joq!CdXSmY&DG znJkWaGg=(?W~ew?%)IBZC8Oh`oebRpA7vUAeB8)*@NqIzRi`Q!aEUm+yHWxnjxAE04@&_Ujg%|9`@3mhjnm rX=e-B&xkivFNS!8;luTY=?u&akuIV^&zKZffkZuB{an^LB{Ts50JWm; literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/selectphoto_small_grey.png b/TMessagesProj/src/main/res/drawable-xhdpi/selectphoto_small_grey.png new file mode 100755 index 0000000000000000000000000000000000000000..598676b9165e4ab7664a60c72ef9c548cbcda20f GIT binary patch literal 461 zcmV;;0W$uHP)%w0aB^9{sa2cSjGbBY zC-2m+*Un~oo_2O-BpU=l#^sjFINnHr1W14cNZ`K(@~Q*)zOVFs&+|Tw+e2yN{?NH6 z5W+8z0Y1;25{SST!!9P#azY>mp0yFC(b0MV4*bmeDI^PTg@6jY4FXE=rUjJYO$wv} zZ%Uw>7Q6`o2ER-TUbjH%@Hz!z;gOl@z(N76(@msiBfL<6!J}-DgQUby;kg0;ZlLUt z5>kB5+{L#HhAGXAR*Dw3IEk9lt6;PuXMtH zy$|ptkg6&8L>n1L;vDvAhfll{e~>661rzX6M~R5UKIXPocV zgTx)Bj$Dx`GB)wcC`*6xkpKyh011!)36Ow%dkQcBnCg-kN&n|?00000NkvXXu0mjf Dv^>J< literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/gallery.png b/TMessagesProj/src/main/res/drawable-xxhdpi/gallery.png new file mode 100755 index 0000000000000000000000000000000000000000..516f851e8146496cd50f960038e97a1f8eb5ad93 GIT binary patch literal 705 zcmeAS@N?(olHy`uVBq!ia0vp^Q6S901|%(3I5Gh#mUKs7M+S!VC(K#9UIO`&C9V-A z!TD(=<%vb942~)JNvR5+xryniL8*x;m4zo$Z5SAsf<0XvLn>~)xx3dpI#A|Vq3|k> zi9%VKyc=Cxo1ER3F1UNA<|lj15{ny--K&4FFL4%p`yfnwspuc>sEyvWhnJRVzq@o* z)k5RQ^AkG*oP6>o6;HY|`#tmd1)Y^YD~jH|?>gqPFyMv4zsW5O84EZsI57J*u+3uN zHMy`vurlQE^(TqD{kufZUSl+2+*QlpRw^%{G{Z)F*4k!}5*Ab)Q0`k3TZiB0i@)~I zV!oySY2&TsdaH^ZemmN2I&rXe{c2%{-R|c^YWI2H4P&Ew6-WST5*V=7dt~jxIPgr^5I=P!~PW}z8yF29^QtAc);$sD%RAjud;gKiH&t1s`788g?Y2#6-xWv-gDGZ@r^dccVFT*`ZSRtHIW~jJe5ipR!Yr*=_cH(zUJA zpmOQFpYsZYO!vq}Z~pIc^UnY1uZuFWZ*pvGI{nmZZdiSL&AF93oM-8H0^Wp9^TkgIn!j-P$AbTz}>GEUj2^4@8-zC3eZE!%Zz9s6Oo`SEL3&5wS2#-NYW zFUQC)Pv=l|$>zh-i?_UrbAiSfN_3P+s~@bdPj&^xr&Ip^K@|xskrs#_C?ME3Oo*u%CYA& zWesE(T}asTJ${1RM{Tz>zN@BxnSjPKG%zp-FfcGNI5049FfcG?+%G;L`Th9&>72-- z3<^M{3wC|5JHP@{z3y~W7iR%0Cr}Sq7HZHh#cWMAC|m19SPK>SH9 literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/nophotos.9.png b/TMessagesProj/src/main/res/drawable-xxhdpi/nophotos.9.png new file mode 100644 index 0000000000000000000000000000000000000000..123b71b564f2479ab3a6d578daa8858fcb2e5ba2 GIT binary patch literal 2000 zcmeAS@N?(olHy`uVBq!ia0y~yU_1iC9Be?5e%PaVc@GM^3St9Ttzi{9El6ULNn^v^{y%?M;3M8yy1Hc&p0CyuKdu?z*5OlT4oq zUwyR7xBptFo_}VT5UJQD#?0U-;=;fZD8T42LXj>TLsNz!gMf=8i-Q2GAOp(~L_xAg z<{V`JJ0BFC0t177$onl9w%;KJ3`!RPK^FlR0cS@RAQS;Hfx+w8ve~iZoI-~}M-vAS zY5*Bx%wSodde)0u8x**dfTHVIfyq(O1)&Ye1Y~9*$W#G#kQK6HKHyf%=x%cl00m5P95?1*j{p%ef}`jIv?P zwL%_H;H-WuaJ*n|oW0E9g#GvJ&swx8G$|YkE&TCLLd~@A;>(gnb^G;!rcdw@nB0-L zAx3Yp)4~rIve#YBx|n13`{%!u92+^1+iL0sCYQapaFe<8!}-YL?<)K4o|jmO0$t(} zF7RIRc*k~k{ksp0=bvAkv=I~o6Xq!#i=MkT?)|d27qjP;Z;gtrnI9zJDDW_|sUlP6 z@ttokOwHfV*}XUvB(}0i;+UaS@3H0AzkK`l?ZcnsKWnAWrUe6~6lER%So9UX1}fi} zyZtsO&|Y#Rbv&}Yz4&_0>AJr!EI?jd&YN_}`~wdgGl-MJZs=mj^8w`M6tfO__8*|2 zG?G8Ezfc#LLOK+bfUZ+$1DOO)DoCk@A|^u<$AFLLcw}@iHKmz#)H{i9**`<1zd_5Z6#*K@bo-9FypP+Du8BUG`c0e44 zN4^(`?;#72Vu3IaH{g-q1;p#n1&Or)q^<>;?y-RvK-_^#BQYQWh)r?G{ey=4Cvq*& z2I5pa@-u+=0zR+f13W<74o#Za0Lb74gu)gdr~+as9CDwaLGzDX3%r2X4Uc>?G;$fp zu|OV(EAZ$8CCB~5qz-IF1t`210d7&j-1=Z} z1`z|aK>LeBofv_-fG7)I0&yz^wHZ-y01Bp~1nOfYa^rw*MFprhs089~WVVTjN~RBS z)v-veI!8+L!8T}10T-yn(=H{tb0=$hYXk=GVTAIEkP#(EKlP^WZ^&x2I0v9MoFG>bw2jn-j z#fPgbQiB$X6xC?=pq&j|0935oP@|vRiKnLt>c&RUyd%y?g|P~n4kZkHvxVjs00bBS XwFZqS6dhsT00000NkvXXu0mjfrcnUs literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/photobadge.9.png b/TMessagesProj/src/main/res/drawable-xxhdpi/photobadge.9.png new file mode 100644 index 0000000000000000000000000000000000000000..3e4f234a276b4347dd0e6236c1ad92dbe271e9d0 GIT binary patch literal 210 zcmeAS@N?(olHy`uVBq!ia0vp^3P5bd!3HERnn!a2shOTGjv*Dd-rn5E*3H5PcY~Qnc(T_=d#Wzp$P!>qe*1| literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/photoborder.9.png b/TMessagesProj/src/main/res/drawable-xxhdpi/photoborder.9.png new file mode 100644 index 0000000000000000000000000000000000000000..b46d44547cbc2e5eaa53516c875c1ee9bf2066be GIT binary patch literal 277 zcmeAS@N?(olHy`uVBq!ia0vp^Ng&L@1|(N6W#a=~)y|a9VG%_d(D10$Kuup{7G^jBgLvDd)Vx58{LutdF9utSezU%aH$YmhO9Zpg$QrUHx3v IIVCg!01F01WB>pF literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/selectphoto_large.png b/TMessagesProj/src/main/res/drawable-xxhdpi/selectphoto_large.png new file mode 100755 index 0000000000000000000000000000000000000000..d22cfb8ff612b28f0b79f3201a1d403b2b4c778e GIT binary patch literal 698 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGoEa{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+AuIM`FOfGhE&{obJyC7IZ@F`QG!?(38;V0qtf2I){OQgMmSSfkA6QAD_=u&S4aIzQy>*^Nm6e(O`exw98HLU3 zAMR#;=^Z$C=9bw9zV8aS{xR4gs(iAnzqYG* z-(%ARjlU5^M|_oJf3DB9`!qX_ImqEe+Mi_%vp6Dq-!m;}oN)KYItD|*O)~e{9e7%D zj(=wr5K?^ov6iXD;Y3}{eTL!|eSQwLWBiN{m=B)$v5+A~z^7MUXaQ%_&X1?dnEvz6 z47Ia<9#!@8`=O}yk1G8y-CYtNkv-u8!)m2H-rLvq%5x`#vJ^i)zDN5}+%EmUX*GLq z2fb2CvEO&B)=~A4+MdBTCLVbQ9mL?KtKdU zKm@K7iIeu#jaIG0nY)X2fXL8iuqWm%i7Tep~uc2Lk=tqzUP9~Fi3+?XVCe{(! zeUJ#w($dm9Xm=m-8g5>u^GF^FARjm>$m@{ZZbz_C0Eyr%E-t=DoT1ZjvOUGI(f zg;E7a6v)Ogu>)OPc5qk3hVD2bKsHVkL1L`Xw6e02#)4A}*GEN=RKpPkG7*6lmd#dd}V>RJT_o6>+=**`w#U13NoApSZeiIiJtJfc1lr7rY>;iX#Hlj&<9< zy}i8;F2(Qi#>U1=`21?4NGjt915Hm)4;&pGzFAc(XZpy?_1xN@9qO!ie{tDWSK;B3s z61QaIs08E-DISlH1%aa)kTBBW;o)WwI4S~(A_an@Dv%T;88|8forSd73>?*g>LSg~ z&OWPDD!<)uvf1oc4yVTtjt)R>NUT0|dv0!S%89hLw)RCPjut@NRl0rM)`@4(cV}j1 zp4domxc?06l90o)aI^ucgY9)g_AQqv8? zEojD}$OxhzJfRUpKme3g_bCnYa8O_p>~LUF5@_T&A^>HGq#k?0yUTk)(VXZnEVT~b zIljn0f018(RxESM2bV(0d4 zPg|f-P}8ujz2UR8anaT{JbzvKW$SKVF|3*%{@mn%VfO2$%^fB|B^KKpHcy&7&8bW1 zINOPs1A87lshzm!=*GRxYK#*W9V@J4_f&H2f6S!Px`gSt=m~L8-ah^b+LN?o;uokb zS+A;6Y9Zv1J2B+Z46n8CW-R#rqVD9r{4bJsJ0I70z^>d0))}kL>c?;jqDs<|P;k}f`=qc-W0;oo_ zsv|CyYw{

yEXNs=y$1QD8Czhb@o+3}&9jsAujCj0|c#>hIQWljs0OK7*&LpUXO@ GgeCx%YUZ{8 literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/selectphoto_small_grey.png b/TMessagesProj/src/main/res/drawable-xxhdpi/selectphoto_small_grey.png new file mode 100755 index 0000000000000000000000000000000000000000..935604b4d8aa4663740c582faa435c7be5f189f0 GIT binary patch literal 586 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@ZgvM!Ea{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+AuIM-tlyC45_&F=C+~t5d#tS4{^GF zO%KWij@&$Y)mLEo;j;&q&Yr#b0eeBQ7T0zej$fQ}_8vW&uef8!izh+x3av%y>oX@` z|DyWe-p1+nViWsW*^?iurADfG6bA_~a5yk92{bUUC@?5O8Hp!z`~yT@BJGa&M5cDej%W724Ig}AQko;3b#LX|w!X!az8=_lZFceB z$>)n#Sj>I5Ky}V4=i*hFD=dyVRGodgVqx+&kHtp~*%p=e#%J}djFVOFm0EsTKzWJ$ zagW8vU;Ys(?oeS`em(gf<0OeW_w>8OJQfwKStiBi(eLf?s9??WBwY__Q(o}O zd2n}H=%s(o^i+|-=)Ty$zb9+2(&U!De(po&5 zgX{UE)lRq8Ds~%o8&U{e+`Cpqv149c^STk}k0t5YtVm%WNgXxEZ V+=*H@DuIcC!PC{xWt~$(69C^m?dSji literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable/bar_selector_picker.xml b/TMessagesProj/src/main/res/drawable/bar_selector_picker.xml new file mode 100644 index 000000000..3a705f195 --- /dev/null +++ b/TMessagesProj/src/main/res/drawable/bar_selector_picker.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TMessagesProj/src/main/res/layout/media_photo_layout.xml b/TMessagesProj/src/main/res/layout/media_photo_layout.xml index b60a04d28..c3a16aae9 100644 --- a/TMessagesProj/src/main/res/layout/media_photo_layout.xml +++ b/TMessagesProj/src/main/res/layout/media_photo_layout.xml @@ -1,10 +1,11 @@ - - + + + android:layout_height="fill_parent"/> + \ No newline at end of file diff --git a/TMessagesProj/src/main/res/layout/media_video_layout.xml b/TMessagesProj/src/main/res/layout/media_video_layout.xml index 6bcdc3293..810f77f3b 100644 --- a/TMessagesProj/src/main/res/layout/media_video_layout.xml +++ b/TMessagesProj/src/main/res/layout/media_video_layout.xml @@ -6,8 +6,7 @@ + android:layout_height="fill_parent"/> + + + + + + + + + + + + \ No newline at end of file diff --git a/TMessagesProj/src/main/res/layout/photo_picker_bottom_layout.xml b/TMessagesProj/src/main/res/layout/photo_picker_bottom_layout.xml new file mode 100644 index 000000000..07777cb07 --- /dev/null +++ b/TMessagesProj/src/main/res/layout/photo_picker_bottom_layout.xml @@ -0,0 +1,69 @@ + + +