Update to 7.9.1 (2387)

This commit is contained in:
DrKLO 2021-07-31 06:39:13 +07:00
parent 3e5d2ba92b
commit 24c6968b8a
23 changed files with 266 additions and 138 deletions

View file

@ -299,7 +299,7 @@ android {
} }
} }
defaultConfig.versionCode = 2384 defaultConfig.versionCode = 2387
applicationVariants.all { variant -> applicationVariants.all { variant ->
variant.outputs.all { output -> variant.outputs.all { output ->
@ -318,7 +318,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 29 targetSdkVersion 29
versionName "7.9.0" versionName "7.9.1"
vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi'] vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']

View file

@ -394,7 +394,12 @@ JNIEXPORT jlong JNICALL Java_org_telegram_messenger_voip_NativeInstance_makeGrou
}); });
}, },
.videoCapture = videoCapture, .videoCapture = videoCapture,
.requestBroadcastPart = [](std::shared_ptr<PlatformContext> platformContext, int64_t timestamp, int64_t duration, std::function<void(BroadcastPart &&)> callback) -> std::shared_ptr<BroadcastPartTask> { .videoContentType = screencast ? VideoContentType::Screencast : VideoContentType::Generic,
.initialEnableNoiseSuppression = (bool) noiseSupression,
.platformContext = platformContext
};
if (!screencast) {
descriptor.requestBroadcastPart = [](std::shared_ptr<PlatformContext> platformContext, int64_t timestamp, int64_t duration, std::function<void(BroadcastPart &&)> callback) -> std::shared_ptr<BroadcastPartTask> {
std::shared_ptr<BroadcastPartTask> task = std::make_shared<BroadcastPartTaskJava>(platformContext, callback, timestamp); std::shared_ptr<BroadcastPartTask> task = std::make_shared<BroadcastPartTaskJava>(platformContext, callback, timestamp);
((AndroidContext *) platformContext.get())->streamTask = task; ((AndroidContext *) platformContext.get())->streamTask = task;
tgvoip::jni::DoWithJNI([platformContext, timestamp, duration, task](JNIEnv *env) { tgvoip::jni::DoWithJNI([platformContext, timestamp, duration, task](JNIEnv *env) {
@ -402,10 +407,8 @@ JNIEXPORT jlong JNICALL Java_org_telegram_messenger_voip_NativeInstance_makeGrou
env->CallVoidMethod(globalRef, env->GetMethodID(NativeInstanceClass, "onRequestBroadcastPart", "(JJ)V"), timestamp, duration); env->CallVoidMethod(globalRef, env->GetMethodID(NativeInstanceClass, "onRequestBroadcastPart", "(JJ)V"), timestamp, duration);
}); });
return task; return task;
}, };
.videoContentType = screencast ? VideoContentType::Screencast : VideoContentType::Generic, descriptor.requestMediaChannelDescriptions = [platformContext](std::vector<uint32_t> const &ssrcs, std::function<void(std::vector<MediaChannelDescription> &&)> callback) -> std::shared_ptr<RequestMediaChannelDescriptionTask> {
.initialEnableNoiseSuppression = (bool) noiseSupression,
.requestMediaChannelDescriptions = [platformContext](std::vector<uint32_t> const &ssrcs, std::function<void(std::vector<MediaChannelDescription> &&)> callback) -> std::shared_ptr<RequestMediaChannelDescriptionTask> {
std::shared_ptr<RequestMediaChannelDescriptionTaskJava> task = std::make_shared<RequestMediaChannelDescriptionTaskJava>(platformContext, callback); std::shared_ptr<RequestMediaChannelDescriptionTaskJava> task = std::make_shared<RequestMediaChannelDescriptionTaskJava>(platformContext, callback);
((AndroidContext *) platformContext.get())->descriptionTasks.push_back(task); ((AndroidContext *) platformContext.get())->descriptionTasks.push_back(task);
tgvoip::jni::DoWithJNI([platformContext, ssrcs, task](JNIEnv *env) { tgvoip::jni::DoWithJNI([platformContext, ssrcs, task](JNIEnv *env) {
@ -423,9 +426,8 @@ JNIEXPORT jlong JNICALL Java_org_telegram_messenger_voip_NativeInstance_makeGrou
env->DeleteLocalRef(intArray); env->DeleteLocalRef(intArray);
}); });
return task; return task;
},
.platformContext = platformContext
}; };
}
auto *holder = new InstanceHolder; auto *holder = new InstanceHolder;
holder->groupNativeInstance = std::make_unique<GroupInstanceCustomImpl>(std::move(descriptor)); holder->groupNativeInstance = std::make_unique<GroupInstanceCustomImpl>(std::move(descriptor));

View file

@ -23,7 +23,6 @@ import android.content.Context;
import android.graphics.PointF; import android.graphics.PointF;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.util.AttributeSet;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -59,7 +59,6 @@ import android.widget.LinearLayout;
import android.widget.OverScroller; import android.widget.OverScroller;
import org.telegram.messenger.AndroidUtilities; import org.telegram.messenger.AndroidUtilities;
import org.telegram.messenger.BuildConfig;
import org.telegram.messenger.BuildVars; import org.telegram.messenger.BuildVars;
import org.telegram.messenger.FileLog; import org.telegram.messenger.FileLog;
@ -2776,7 +2775,7 @@ public class RecyclerView extends ViewGroup implements ScrollingView,
* same View may still get the focus as a result of that search. * same View may still get the focus as a result of that search.
*/ */
private boolean isPreferredNextFocus(View focused, View next, int direction) { private boolean isPreferredNextFocus(View focused, View next, int direction) {
if (next == null || next == this) { if (next == null || next == this || next == focused) {
return false; return false;
} }
// panic, result view is not a child anymore, maybe workaround b/37864393 // panic, result view is not a child anymore, maybe workaround b/37864393
@ -2826,9 +2825,9 @@ public class RecyclerView extends ViewGroup implements ScrollingView,
case View.FOCUS_DOWN: case View.FOCUS_DOWN:
return downness > 0; return downness > 0;
case View.FOCUS_FORWARD: case View.FOCUS_FORWARD:
return downness > 0 || (downness == 0 && rightness * rtl >= 0); return downness > 0 || (downness == 0 && rightness * rtl > 0);
case View.FOCUS_BACKWARD: case View.FOCUS_BACKWARD:
return downness < 0 || (downness == 0 && rightness * rtl <= 0); return downness < 0 || (downness == 0 && rightness * rtl < 0);
} }
throw new IllegalArgumentException("Invalid direction: " + direction + exceptionLabel()); throw new IllegalArgumentException("Invalid direction: " + direction + exceptionLabel());
} }
@ -5107,7 +5106,7 @@ public class RecyclerView extends ViewGroup implements ScrollingView,
// but some general-purpose code may choose to respond to changes this way. // but some general-purpose code may choose to respond to changes this way.
final int scrollX = getScrollX(); final int scrollX = getScrollX();
final int scrollY = getScrollY(); final int scrollY = getScrollY();
onScrollChanged(scrollX, scrollY, scrollX, scrollY); onScrollChanged(scrollX, scrollY, scrollX - hresult, scrollY - vresult);
// Pass the real deltas to onScrolled, the RecyclerView-specific method. // Pass the real deltas to onScrolled, the RecyclerView-specific method.
onScrolled(hresult, vresult); onScrolled(hresult, vresult);
@ -5327,7 +5326,7 @@ public class RecyclerView extends ViewGroup implements ScrollingView,
postOnAnimation(); postOnAnimation();
if (mGapWorker != null) { if (mGapWorker != null) {
mGapWorker.postFromTraversal(RecyclerView.this, unconsumedX, unconsumedY); mGapWorker.postFromTraversal(RecyclerView.this, consumedX, consumedY);
} }
} }
} }

View file

@ -390,22 +390,6 @@ public class AndroidUtilities {
int end; int end;
} }
private static Boolean standaloneApp;
public static boolean isStandaloneApp() {
if (standaloneApp == null) {
standaloneApp = "org.telegram.messenger.web".equals(ApplicationLoader.applicationContext.getPackageName());
}
return standaloneApp;
}
private static Boolean betaApp;
public static boolean isBetaApp() {
if (betaApp == null) {
betaApp = "org.telegram.messenger.beta".equals(ApplicationLoader.applicationContext.getPackageName());
}
return betaApp;
}
private static String makeUrl(String url, String[] prefixes, Matcher matcher) { private static String makeUrl(String url, String[] prefixes, Matcher matcher) {
boolean hasPrefix = false; boolean hasPrefix = false;
for (int i = 0; i < prefixes.length; i++) { for (int i = 0; i < prefixes.length; i++) {
@ -1784,7 +1768,7 @@ public class AndroidUtilities {
public static boolean isTablet() { public static boolean isTablet() {
if (isTablet == null) { if (isTablet == null) {
isTablet = ApplicationLoader.applicationContext.getResources().getBoolean(R.bool.isTablet); isTablet = ApplicationLoader.applicationContext != null && ApplicationLoader.applicationContext.getResources().getBoolean(R.bool.isTablet);
} }
return isTablet; return isTablet;
} }

View file

@ -139,7 +139,7 @@ public class ApplicationLoader extends Application {
FileLog.d("screen state = " + isScreenOn); FileLog.d("screen state = " + isScreenOn);
} }
} catch (Exception e) { } catch (Exception e) {
FileLog.e(e); e.printStackTrace();
} }
SharedConfig.loadConfig(); SharedConfig.loadConfig();

View file

@ -19,14 +19,14 @@ 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 = true/* || Build.VERSION.SDK_INT <= 28*/; public static boolean NO_SCOPED_STORAGE = true/* || Build.VERSION.SDK_INT <= 28*/;
public static int BUILD_VERSION = 2384; public static int BUILD_VERSION = 2387;
public static String BUILD_VERSION_STRING = "7.9.0"; public static String BUILD_VERSION_STRING = "7.9.1";
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 APPCENTER_HASH = "a5b5c4f5-51da-dedc-9918-d9766a22ca7c"; public static String APPCENTER_HASH = "a5b5c4f5-51da-dedc-9918-d9766a22ca7c";
public static String APPCENTER_HASH_DEBUG = "f9726602-67c9-48d2-b5d0-4761f1c1a8f3"; public static String APPCENTER_HASH_DEBUG = "f9726602-67c9-48d2-b5d0-4761f1c1a8f3";
// //
public static String SMS_HASH = AndroidUtilities.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";
static { static {
@ -35,4 +35,20 @@ public class BuildVars {
LOGS_ENABLED = DEBUG_VERSION || sharedPreferences.getBoolean("logsEnabled", DEBUG_VERSION); LOGS_ENABLED = DEBUG_VERSION || sharedPreferences.getBoolean("logsEnabled", DEBUG_VERSION);
} }
} }
private static Boolean standaloneApp;
public static boolean isStandaloneApp() {
if (standaloneApp == null) {
standaloneApp = ApplicationLoader.applicationContext != null && "org.telegram.messenger.web".equals(ApplicationLoader.applicationContext.getPackageName());
}
return standaloneApp;
}
private static Boolean betaApp;
public static boolean isBetaApp() {
if (betaApp == null) {
betaApp = ApplicationLoader.applicationContext != null && "org.telegram.messenger.beta".equals(ApplicationLoader.applicationContext.getPackageName());
}
return betaApp;
}
} }

View file

@ -288,7 +288,6 @@ public class Emoji {
@Override @Override
public void setAlpha(int alpha) { public void setAlpha(int alpha) {
placeholderPaint.setAlpha(alpha);
paint.setAlpha(alpha); paint.setAlpha(alpha);
} }

View file

@ -14187,7 +14187,7 @@ public class MessagesController extends BaseController implements NotificationCe
} }
for (int a = 0, N = reasons.size(); a < N; a++) { for (int a = 0, N = reasons.size(); a < N; a++) {
TLRPC.TL_restrictionReason reason = reasons.get(a); TLRPC.TL_restrictionReason reason = reasons.get(a);
if ("all".equals(reason.platform) || !AndroidUtilities.isStandaloneApp() && !AndroidUtilities.isBetaApp() && "android".equals(reason.platform)) { if ("all".equals(reason.platform) || !BuildVars.isStandaloneApp() && !BuildVars.isBetaApp() && "android".equals(reason.platform)) {
return reason.text; return reason.text;
} }
} }

View file

@ -421,7 +421,7 @@ public class SharedConfig {
} }
public static boolean isAppUpdateAvailable() { public static boolean isAppUpdateAvailable() {
if (pendingAppUpdate == null || pendingAppUpdate.document == null || !AndroidUtilities.isStandaloneApp()) { if (pendingAppUpdate == null || pendingAppUpdate.document == null || !BuildVars.isStandaloneApp()) {
return false; return false;
} }
int currentVersion; int currentVersion;

View file

@ -2899,10 +2899,12 @@ public class VoIPService extends Service implements SensorEventListener, AudioMa
} }
stopForeground(true); stopForeground(true);
stopRinging(); stopRinging();
if (currentAccount >= 0) {
if (ApplicationLoader.mainInterfacePaused || !ApplicationLoader.isScreenOn) { if (ApplicationLoader.mainInterfacePaused || !ApplicationLoader.isScreenOn) {
MessagesController.getInstance(currentAccount).ignoreSetOnline = false; MessagesController.getInstance(currentAccount).ignoreSetOnline = false;
} }
NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.appDidLogout); NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.appDidLogout);
}
SensorManager sm = (SensorManager) getSystemService(SENSOR_SERVICE); SensorManager sm = (SensorManager) getSystemService(SENSOR_SERVICE);
Sensor proximity = sm.getDefaultSensor(Sensor.TYPE_PROXIMITY); Sensor proximity = sm.getDefaultSensor(Sensor.TYPE_PROXIMITY);
if (proximity != null) { if (proximity != null) {
@ -3006,17 +3008,19 @@ public class VoIPService extends Service implements SensorEventListener, AudioMa
} }
} }
ConnectionsManager.getInstance(currentAccount).setAppPaused(true, false);
VoIPHelper.lastCallTime = SystemClock.elapsedRealtime(); VoIPHelper.lastCallTime = SystemClock.elapsedRealtime();
setSinks(null, null); setSinks(null, null);
if (onDestroyRunnable != null) { if (onDestroyRunnable != null) {
onDestroyRunnable.run(); onDestroyRunnable.run();
} }
if (currentAccount >= 0) {
ConnectionsManager.getInstance(currentAccount).setAppPaused(true, false);
if (ChatObject.isChannel(chat)) { if (ChatObject.isChannel(chat)) {
MessagesController.getInstance(currentAccount).startShortPoll(chat, classGuid, true); MessagesController.getInstance(currentAccount).startShortPoll(chat, classGuid, true);
} }
} }
}
public long getCallID() { public long getCallID() {
return privateCall != null ? privateCall.id : 0; return privateCall != null ? privateCall.id : 0;

View file

@ -1458,7 +1458,7 @@ public class ActionBar extends FrameLayout {
@Override @Override
public Animator createAnimator(ViewGroup sceneRoot, TransitionValues startValues, TransitionValues endValues) { public Animator createAnimator(ViewGroup sceneRoot, TransitionValues startValues, TransitionValues endValues) {
if (startValues.view instanceof SimpleTextView) { if (startValues != null && startValues.view instanceof SimpleTextView) {
AnimatorSet animatorSet = new AnimatorSet(); AnimatorSet animatorSet = new AnimatorSet();
Animator animator = super.createAnimator(sceneRoot, startValues, endValues); Animator animator = super.createAnimator(sceneRoot, startValues, endValues);
float s = (float) startValues.values.get("text_size") / (float) endValues.values.get("text_size"); float s = (float) startValues.values.get("text_size") / (float) endValues.values.get("text_size");

View file

@ -229,7 +229,7 @@ public class ActionBarMenuItem extends FrameLayout {
toggleSubMenu(); toggleSubMenu();
return true; return true;
} }
} else if (popupWindow != null && popupWindow.isShowing()) { } else if (showSubmenuByMove && popupWindow != null && popupWindow.isShowing()) {
getLocationOnScreen(location); getLocationOnScreen(location);
float x = event.getX() + location[0]; float x = event.getX() + location[0];
float y = event.getY() + location[1]; float y = event.getY() + location[1];
@ -245,14 +245,14 @@ public class ActionBarMenuItem extends FrameLayout {
if (!rect.contains((int) x, (int) y)) { if (!rect.contains((int) x, (int) y)) {
child.setPressed(false); child.setPressed(false);
child.setSelected(false); child.setSelected(false);
if (Build.VERSION.SDK_INT == 21) { if (Build.VERSION.SDK_INT == 21 && child.getBackground() != null) {
child.getBackground().setVisible(false, false); child.getBackground().setVisible(false, false);
} }
} else { } else {
child.setPressed(true); child.setPressed(true);
child.setSelected(true); child.setSelected(true);
if (Build.VERSION.SDK_INT >= 21) { if (Build.VERSION.SDK_INT >= 21) {
if (Build.VERSION.SDK_INT == 21) { if (Build.VERSION.SDK_INT == 21 && child.getBackground() != null) {
child.getBackground().setVisible(true, false); child.getBackground().setVisible(true, false);
} }
child.drawableHotspotChanged(x, y - child.getTop()); child.drawableHotspotChanged(x, y - child.getTop());

View file

@ -7460,10 +7460,6 @@ public class Theme {
chat_statusRecordPaint.setStrokeCap(Paint.Cap.ROUND); chat_statusRecordPaint.setStrokeCap(Paint.Cap.ROUND);
chat_actionTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); chat_actionTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
chat_actionTextPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); chat_actionTextPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
chat_actionBackgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
chat_actionBackgroundSelectedPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
chat_actionBackgroundPaint2 = new Paint(Paint.ANTI_ALIAS_FLAG);
chat_actionBackgroundSelectedPaint2 = new Paint(Paint.ANTI_ALIAS_FLAG);
chat_actionBackgroundGradientDarkenPaint = new Paint(Paint.ANTI_ALIAS_FLAG); chat_actionBackgroundGradientDarkenPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
chat_actionBackgroundGradientDarkenPaint.setColor(0x2a000000); chat_actionBackgroundGradientDarkenPaint.setColor(0x2a000000);
chat_timeBackgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG); chat_timeBackgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
@ -7474,6 +7470,18 @@ public class Theme {
chat_radialProgressPausedPaint = new Paint(Paint.ANTI_ALIAS_FLAG); chat_radialProgressPausedPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
chat_radialProgressPausedSeekbarPaint = new Paint(Paint.ANTI_ALIAS_FLAG); chat_radialProgressPausedSeekbarPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
} }
if (chat_actionBackgroundPaint == null) {
chat_actionBackgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
}
if (chat_actionBackgroundSelectedPaint == null) {
chat_actionBackgroundSelectedPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
}
if (chat_actionBackgroundPaint2 == null) {
chat_actionBackgroundPaint2 = new Paint(Paint.ANTI_ALIAS_FLAG);
}
if (chat_actionBackgroundSelectedPaint2 == null) {
chat_actionBackgroundSelectedPaint2 = new Paint(Paint.ANTI_ALIAS_FLAG);
}
} }
public static void createChatResources(Context context, boolean fontsOnly) { public static void createChatResources(Context context, boolean fontsOnly) {
@ -8046,6 +8054,8 @@ public class Theme {
} }
if (servicePressedColor == null) { if (servicePressedColor == null) {
servicePressedColor = serviceSelectedMessageColor; servicePressedColor = serviceSelectedMessageColor;
}
if (servicePressedColor2 == null) {
servicePressedColor2 = serviceSelectedMessage2Color; servicePressedColor2 = serviceSelectedMessage2Color;
} }

View file

@ -29,16 +29,13 @@ import android.graphics.Path;
import android.graphics.PixelFormat; import android.graphics.PixelFormat;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter; import android.graphics.PorterDuffColorFilter;
import android.graphics.RadialGradient;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.RectF; import android.graphics.RectF;
import android.graphics.Shader; import android.graphics.Shader;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.RippleDrawable; import android.graphics.drawable.RippleDrawable;
import android.media.MediaPlayer;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -71,8 +68,6 @@ import android.widget.Toast;
import androidx.core.graphics.ColorUtils; import androidx.core.graphics.ColorUtils;
import com.google.android.exoplayer2.util.Log;
import org.telegram.PhoneFormat.PhoneFormat; import org.telegram.PhoneFormat.PhoneFormat;
import org.telegram.messenger.AndroidUtilities; import org.telegram.messenger.AndroidUtilities;
import org.telegram.messenger.ChatObject; import org.telegram.messenger.ChatObject;
@ -119,7 +114,6 @@ import org.telegram.ui.Components.LinkPath;
import org.telegram.ui.Components.MediaActionDrawable; import org.telegram.ui.Components.MediaActionDrawable;
import org.telegram.ui.Components.MessageBackgroundDrawable; import org.telegram.ui.Components.MessageBackgroundDrawable;
import org.telegram.ui.Components.MotionBackgroundDrawable; import org.telegram.ui.Components.MotionBackgroundDrawable;
import org.telegram.ui.Components.PlayPauseDrawable;
import org.telegram.ui.Components.Point; import org.telegram.ui.Components.Point;
import org.telegram.ui.Components.RLottieDrawable; import org.telegram.ui.Components.RLottieDrawable;
import org.telegram.ui.Components.RadialProgress2; import org.telegram.ui.Components.RadialProgress2;
@ -139,7 +133,6 @@ import org.telegram.ui.Components.URLSpanNoUnderline;
import org.telegram.ui.Components.VideoForwardDrawable; import org.telegram.ui.Components.VideoForwardDrawable;
import org.telegram.ui.PhotoViewer; import org.telegram.ui.PhotoViewer;
import org.telegram.ui.PinchToZoomHelper; import org.telegram.ui.PinchToZoomHelper;
import org.telegram.ui.RoundVideoProgressShadow;
import org.telegram.ui.SecretMediaViewer; import org.telegram.ui.SecretMediaViewer;
import java.io.File; import java.io.File;
@ -8483,6 +8476,10 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
maxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y); maxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y);
} }
} }
if (isPlayingRound) {
int backgroundWidthLocal = backgroundWidth - (AndroidUtilities.roundPlayingMessageSize - AndroidUtilities.roundMessageSize);
return maxWidth - backgroundWidthLocal - AndroidUtilities.dp(57);
}
return maxWidth - backgroundWidth - AndroidUtilities.dp(57); return maxWidth - backgroundWidth - AndroidUtilities.dp(57);
} }
if (currentMessagesGroup != null && !currentMessagesGroup.isDocuments) { if (currentMessagesGroup != null && !currentMessagesGroup.isDocuments) {
@ -10593,6 +10590,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
if (currentMessageObject.shouldDrawWithoutBackground()) { if (currentMessageObject.shouldDrawWithoutBackground()) {
if (currentMessageObject.isOutOwner()) { if (currentMessageObject.isOutOwner()) {
replyStartX = AndroidUtilities.dp(23); replyStartX = AndroidUtilities.dp(23);
if (isPlayingRound) {
replyStartX -= (AndroidUtilities.roundPlayingMessageSize - AndroidUtilities.roundMessageSize);
}
} else if (currentMessageObject.type == MessageObject.TYPE_ROUND_VIDEO) { } else if (currentMessageObject.type == MessageObject.TYPE_ROUND_VIDEO) {
replyStartX = backgroundDrawableLeft + backgroundDrawableRight + AndroidUtilities.dp(4); replyStartX = backgroundDrawableLeft + backgroundDrawableRight + AndroidUtilities.dp(4);
} else { } else {
@ -11076,8 +11076,12 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
replyStartX += currentMessagesGroup.transitionParams.offsetLeft; replyStartX += currentMessagesGroup.transitionParams.offsetLeft;
} }
if (transitionParams.animateBackgroundBoundsInner) { if (transitionParams.animateBackgroundBoundsInner) {
if (isRoundVideo) {
replyStartX += transitionParams.deltaLeft + transitionParams.deltaRight;
} else {
replyStartX += transitionParams.deltaLeft; replyStartX += transitionParams.deltaLeft;
} }
}
if (currentMessageObject.shouldDrawWithoutBackground()) { if (currentMessageObject.shouldDrawWithoutBackground()) {
Theme.chat_replyLinePaint.setColor(Theme.getColor(Theme.key_chat_stickerReplyLine)); Theme.chat_replyLinePaint.setColor(Theme.getColor(Theme.key_chat_stickerReplyLine));
int oldAlpha = Theme.chat_replyLinePaint.getAlpha(); int oldAlpha = Theme.chat_replyLinePaint.getAlpha();
@ -13222,6 +13226,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
y1 = layoutHeight - AndroidUtilities.dp(6.3f - (drawPinnedBottom ? 2 : 0)) - timeLayout.getHeight(); y1 = layoutHeight - AndroidUtilities.dp(6.3f - (drawPinnedBottom ? 2 : 0)) - timeLayout.getHeight();
} }
if (durationLayout != null) {
Theme.chat_timePaint.setAlpha((int) (255 * timeAlpha)); Theme.chat_timePaint.setAlpha((int) (255 * timeAlpha));
canvas.save(); canvas.save();
canvas.translate(x1, y1); canvas.translate(x1, y1);
@ -13230,6 +13235,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
Theme.chat_timePaint.setAlpha(255); Theme.chat_timePaint.setAlpha(255);
} }
} }
}
@Override @Override
public int getObserverTag() { public int getObserverTag() {
@ -13570,6 +13576,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
private class MessageAccessibilityNodeProvider extends AccessibilityNodeProvider { private class MessageAccessibilityNodeProvider extends AccessibilityNodeProvider {
private final int LINK_IDS_START = 2000; private final int LINK_IDS_START = 2000;
private final int LINK_CAPTION_IDS_START = 3000;
private final int BOT_BUTTONS_START = 1000; private final int BOT_BUTTONS_START = 1000;
private final int POLL_BUTTONS_START = 500; private final int POLL_BUTTONS_START = 500;
private final int INSTANT_VIEW = 499; private final int INSTANT_VIEW = 499;
@ -13583,7 +13590,6 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
@Override @Override
public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) {
//FileLog.e("create node info "+virtualViewId);
int[] pos = {0, 0}; int[] pos = {0, 0};
getLocationOnScreen(pos); getLocationOnScreen(pos);
if (virtualViewId == HOST_VIEW_ID) { if (virtualViewId == HOST_VIEW_ID) {
@ -13594,6 +13600,14 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
sb.append(UserObject.getUserName(currentUser)); sb.append(UserObject.getUserName(currentUser));
sb.append('\n'); sb.append('\n');
} }
if (drawForwardedName) {
for (int a = 0; a < 2; a++) {
if (forwardedNameLayout[a] != null) {
sb.append(forwardedNameLayout[a].getText());
sb.append(a == 0 ? " " : "\n");
}
}
}
if (!TextUtils.isEmpty(currentMessageObject.messageText)) { if (!TextUtils.isEmpty(currentMessageObject.messageText)) {
sb.append(currentMessageObject.messageText); sb.append(currentMessageObject.messageText);
} }
@ -13608,10 +13622,16 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
sb.append(", "); sb.append(", ");
sb.append(AndroidUtilities.formatFileSize(documentAttach.size)); sb.append(AndroidUtilities.formatFileSize(documentAttach.size));
} }
if (documentAttachType == DOCUMENT_ATTACH_TYPE_VIDEO) {
sb.append(", ");
sb.append(LocaleController.formatDuration(currentMessageObject.getDuration()));
}
} }
if (currentMessageObject.isMusic()) { if (currentMessageObject.isMusic()) {
sb.append("\n"); sb.append("\n");
sb.append(LocaleController.formatString("AccDescrMusicInfo", R.string.AccDescrMusicInfo, currentMessageObject.getMusicAuthor(), currentMessageObject.getMusicTitle())); sb.append(LocaleController.formatString("AccDescrMusicInfo", R.string.AccDescrMusicInfo, currentMessageObject.getMusicAuthor(), currentMessageObject.getMusicTitle()));
sb.append(", ");
sb.append(LocaleController.formatDuration(currentMessageObject.getDuration()));
} else if (currentMessageObject.isVoice() || isRoundVideo) { } else if (currentMessageObject.isVoice() || isRoundVideo) {
sb.append(", "); sb.append(", ");
sb.append(LocaleController.formatDuration(currentMessageObject.getDuration())); sb.append(LocaleController.formatDuration(currentMessageObject.getDuration()));
@ -13720,7 +13740,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
info.addAction(AccessibilityNodeInfo.ACTION_LONG_CLICK); info.addAction(AccessibilityNodeInfo.ACTION_LONG_CLICK);
} }
if (currentMessageObject.isVoice() || currentMessageObject.isMusic() && MediaController.getInstance().isPlayingMessage(currentMessageObject)) { if ((currentMessageObject.isVoice() || currentMessageObject.isMusic()) && MediaController.getInstance().isPlayingMessage(currentMessageObject)) {
seekBarAccessibilityDelegate.onInitializeAccessibilityNodeInfoInternal(info); seekBarAccessibilityDelegate.onInitializeAccessibilityNodeInfoInternal(info);
} }
@ -13734,6 +13754,15 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
i++; i++;
} }
} }
if (currentMessageObject.caption instanceof Spannable) {
Spannable buffer = (Spannable) currentMessageObject.caption;
CharacterStyle[] links = buffer.getSpans(0, buffer.length(), ClickableSpan.class);
i = 0;
for (CharacterStyle link : links) {
info.addChild(ChatMessageCell.this, LINK_CAPTION_IDS_START + i);
i++;
}
}
i = 0; i = 0;
for (BotButton button : botButtons) { for (BotButton button : botButtons) {
info.addChild(ChatMessageCell.this, BOT_BUTTONS_START + i); info.addChild(ChatMessageCell.this, BOT_BUTTONS_START + i);
@ -13768,12 +13797,43 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
info.setSource(ChatMessageCell.this, virtualViewId); info.setSource(ChatMessageCell.this, virtualViewId);
info.setParent(ChatMessageCell.this); info.setParent(ChatMessageCell.this);
info.setPackageName(getContext().getPackageName()); info.setPackageName(getContext().getPackageName());
if (virtualViewId >= LINK_IDS_START) { if (virtualViewId >= LINK_CAPTION_IDS_START) {
if (!(currentMessageObject.caption instanceof Spannable) || captionLayout == null) {
return null;
}
Spannable buffer = (Spannable) currentMessageObject.caption;
ClickableSpan link = getLinkById(virtualViewId, true);
if (link == null) {
return null;
}
int[] linkPos = getRealSpanStartAndEnd(buffer, link);
String content = buffer.subSequence(linkPos[0], linkPos[1]).toString();
info.setText(content);
int length = captionLayout.getText().length();
captionLayout.getSelectionPath(linkPos[0], linkPos[1], linkPath);
linkPath.computeBounds(rectF, true);
rect.set((int) rectF.left, (int) rectF.top, (int) rectF.right, (int) rectF.bottom);
rect.offset((int) captionX, (int) captionY);
info.setBoundsInParent(rect);
if (accessibilityVirtualViewBounds.get(virtualViewId) == null) {
accessibilityVirtualViewBounds.put(virtualViewId, new Rect(rect));
}
rect.offset(pos[0], pos[1]);
info.setBoundsInScreen(rect);
info.setClassName("android.widget.TextView");
info.setEnabled(true);
info.setClickable(true);
info.setLongClickable(true);
info.addAction(AccessibilityNodeInfo.ACTION_CLICK);
info.addAction(AccessibilityNodeInfo.ACTION_LONG_CLICK);
} else if (virtualViewId >= LINK_IDS_START) {
if (!(currentMessageObject.messageText instanceof Spannable)) { if (!(currentMessageObject.messageText instanceof Spannable)) {
return null; return null;
} }
Spannable buffer = (Spannable) currentMessageObject.messageText; Spannable buffer = (Spannable) currentMessageObject.messageText;
ClickableSpan link = getLinkById(virtualViewId); ClickableSpan link = getLinkById(virtualViewId, false);
if (link == null) { if (link == null) {
return null; return null;
} }
@ -13898,7 +13958,6 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
info.setContentDescription(LocaleController.getString("ShareFile", R.string.ShareFile)); info.setContentDescription(LocaleController.getString("ShareFile", R.string.ShareFile));
} }
info.addAction(AccessibilityNodeInfo.ACTION_CLICK); info.addAction(AccessibilityNodeInfo.ACTION_CLICK);
// } else if (drawShareButton && x >= shareStartX && x <= shareStartX + AndroidUtilities.dp(40) && y >= shareStartY && y <= shareStartY + AndroidUtilities.dp(32)) {
rect.set((int) sideStartX, (int) sideStartY, (int) sideStartX + AndroidUtilities.dp(40), (int) sideStartY + AndroidUtilities.dp(32)); rect.set((int) sideStartX, (int) sideStartY, (int) sideStartX + AndroidUtilities.dp(40), (int) sideStartY + AndroidUtilities.dp(32));
info.setBoundsInParent(rect); info.setBoundsInParent(rect);
if (accessibilityVirtualViewBounds.get(virtualViewId) == null || !accessibilityVirtualViewBounds.get(virtualViewId).equals(rect)) { if (accessibilityVirtualViewBounds.get(virtualViewId) == null || !accessibilityVirtualViewBounds.get(virtualViewId).equals(rect)) {
@ -13960,8 +14019,14 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
if (action == AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS) { if (action == AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS) {
sendAccessibilityEventForVirtualView(virtualViewId, AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED); sendAccessibilityEventForVirtualView(virtualViewId, AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED);
} else if (action == AccessibilityNodeInfo.ACTION_CLICK) { } else if (action == AccessibilityNodeInfo.ACTION_CLICK) {
if (virtualViewId >= LINK_IDS_START) { if (virtualViewId >= LINK_CAPTION_IDS_START) {
ClickableSpan link = getLinkById(virtualViewId); ClickableSpan link = getLinkById(virtualViewId, true);
if (link != null) {
delegate.didPressUrl(ChatMessageCell.this, link, false);
sendAccessibilityEventForVirtualView(virtualViewId, AccessibilityEvent.TYPE_VIEW_CLICKED);
}
} else if (virtualViewId >= LINK_IDS_START) {
ClickableSpan link = getLinkById(virtualViewId, false);
if (link != null) { if (link != null) {
delegate.didPressUrl(ChatMessageCell.this, link, false); delegate.didPressUrl(ChatMessageCell.this, link, false);
sendAccessibilityEventForVirtualView(virtualViewId, AccessibilityEvent.TYPE_VIEW_CLICKED); sendAccessibilityEventForVirtualView(virtualViewId, AccessibilityEvent.TYPE_VIEW_CLICKED);
@ -14018,7 +14083,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
} }
} }
} else if (action == AccessibilityNodeInfo.ACTION_LONG_CLICK) { } else if (action == AccessibilityNodeInfo.ACTION_LONG_CLICK) {
ClickableSpan link = getLinkById(virtualViewId); ClickableSpan link = getLinkById(virtualViewId, virtualViewId >= LINK_CAPTION_IDS_START);
if (link != null) { if (link != null) {
delegate.didPressUrl(ChatMessageCell.this, link, true); delegate.didPressUrl(ChatMessageCell.this, link, true);
sendAccessibilityEventForVirtualView(virtualViewId, AccessibilityEvent.TYPE_VIEW_LONG_CLICKED); sendAccessibilityEventForVirtualView(virtualViewId, AccessibilityEvent.TYPE_VIEW_LONG_CLICKED);
@ -14028,7 +14093,19 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
return true; return true;
} }
private ClickableSpan getLinkById(int id) { private ClickableSpan getLinkById(int id, boolean caption) {
if (caption) {
id -= LINK_CAPTION_IDS_START;
if (!(currentMessageObject.caption instanceof Spannable)) {
return null;
}
Spannable buffer = (Spannable) currentMessageObject.caption;
ClickableSpan[] links = buffer.getSpans(0, buffer.length(), ClickableSpan.class);
if (links.length <= id) {
return null;
}
return links[id];
} else {
id -= LINK_IDS_START; id -= LINK_IDS_START;
if (!(currentMessageObject.messageText instanceof Spannable)) { if (!(currentMessageObject.messageText instanceof Spannable)) {
return null; return null;
@ -14041,6 +14118,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
return links[id]; return links[id];
} }
} }
}
public void setImageCoords(float x, float y, float w, float h) { public void setImageCoords(float x, float y, float w, float h) {
photoImage.setImageCoords(x, y, w, h); photoImage.setImageCoords(x, y, w, h);

View file

@ -2793,6 +2793,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
groupedBackgroundWasDraw = true; groupedBackgroundWasDraw = true;
} }
if (cell != null && cell.getPhotoImage().isAnimationRunning()) {
invalidate();
}
float viewClipLeft = Math.max(chatListView.getLeft(), chatListView.getLeft() + child.getX()); float viewClipLeft = Math.max(chatListView.getLeft(), chatListView.getLeft() + child.getX());
float viewClipTop = Math.max(listTop, chatListView.getTop() + child.getY()); float viewClipTop = Math.max(listTop, chatListView.getTop() + child.getY());
float viewClipRight = Math.min(chatListView.getRight(), chatListView.getLeft() + child.getX() + child.getMeasuredWidth()); float viewClipRight = Math.min(chatListView.getRight(), chatListView.getLeft() + child.getX() + child.getMeasuredWidth());

View file

@ -1832,9 +1832,12 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
return false; return false;
} }
if (isPopupShowing() && event.getAction() == MotionEvent.ACTION_DOWN) { if (isPopupShowing() && event.getAction() == MotionEvent.ACTION_DOWN) {
boolean rez = false;
if (searchingType != 0) { if (searchingType != 0) {
searchingType = 0; searchingType = 0;
emojiView.closeSearch(false); emojiView.closeSearch(false);
requestFocus();
rez = true;
} }
showPopup(AndroidUtilities.usingHardwareInput ? 0 : 2, 0); showPopup(AndroidUtilities.usingHardwareInput ? 0 : 2, 0);
if (stickersExpanded) { if (stickersExpanded) {
@ -1847,7 +1850,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
} else { } else {
openKeyboardInternal(); openKeyboardInternal();
} }
return false; return rez;
} }
try { try {
return super.onTouchEvent(event); return super.onTouchEvent(event);
@ -4092,7 +4095,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
} }
if (stickersExpanded) { if (stickersExpanded) {
setStickersExpanded(false, true, false); setStickersExpanded(false, true, false);
if (searchingType != 0) { if (searchingType != 0 && emojiView != null) {
emojiView.closeSearch(false); emojiView.closeSearch(false);
emojiView.hideSearchKeyboard(); emojiView.hideSearchKeyboard();
} }
@ -4165,6 +4168,20 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
} }
return; return;
} }
if (searchingType != 0) {
searchingType = 0;
emojiView.closeSearch(false);
if (stickersExpanded) {
setStickersExpanded(false, true, false);
waitingForKeyboardOpenAfterAnimation = true;
AndroidUtilities.runOnUIThread(() -> {
waitingForKeyboardOpenAfterAnimation = false;
openKeyboardInternal();
}, 200);
}
}
CharSequence[] message = new CharSequence[]{AndroidUtilities.getTrimmedString(messageEditText.getText())}; CharSequence[] message = new CharSequence[]{AndroidUtilities.getTrimmedString(messageEditText.getText())};
ArrayList<TLRPC.MessageEntity> entities = MediaDataController.getInstance(currentAccount).getEntities(message, supportsSendingNewEntities()); ArrayList<TLRPC.MessageEntity> entities = MediaDataController.getInstance(currentAccount).getEntities(message, supportsSendingNewEntities());
if (!TextUtils.equals(message[0], editingMessageObject.messageText) || entities != null && !entities.isEmpty() || entities == null && !editingMessageObject.messageOwner.entities.isEmpty() || editingMessageObject.messageOwner.media instanceof TLRPC.TL_messageMediaWebPage) { if (!TextUtils.equals(message[0], editingMessageObject.messageText) || entities != null && !entities.isEmpty() || entities == null && !editingMessageObject.messageOwner.entities.isEmpty() || editingMessageObject.messageOwner.media instanceof TLRPC.TL_messageMediaWebPage) {

View file

@ -220,6 +220,7 @@ public class InstantCameraView extends FrameLayout implements NotificationCenter
private int pointerId1, pointerId2; private int pointerId1, pointerId2;
private int textureViewSize; private int textureViewSize;
private boolean isMessageTransition; private boolean isMessageTransition;
private boolean updateTextureViewSize;
@SuppressLint("ClickableViewAccessibility") @SuppressLint("ClickableViewAccessibility")
public InstantCameraView(Context context, ChatActivity parentFragment) { public InstantCameraView(Context context, ChatActivity parentFragment) {
@ -358,8 +359,9 @@ public class InstantCameraView extends FrameLayout implements NotificationCenter
@Override @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (updateTextureViewSize) {
int newSize; int newSize;
if (MeasureSpec.getSize(heightMeasureSpec) > MeasureSpec.getSize(widthMeasureSpec)) { if (MeasureSpec.getSize(heightMeasureSpec) > MeasureSpec.getSize(widthMeasureSpec) * 1.3f) {
newSize = AndroidUtilities.roundPlayingMessageSize; newSize = AndroidUtilities.roundPlayingMessageSize;
} else { } else {
newSize = AndroidUtilities.roundMessageSize; newSize = AndroidUtilities.roundMessageSize;
@ -374,6 +376,8 @@ public class InstantCameraView extends FrameLayout implements NotificationCenter
cameraContainer.invalidateOutline(); cameraContainer.invalidateOutline();
} }
} }
updateTextureViewSize = false;
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec); super.onMeasure(widthMeasureSpec, heightMeasureSpec);
} }
@ -597,6 +601,7 @@ public class InstantCameraView extends FrameLayout implements NotificationCenter
}); });
cameraContainer.addView(textureView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT)); cameraContainer.addView(textureView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
updateTextureViewSize = true;
setVisibility(VISIBLE); setVisibility(VISIBLE);
startAnimation(true); startAnimation(true);

View file

@ -238,6 +238,7 @@ public class RecyclerAnimationScrollHelper {
} }
} }
recyclerView.setScrollEnabled(true);
recyclerView.setVerticalScrollBarEnabled(true); recyclerView.setVerticalScrollBarEnabled(true);
if (BuildVars.DEBUG_VERSION) { if (BuildVars.DEBUG_VERSION) {

View file

@ -4138,8 +4138,10 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
if (searchIsShowed) { if (searchIsShowed) {
AndroidUtilities.requestAdjustResize(getParentActivity(), classGuid); AndroidUtilities.requestAdjustResize(getParentActivity(), classGuid);
} }
if (viewPages != null) {
viewPages[0].dialogsAdapter.notifyDataSetChanged(); viewPages[0].dialogsAdapter.notifyDataSetChanged();
} }
}
@Override @Override
public boolean presentFragment(BaseFragment fragment) { public boolean presentFragment(BaseFragment fragment) {

View file

@ -1629,7 +1629,7 @@ public class LoginActivity extends BaseFragment {
return; return;
} }
String phone = PhoneFormat.stripExceptNumbers("" + codeField.getText() + phoneField.getText()); String phone = PhoneFormat.stripExceptNumbers("" + codeField.getText() + phoneField.getText());
boolean isTestBakcend = getConnectionsManager().isTestBackend(); boolean isTestBakcend = BuildVars.DEBUG_PRIVATE_VERSION && getConnectionsManager().isTestBackend();
if (isTestBakcend != testBackend) { if (isTestBakcend != testBackend) {
getConnectionsManager().switchBackend(false); getConnectionsManager().switchBackend(false);
isTestBakcend = testBackend; isTestBakcend = testBackend;

View file

@ -4763,7 +4763,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
public void setVisibility(int visibility) { public void setVisibility(int visibility) {
super.setVisibility(visibility); super.setVisibility(visibility);
if (videoTimelineView != null && videoTimelineView.getVisibility() != GONE) { if (videoTimelineView != null && videoTimelineView.getVisibility() != GONE) {
showVideoTimeline(visibility == View.VISIBLE, false); videoTimelineView.setVisibility(visibility == VISIBLE ? VISIBLE : INVISIBLE);
} }
} }
@ -4801,9 +4801,11 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
videoTimelineView = new VideoTimelinePlayView(parentActivity) { videoTimelineView = new VideoTimelinePlayView(parentActivity) {
@Override @Override
public void setTranslationY(float translationY) { public void setTranslationY(float translationY) {
if (getTranslationY() != translationY) {
super.setTranslationY(translationY); super.setTranslationY(translationY);
containerView.invalidate(); containerView.invalidate();
} }
}
}; };
videoTimelineView.setDelegate(new VideoTimelinePlayView.VideoTimelineViewDelegate() { videoTimelineView.setDelegate(new VideoTimelinePlayView.VideoTimelineViewDelegate() {
@ -10485,6 +10487,8 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
if (!animated) { if (!animated) {
videoTimelineView.animate().setListener(null).cancel(); videoTimelineView.animate().setListener(null).cancel();
videoTimelineView.setVisibility(show ? View.VISIBLE : View.GONE); videoTimelineView.setVisibility(show ? View.VISIBLE : View.GONE);
videoTimelineView.setTranslationY(0);
videoTimelineView.setAlpha(pickerView.getAlpha());
} else { } else {
if (show && videoTimelineView.getTag() == null) { if (show && videoTimelineView.getTag() == null) {
if (videoTimelineView.getVisibility() != View.VISIBLE) { if (videoTimelineView.getVisibility() != View.VISIBLE) {

View file

@ -2676,7 +2676,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
LocaleController.getString("DebugMenuClearMediaCache", R.string.DebugMenuClearMediaCache), LocaleController.getString("DebugMenuClearMediaCache", R.string.DebugMenuClearMediaCache),
LocaleController.getString("DebugMenuCallSettings", R.string.DebugMenuCallSettings), LocaleController.getString("DebugMenuCallSettings", R.string.DebugMenuCallSettings),
null, null,
BuildVars.DEBUG_PRIVATE_VERSION || AndroidUtilities.isStandaloneApp() ? LocaleController.getString("DebugMenuCheckAppUpdate", R.string.DebugMenuCheckAppUpdate) : null, BuildVars.DEBUG_PRIVATE_VERSION || BuildVars.isStandaloneApp() ? LocaleController.getString("DebugMenuCheckAppUpdate", R.string.DebugMenuCheckAppUpdate) : null,
LocaleController.getString("DebugMenuReadAllDialogs", R.string.DebugMenuReadAllDialogs), LocaleController.getString("DebugMenuReadAllDialogs", R.string.DebugMenuReadAllDialogs),
SharedConfig.pauseMusicOnRecord ? LocaleController.getString("DebugMenuDisablePauseMusic", R.string.DebugMenuDisablePauseMusic) : LocaleController.getString("DebugMenuEnablePauseMusic", R.string.DebugMenuEnablePauseMusic), SharedConfig.pauseMusicOnRecord ? LocaleController.getString("DebugMenuDisablePauseMusic", R.string.DebugMenuDisablePauseMusic) : LocaleController.getString("DebugMenuEnablePauseMusic", R.string.DebugMenuEnablePauseMusic),
BuildVars.DEBUG_VERSION && !AndroidUtilities.isTablet() && Build.VERSION.SDK_INT >= 23 ? (SharedConfig.smoothKeyboard ? LocaleController.getString("DebugMenuDisableSmoothKeyboard", R.string.DebugMenuDisableSmoothKeyboard) : LocaleController.getString("DebugMenuEnableSmoothKeyboard", R.string.DebugMenuEnableSmoothKeyboard)) : null, BuildVars.DEBUG_VERSION && !AndroidUtilities.isTablet() && Build.VERSION.SDK_INT >= 23 ? (SharedConfig.smoothKeyboard ? LocaleController.getString("DebugMenuDisableSmoothKeyboard", R.string.DebugMenuDisableSmoothKeyboard) : LocaleController.getString("DebugMenuEnableSmoothKeyboard", R.string.DebugMenuEnableSmoothKeyboard)) : null,
@ -3012,6 +3012,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
timeItem = new ImageView(context); timeItem = new ImageView(context);
timeItem.setPadding(AndroidUtilities.dp(10), AndroidUtilities.dp(10), AndroidUtilities.dp(5), AndroidUtilities.dp(5)); timeItem.setPadding(AndroidUtilities.dp(10), AndroidUtilities.dp(10), AndroidUtilities.dp(5), AndroidUtilities.dp(5));
timeItem.setScaleType(ImageView.ScaleType.CENTER); timeItem.setScaleType(ImageView.ScaleType.CENTER);
timeItem.setAlpha(0.0f);
timeItem.setImageDrawable(timerDrawable = new TimerDrawable(context)); timeItem.setImageDrawable(timerDrawable = new TimerDrawable(context));
frameLayout.addView(timeItem, LayoutHelper.createFrame(34, 34, Gravity.TOP | Gravity.LEFT)); frameLayout.addView(timeItem, LayoutHelper.createFrame(34, 34, Gravity.TOP | Gravity.LEFT));
updateTimeItem(); updateTimeItem();
@ -5005,6 +5006,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
@Override @Override
protected AnimatorSet onCustomTransitionAnimation(final boolean isOpen, final Runnable callback) { protected AnimatorSet onCustomTransitionAnimation(final boolean isOpen, final Runnable callback) {
if (playProfileAnimation != 0 && allowProfileAnimation && !isPulledDown) { if (playProfileAnimation != 0 && allowProfileAnimation && !isPulledDown) {
if (timeItem != null) {
timeItem.setAlpha(1.0f);
}
final AnimatorSet animatorSet = new AnimatorSet(); final AnimatorSet animatorSet = new AnimatorSet();
animatorSet.setDuration(playProfileAnimation == 2 ? 250 : 180); animatorSet.setDuration(playProfileAnimation == 2 ? 250 : 180);
listView.setLayerType(View.LAYER_TYPE_HARDWARE, null); listView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
@ -5060,9 +5064,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
animators.add(ObjectAnimator.ofFloat(nameTextView[a], View.ALPHA, a == 0 ? 0.0f : 1.0f)); animators.add(ObjectAnimator.ofFloat(nameTextView[a], View.ALPHA, a == 0 ? 0.0f : 1.0f));
} }
if (timeItem.getTag() != null) { if (timeItem.getTag() != null) {
animators.add(ObjectAnimator.ofFloat(timeItem, View.ALPHA, 0.0f)); animators.add(ObjectAnimator.ofFloat(timeItem, View.ALPHA, 1.0f, 0.0f));
animators.add(ObjectAnimator.ofFloat(timeItem, View.SCALE_X, 0.0f)); animators.add(ObjectAnimator.ofFloat(timeItem, View.SCALE_X, 1.0f, 0.0f));
animators.add(ObjectAnimator.ofFloat(timeItem, View.SCALE_Y, 0.0f)); animators.add(ObjectAnimator.ofFloat(timeItem, View.SCALE_Y, 1.0f, 0.0f));
} }
if (animatingItem != null) { if (animatingItem != null) {
animatingItem.setAlpha(1.0f); animatingItem.setAlpha(1.0f);
@ -5114,9 +5118,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
animators.add(ObjectAnimator.ofFloat(nameTextView[a], View.ALPHA, a == 0 ? 1.0f : 0.0f)); animators.add(ObjectAnimator.ofFloat(nameTextView[a], View.ALPHA, a == 0 ? 1.0f : 0.0f));
} }
if (timeItem.getTag() != null) { if (timeItem.getTag() != null) {
animators.add(ObjectAnimator.ofFloat(timeItem, View.ALPHA, 1.0f)); animators.add(ObjectAnimator.ofFloat(timeItem, View.ALPHA, 0.0f, 1.0f));
animators.add(ObjectAnimator.ofFloat(timeItem, View.SCALE_X, 1.0f)); animators.add(ObjectAnimator.ofFloat(timeItem, View.SCALE_X, 0.0f, 1.0f));
animators.add(ObjectAnimator.ofFloat(timeItem, View.SCALE_Y, 1.0f)); animators.add(ObjectAnimator.ofFloat(timeItem, View.SCALE_Y, 0.0f, 1.0f));
} }
if (animatingItem != null) { if (animatingItem != null) {
animatingItem.setAlpha(0.0f); animatingItem.setAlpha(0.0f);
@ -6783,7 +6787,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
break; break;
case 0: case 0:
case 9: case 9:
if (AndroidUtilities.isStandaloneApp()) { if (BuildVars.isStandaloneApp()) {
abi = "direct " + Build.CPU_ABI + " " + Build.CPU_ABI2; abi = "direct " + Build.CPU_ABI + " " + Build.CPU_ABI2;
} else { } else {
abi = "universal " + Build.CPU_ABI + " " + Build.CPU_ABI2; abi = "universal " + Build.CPU_ABI + " " + Build.CPU_ABI2;