mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 06:25:14 +01:00
Update to 8.7.2
This commit is contained in:
parent
8309ac8d7c
commit
8283c12364
17 changed files with 233 additions and 98 deletions
|
@ -300,7 +300,7 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig.versionCode = 2629
|
defaultConfig.versionCode = 2634
|
||||||
|
|
||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
variant.outputs.all { output ->
|
variant.outputs.all { output ->
|
||||||
|
@ -319,7 +319,7 @@ android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionName "8.7.1"
|
versionName "8.7.2"
|
||||||
|
|
||||||
vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']
|
vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "tgcalls/VideoCaptureInterface.h"
|
#include "tgcalls/VideoCaptureInterface.h"
|
||||||
#include "tgcalls/v2/InstanceV2Impl.h"
|
#include "tgcalls/v2/InstanceV2Impl.h"
|
||||||
#include "tgcalls/v2_4_0_0/InstanceV2_4_0_0Impl.h"
|
#include "tgcalls/v2_4_0_0/InstanceV2_4_0_0Impl.h"
|
||||||
|
#include "tgcalls/v2/InstanceV2ReferenceImpl.h"
|
||||||
|
|
||||||
using namespace tgcalls;
|
using namespace tgcalls;
|
||||||
|
|
||||||
|
@ -32,6 +33,7 @@ const auto RegisterTag = Register<InstanceImpl>();
|
||||||
const auto RegisterTagLegacy = Register<InstanceImplLegacy>();
|
const auto RegisterTagLegacy = Register<InstanceImplLegacy>();
|
||||||
const auto RegisterTagV2_4_0_0 = Register<InstanceV2_4_0_0Impl>();
|
const auto RegisterTagV2_4_0_0 = Register<InstanceV2_4_0_0Impl>();
|
||||||
const auto RegisterTagV2_4_0_1 = Register<InstanceV2Impl>();
|
const auto RegisterTagV2_4_0_1 = Register<InstanceV2Impl>();
|
||||||
|
const auto RegisterTagV2_4_1_2 = Register<InstanceV2ReferenceImpl>();
|
||||||
|
|
||||||
jclass TrafficStatsClass;
|
jclass TrafficStatsClass;
|
||||||
jclass FingerprintClass;
|
jclass FingerprintClass;
|
||||||
|
|
|
@ -20,11 +20,11 @@ public class BuildVars {
|
||||||
public static boolean USE_CLOUD_STRINGS = true;
|
public static boolean USE_CLOUD_STRINGS = true;
|
||||||
public static boolean CHECK_UPDATES = true;
|
public static boolean CHECK_UPDATES = true;
|
||||||
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
|
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
|
||||||
public static int BUILD_VERSION = 2629;
|
public static int BUILD_VERSION = 2634;
|
||||||
public static String BUILD_VERSION_STRING = "8.7.1";
|
public static String BUILD_VERSION_STRING = "8.7.2";
|
||||||
public static int APP_ID = 4;
|
public static int APP_ID = 4;
|
||||||
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
||||||
|
|
||||||
public static String SMS_HASH = isStandaloneApp() ? "w0lkcmTZkKh" : (DEBUG_VERSION ? "O2P2z+/jBpJ" : "oLeq9AcOZkT");
|
public static String SMS_HASH = isStandaloneApp() ? "w0lkcmTZkKh" : (DEBUG_VERSION ? "O2P2z+/jBpJ" : "oLeq9AcOZkT");
|
||||||
public static String PLAYSTORE_APP_URL = "https://play.google.com/store/apps/details?id=org.telegram.messenger";
|
public static String PLAYSTORE_APP_URL = "https://play.google.com/store/apps/details?id=org.telegram.messenger";
|
||||||
|
|
||||||
|
|
|
@ -12582,7 +12582,7 @@ public class MessagesStorage extends BaseController {
|
||||||
state.dispose();
|
state.dispose();
|
||||||
|
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
state = database.executeFast("UPDATE reaction_mentions SET state = 0 WHERE dialog_id ?");
|
state = database.executeFast("UPDATE reaction_mentions SET state = 0 WHERE dialog_id = ?");
|
||||||
state.bindLong(1, dialogId);
|
state.bindLong(1, dialogId);
|
||||||
state.step();
|
state.step();
|
||||||
state.dispose();
|
state.dispose();
|
||||||
|
|
|
@ -15,7 +15,7 @@ import java.util.List;
|
||||||
|
|
||||||
public final class Instance {
|
public final class Instance {
|
||||||
|
|
||||||
public static final List<String> AVAILABLE_VERSIONS = Build.VERSION.SDK_INT >= 18 ? Arrays.asList("4.0.1", "4.0.0", "3.0.0", "2.7.7", "2.4.4") : Arrays.asList("2.4.4");
|
public static final List<String> AVAILABLE_VERSIONS = Build.VERSION.SDK_INT >= 18 ? Arrays.asList("4.1.2", "4.0.2", "4.0.1", "4.0.0", "3.0.0", "2.7.7", "2.4.4") : Arrays.asList("2.4.4");
|
||||||
|
|
||||||
public static final int AUDIO_STATE_MUTED = 0;
|
public static final int AUDIO_STATE_MUTED = 0;
|
||||||
public static final int AUDIO_STATE_ACTIVE = 1;
|
public static final int AUDIO_STATE_ACTIVE = 1;
|
||||||
|
|
|
@ -312,9 +312,7 @@ public class CalendarActivity extends BaseFragment {
|
||||||
@Override
|
@Override
|
||||||
public void run(boolean forAll) {
|
public void run(boolean forAll) {
|
||||||
finishFragment();
|
finishFragment();
|
||||||
if (parentLayout == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (parentLayout.fragmentsStack.size() >= 2) {
|
if (parentLayout.fragmentsStack.size() >= 2) {
|
||||||
BaseFragment fragment = parentLayout.fragmentsStack.get(parentLayout.fragmentsStack.size() - 2);
|
BaseFragment fragment = parentLayout.fragmentsStack.get(parentLayout.fragmentsStack.size() - 2);
|
||||||
if (fragment instanceof ChatActivity) {
|
if (fragment instanceof ChatActivity) {
|
||||||
|
|
|
@ -10872,12 +10872,19 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||||
replyTextWidth = AndroidUtilities.dp(4 + (needReplyImage ? 44 : 0));
|
replyTextWidth = AndroidUtilities.dp(4 + (needReplyImage ? 44 : 0));
|
||||||
if (stringFinalText != null) {
|
if (stringFinalText != null) {
|
||||||
SpannableStringBuilder sb = new SpannableStringBuilder(stringFinalText);
|
SpannableStringBuilder sb = new SpannableStringBuilder(stringFinalText);
|
||||||
|
boolean changed = false;
|
||||||
for (TextStyleSpan span : sb.getSpans(0, sb.length(), TextStyleSpan.class)) {
|
for (TextStyleSpan span : sb.getSpans(0, sb.length(), TextStyleSpan.class)) {
|
||||||
if ((span.getTextStyleRun().flags & TextStyleSpan.FLAG_STYLE_MONO) != 0) {
|
if ((span.getTextStyleRun().flags & TextStyleSpan.FLAG_STYLE_MONO) != 0) {
|
||||||
|
changed = true;
|
||||||
sb.removeSpan(span);
|
sb.removeSpan(span);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
replyTextLayout = new StaticLayout(sb, Theme.chat_replyTextPaint, maxWidth + AndroidUtilities.dp(10), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
if (changed) {
|
||||||
|
stringFinalText = TextUtils.ellipsize(sb, Theme.chat_replyTextPaint, maxWidth, TextUtils.TruncateAt.END);
|
||||||
|
} else {
|
||||||
|
stringFinalText = sb;
|
||||||
|
}
|
||||||
|
replyTextLayout = new StaticLayout(stringFinalText, Theme.chat_replyTextPaint, maxWidth + AndroidUtilities.dp(10), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
||||||
if (replyTextLayout.getLineCount() > 0) {
|
if (replyTextLayout.getLineCount() > 0) {
|
||||||
replyTextWidth += (int) Math.ceil(replyTextLayout.getLineWidth(0)) + AndroidUtilities.dp(8);
|
replyTextWidth += (int) Math.ceil(replyTextLayout.getLineWidth(0)) + AndroidUtilities.dp(8);
|
||||||
replyTextOffset = (int) replyTextLayout.getLineLeft(0);
|
replyTextOffset = (int) replyTextLayout.getLineLeft(0);
|
||||||
|
|
|
@ -201,6 +201,7 @@ public class ChatRightsEditActivity extends BaseFragment {
|
||||||
adminRights.ban_users = myAdminRights.ban_users;
|
adminRights.ban_users = myAdminRights.ban_users;
|
||||||
adminRights.invite_users = myAdminRights.invite_users;
|
adminRights.invite_users = myAdminRights.invite_users;
|
||||||
adminRights.pin_messages = myAdminRights.pin_messages;
|
adminRights.pin_messages = myAdminRights.pin_messages;
|
||||||
|
adminRights.other = myAdminRights.other;
|
||||||
initialIsSet = false;
|
initialIsSet = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -216,10 +217,11 @@ public class ChatRightsEditActivity extends BaseFragment {
|
||||||
adminRights.pin_messages = rightsAdmin.pin_messages;
|
adminRights.pin_messages = rightsAdmin.pin_messages;
|
||||||
adminRights.add_admins = rightsAdmin.add_admins;
|
adminRights.add_admins = rightsAdmin.add_admins;
|
||||||
adminRights.anonymous = rightsAdmin.anonymous;
|
adminRights.anonymous = rightsAdmin.anonymous;
|
||||||
|
adminRights.other = rightsAdmin.other;
|
||||||
|
|
||||||
initialIsSet = adminRights.change_info || adminRights.post_messages || adminRights.edit_messages ||
|
initialIsSet = adminRights.change_info || adminRights.post_messages || adminRights.edit_messages ||
|
||||||
adminRights.delete_messages || adminRights.ban_users || adminRights.invite_users ||
|
adminRights.delete_messages || adminRights.ban_users || adminRights.invite_users ||
|
||||||
adminRights.pin_messages || adminRights.add_admins || adminRights.manage_call || adminRights.anonymous;
|
adminRights.pin_messages || adminRights.add_admins || adminRights.manage_call || adminRights.anonymous || adminRights.other;
|
||||||
|
|
||||||
if (type == TYPE_ADD_BOT) {
|
if (type == TYPE_ADD_BOT) {
|
||||||
asAdmin = isChannel || initialIsSet;
|
asAdmin = isChannel || initialIsSet;
|
||||||
|
|
|
@ -3061,6 +3061,11 @@ public class AlertsCreator {
|
||||||
|
|
||||||
int[] values = new int[]{
|
int[] values = new int[]{
|
||||||
0,
|
0,
|
||||||
|
30,
|
||||||
|
60,
|
||||||
|
60 * 2,
|
||||||
|
60 * 3,
|
||||||
|
60 * 8,
|
||||||
60 * 24,
|
60 * 24,
|
||||||
2 * 60 * 24,
|
2 * 60 * 24,
|
||||||
3 * 60 * 24,
|
3 * 60 * 24,
|
||||||
|
@ -3084,14 +3089,18 @@ public class AlertsCreator {
|
||||||
protected CharSequence getContentDescription(int index) {
|
protected CharSequence getContentDescription(int index) {
|
||||||
if (values[index] == 0) {
|
if (values[index] == 0) {
|
||||||
return LocaleController.getString("MuteNever", R.string.MuteNever);
|
return LocaleController.getString("MuteNever", R.string.MuteNever);
|
||||||
|
} else if (values[index] < 60) {
|
||||||
|
return LocaleController.formatPluralString("Minutes", values[index]);
|
||||||
|
} else if (values[index] < 60 * 24) {
|
||||||
|
return LocaleController.formatPluralString("Hours", values[index] / 60);
|
||||||
} else if (values[index] < 7 * 60 * 24) {
|
} else if (values[index] < 7 * 60 * 24) {
|
||||||
return LocaleController.formatPluralString("Days", values[index] / (60 * 24));
|
return LocaleController.formatPluralString("Days", values[index] / (60 * 24));
|
||||||
} else if (values[index] < 31 * 60 * 24) {
|
} else if (values[index] < 31 * 60 * 24) {
|
||||||
return LocaleController.formatPluralString("Weeks", values[index] / (60 * 24));
|
return LocaleController.formatPluralString("Weeks", values[index] / (7 * 60 * 24));
|
||||||
} else if (values[index] < 365 * 60 * 24) {
|
} else if (values[index] < 365 * 60 * 24) {
|
||||||
return LocaleController.formatPluralString("Months", values[index] / (7 * 60 * 24));
|
return LocaleController.formatPluralString("Months", values[index] / (31 * 60 * 24));
|
||||||
} else {
|
} else {
|
||||||
return LocaleController.formatPluralString("Years", values[index] * 5 / 31 * 60 * 24);
|
return LocaleController.formatPluralString("Years", values[index] / (365 * 60 * 24));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -3102,6 +3111,10 @@ public class AlertsCreator {
|
||||||
numberPicker.setFormatter(index -> {
|
numberPicker.setFormatter(index -> {
|
||||||
if (values[index] == 0) {
|
if (values[index] == 0) {
|
||||||
return LocaleController.getString("MuteNever", R.string.MuteNever);
|
return LocaleController.getString("MuteNever", R.string.MuteNever);
|
||||||
|
} else if (values[index] < 60) {
|
||||||
|
return LocaleController.formatPluralString("Minutes", values[index]);
|
||||||
|
} else if (values[index] < 60 * 24) {
|
||||||
|
return LocaleController.formatPluralString("Hours", values[index] / 60);
|
||||||
} else if (values[index] < 7 * 60 * 24) {
|
} else if (values[index] < 7 * 60 * 24) {
|
||||||
return LocaleController.formatPluralString("Days", values[index] / (60 * 24));
|
return LocaleController.formatPluralString("Days", values[index] / (60 * 24));
|
||||||
} else if (values[index] < 31 * 60 * 24) {
|
} else if (values[index] < 31 * 60 * 24) {
|
||||||
|
|
|
@ -108,6 +108,8 @@ public class BotWebViewContainer extends FrameLayout implements NotificationCent
|
||||||
|
|
||||||
private Activity parentActivity;
|
private Activity parentActivity;
|
||||||
|
|
||||||
|
private boolean isViewPortByMeasureSuppressed;
|
||||||
|
|
||||||
public BotWebViewContainer(@NonNull Context context, Theme.ResourcesProvider resourcesProvider, int backgroundColor) {
|
public BotWebViewContainer(@NonNull Context context, Theme.ResourcesProvider resourcesProvider, int backgroundColor) {
|
||||||
super(context);
|
super(context);
|
||||||
this.resourcesProvider = resourcesProvider;
|
this.resourcesProvider = resourcesProvider;
|
||||||
|
@ -165,6 +167,10 @@ public class BotWebViewContainer extends FrameLayout implements NotificationCent
|
||||||
setFocusable(false);
|
setFocusable(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setViewPortByMeasureSuppressed(boolean viewPortByMeasureSuppressed) {
|
||||||
|
isViewPortByMeasureSuppressed = viewPortByMeasureSuppressed;
|
||||||
|
}
|
||||||
|
|
||||||
private void checkCreateWebView() {
|
private void checkCreateWebView() {
|
||||||
if (webView == null && !webViewNotAvailable) {
|
if (webView == null && !webViewNotAvailable) {
|
||||||
try {
|
try {
|
||||||
|
@ -571,7 +577,9 @@ public class BotWebViewContainer extends FrameLayout implements NotificationCent
|
||||||
@Override
|
@Override
|
||||||
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
||||||
super.onSizeChanged(w, h, oldw, oldh);
|
super.onSizeChanged(w, h, oldw, oldh);
|
||||||
invalidateViewPortHeight(true);
|
if (!isViewPortByMeasureSuppressed) {
|
||||||
|
invalidateViewPortHeight(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void invalidateViewPortHeight() {
|
public void invalidateViewPortHeight() {
|
||||||
|
|
|
@ -3487,6 +3487,10 @@ public class ChatActivityEnterView extends BlurredFrameLayout implements Notific
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void forceSmoothKeyboard(boolean smoothKeyboard) {
|
||||||
|
this.smoothKeyboard = smoothKeyboard && SharedConfig.smoothKeyboard && !AndroidUtilities.isInMultiwindow && (parentFragment == null || !parentFragment.isInBubbleMode());
|
||||||
|
}
|
||||||
|
|
||||||
protected void onLineCountChanged(int oldLineCount, int newLineCount) {
|
protected void onLineCountChanged(int oldLineCount, int newLineCount) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,6 +136,8 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
|
||||||
ChatAttachAlertBotWebViewLayout webViewLayout = new ChatAttachAlertBotWebViewLayout(this, getContext(), resourcesProvider);
|
ChatAttachAlertBotWebViewLayout webViewLayout = new ChatAttachAlertBotWebViewLayout(this, getContext(), resourcesProvider);
|
||||||
botAttachLayouts.put(id, webViewLayout);
|
botAttachLayouts.put(id, webViewLayout);
|
||||||
botAttachLayouts.get(id).setDelegate(new BotWebViewContainer.Delegate() {
|
botAttachLayouts.get(id).setDelegate(new BotWebViewContainer.Delegate() {
|
||||||
|
private ValueAnimator botButtonAnimator;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCloseRequested(Runnable callback) {
|
public void onCloseRequested(Runnable callback) {
|
||||||
if (currentAttachLayout != webViewLayout) {
|
if (currentAttachLayout != webViewLayout) {
|
||||||
|
@ -173,8 +175,13 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
|
||||||
botMainButtonTextView.setTextColor(textColor);
|
botMainButtonTextView.setTextColor(textColor);
|
||||||
botMainButtonTextView.setBackground(BotWebViewContainer.getMainButtonRippleDrawable(color));
|
botMainButtonTextView.setBackground(BotWebViewContainer.getMainButtonRippleDrawable(color));
|
||||||
if (botButtonWasVisible != isVisible) {
|
if (botButtonWasVisible != isVisible) {
|
||||||
ValueAnimator animator = ValueAnimator.ofFloat(isVisible ? 0 : 1, isVisible ? 1 : 0).setDuration(250);
|
botButtonWasVisible = isVisible;
|
||||||
animator.addUpdateListener(animation -> {
|
|
||||||
|
if (botButtonAnimator != null) {
|
||||||
|
botButtonAnimator.cancel();
|
||||||
|
}
|
||||||
|
botButtonAnimator = ValueAnimator.ofFloat(isVisible ? 0 : 1, isVisible ? 1 : 0).setDuration(250);
|
||||||
|
botButtonAnimator.addUpdateListener(animation -> {
|
||||||
float value = (float) animation.getAnimatedValue();
|
float value = (float) animation.getAnimatedValue();
|
||||||
buttonsRecyclerView.setAlpha(1f - value);
|
buttonsRecyclerView.setAlpha(1f - value);
|
||||||
botMainButtonTextView.setAlpha(value);
|
botMainButtonTextView.setAlpha(value);
|
||||||
|
@ -182,7 +189,7 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
|
||||||
shadow.setTranslationY(botMainButtonOffsetY);
|
shadow.setTranslationY(botMainButtonOffsetY);
|
||||||
buttonsRecyclerView.setTranslationY(botMainButtonOffsetY);
|
buttonsRecyclerView.setTranslationY(botMainButtonOffsetY);
|
||||||
});
|
});
|
||||||
animator.addListener(new AnimatorListenerAdapter() {
|
botButtonAnimator.addListener(new AnimatorListenerAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationStart(Animator animation) {
|
public void onAnimationStart(Animator animation) {
|
||||||
if (isVisible) {
|
if (isVisible) {
|
||||||
|
@ -201,7 +208,6 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animator animation) {
|
public void onAnimationEnd(Animator animation) {
|
||||||
botButtonWasVisible = isVisible;
|
|
||||||
if (!isVisible) {
|
if (!isVisible) {
|
||||||
botMainButtonTextView.setVisibility(View.GONE);
|
botMainButtonTextView.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
|
@ -212,9 +218,13 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
|
||||||
for (int i = 0; i < botAttachLayouts.size(); i++) {
|
for (int i = 0; i < botAttachLayouts.size(); i++) {
|
||||||
botAttachLayouts.valueAt(i).setMeasureOffsetY(offsetY);
|
botAttachLayouts.valueAt(i).setMeasureOffsetY(offsetY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (botButtonAnimator == animation) {
|
||||||
|
botButtonAnimator = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
animator.start();
|
botButtonAnimator.start();
|
||||||
}
|
}
|
||||||
botProgressView.setProgressColor(textColor);
|
botProgressView.setProgressColor(textColor);
|
||||||
if (botButtonProgressWasVisible != isProgressVisible) {
|
if (botButtonProgressWasVisible != isProgressVisible) {
|
||||||
|
|
|
@ -217,44 +217,58 @@ public class ChatAttachAlertBotWebViewLayout extends ChatAttachAlert.AttachAlert
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
webViewContainer.setViewPortByMeasureSuppressed(true);
|
||||||
|
|
||||||
|
boolean doNotScroll = false;
|
||||||
|
float openOffset = -swipeContainer.getOffsetY() + swipeContainer.getTopActionBarOffsetY();
|
||||||
|
if (swipeContainer.getSwipeOffsetY() != openOffset) {
|
||||||
|
swipeContainer.stickTo(openOffset);
|
||||||
|
doNotScroll = true;
|
||||||
|
}
|
||||||
|
|
||||||
int oldh = contentHeight + parentAlert.sizeNotifierFrameLayout.measureKeyboardHeight();
|
int oldh = contentHeight + parentAlert.sizeNotifierFrameLayout.measureKeyboardHeight();
|
||||||
setMeasuredDimension(getMeasuredWidth(), contentHeight);
|
setMeasuredDimension(getMeasuredWidth(), contentHeight);
|
||||||
ignoreMeasure = true;
|
ignoreMeasure = true;
|
||||||
|
swipeContainer.setSwipeOffsetAnimationDisallowed(true);
|
||||||
|
|
||||||
if (webViewScrollAnimator != null) {
|
if (!doNotScroll) {
|
||||||
webViewScrollAnimator.cancel();
|
if (webViewScrollAnimator != null) {
|
||||||
webViewScrollAnimator = null;
|
webViewScrollAnimator.cancel();
|
||||||
}
|
webViewScrollAnimator = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (webViewContainer.getWebView() != null) {
|
if (webViewContainer.getWebView() != null) {
|
||||||
int fromY = webViewContainer.getWebView().getScrollY();
|
int fromY = webViewContainer.getWebView().getScrollY();
|
||||||
int toY = fromY + (oldh - contentHeight);
|
int toY = fromY + (oldh - contentHeight);
|
||||||
webViewScrollAnimator = ValueAnimator.ofInt(fromY, toY).setDuration(250);
|
webViewScrollAnimator = ValueAnimator.ofInt(fromY, toY).setDuration(250);
|
||||||
webViewScrollAnimator.setInterpolator(ChatListItemAnimator.DEFAULT_INTERPOLATOR);
|
webViewScrollAnimator.setInterpolator(ChatListItemAnimator.DEFAULT_INTERPOLATOR);
|
||||||
webViewScrollAnimator.addUpdateListener(animation -> {
|
webViewScrollAnimator.addUpdateListener(animation -> {
|
||||||
int val = (int) animation.getAnimatedValue();
|
int val = (int) animation.getAnimatedValue();
|
||||||
if (webViewContainer.getWebView() != null) {
|
|
||||||
webViewContainer.getWebView().setScrollY(val);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
webViewScrollAnimator.addListener(new AnimatorListenerAdapter() {
|
|
||||||
@Override
|
|
||||||
public void onAnimationEnd(Animator animation) {
|
|
||||||
if (webViewContainer.getWebView() != null) {
|
if (webViewContainer.getWebView() != null) {
|
||||||
webViewContainer.getWebView().setScrollY(toY);
|
webViewContainer.getWebView().setScrollY(val);
|
||||||
}
|
}
|
||||||
if (animation == webViewScrollAnimator) {
|
});
|
||||||
webViewScrollAnimator = null;
|
webViewScrollAnimator.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
if (webViewContainer.getWebView() != null) {
|
||||||
|
webViewContainer.getWebView().setScrollY(toY);
|
||||||
|
}
|
||||||
|
if (animation == webViewScrollAnimator) {
|
||||||
|
webViewScrollAnimator = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
webViewScrollAnimator.start();
|
||||||
webViewScrollAnimator.start();
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPanTransitionEnd() {
|
public void onPanTransitionEnd() {
|
||||||
ignoreMeasure = false;
|
ignoreMeasure = false;
|
||||||
|
swipeContainer.setSwipeOffsetAnimationDisallowed(false);
|
||||||
|
webViewContainer.setViewPortByMeasureSuppressed(false);
|
||||||
requestLayout();
|
requestLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -443,7 +457,7 @@ public class ChatAttachAlertBotWebViewLayout extends ChatAttachAlert.AttachAlert
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
int getButtonsHideOffset() {
|
int getButtonsHideOffset() {
|
||||||
return AndroidUtilities.dp(56);
|
return (int) swipeContainer.getTopActionBarOffsetY() + AndroidUtilities.dp(12);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -510,9 +524,12 @@ public class ChatAttachAlertBotWebViewLayout extends ChatAttachAlert.AttachAlert
|
||||||
|
|
||||||
private float topActionBarOffsetY = ActionBar.getCurrentActionBarHeight();
|
private float topActionBarOffsetY = ActionBar.getCurrentActionBarHeight();
|
||||||
private float offsetY = -1;
|
private float offsetY = -1;
|
||||||
|
private float pendingOffsetY = -1;
|
||||||
private float swipeOffsetY;
|
private float swipeOffsetY;
|
||||||
private boolean isSwipeOffsetAnimationDisallowed;
|
private boolean isSwipeOffsetAnimationDisallowed;
|
||||||
|
|
||||||
|
private ValueAnimator offsetYAnimator;
|
||||||
|
|
||||||
private boolean flingInProgress;
|
private boolean flingInProgress;
|
||||||
|
|
||||||
private WebView webView;
|
private WebView webView;
|
||||||
|
@ -655,18 +672,43 @@ public class ChatAttachAlertBotWebViewLayout extends ChatAttachAlert.AttachAlert
|
||||||
float wasOffsetY = this.offsetY;
|
float wasOffsetY = this.offsetY;
|
||||||
boolean wasOnTop = swipeOffsetY == -wasOffsetY + topActionBarOffsetY;
|
boolean wasOnTop = swipeOffsetY == -wasOffsetY + topActionBarOffsetY;
|
||||||
if (wasOffsetY != -1 && !isSwipeOffsetAnimationDisallowed) {
|
if (wasOffsetY != -1 && !isSwipeOffsetAnimationDisallowed) {
|
||||||
ValueAnimator animator = ValueAnimator.ofFloat(wasOffsetY, offsetY).setDuration(200);
|
offsetYAnimator = ValueAnimator.ofFloat(wasOffsetY, offsetY).setDuration(200);
|
||||||
animator.setInterpolator(CubicBezierInterpolator.DEFAULT);
|
offsetYAnimator.setInterpolator(CubicBezierInterpolator.DEFAULT);
|
||||||
animator.addUpdateListener(animation -> {
|
offsetYAnimator.addUpdateListener(animation -> {
|
||||||
this.offsetY = (float) animation.getAnimatedValue();
|
this.offsetY = (float) animation.getAnimatedValue();
|
||||||
if (wasOnTop) {
|
if (wasOnTop) {
|
||||||
swipeOffsetY = -this.offsetY + topActionBarOffsetY;
|
swipeOffsetY = -this.offsetY + topActionBarOffsetY;
|
||||||
} else {
|
} else {
|
||||||
swipeOffsetY = MathUtils.clamp(swipeOffsetY, -this.offsetY + topActionBarOffsetY, getHeight() - this.offsetY + topActionBarOffsetY);
|
swipeOffsetY = MathUtils.clamp(swipeOffsetY, -this.offsetY + topActionBarOffsetY, getHeight() - this.offsetY + topActionBarOffsetY);
|
||||||
}
|
}
|
||||||
|
if (scrollAnimator != null && scrollAnimator.getSpring().getFinalPosition() == -wasOffsetY + topActionBarOffsetY) {
|
||||||
|
scrollAnimator.getSpring().setFinalPosition(-offsetY + topActionBarOffsetY);
|
||||||
|
}
|
||||||
invalidateTranslation();
|
invalidateTranslation();
|
||||||
});
|
});
|
||||||
animator.start();
|
offsetYAnimator.addListener(new AnimatorListenerAdapter() {
|
||||||
|
private boolean isCanceled;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
if (offsetYAnimator == animation) {
|
||||||
|
offsetYAnimator = null;
|
||||||
|
|
||||||
|
if (!isCanceled) {
|
||||||
|
WebViewSwipeContainer.this.offsetY = offsetY;
|
||||||
|
invalidateTranslation();
|
||||||
|
} else {
|
||||||
|
pendingOffsetY = offsetY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationCancel(Animator animation) {
|
||||||
|
isCanceled = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
offsetYAnimator.start();
|
||||||
} else {
|
} else {
|
||||||
this.offsetY = offsetY;
|
this.offsetY = offsetY;
|
||||||
if (wasOnTop) {
|
if (wasOnTop) {
|
||||||
|
@ -724,9 +766,13 @@ public class ChatAttachAlertBotWebViewLayout extends ChatAttachAlert.AttachAlert
|
||||||
flingInProgress = false;
|
flingInProgress = false;
|
||||||
} else {
|
} else {
|
||||||
if (swipeOffsetY <= -swipeStickyRange) {
|
if (swipeOffsetY <= -swipeStickyRange) {
|
||||||
stickTo(-offsetY + topActionBarOffsetY);
|
if (swipeOffsetY != -offsetY + topActionBarOffsetY) {
|
||||||
|
stickTo(-offsetY + topActionBarOffsetY);
|
||||||
|
}
|
||||||
} else if (swipeOffsetY > -swipeStickyRange && swipeOffsetY <= swipeStickyRange) {
|
} else if (swipeOffsetY > -swipeStickyRange && swipeOffsetY <= swipeStickyRange) {
|
||||||
stickTo(0);
|
if (swipeOffsetY != 0) {
|
||||||
|
stickTo(0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (delegate != null) {
|
if (delegate != null) {
|
||||||
delegate.onDismiss();
|
delegate.onDismiss();
|
||||||
|
@ -747,7 +793,7 @@ public class ChatAttachAlertBotWebViewLayout extends ChatAttachAlert.AttachAlert
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stickTo(float offset, Runnable callback) {
|
public void stickTo(float offset, Runnable callback) {
|
||||||
if (swipeOffsetY == offset) {
|
if (swipeOffsetY == offset || scrollAnimator != null && scrollAnimator.getSpring().getFinalPosition() == offset) {
|
||||||
if (callback != null) {
|
if (callback != null) {
|
||||||
callback.run();
|
callback.run();
|
||||||
}
|
}
|
||||||
|
@ -757,6 +803,9 @@ public class ChatAttachAlertBotWebViewLayout extends ChatAttachAlert.AttachAlert
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (offsetYAnimator != null) {
|
||||||
|
offsetYAnimator.cancel();
|
||||||
|
}
|
||||||
if (scrollAnimator != null) {
|
if (scrollAnimator != null) {
|
||||||
scrollAnimator.cancel();
|
scrollAnimator.cancel();
|
||||||
}
|
}
|
||||||
|
@ -775,6 +824,14 @@ public class ChatAttachAlertBotWebViewLayout extends ChatAttachAlert.AttachAlert
|
||||||
if (scrollEndListener != null) {
|
if (scrollEndListener != null) {
|
||||||
scrollEndListener.run();
|
scrollEndListener.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pendingOffsetY != -1) {
|
||||||
|
boolean wasDisallowed = isSwipeOffsetAnimationDisallowed;
|
||||||
|
isSwipeOffsetAnimationDisallowed = true;
|
||||||
|
setOffsetY(pendingOffsetY);
|
||||||
|
pendingOffsetY = -1;
|
||||||
|
isSwipeOffsetAnimationDisallowed = wasDisallowed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
scrollAnimator.start();
|
scrollAnimator.start();
|
||||||
|
|
|
@ -40,6 +40,9 @@ public class ChatScrimPopupContainerLayout extends LinearLayout {
|
||||||
if (popupWindowLayout.getSwipeBack() != null) {
|
if (popupWindowLayout.getSwipeBack() != null) {
|
||||||
widthDiff = popupWindowLayout.getSwipeBack().getMeasuredWidth() - popupWindowLayout.getSwipeBack().getChildAt(0).getMeasuredWidth();
|
widthDiff = popupWindowLayout.getSwipeBack().getMeasuredWidth() - popupWindowLayout.getSwipeBack().getChildAt(0).getMeasuredWidth();
|
||||||
}
|
}
|
||||||
|
if (reactionsLayout.getLayoutParams().width != LayoutHelper.WRAP_CONTENT && reactionsLayout.getLayoutParams().width + widthDiff > getMeasuredWidth()) {
|
||||||
|
widthDiff = getMeasuredWidth() - reactionsLayout.getLayoutParams().width + AndroidUtilities.dp(8);
|
||||||
|
}
|
||||||
((LayoutParams) reactionsLayout.getLayoutParams()).rightMargin = widthDiff;
|
((LayoutParams) reactionsLayout.getLayoutParams()).rightMargin = widthDiff;
|
||||||
if (bottomView != null) {
|
if (bottomView != null) {
|
||||||
if (popupWindowLayout.getSwipeBack() != null) {
|
if (popupWindowLayout.getSwipeBack() != null) {
|
||||||
|
|
|
@ -303,6 +303,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
private RecyclerView sideMenu;
|
private RecyclerView sideMenu;
|
||||||
private ChatActivityEnterView commentView;
|
private ChatActivityEnterView commentView;
|
||||||
private View commentViewBg;
|
private View commentViewBg;
|
||||||
|
private final boolean commentViewAnimated = false;
|
||||||
private ImageView[] writeButton;
|
private ImageView[] writeButton;
|
||||||
private FrameLayout writeButtonContainer;
|
private FrameLayout writeButtonContainer;
|
||||||
private View selectedCountView;
|
private View selectedCountView;
|
||||||
|
@ -781,13 +782,6 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
} else {
|
} else {
|
||||||
h = heightSize - inputFieldHeight + AndroidUtilities.dp(2) - (onlySelect ? 0 : actionBar.getMeasuredHeight()) - topPadding;
|
h = heightSize - inputFieldHeight + AndroidUtilities.dp(2) - (onlySelect ? 0 : actionBar.getMeasuredHeight()) - topPadding;
|
||||||
}
|
}
|
||||||
int paddingBottom = 0;
|
|
||||||
if (keyboardSize > AndroidUtilities.dp(20)) {
|
|
||||||
h += (paddingBottom = inputFieldHeight + keyboardSize);
|
|
||||||
}
|
|
||||||
if (((ViewPage) child).listView != null) {
|
|
||||||
((ViewPage) child).listView.setPadding(0, 0, 0, paddingBottom);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (filtersTabAnimator != null && filterTabsView != null && filterTabsView.getVisibility() == VISIBLE) {
|
if (filtersTabAnimator != null && filterTabsView != null && filterTabsView.getVisibility() == VISIBLE) {
|
||||||
h += filterTabsMoveFrom;
|
h += filterTabsMoveFrom;
|
||||||
|
@ -822,39 +816,10 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int previousHeight = -1;
|
|
||||||
private AnimatorSet keyboardAnimator;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||||
final int count = getChildCount();
|
final int count = getChildCount();
|
||||||
|
|
||||||
int layoutHeight = b - t;
|
|
||||||
if (previousHeight != -1 && commentView != null) {
|
|
||||||
if (Math.abs(previousHeight - layoutHeight) > AndroidUtilities.dp(20)) {
|
|
||||||
if (keyboardAnimator != null) {
|
|
||||||
keyboardAnimator.cancel();
|
|
||||||
}
|
|
||||||
keyboardAnimator = new AnimatorSet();
|
|
||||||
ArrayList<Animator> animators = new ArrayList<>();
|
|
||||||
animators.add(ObjectAnimator.ofFloat(commentView, TRANSLATION_Y, previousHeight - layoutHeight, 0));
|
|
||||||
if (commentViewBg != null) {
|
|
||||||
animators.add(ObjectAnimator.ofFloat(commentViewBg, TRANSLATION_Y, previousHeight - layoutHeight, 0));
|
|
||||||
}
|
|
||||||
if (writeButtonContainer != null) {
|
|
||||||
animators.add(ObjectAnimator.ofFloat(writeButtonContainer, TRANSLATION_Y, previousHeight - layoutHeight, 0));
|
|
||||||
}
|
|
||||||
if (selectedCountView != null) {
|
|
||||||
animators.add(ObjectAnimator.ofFloat(selectedCountView, TRANSLATION_Y, previousHeight - layoutHeight, 0));
|
|
||||||
}
|
|
||||||
keyboardAnimator.playTogether(animators);
|
|
||||||
keyboardAnimator.setDuration(AdjustPanLayoutHelper.keyboardDuration);
|
|
||||||
keyboardAnimator.setInterpolator(AdjustPanLayoutHelper.keyboardInterpolator);
|
|
||||||
keyboardAnimator.start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
previousHeight = layoutHeight;
|
|
||||||
|
|
||||||
int paddingBottom;
|
int paddingBottom;
|
||||||
Object tag = commentView != null ? commentView.getTag() : null;
|
Object tag = commentView != null ? commentView.getTag() : null;
|
||||||
int keyboardSize = measureKeyboardHeight();
|
int keyboardSize = measureKeyboardHeight();
|
||||||
|
@ -866,9 +831,9 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
setBottomClip(paddingBottom);
|
setBottomClip(paddingBottom);
|
||||||
lastMeasuredTopPadding = topPadding;
|
lastMeasuredTopPadding = topPadding;
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = -1; i < count; i++) {
|
||||||
final View child = getChildAt(i);
|
final View child = i == -1 ? commentView : getChildAt(i);
|
||||||
if (child.getVisibility() == GONE) {
|
if (child == null || child.getVisibility() == GONE) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
final FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) child.getLayoutParams();
|
final FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) child.getLayoutParams();
|
||||||
|
@ -943,6 +908,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
searchViewPager.setKeyboardHeight(keyboardSize);
|
searchViewPager.setKeyboardHeight(keyboardSize);
|
||||||
notifyHeightChanged();
|
notifyHeightChanged();
|
||||||
updateContextViewPosition();
|
updateContextViewPosition();
|
||||||
|
updateCommentView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -3367,17 +3333,35 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
AndroidUtilities.requestAdjustResize(getParentActivity(), classGuid);
|
AndroidUtilities.requestAdjustResize(getParentActivity(), classGuid);
|
||||||
}
|
}
|
||||||
return super.dispatchTouchEvent(ev);
|
return super.dispatchTouchEvent(ev);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void setTranslationY(float translationY) {
|
||||||
|
super.setTranslationY(translationY);
|
||||||
|
if (!commentViewAnimated) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (commentViewBg != null) {
|
||||||
|
commentViewBg.setTranslationY(translationY);
|
||||||
|
}
|
||||||
|
if (writeButtonContainer != null) {
|
||||||
|
writeButtonContainer.setTranslationY(translationY);
|
||||||
|
}
|
||||||
|
if (selectedCountView != null) {
|
||||||
|
selectedCountView.setTranslationY(translationY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
contentView.setClipChildren(false);
|
||||||
|
contentView.setClipToPadding(false);
|
||||||
commentView.allowBlur = false;
|
commentView.allowBlur = false;
|
||||||
commentView.setAllowStickersAndGifs(false, false);
|
commentView.setAllowStickersAndGifs(false, false);
|
||||||
commentView.setForceShowSendButton(true, false);
|
commentView.setForceShowSendButton(true, false);
|
||||||
commentView.setVisibility(View.GONE);
|
commentView.setVisibility(View.GONE);
|
||||||
commentView.getSendButton().setAlpha(0);
|
commentView.getSendButton().setAlpha(0);
|
||||||
contentView.addView(commentView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.BOTTOM));
|
|
||||||
commentViewBg = new View(getParentActivity());
|
commentViewBg = new View(getParentActivity());
|
||||||
commentViewBg.setBackgroundColor(getThemedColor(Theme.key_chat_messagePanelBackground));
|
commentViewBg.setBackgroundColor(getThemedColor(Theme.key_chat_messagePanelBackground));
|
||||||
contentView.addView(commentViewBg, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 1600, Gravity.BOTTOM | Gravity.FILL_HORIZONTAL, 0, 0, 0, -1600));
|
contentView.addView(commentViewBg, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 1600, Gravity.BOTTOM | Gravity.FILL_HORIZONTAL, 0, 0, 0, -1600));
|
||||||
|
contentView.addView(commentView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.BOTTOM));
|
||||||
commentView.setDelegate(new ChatActivityEnterView.ChatActivityEnterViewDelegate() {
|
commentView.setDelegate(new ChatActivityEnterView.ChatActivityEnterViewDelegate() {
|
||||||
@Override
|
@Override
|
||||||
public void onMessageSend(CharSequence message, boolean notify, int scheduleDate) {
|
public void onMessageSend(CharSequence message, boolean notify, int scheduleDate) {
|
||||||
|
@ -3397,6 +3381,20 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bottomPanelTranslationYChanged(float translation) {
|
||||||
|
if (commentViewAnimated) {
|
||||||
|
if (keyboardAnimator != null) {
|
||||||
|
keyboardAnimator.cancel();
|
||||||
|
keyboardAnimator = null;
|
||||||
|
}
|
||||||
|
if (commentView != null) {
|
||||||
|
commentView.setTranslationY(translation);
|
||||||
|
commentViewIgnoreTopUpdate = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStickersExpandedChange() {
|
public void onStickersExpandedChange() {
|
||||||
|
|
||||||
|
@ -3797,6 +3795,35 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
return fragmentView;
|
return fragmentView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int commentViewPreviousTop = -1;
|
||||||
|
private ValueAnimator keyboardAnimator;
|
||||||
|
private boolean commentViewIgnoreTopUpdate = false;
|
||||||
|
|
||||||
|
private void updateCommentView() {
|
||||||
|
if (!commentViewAnimated || commentView == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int top = commentView.getTop();
|
||||||
|
if (commentViewPreviousTop > 0 && Math.abs(top - commentViewPreviousTop) > AndroidUtilities.dp(20) && !commentView.isPopupShowing()) {
|
||||||
|
if (commentViewIgnoreTopUpdate) {
|
||||||
|
commentViewIgnoreTopUpdate = false;
|
||||||
|
commentViewPreviousTop = top;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (keyboardAnimator != null) {
|
||||||
|
keyboardAnimator.cancel();
|
||||||
|
}
|
||||||
|
keyboardAnimator = ValueAnimator.ofFloat(commentViewPreviousTop - top, 0);
|
||||||
|
keyboardAnimator.addUpdateListener(a -> {
|
||||||
|
commentView.setTranslationY((float) a.getAnimatedValue());
|
||||||
|
});
|
||||||
|
keyboardAnimator.setDuration(AdjustPanLayoutHelper.keyboardDuration);
|
||||||
|
keyboardAnimator.setInterpolator(AdjustPanLayoutHelper.keyboardInterpolator);
|
||||||
|
keyboardAnimator.start();
|
||||||
|
}
|
||||||
|
commentViewPreviousTop = top;
|
||||||
|
}
|
||||||
|
|
||||||
private void updateAppUpdateViews(boolean animated) {
|
private void updateAppUpdateViews(boolean animated) {
|
||||||
if (updateLayout == null) {
|
if (updateLayout == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -7644,11 +7671,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
int[] location = new int[2];
|
int[] location = new int[2];
|
||||||
view.getLocationInWindow(location);
|
view.getLocationInWindow(location);
|
||||||
int y;
|
int y;
|
||||||
// if (keyboardVisible && parentFragment.contentView.getMeasuredHeight() > AndroidUtilities.dp(58)) {
|
|
||||||
// y = location[1] + view.getMeasuredHeight();
|
|
||||||
// } else {
|
|
||||||
y = location[1] - layout.getMeasuredHeight() - AndroidUtilities.dp(2);
|
y = location[1] - layout.getMeasuredHeight() - AndroidUtilities.dp(2);
|
||||||
// }
|
|
||||||
sendPopupWindow.showAtLocation(view, Gravity.LEFT | Gravity.TOP, location[0] + view.getMeasuredWidth() - layout.getMeasuredWidth() + AndroidUtilities.dp(8), y);
|
sendPopupWindow.showAtLocation(view, Gravity.LEFT | Gravity.TOP, location[0] + view.getMeasuredWidth() - layout.getMeasuredWidth() + AndroidUtilities.dp(8), y);
|
||||||
sendPopupWindow.dimBehind();
|
sendPopupWindow.dimBehind();
|
||||||
view.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
|
view.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
|
||||||
|
|
|
@ -73,6 +73,7 @@ public class DownloadProgressIcon extends View implements NotificationCenter.Not
|
||||||
paint.setColor(Theme.getColor(Theme.key_actionBarDefaultIcon));
|
paint.setColor(Theme.getColor(Theme.key_actionBarDefaultIcon));
|
||||||
paint2.setColor(Theme.getColor(Theme.key_actionBarDefaultIcon));
|
paint2.setColor(Theme.getColor(Theme.key_actionBarDefaultIcon));
|
||||||
downloadImageReceiver.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_actionBarDefaultIcon), PorterDuff.Mode.MULTIPLY));
|
downloadImageReceiver.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_actionBarDefaultIcon), PorterDuff.Mode.MULTIPLY));
|
||||||
|
downloadCompleteImageReceiver.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_actionBarDefaultIcon), PorterDuff.Mode.MULTIPLY));
|
||||||
paint2.setAlpha(100);
|
paint2.setAlpha(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3037,7 +3037,7 @@ public class LaunchActivity extends BasePermissionsActivity implements ActionBar
|
||||||
MessagesController.getInstance(intentAccount).checkIsInChat(chat, user, (isInChatAlready, currentRights, currentRank) -> AndroidUtilities.runOnUIThread(() -> {
|
MessagesController.getInstance(intentAccount).checkIsInChat(chat, user, (isInChatAlready, currentRights, currentRank) -> AndroidUtilities.runOnUIThread(() -> {
|
||||||
TLRPC.TL_chatAdminRights requestingRights = null;
|
TLRPC.TL_chatAdminRights requestingRights = null;
|
||||||
if (botChatAdminParams != null) {
|
if (botChatAdminParams != null) {
|
||||||
String[] adminParams = botChatAdminParams.split("\\+");
|
String[] adminParams = botChatAdminParams.split("\\+| ");
|
||||||
requestingRights = new TLRPC.TL_chatAdminRights();
|
requestingRights = new TLRPC.TL_chatAdminRights();
|
||||||
final int count = adminParams.length;
|
final int count = adminParams.length;
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
|
@ -3053,12 +3053,14 @@ public class LaunchActivity extends BasePermissionsActivity implements ActionBar
|
||||||
requestingRights.edit_messages = true;
|
requestingRights.edit_messages = true;
|
||||||
break;
|
break;
|
||||||
case "add_admins":
|
case "add_admins":
|
||||||
|
case "promote_members":
|
||||||
requestingRights.add_admins = true;
|
requestingRights.add_admins = true;
|
||||||
break;
|
break;
|
||||||
case "delete_messages":
|
case "delete_messages":
|
||||||
requestingRights.delete_messages = true;
|
requestingRights.delete_messages = true;
|
||||||
break;
|
break;
|
||||||
case "ban_users":
|
case "ban_users":
|
||||||
|
case "restrict_members":
|
||||||
requestingRights.ban_users = true;
|
requestingRights.ban_users = true;
|
||||||
break;
|
break;
|
||||||
case "invite_users":
|
case "invite_users":
|
||||||
|
@ -3067,9 +3069,13 @@ public class LaunchActivity extends BasePermissionsActivity implements ActionBar
|
||||||
case "pin_messages":
|
case "pin_messages":
|
||||||
requestingRights.pin_messages = true;
|
requestingRights.pin_messages = true;
|
||||||
break;
|
break;
|
||||||
|
case "manage_video_chats":
|
||||||
case "manage_call":
|
case "manage_call":
|
||||||
requestingRights.manage_call = true;
|
requestingRights.manage_call = true;
|
||||||
break;
|
break;
|
||||||
|
case "manage_chat":
|
||||||
|
requestingRights.other = true;
|
||||||
|
break;
|
||||||
case "anonymous":
|
case "anonymous":
|
||||||
requestingRights.anonymous = true;
|
requestingRights.anonymous = true;
|
||||||
break;
|
break;
|
||||||
|
@ -3094,6 +3100,7 @@ public class LaunchActivity extends BasePermissionsActivity implements ActionBar
|
||||||
editRights.pin_messages = requestingRights.pin_messages || editRights.pin_messages;
|
editRights.pin_messages = requestingRights.pin_messages || editRights.pin_messages;
|
||||||
editRights.manage_call = requestingRights.manage_call || editRights.manage_call;
|
editRights.manage_call = requestingRights.manage_call || editRights.manage_call;
|
||||||
editRights.anonymous = requestingRights.anonymous || editRights.anonymous;
|
editRights.anonymous = requestingRights.anonymous || editRights.anonymous;
|
||||||
|
editRights.other = requestingRights.other || editRights.other;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ChatRightsEditActivity editRightsActivity = new ChatRightsEditActivity(user.id, -did, editRights, null, null, currentRank, ChatRightsEditActivity.TYPE_ADD_BOT, true, !isInChatAlready, null);
|
ChatRightsEditActivity editRightsActivity = new ChatRightsEditActivity(user.id, -did, editRights, null, null, currentRank, ChatRightsEditActivity.TYPE_ADD_BOT, true, !isInChatAlready, null);
|
||||||
|
|
Loading…
Reference in a new issue