mirror of
https://github.com/wrwrabbit/Partisan-Telegram-Android.git
synced 2026-05-05 15:41:02 +00:00
merge original
This commit is contained in:
commit
cd9a547d27
343 changed files with 48558 additions and 17070 deletions
|
|
@ -49,7 +49,6 @@ import android.net.Uri;
|
|||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.SystemClock;
|
||||
import android.os.Vibrator;
|
||||
import android.provider.Settings;
|
||||
import android.text.Layout;
|
||||
import android.text.Spannable;
|
||||
|
|
@ -696,13 +695,15 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
|
||||
if (DialogObject.isChatDialog(dialogId)) {
|
||||
TLRPC.Chat currentChat = MessagesController.getInstance(currentAccount).getChat(-dialogId);
|
||||
if (currentChat != null && currentChat.username != null) {
|
||||
url1 = "https://t.me/" + currentChat.username + "/" + messageId + "?t=" + finalTimestamp;
|
||||
String username = ChatObject.getPublicUsername(currentChat);
|
||||
if (username != null) {
|
||||
url1 = "https://t.me/" + username + "/" + messageId + "?t=" + finalTimestamp;
|
||||
}
|
||||
} else {
|
||||
TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(dialogId);
|
||||
if (user != null && user.username != null) {
|
||||
url1 = "https://t.me/" + user.username + "/" + messageId + "?t=" + finalTimestamp;
|
||||
String username = UserObject.getPublicUsername(user);
|
||||
if (user != null && username != null) {
|
||||
url1 = "https://t.me/" + username + "/" + messageId + "?t=" + finalTimestamp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1159,6 +1160,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
private boolean canEditAvatar;
|
||||
private boolean isEvent;
|
||||
private int sharedMediaType;
|
||||
private int topicId;
|
||||
private long currentDialogId;
|
||||
private long mergeDialogId;
|
||||
private int totalImagesCount;
|
||||
|
|
@ -3361,17 +3363,18 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
}
|
||||
} else if (id == NotificationCenter.mediaCountDidLoad) {
|
||||
long uid = (Long) args[0];
|
||||
if (uid == currentDialogId || uid == mergeDialogId) {
|
||||
int topicId = (Integer) args[1];
|
||||
if (this.topicId == topicId && (uid == currentDialogId || uid == mergeDialogId)) {
|
||||
if (currentMessageObject == null || MediaDataController.getMediaType(currentMessageObject.messageOwner) == sharedMediaType) {
|
||||
if (uid == currentDialogId) {
|
||||
totalImagesCount = (Integer) args[1];
|
||||
totalImagesCount = (Integer) args[2];
|
||||
} else {
|
||||
totalImagesCountMerge = (Integer) args[1];
|
||||
totalImagesCountMerge = (Integer) args[2];
|
||||
}
|
||||
if (needSearchImageInArr && isFirstLoading) {
|
||||
isFirstLoading = false;
|
||||
loadingMoreImages = true;
|
||||
MediaDataController.getInstance(currentAccount).loadMedia(currentDialogId, 20, 0, 0, sharedMediaType, 1, classGuid, 0);
|
||||
MediaDataController.getInstance(currentAccount).loadMedia(currentDialogId, 20, 0, 0, sharedMediaType, topicId, 1, classGuid, 0);
|
||||
} else if (!imagesArr.isEmpty()) {
|
||||
if (opennedFromMedia) {
|
||||
actionBar.setTitle(LocaleController.formatString("Of", R.string.Of, startOffset + currentIndex + 1, totalImagesCount + totalImagesCountMerge));
|
||||
|
|
@ -3466,7 +3469,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
|
||||
if (!endReached[loadIndex]) {
|
||||
loadingMoreImages = true;
|
||||
MediaDataController.getInstance(currentAccount).loadMedia(loadIndex == 0 ? currentDialogId : mergeDialogId, 40, loadFromMaxId, 0, sharedMediaType, 1, classGuid, 0);
|
||||
MediaDataController.getInstance(currentAccount).loadMedia(loadIndex == 0 ? currentDialogId : mergeDialogId, 40, loadFromMaxId, 0, sharedMediaType, topicId, 1, classGuid, 0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -3937,7 +3940,28 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
animatingImageView.setAnimationValues(animationValues);
|
||||
windowView.addView(animatingImageView, LayoutHelper.createFrame(40, 40));
|
||||
|
||||
containerView = new FrameLayoutDrawer(activity);
|
||||
containerView = new FrameLayoutDrawer(activity) {
|
||||
private Bulletin.Delegate delegate = new Bulletin.Delegate() {
|
||||
@Override
|
||||
public int getBottomOffset(int tag) {
|
||||
return getHeight() - captionEditText.getTop();
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
|
||||
Bulletin.addDelegate(this, delegate);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
|
||||
Bulletin.removeDelegate(this);
|
||||
}
|
||||
};
|
||||
containerView.setFocusable(false);
|
||||
|
||||
containerView.setClipChildren(true);
|
||||
|
|
@ -4047,30 +4071,115 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
return;
|
||||
}
|
||||
|
||||
File f = null;
|
||||
final boolean isVideo;
|
||||
if (currentMessageObject != null) {
|
||||
if (MessageObject.getMedia(currentMessageObject.messageOwner) instanceof TLRPC.TL_messageMediaWebPage && MessageObject.getMedia(currentMessageObject.messageOwner).webpage != null && MessageObject.getMedia(currentMessageObject.messageOwner).webpage.document == null) {
|
||||
TLObject fileLocation = getFileLocation(currentIndex, null);
|
||||
f = FileLoader.getInstance(currentAccount).getPathToAttach(fileLocation, true);
|
||||
} else {
|
||||
f = FileLoader.getInstance(currentAccount).getPathToMessage(currentMessageObject.messageOwner);
|
||||
}
|
||||
isVideo = currentMessageObject.isVideo();
|
||||
} else if (currentFileLocationVideo != null) {
|
||||
f = FileLoader.getInstance(currentAccount).getPathToAttach(getFileLocation(currentFileLocationVideo), getFileLocationExt(currentFileLocationVideo), avatarsDialogId != 0 || isEvent);
|
||||
isVideo = false;
|
||||
} else if (pageBlocksAdapter != null) {
|
||||
f = pageBlocksAdapter.getFile(currentIndex);
|
||||
isVideo = pageBlocksAdapter.isVideo(currentIndex);
|
||||
ArrayList<MessageObject> msgs = new ArrayList<>(1);
|
||||
MessageObject.GroupedMessages group = parentChatActivity != null ? parentChatActivity.getGroup(currentMessageObject.getGroupId()) : null;
|
||||
if (group != null) {
|
||||
msgs.addAll(group.messages);
|
||||
} else {
|
||||
isVideo = false;
|
||||
msgs.add(currentMessageObject);
|
||||
}
|
||||
|
||||
if (f != null && f.exists()) {
|
||||
MediaController.saveFile(f.toString(), parentActivity, isVideo ? 1 : 0, null, null, () -> BulletinFactory.createSaveToGalleryBulletin(containerView, isVideo, 0xf9222222, 0xffffffff).show());
|
||||
if (msgs.size() <= 1) {
|
||||
File f = null;
|
||||
final boolean isVideo;
|
||||
if (currentMessageObject != null) {
|
||||
if (MessageObject.getMedia(currentMessageObject.messageOwner) instanceof TLRPC.TL_messageMediaWebPage && MessageObject.getMedia(currentMessageObject.messageOwner).webpage != null && MessageObject.getMedia(currentMessageObject.messageOwner).webpage.document == null) {
|
||||
TLObject fileLocation = getFileLocation(currentIndex, null);
|
||||
f = FileLoader.getInstance(currentAccount).getPathToAttach(fileLocation, true);
|
||||
} else {
|
||||
f = FileLoader.getInstance(currentAccount).getPathToMessage(currentMessageObject.messageOwner);
|
||||
}
|
||||
isVideo = currentMessageObject.isVideo();
|
||||
} else if (currentFileLocationVideo != null) {
|
||||
f = FileLoader.getInstance(currentAccount).getPathToAttach(getFileLocation(currentFileLocationVideo), getFileLocationExt(currentFileLocationVideo), avatarsDialogId != 0 || isEvent);
|
||||
isVideo = false;
|
||||
} else if (pageBlocksAdapter != null) {
|
||||
f = pageBlocksAdapter.getFile(currentIndex);
|
||||
isVideo = pageBlocksAdapter.isVideo(currentIndex);
|
||||
} else {
|
||||
isVideo = false;
|
||||
}
|
||||
|
||||
if (f != null && f.exists()) {
|
||||
MediaController.saveFile(f.toString(), parentActivity, isVideo ? 1 : 0, null, null, () -> BulletinFactory.createSaveToGalleryBulletin(containerView, isVideo, 0xf9222222, 0xffffffff).show());
|
||||
} else {
|
||||
showDownloadAlert();
|
||||
}
|
||||
} else {
|
||||
showDownloadAlert();
|
||||
boolean isVideo_ = false;
|
||||
for (int i = 0; i < msgs.size() && !isVideo_; ++i) {
|
||||
if (msgs.get(i).isVideo()) {
|
||||
isVideo_ = true;
|
||||
}
|
||||
}
|
||||
final boolean isVideo = isVideo_;
|
||||
AlertDialog dialog = new AlertDialog.Builder(parentActivity, resourcesProvider)
|
||||
.setTitle(LocaleController.getString("SaveGroupMedia", R.string.SaveGroupMedia))
|
||||
.setMessage(LocaleController.getString("SaveGroupMediaMessage", R.string.SaveGroupMediaMessage))
|
||||
.setDialogButtonColorKey(Theme.key_voipgroup_listeningText)
|
||||
.setNegativeButton((!isVideo ? LocaleController.getString("ThisPhoto", R.string.ThisPhoto) : LocaleController.getString("ThisMedia", R.string.ThisMedia)), (di, a) -> {
|
||||
if (currentMessageObject == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
File f;
|
||||
if (MessageObject.getMedia(currentMessageObject.messageOwner) instanceof TLRPC.TL_messageMediaWebPage && MessageObject.getMedia(currentMessageObject.messageOwner).webpage != null && MessageObject.getMedia(currentMessageObject.messageOwner).webpage.document == null) {
|
||||
TLObject fileLocation = getFileLocation(currentIndex, null);
|
||||
f = FileLoader.getInstance(currentAccount).getPathToAttach(fileLocation, true);
|
||||
} else {
|
||||
f = FileLoader.getInstance(currentAccount).getPathToMessage(currentMessageObject.messageOwner);
|
||||
}
|
||||
boolean isThisVideo = currentMessageObject.isVideo();
|
||||
|
||||
if (f != null && f.exists()) {
|
||||
MediaController.saveFile(f.toString(), parentActivity, isThisVideo ? 1 : 0, null, null, () -> BulletinFactory.createSaveToGalleryBulletin(containerView, isThisVideo, 0xf9222222, 0xffffffff).show());
|
||||
} else {
|
||||
showDownloadAlert();
|
||||
}
|
||||
})
|
||||
.setPositiveButton(!isVideo ? LocaleController.formatPluralString("AllNPhotos", msgs.size()) : LocaleController.formatPluralString("AllNMedia", msgs.size()), (di, a) -> {
|
||||
final int[] count = new int[1];
|
||||
final int[] done = new int[1];
|
||||
Runnable bulletin = () -> {
|
||||
done[0]++;
|
||||
if (done[0] == count[0]) {
|
||||
BulletinFactory.createSaveToGalleryBulletin(containerView, count[0], isVideo, 0xf9222222, 0xffffffff).show();
|
||||
}
|
||||
};
|
||||
for (int i = 0; i < msgs.size(); ++i) {
|
||||
MessageObject msg = msgs.get(i);
|
||||
if (msg == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
File f;
|
||||
if (MessageObject.getMedia(msg.messageOwner) instanceof TLRPC.TL_messageMediaWebPage && MessageObject.getMedia(msg.messageOwner).webpage != null && MessageObject.getMedia(msg.messageOwner).webpage.document == null) {
|
||||
f = FileLoader.getInstance(currentAccount).getPathToAttach(getFileLocation(currentIndex, null), true);
|
||||
} else {
|
||||
f = FileLoader.getInstance(currentAccount).getPathToMessage(msg.messageOwner);
|
||||
}
|
||||
boolean isThisVideo = msg.isVideo();
|
||||
|
||||
if (f != null && f.exists()) {
|
||||
count[0]++;
|
||||
MediaController.saveFile(f.toString(), parentActivity, isThisVideo ? 1 : 0, null, null, () -> AndroidUtilities.runOnUIThread(bulletin));
|
||||
}
|
||||
}
|
||||
})
|
||||
.setNeutralButton(LocaleController.getString("Cancel", R.string.Cancel), (di, a) -> {
|
||||
di.dismiss();
|
||||
}).create();
|
||||
dialog.setBackgroundColor(getThemedColor(Theme.key_voipgroup_dialogBackground));
|
||||
dialog.show();
|
||||
View neutralButton = dialog.getButton(Dialog.BUTTON_NEUTRAL);
|
||||
if (neutralButton instanceof TextView) {
|
||||
((TextView) neutralButton).setTextColor(getThemedColor(Theme.key_dialogTextRed));
|
||||
neutralButton.setBackground(Theme.getRoundRectSelectorDrawable(getThemedColor(Theme.key_dialogTextRed)));
|
||||
if (dialog.getButtonsLayout() instanceof LinearLayout && ((LinearLayout) dialog.getButtonsLayout()).getOrientation() == LinearLayout.VERTICAL) {
|
||||
neutralButton.bringToFront();
|
||||
}
|
||||
}
|
||||
dialog.setTextColor(getThemedColor(Theme.key_voipgroup_actionBarItems));
|
||||
}
|
||||
} else if (id == gallery_menu_showall) {
|
||||
if (currentDialogId != 0) {
|
||||
|
|
@ -4129,53 +4238,51 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
}
|
||||
}
|
||||
((LaunchActivity) parentActivity).switchToAccount(currentMessageObject.currentAccount, true);
|
||||
if (isChannel) {
|
||||
ArrayList<MessageObject> msgs = new ArrayList<>(1);
|
||||
MessageObject.GroupedMessages group = parentChatActivity != null ? parentChatActivity.getGroup(currentMessageObject.getGroupId()) : null;
|
||||
if (group != null) {
|
||||
msgs.addAll(group.messages);
|
||||
} else {
|
||||
msgs.add(currentMessageObject);
|
||||
ArrayList<MessageObject> msgs = new ArrayList<>(1);
|
||||
MessageObject.GroupedMessages group = parentChatActivity != null ? parentChatActivity.getGroup(currentMessageObject.getGroupId()) : null;
|
||||
if (group != null) {
|
||||
msgs.addAll(group.messages);
|
||||
} else {
|
||||
msgs.add(currentMessageObject);
|
||||
}
|
||||
|
||||
if (isChannel && msgs.size() <= 1) {
|
||||
showShareAlert(msgs);
|
||||
} else if (msgs.size() > 1) {
|
||||
boolean photos = true;
|
||||
for (int i = 0; i < msgs.size(); ++i) {
|
||||
if (!msgs.get(i).isPhoto() || msgs.get(i).isVideo()) {
|
||||
photos = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (msgs.size() <= 1) {
|
||||
showShareAlert(msgs);
|
||||
} else {
|
||||
boolean photos = true;
|
||||
for (int i = 0; i < msgs.size(); ++i) {
|
||||
if (!msgs.get(i).isPhoto() || msgs.get(i).isVideo()) {
|
||||
photos = false;
|
||||
break;
|
||||
}
|
||||
AlertDialog dialog = new AlertDialog.Builder(parentActivity, resourcesProvider)
|
||||
.setTitle(LocaleController.getString("ForwardGroupMedia", R.string.ForwardGroupMedia))
|
||||
.setMessage(LocaleController.getString("ForwardGroupMediaMessage", R.string.ForwardGroupMediaMessage))
|
||||
.setDialogButtonColorKey(Theme.key_voipgroup_listeningText)
|
||||
.setNegativeButton((photos ? LocaleController.getString("ThisPhoto", R.string.ThisPhoto) : LocaleController.getString("ThisMedia", R.string.ThisMedia)), (di, a) -> {
|
||||
ArrayList<MessageObject> singleMessage = new ArrayList<>(1);
|
||||
singleMessage.add(currentMessageObject);
|
||||
showShareAlert(singleMessage);
|
||||
})
|
||||
.setPositiveButton(photos ? LocaleController.formatPluralString("AllNPhotos", msgs.size()) : LocaleController.formatPluralString("AllNMedia", msgs.size()), (di, a) -> {
|
||||
showShareAlert(msgs);
|
||||
})
|
||||
.setNeutralButton(LocaleController.getString("Cancel", R.string.Cancel), (di, a) -> {
|
||||
di.dismiss();
|
||||
}).create();
|
||||
dialog.setBackgroundColor(getThemedColor(Theme.key_voipgroup_dialogBackground));
|
||||
dialog.show();
|
||||
View neutralButton = dialog.getButton(Dialog.BUTTON_NEUTRAL);
|
||||
if (neutralButton instanceof TextView) {
|
||||
((TextView) neutralButton).setTextColor(getThemedColor(Theme.key_dialogTextRed));
|
||||
neutralButton.setBackground(Theme.getRoundRectSelectorDrawable(getThemedColor(Theme.key_dialogTextRed)));
|
||||
if (dialog.getButtonsLayout() instanceof LinearLayout && ((LinearLayout) dialog.getButtonsLayout()).getOrientation() == LinearLayout.VERTICAL) {
|
||||
neutralButton.bringToFront();
|
||||
}
|
||||
|
||||
AlertDialog dialog = new AlertDialog.Builder(parentActivity, resourcesProvider)
|
||||
.setTitle(LocaleController.getString("ForwardGroupMedia", R.string.ForwardGroupMedia))
|
||||
.setMessage(LocaleController.getString("ForwardGroupMediaMessage", R.string.ForwardGroupMediaMessage))
|
||||
.setDialogButtonColorKey(Theme.key_voipgroup_listeningText)
|
||||
.setNegativeButton((photos ? LocaleController.getString("ThisPhoto", R.string.ThisPhoto) : LocaleController.getString("ThisMedia", R.string.ThisMedia)), (di, a) -> {
|
||||
ArrayList<MessageObject> singleMessage = new ArrayList<>(1);
|
||||
singleMessage.add(currentMessageObject);
|
||||
showShareAlert(singleMessage);
|
||||
})
|
||||
.setPositiveButton(photos ? LocaleController.formatPluralString("AllNPhotos", msgs.size()) : LocaleController.formatPluralString("AllNMedia", msgs.size()), (di, a) -> {
|
||||
showShareAlert(msgs);
|
||||
})
|
||||
.setNeutralButton(LocaleController.getString("Cancel", R.string.Cancel), (di, a) -> {
|
||||
di.dismiss();
|
||||
}).create();
|
||||
dialog.setBackgroundColor(getThemedColor(Theme.key_voipgroup_dialogBackground));
|
||||
dialog.show();
|
||||
View neutralButton = dialog.getButton(Dialog.BUTTON_NEUTRAL);
|
||||
if (neutralButton instanceof TextView) {
|
||||
((TextView) neutralButton).setTextColor(getThemedColor(Theme.key_dialogTextRed));
|
||||
neutralButton.setBackground(Theme.getRoundRectSelectorDrawable(getThemedColor(Theme.key_dialogTextRed)));
|
||||
if (dialog.getButtonsLayout() instanceof LinearLayout && ((LinearLayout) dialog.getButtonsLayout()).getOrientation() == LinearLayout.VERTICAL) {
|
||||
neutralButton.bringToFront();
|
||||
}
|
||||
}
|
||||
dialog.setTextColor(getThemedColor(Theme.key_voipgroup_actionBarItems));
|
||||
}
|
||||
dialog.setTextColor(getThemedColor(Theme.key_voipgroup_actionBarItems));
|
||||
} else {
|
||||
Bundle args = new Bundle();
|
||||
args.putBoolean("onlySelect", true);
|
||||
|
|
@ -4185,9 +4292,9 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
fmessages.add(currentMessageObject);
|
||||
final ChatActivity parentChatActivityFinal = parentChatActivity;
|
||||
fragment.setDelegate((fragment1, dids, message, param) -> {
|
||||
if (dids.size() > 1 || dids.get(0) == UserConfig.getInstance(currentAccount).getClientUserId() || message != null) {
|
||||
if (dids.size() > 1 || dids.get(0).dialogId == UserConfig.getInstance(currentAccount).getClientUserId() || message != null) {
|
||||
for (int a = 0; a < dids.size(); a++) {
|
||||
long did = dids.get(a);
|
||||
long did = dids.get(a).dialogId;
|
||||
if (message != null) {
|
||||
SendMessagesHelper.getInstance(currentAccount).sendMessage(message.toString(), did, null, null, null, true, null, null, null, true, 0, null, false);
|
||||
}
|
||||
|
|
@ -4196,13 +4303,13 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
fragment1.finishFragment();
|
||||
if (parentChatActivityFinal != null) {
|
||||
if (dids.size() == 1) {
|
||||
parentChatActivityFinal.getUndoView().showWithAction(dids.get(0), UndoView.ACTION_FWD_MESSAGES, fmessages.size());
|
||||
parentChatActivityFinal.getUndoView().showWithAction(dids.get(0).dialogId, UndoView.ACTION_FWD_MESSAGES, fmessages.size());
|
||||
} else {
|
||||
parentChatActivityFinal.getUndoView().showWithAction(0, UndoView.ACTION_FWD_MESSAGES, fmessages.size(), dids.size(), null, null);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
long did = dids.get(0);
|
||||
long did = dids.get(0).dialogId;
|
||||
Bundle args1 = new Bundle();
|
||||
args1.putBoolean("scrollToTopOnResume", true);
|
||||
if (DialogObject.isEncryptedDialog(did)) {
|
||||
|
|
@ -5286,10 +5393,13 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
pickerViewSendButton.setContentDescription(LocaleController.getString("Send", R.string.Send));
|
||||
pickerViewSendButton.setOnClickListener(v -> {
|
||||
if (captionEditText.getCaptionLimitOffset() < 0) {
|
||||
AndroidUtilities.shakeView(captionLimitView, 2, 0);
|
||||
Vibrator vibrator = (Vibrator) captionLimitView.getContext().getSystemService(Context.VIBRATOR_SERVICE);
|
||||
if (vibrator != null) {
|
||||
vibrator.vibrate(200);
|
||||
AndroidUtilities.shakeView(captionLimitView);
|
||||
try {
|
||||
captionLimitView.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
|
||||
} catch (Exception ignored) {}
|
||||
|
||||
if (!MessagesController.getInstance(currentAccount).premiumLocked && MessagesController.getInstance(currentAccount).captionLengthLimitPremium > captionEditText.getCodePointCount()) {
|
||||
showCaptionLimitBulletin(containerView);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -5997,7 +6107,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
ignoreDidSetImage = false;
|
||||
});
|
||||
|
||||
captionEditText = new PhotoViewerCaptionEnterView(activityContext, containerView, windowView, resourcesProvider) {
|
||||
captionEditText = new PhotoViewerCaptionEnterView(this, activityContext, containerView, windowView, resourcesProvider) {
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||
try {
|
||||
|
|
@ -6157,6 +6267,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
|
||||
if (mentionListViewVisible && getVisibility() == VISIBLE && mentionListAnimation == null) {
|
||||
setTranslationY(h - oldh);
|
||||
mentionListView.setTranslationY(MathUtils.clamp(mentionListView.getTranslationY(), Math.min(h - oldh, 0), Math.max(h - oldh, 0)));
|
||||
mentionListAnimation = new SpringAnimation(this, DynamicAnimation.TRANSLATION_Y)
|
||||
.setMinValue(Math.min(h - oldh, 0))
|
||||
.setMaxValue(Math.max(h - oldh, 0))
|
||||
|
|
@ -6216,6 +6327,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
mentionListView.setVisibility(View.VISIBLE);
|
||||
mentionListViewVisible = true;
|
||||
mentionListView.setTranslationY(AndroidUtilities.dp(height));
|
||||
mentionListView.setTranslationY(MathUtils.clamp(mentionListView.getTranslationY(), 0, AndroidUtilities.dp(height)));
|
||||
mentionListAnimation = new SpringAnimation(mentionListView, DynamicAnimation.TRANSLATION_Y)
|
||||
.setMinValue(0)
|
||||
.setMaxValue(AndroidUtilities.dp(height))
|
||||
|
|
@ -6243,6 +6355,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
}
|
||||
if (allowMentions) {
|
||||
mentionListViewVisible = false;
|
||||
mentionListView.setTranslationY(MathUtils.clamp(mentionListView.getTranslationY(), 0, mentionListView.getMeasuredHeight()));
|
||||
mentionListAnimation = new SpringAnimation(mentionListView, DynamicAnimation.TRANSLATION_Y)
|
||||
.setMinValue(0)
|
||||
.setMaxValue(mentionListView.getMeasuredHeight())
|
||||
|
|
@ -6279,8 +6392,9 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
int len = mentionsAdapter.getResultLength();
|
||||
if (object instanceof TLRPC.User) {
|
||||
TLRPC.User user = (TLRPC.User) object;
|
||||
if (user.username != null) {
|
||||
captionEditText.replaceWithText(start, len, "@" + user.username + " ", false);
|
||||
String username = UserObject.getPublicUsername(user);
|
||||
if (username != null) {
|
||||
captionEditText.replaceWithText(start, len, "@" + username + " ", false);
|
||||
} else {
|
||||
String name = UserObject.getFirstName(user);
|
||||
Spannable spannable = new SpannableString(name + " ");
|
||||
|
|
@ -6320,7 +6434,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity, resourcesProvider);
|
||||
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
|
||||
builder.setMessage(LocaleController.getString("ClearSearch", R.string.ClearSearch));
|
||||
builder.setPositiveButton(LocaleController.getString("ClearButton", R.string.ClearButton).toUpperCase(), (dialogInterface, i) -> mentionsAdapter.clearRecentHashtags());
|
||||
builder.setPositiveButton(LocaleController.getString("ClearButton", R.string.ClearButton), (dialogInterface, i) -> mentionsAdapter.clearRecentHashtags());
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
showAlertDialog(builder);
|
||||
return true;
|
||||
|
|
@ -6341,6 +6455,25 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
}
|
||||
}
|
||||
|
||||
public void showCaptionLimitBulletin(FrameLayout view) {
|
||||
if (!(parentFragment instanceof ChatActivity) || !ChatObject.isChannelAndNotMegaGroup(((ChatActivity) parentFragment).getCurrentChat())) {
|
||||
return;
|
||||
}
|
||||
BulletinFactory.of(view, resourcesProvider).createCaptionLimitBulletin(MessagesController.getInstance(currentAccount).captionLengthLimitPremium, ()->{
|
||||
closePhoto(false, false);
|
||||
if (parentAlert != null) {
|
||||
parentAlert.dismiss(true);
|
||||
}
|
||||
if (parentFragment != null) {
|
||||
parentFragment.presentFragment(new PremiumPreviewFragment("caption_limit"));
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
|
||||
public ChatAttachAlert getParentAlert() {
|
||||
return parentAlert;
|
||||
}
|
||||
|
||||
private ValueAnimator navBarAnimator;
|
||||
private void animateNavBarColorTo(int color) {
|
||||
animateNavBarColorTo(color, true);
|
||||
|
|
@ -6421,8 +6554,10 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
if (videoEditedInfo != null) {
|
||||
long sizeToCheck = (long) (videoEditedInfo.estimatedSize * 0.9f);
|
||||
if ((sizeToCheck > FileLoader.DEFAULT_MAX_FILE_SIZE && !UserConfig.getInstance(currentAccount).isPremium()) || sizeToCheck > FileLoader.DEFAULT_MAX_FILE_SIZE_PREMIUM) {
|
||||
LimitReachedBottomSheet limitReachedBottomSheet = new LimitReachedBottomSheet(parentAlert.getBaseFragment(), parentAlert.getContainer().getContext(), LimitReachedBottomSheet.TYPE_LARGE_FILE, UserConfig.selectedAccount);
|
||||
limitReachedBottomSheet.show();
|
||||
if (parentAlert != null) {
|
||||
LimitReachedBottomSheet limitReachedBottomSheet = new LimitReachedBottomSheet(parentAlert.getBaseFragment(), parentAlert.getContainer().getContext(), LimitReachedBottomSheet.TYPE_LARGE_FILE, UserConfig.selectedAccount);
|
||||
limitReachedBottomSheet.show();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -6459,7 +6594,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
final boolean finalOpenKeyboardOnShareAlertClose = openKeyboardOnShareAlertClose;
|
||||
ShareAlert alert = new ShareAlert(parentActivity, parentChatActivity, messages, null, null, false, null, null, false, true, null) {
|
||||
@Override
|
||||
protected void onSend(LongSparseArray<TLRPC.Dialog> dids, int count) {
|
||||
protected void onSend(LongSparseArray<TLRPC.Dialog> dids, int count, TLRPC.TL_forumTopic topic) {
|
||||
AndroidUtilities.runOnUIThread(() -> {
|
||||
BulletinFactory.createForwardedBulletin(parentActivity, photoContainerView, dids.size(), dids.size() == 1 ? dids.valueAt(0).id : 0, count, 0xf9222222, 0xffffffff).show();
|
||||
}, 250);
|
||||
|
|
@ -6873,8 +7008,12 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
pipAnimationInProgress = false;
|
||||
switchToInlineRunnable.run();
|
||||
AndroidUtilities.runOnUIThread(()->{
|
||||
videoTextureView.setOutlineProvider(null);
|
||||
textureImageView.setOutlineProvider(null);
|
||||
if (videoTextureView != null) {
|
||||
videoTextureView.setOutlineProvider(null);
|
||||
}
|
||||
if (textureImageView != null) {
|
||||
textureImageView.setOutlineProvider(null);
|
||||
}
|
||||
if (firstFrameView != null) {
|
||||
firstFrameView.setOutlineProvider(null);
|
||||
}
|
||||
|
|
@ -7750,6 +7889,48 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
if (photoViewerWebView != null && photoViewerWebView.isControllable() && !playWhenReady) {
|
||||
toggleActionBar(true, true);
|
||||
}
|
||||
if (photoViewerWebView != null && photoViewerWebView.isControllable() && playbackState == ExoPlayer.STATE_READY && getVideoDuration() >= 10000 && shouldSavePositionForCurrentVideo == null && shouldSavePositionForCurrentVideoShortTerm == null) {
|
||||
if (currentMessageObject != null) {
|
||||
final long duration = getVideoDuration() / 1000L;
|
||||
final String name = currentMessageObject.messageOwner != null && currentMessageObject.messageOwner.media != null && currentMessageObject.messageOwner.media.webpage != null ? currentMessageObject.messageOwner.media.webpage.url : null;
|
||||
if (!TextUtils.isEmpty(name)) {
|
||||
if (duration >= 10 * 60) {
|
||||
if (currentMessageObject.forceSeekTo < 0) {
|
||||
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("media_saved_pos", Activity.MODE_PRIVATE);
|
||||
float pos = preferences.getFloat(name, -1);
|
||||
if (pos > 0 && pos < 0.999f) {
|
||||
currentMessageObject.forceSeekTo = pos;
|
||||
videoPlayerSeekbar.setProgress(pos);
|
||||
}
|
||||
}
|
||||
shouldSavePositionForCurrentVideo = name;
|
||||
} else if (duration >= 10) {
|
||||
SavedVideoPosition videoPosition = null;
|
||||
for (int i = savedVideoPositions.size() - 1; i >= 0; i--) {
|
||||
final SavedVideoPosition item = savedVideoPositions.valueAt(i);
|
||||
if (item.timestamp < SystemClock.elapsedRealtime() - 5 * 1000) {
|
||||
savedVideoPositions.removeAt(i);
|
||||
} else if (videoPosition == null && savedVideoPositions.keyAt(i).equals(name)) {
|
||||
videoPosition = item;
|
||||
}
|
||||
}
|
||||
if (currentMessageObject.forceSeekTo < 0 && videoPosition != null) {
|
||||
float pos = videoPosition.position;
|
||||
if (pos > 0 && pos < 0.999f) {
|
||||
currentMessageObject.forceSeekTo = pos;
|
||||
videoPlayerSeekbar.setProgress(pos);
|
||||
}
|
||||
}
|
||||
shouldSavePositionForCurrentVideoShortTerm = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (currentMessageObject != null && currentMessageObject.forceSeekTo >= 0) {
|
||||
seekVideoOrWebToProgress(currentMessageObject.forceSeekTo);
|
||||
currentMessageObject.forceSeekTo = -1;
|
||||
}
|
||||
}
|
||||
if (isStreaming) {
|
||||
if (playbackState == ExoPlayer.STATE_BUFFERING && skipFirstBufferingProgress) {
|
||||
if (playWhenReady) {
|
||||
|
|
@ -8439,6 +8620,13 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
} else {
|
||||
playerWasPlaying = false;
|
||||
}
|
||||
if (photoViewerWebView != null) {
|
||||
AndroidUtilities.cancelRunOnUIThread(hideActionBarRunnable);
|
||||
if (shouldSavePositionForCurrentVideoShortTerm != null) {
|
||||
float progress = getCurrentVideoPosition() / (float) getVideoDuration();
|
||||
savedVideoPositions.put(shouldSavePositionForCurrentVideoShortTerm, new SavedVideoPosition(progress, SystemClock.elapsedRealtime()));
|
||||
}
|
||||
}
|
||||
|
||||
if (orientationEventListener != null) {
|
||||
orientationEventListener.disable();
|
||||
|
|
@ -10991,9 +11179,9 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
if (currentAnimation == null && !isEvent) {
|
||||
if (currentDialogId != 0 && totalImagesCount == 0 && currentMessageObject != null && !currentMessageObject.scheduled) {
|
||||
if (MediaDataController.getMediaType(currentMessageObject.messageOwner) == sharedMediaType) {
|
||||
MediaDataController.getInstance(currentAccount).getMediaCount(currentDialogId, sharedMediaType, classGuid, true);
|
||||
MediaDataController.getInstance(currentAccount).getMediaCount(currentDialogId, topicId, sharedMediaType, classGuid, true);
|
||||
if (mergeDialogId != 0) {
|
||||
MediaDataController.getInstance(currentAccount).getMediaCount(mergeDialogId, sharedMediaType, classGuid, true);
|
||||
MediaDataController.getInstance(currentAccount).getMediaCount(mergeDialogId, topicId, sharedMediaType, classGuid, true);
|
||||
}
|
||||
}
|
||||
} else if (avatarsDialogId != 0) {
|
||||
|
|
@ -11216,7 +11404,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
}
|
||||
|
||||
if (!placeProvider.loadMore()) {
|
||||
MediaDataController.getInstance(currentAccount).loadMedia(loadIndex == 0 ? currentDialogId : mergeDialogId, 40, loadFromMaxId, 0, sharedMediaType, 1, classGuid, 0);
|
||||
MediaDataController.getInstance(currentAccount).loadMedia(loadIndex == 0 ? currentDialogId : mergeDialogId, 40, loadFromMaxId, 0, sharedMediaType, topicId,1, classGuid, 0);
|
||||
loadingMoreImages = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -11225,7 +11413,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
int loadFromMinId = imagesArr.get(0).getId();
|
||||
int loadIndex = 0;
|
||||
if (!placeProvider.loadMore()) {
|
||||
MediaDataController.getInstance(currentAccount).loadMedia(loadIndex == 0 ? currentDialogId : mergeDialogId, 40, 0, loadFromMinId, sharedMediaType, 1, classGuid, 0);
|
||||
MediaDataController.getInstance(currentAccount).loadMedia(loadIndex == 0 ? currentDialogId : mergeDialogId, 40, 0, loadFromMinId, sharedMediaType, topicId, 1, classGuid, 0);
|
||||
loadingMoreImages = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -11249,7 +11437,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
}
|
||||
}
|
||||
|
||||
MediaDataController.getInstance(currentAccount).loadMedia(loadIndex == 0 ? currentDialogId : mergeDialogId, 80, loadFromMaxId, 0, sharedMediaType, 1, classGuid, 0);
|
||||
MediaDataController.getInstance(currentAccount).loadMedia(loadIndex == 0 ? currentDialogId : mergeDialogId, 80, loadFromMaxId, 0, sharedMediaType, topicId, 1, classGuid, 0);
|
||||
loadingMoreImages = true;
|
||||
}
|
||||
actionBar.setTitle(LocaleController.formatString("Of", R.string.Of, (totalImagesCount + totalImagesCountMerge - imagesArr.size()) + switchingToIndex + 1, totalImagesCount + totalImagesCountMerge));
|
||||
|
|
@ -12862,40 +13050,40 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
}
|
||||
}
|
||||
|
||||
public boolean openPhoto(final MessageObject messageObject, ChatActivity chatActivity, long dialogId, long mergeDialogId, final PhotoViewerProvider provider) {
|
||||
return openPhoto(messageObject, null, null, null, null, null, null, 0, provider, chatActivity, dialogId, mergeDialogId, true, null, null);
|
||||
public boolean openPhoto(final MessageObject messageObject, ChatActivity chatActivity, long dialogId, long mergeDialogId, int topicId, final PhotoViewerProvider provider) {
|
||||
return openPhoto(messageObject, null, null, null, null, null, null, 0, provider, chatActivity, dialogId, mergeDialogId, topicId, true, null, null);
|
||||
}
|
||||
|
||||
public boolean openPhoto(final MessageObject messageObject, int embedSeekTime, ChatActivity chatActivity, long dialogId, long mergeDialogId, final PhotoViewerProvider provider) {
|
||||
return openPhoto(messageObject, null, null, null, null, null, null, 0, provider, chatActivity, dialogId, mergeDialogId, true, null, embedSeekTime);
|
||||
public boolean openPhoto(final MessageObject messageObject, int embedSeekTime, ChatActivity chatActivity, long dialogId, long mergeDialogId, int topicId, final PhotoViewerProvider provider) {
|
||||
return openPhoto(messageObject, null, null, null, null, null, null, 0, provider, chatActivity, dialogId, mergeDialogId, topicId, true, null, embedSeekTime);
|
||||
}
|
||||
|
||||
public boolean openPhoto(final MessageObject messageObject, long dialogId, long mergeDialogId, final PhotoViewerProvider provider, boolean fullScreenVideo) {
|
||||
return openPhoto(messageObject, null, null, null, null, null, null, 0, provider, null, dialogId, mergeDialogId, fullScreenVideo, null, null);
|
||||
public boolean openPhoto(final MessageObject messageObject, long dialogId, long mergeDialogId, int topicId, final PhotoViewerProvider provider, boolean fullScreenVideo) {
|
||||
return openPhoto(messageObject, null, null, null, null, null, null, 0, provider, null, dialogId, mergeDialogId, topicId, fullScreenVideo, null, null);
|
||||
}
|
||||
|
||||
public boolean openPhoto(final TLRPC.FileLocation fileLocation, final PhotoViewerProvider provider) {
|
||||
return openPhoto(null, fileLocation, null, null, null, null, null, 0, provider, null, 0, 0, true, null, null);
|
||||
return openPhoto(null, fileLocation, null, null, null, null, null, 0, provider, null, 0, 0, 0, true, null, null);
|
||||
}
|
||||
|
||||
public boolean openPhotoWithVideo(final TLRPC.FileLocation fileLocation, ImageLocation videoLocation, final PhotoViewerProvider provider) {
|
||||
return openPhoto(null, fileLocation, null, videoLocation, null, null, null, 0, provider, null, 0, 0, true, null, null);
|
||||
return openPhoto(null, fileLocation, null, videoLocation, null, null, null, 0, provider, null, 0, 0, 0, true, null, null);
|
||||
}
|
||||
|
||||
public boolean openPhoto(final TLRPC.FileLocation fileLocation, final ImageLocation imageLocation, final PhotoViewerProvider provider) {
|
||||
return openPhoto(null, fileLocation, imageLocation, null, null, null, null, 0, provider, null, 0, 0, true, null, null);
|
||||
return openPhoto(null, fileLocation, imageLocation, null, null, null, null, 0, provider, null, 0, 0, 0, true, null, null);
|
||||
}
|
||||
|
||||
public boolean openPhoto(final ArrayList<MessageObject> messages, final int index, long dialogId, long mergeDialogId, final PhotoViewerProvider provider) {
|
||||
return openPhoto(messages.get(index), null, null, null, messages, null, null, index, provider, null, dialogId, mergeDialogId, true, null, null);
|
||||
public boolean openPhoto(final ArrayList<MessageObject> messages, final int index, long dialogId, long mergeDialogId, int topicId, final PhotoViewerProvider provider) {
|
||||
return openPhoto(messages.get(index), null, null, null, messages, null, null, index, provider, null, dialogId, mergeDialogId, topicId, true, null, null);
|
||||
}
|
||||
|
||||
public boolean openPhoto(final ArrayList<SecureDocument> documents, final int index, final PhotoViewerProvider provider) {
|
||||
return openPhoto(null, null, null, null, null, documents, null, index, provider, null, 0, 0, true, null, null);
|
||||
return openPhoto(null, null, null, null, null, documents, null, index, provider, null, 0, 0, 0, true, null, null);
|
||||
}
|
||||
|
||||
public boolean openPhoto(int index, PageBlocksAdapter pageBlocksAdapter, PhotoViewerProvider provider) {
|
||||
return openPhoto(null, null, null, null, null, null, null, index, provider, null, 0, 0, true, pageBlocksAdapter, null);
|
||||
return openPhoto(null, null, null, null, null, null, null, index, provider, null, 0, 0, 0, true, pageBlocksAdapter, null);
|
||||
}
|
||||
|
||||
public boolean openPhotoForSelect(final ArrayList<Object> photos, final int index, int type, boolean documentsPicker, final PhotoViewerProvider provider, ChatActivity chatActivity) {
|
||||
|
|
@ -12950,7 +13138,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
return true;
|
||||
}
|
||||
sendPhotoType = type;
|
||||
return openPhoto(null, null, null, null, null, null, photos, index, provider, chatActivity, 0, 0, true, null, null);
|
||||
return openPhoto(null, null, null, null, null, null, photos, index, provider, chatActivity, 0, 0, 0, true, null, null);
|
||||
}
|
||||
|
||||
private void openCurrentPhotoInPaintModeForSelect() {
|
||||
|
|
@ -13158,7 +13346,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
padImageForHorizontalInsets = true;
|
||||
}
|
||||
|
||||
public boolean openPhoto(final MessageObject messageObject, final TLRPC.FileLocation fileLocation, final ImageLocation imageLocation, final ImageLocation videoLocation, final ArrayList<MessageObject> messages, final ArrayList<SecureDocument> documents, final ArrayList<Object> photos, final int index, final PhotoViewerProvider provider, ChatActivity chatActivity, long dialogId, long mDialogId, boolean fullScreenVideo, PageBlocksAdapter pageBlocksAdapter, Integer embedSeekTime) {
|
||||
public boolean openPhoto(final MessageObject messageObject, final TLRPC.FileLocation fileLocation, final ImageLocation imageLocation, final ImageLocation videoLocation, final ArrayList<MessageObject> messages, final ArrayList<SecureDocument> documents, final ArrayList<Object> photos, final int index, final PhotoViewerProvider provider, ChatActivity chatActivity, long dialogId, long mDialogId, int topicId, boolean fullScreenVideo, PageBlocksAdapter pageBlocksAdapter, Integer embedSeekTime) {
|
||||
if (parentActivity == null || isVisible || provider == null && checkAnimation() || messageObject == null && fileLocation == null && messages == null && photos == null && documents == null && imageLocation == null && pageBlocksAdapter == null) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -13228,6 +13416,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
placeProvider = provider;
|
||||
mergeDialogId = mDialogId;
|
||||
currentDialogId = dialogId;
|
||||
this.topicId = topicId;
|
||||
selectedPhotosAdapter.notifyDataSetChanged();
|
||||
this.pageBlocksAdapter = pageBlocksAdapter;
|
||||
|
||||
|
|
@ -13667,6 +13856,14 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
}
|
||||
videoPlayerSeekbar.clearTimestamps();
|
||||
updateVideoPlayerTime();
|
||||
|
||||
shouldSavePositionForCurrentVideo = null;
|
||||
shouldSavePositionForCurrentVideoShortTerm = null;
|
||||
lastSaveTime = 0;
|
||||
seekToProgressPending = seekToProgressPending2;
|
||||
videoPlayerSeekbar.setProgress(0);
|
||||
videoTimelineView.setProgress(0);
|
||||
videoPlayerSeekbar.setBufferedProgress(0);
|
||||
}
|
||||
|
||||
private void makeFocusable() {
|
||||
|
|
@ -14892,13 +15089,17 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
if (clippingImageProgress != 0) {
|
||||
progress = progress + (1f - progress) * clippingImageProgress;
|
||||
}
|
||||
float scale = 1f + (1f - MathUtils.clamp(progress, 0, 1)) * ZOOM_SCALE;
|
||||
float scale = 1f + (1f - Utilities.clamp(progress, 1, 0)) * ZOOM_SCALE;
|
||||
View view = parentFragment.getFragmentView();
|
||||
view.setPivotX(view.getWidth() / 2f);
|
||||
view.setPivotY(view.getHeight() / 2f);
|
||||
view.setScaleX(scale);
|
||||
view.setScaleY(scale);
|
||||
|
||||
if (parentAlert != null) {
|
||||
view = parentAlert.getContainer();
|
||||
view.setPivotX(view.getWidth() / 2f);
|
||||
view.setPivotY(view.getHeight() / 2f);
|
||||
view.setScaleX(scale);
|
||||
view.setScaleY(scale);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue