mirror of
https://github.com/wrwrabbit/Partisan-Telegram-Android.git
synced 2026-05-05 23:51:00 +00:00
Update to 7.8.2 (2376)
Thanks to @alabiaga and @marcelpinto for help with improvements for Android 12. https://github.com/DrKLO/Telegram/pull/1633 https://github.com/DrKLO/Telegram/pull/1636 https://github.com/DrKLO/Telegram/pull/1630
This commit is contained in:
parent
3ac3c37dd2
commit
7a60f948ae
83 changed files with 1038 additions and 877 deletions
|
|
@ -644,9 +644,11 @@ public class ActionBarLayout extends FrameLayout {
|
|||
public boolean onTouchEvent(MotionEvent ev) {
|
||||
if (!checkTransitionAnimation() && !inActionMode && !animationInProgress) {
|
||||
if (fragmentsStack.size() > 1) {
|
||||
if (ev != null && ev.getAction() == MotionEvent.ACTION_DOWN && !startedTracking && !maybeStartTracking) {
|
||||
if (ev != null && ev.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
BaseFragment currentFragment = fragmentsStack.get(fragmentsStack.size() - 1);
|
||||
if (!currentFragment.isSwipeBackEnabled(ev)) {
|
||||
maybeStartTracking = false;
|
||||
startedTracking = false;
|
||||
return false;
|
||||
}
|
||||
startedTrackingPointerId = ev.getPointerId(0);
|
||||
|
|
|
|||
|
|
@ -358,7 +358,11 @@ public class AlertDialog extends Dialog implements Drawable.Callback {
|
|||
WindowManager.LayoutParams params = new WindowManager.LayoutParams();
|
||||
params.copyFrom(window.getAttributes());
|
||||
params.width = Math.min(maxWidth, calculatedWidth) + backgroundPaddings.left + backgroundPaddings.right;
|
||||
window.setAttributes(params);
|
||||
try {
|
||||
window.setAttributes(params);
|
||||
} catch (Throwable e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7369,7 +7369,7 @@ public class Theme {
|
|||
}
|
||||
}
|
||||
|
||||
public static void createCommonChatResources(Context context) {
|
||||
public static void createCommonChatResources() {
|
||||
synchronized (sync) {
|
||||
if (chat_msgTextPaint == null) {
|
||||
chat_msgTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
|
||||
|
|
@ -7466,7 +7466,7 @@ public class Theme {
|
|||
}
|
||||
|
||||
public static void createChatResources(Context context, boolean fontsOnly) {
|
||||
createCommonChatResources(context);
|
||||
createCommonChatResources();
|
||||
|
||||
if (!fontsOnly && chat_msgInDrawable == null) {
|
||||
|
||||
|
|
@ -8687,6 +8687,7 @@ public class Theme {
|
|||
Drawable drawable = wallpaper;
|
||||
AndroidUtilities.runOnUIThread(() -> {
|
||||
wallpaperLoadTask = null;
|
||||
createCommonChatResources();
|
||||
applyChatServiceMessageColor(null, null, drawable);
|
||||
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.didSetNewWallpapper);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -8028,10 +8028,13 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
if (firstVisibleBlockNum >= 0) {
|
||||
int restore = Integer.MIN_VALUE;
|
||||
int oldAlpha = -1;
|
||||
int oldLinkAlpha = -1;
|
||||
if (alpha != 1.0f) {
|
||||
if (drawOnlyText) {
|
||||
oldAlpha = Theme.chat_msgTextPaint.getAlpha();
|
||||
oldLinkAlpha = Color.alpha(Theme.chat_msgTextPaint.linkColor);
|
||||
Theme.chat_msgTextPaint.setAlpha((int) (oldAlpha * alpha));
|
||||
Theme.chat_msgTextPaint.linkColor = ColorUtils.setAlphaComponent(Theme.chat_msgTextPaint.linkColor, (int) (oldLinkAlpha * alpha));
|
||||
} else {
|
||||
if (currentBackgroundDrawable != null) {
|
||||
int top = currentBackgroundDrawable.getBounds().top;
|
||||
|
|
@ -8083,6 +8086,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
}
|
||||
if (oldAlpha >= 0) {
|
||||
Theme.chat_msgTextPaint.setAlpha(oldAlpha);
|
||||
Theme.chat_msgTextPaint.linkColor = ColorUtils.setAlphaComponent(Theme.chat_msgTextPaint.linkColor, oldLinkAlpha);
|
||||
}
|
||||
|
||||
if (restore != Integer.MIN_VALUE) {
|
||||
|
|
@ -9817,6 +9821,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
return;
|
||||
}
|
||||
Theme.MessageDrawable drawable = a == 0 ? currentBackgroundDrawable : currentBackgroundSelectedDrawable;
|
||||
if (drawable == null) {
|
||||
continue;
|
||||
}
|
||||
int h = parentHeight;
|
||||
if (h == 0) {
|
||||
h = AndroidUtilities.displaySize.y;
|
||||
|
|
|
|||
|
|
@ -3102,8 +3102,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
}
|
||||
if (!SharedConfig.smoothKeyboard) {
|
||||
setBottomClip(paddingBottom);
|
||||
} else if (!inPreviewMode) {
|
||||
} else if (!inPreviewMode && chatActivityEnterView.getEmojiPadding() == 0) {
|
||||
setBottomClip(AndroidUtilities.dp(48));
|
||||
} else {
|
||||
setBottomClip(0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
|
|
@ -6936,13 +6938,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
searchUpButton.setOnClickListener(view -> {
|
||||
getMediaDataController().searchMessagesInChat(null, dialog_id, mergeDialogId, classGuid, 1, threadMessageId, searchingUserMessages, searchingChatMessages);
|
||||
showMessagesSearchListView(false);
|
||||
//if (!SharedConfig.searchMessagesAsListUsed && SharedConfig.searchMessagesAsListHintShows < 3 && !searchAsListHintShown && Math.random() <= 0.25) {
|
||||
if (!searchAsListHintShown) {
|
||||
if (!SharedConfig.searchMessagesAsListUsed && SharedConfig.searchMessagesAsListHintShows < 3 && !searchAsListHintShown && Math.random() <= 0.25) {
|
||||
showSearchAsListHint();
|
||||
// searchAsListHintShown = true;
|
||||
searchAsListHintShown = true;
|
||||
SharedConfig.increaseSearchAsListHintShows();
|
||||
}
|
||||
// SharedConfig.increaseSearchAsListHintShows();
|
||||
// }
|
||||
});
|
||||
searchUpButton.setContentDescription(LocaleController.getString("AccDescrSearchNext", R.string.AccDescrSearchNext));
|
||||
|
||||
|
|
@ -6997,9 +6997,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
searchCalendarButton.setContentDescription(LocaleController.getString("JumpToDate", R.string.JumpToDate));
|
||||
|
||||
searchCountText = new SearchCounterView(context);
|
||||
// searchCountText.setTextColor(Theme.getColor(Theme.key_chat_searchPanelText));
|
||||
// searchCountText.setTextSize(15);
|
||||
// searchCountText.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
|
||||
searchCountText.setGravity(Gravity.LEFT);
|
||||
searchContainer.addView(searchCountText, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER_VERTICAL, 0, 0, 108, 0));
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class ChatsWidgetConfigActivity extends ExternalActionActivity {
|
|||
args.putBoolean("onlySelect", true);
|
||||
args.putInt("dialogsType", 10);
|
||||
args.putBoolean("allowSwitchAccount", true);
|
||||
EditWidgetActivity fragment = new EditWidgetActivity(EditWidgetActivity.TYPE_CHATS, creatingAppWidgetId, false);
|
||||
EditWidgetActivity fragment = new EditWidgetActivity(EditWidgetActivity.TYPE_CHATS, creatingAppWidgetId);
|
||||
fragment.setDelegate(dialogs -> {
|
||||
Intent resultValue = new Intent();
|
||||
resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, creatingAppWidgetId);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import android.content.Context;
|
|||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.Layout;
|
||||
import android.text.StaticLayout;
|
||||
|
|
@ -31,6 +32,7 @@ import java.util.ArrayList;
|
|||
|
||||
public class BotCommandsMenuView extends View {
|
||||
|
||||
final RectF rectTmp = new RectF();
|
||||
final Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
final TextPaint textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
|
||||
final MenuDrawable backDrawable = new MenuDrawable() {
|
||||
|
|
@ -74,7 +76,7 @@ public class BotCommandsMenuView extends View {
|
|||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
int size = MeasureSpec.getSize(widthMeasureSpec) + MeasureSpec.getSize(heightMeasureSpec) << 16;
|
||||
if (lastSize != size) {
|
||||
if (lastSize != size || menuText == null) {
|
||||
backDrawable.setBounds(0, 0, getMeasuredWidth(), getMeasuredHeight());
|
||||
textPaint.setTextSize(AndroidUtilities.dp(15));
|
||||
lastSize = size;
|
||||
|
|
@ -93,49 +95,49 @@ public class BotCommandsMenuView extends View {
|
|||
|
||||
@Override
|
||||
protected void dispatchDraw(Canvas canvas) {
|
||||
boolean update = false;
|
||||
if (expanded && expandProgress != 1f) {
|
||||
expandProgress += 16f / 150f;
|
||||
if (expandProgress > 1) {
|
||||
expandProgress = 1f;
|
||||
} else {
|
||||
invalidate();
|
||||
if (menuText != null) {
|
||||
boolean update = false;
|
||||
if (expanded && expandProgress != 1f) {
|
||||
expandProgress += 16f / 150f;
|
||||
if (expandProgress > 1) {
|
||||
expandProgress = 1f;
|
||||
} else {
|
||||
invalidate();
|
||||
}
|
||||
update = true;
|
||||
} else if (!expanded && expandProgress != 0) {
|
||||
expandProgress -= 16f / 150f;
|
||||
if (expandProgress < 0) {
|
||||
expandProgress = 0;
|
||||
} else {
|
||||
invalidate();
|
||||
}
|
||||
update = true;
|
||||
}
|
||||
update = true;
|
||||
} else if (!expanded && expandProgress != 0) {
|
||||
expandProgress -= 16f / 150f;
|
||||
if (expandProgress < 0) {
|
||||
expandProgress = 0;
|
||||
} else {
|
||||
invalidate();
|
||||
|
||||
float expandProgress = CubicBezierInterpolator.DEFAULT.getInterpolation(this.expandProgress);
|
||||
if (update && expandProgress > 0) {
|
||||
textPaint.setAlpha((int) (255 * expandProgress));
|
||||
}
|
||||
update = true;
|
||||
}
|
||||
|
||||
float expandProgress = CubicBezierInterpolator.DEFAULT.getInterpolation(this.expandProgress);
|
||||
if (update && expandProgress > 0) {
|
||||
textPaint.setAlpha((int) (255 * expandProgress));
|
||||
}
|
||||
AndroidUtilities.rectTmp.set(0, 0, AndroidUtilities.dp(40) + (menuText.getWidth() + AndroidUtilities.dp(4)) * expandProgress, getMeasuredHeight());
|
||||
canvas.drawRoundRect(AndroidUtilities.rectTmp, AndroidUtilities.dp(16), AndroidUtilities.dp(16), paint);
|
||||
backgroundDrawable.setBounds((int) AndroidUtilities.rectTmp.left, (int) AndroidUtilities.rectTmp.top, (int) AndroidUtilities.rectTmp.right, (int) AndroidUtilities.rectTmp.bottom);
|
||||
backgroundDrawable.draw(canvas);
|
||||
canvas.save();
|
||||
canvas.translate(AndroidUtilities.dp(8), AndroidUtilities.dp(4));
|
||||
backDrawable.draw(canvas);
|
||||
canvas.restore();
|
||||
|
||||
|
||||
|
||||
if (expandProgress > 0) {
|
||||
rectTmp.set(0, 0, AndroidUtilities.dp(40) + (menuText.getWidth() + AndroidUtilities.dp(4)) * expandProgress, getMeasuredHeight());
|
||||
canvas.drawRoundRect(rectTmp, AndroidUtilities.dp(16), AndroidUtilities.dp(16), paint);
|
||||
backgroundDrawable.setBounds((int) rectTmp.left, (int) rectTmp.top, (int) rectTmp.right, (int) rectTmp.bottom);
|
||||
backgroundDrawable.draw(canvas);
|
||||
canvas.save();
|
||||
canvas.translate(AndroidUtilities.dp(34), (getMeasuredHeight() - menuText.getHeight()) / 2f);
|
||||
menuText.draw(canvas);
|
||||
canvas.translate(AndroidUtilities.dp(8), AndroidUtilities.dp(4));
|
||||
backDrawable.draw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
if (update) {
|
||||
onTranslationChanged((menuText.getWidth() + AndroidUtilities.dp(4)) * expandProgress);
|
||||
if (expandProgress > 0) {
|
||||
canvas.save();
|
||||
canvas.translate(AndroidUtilities.dp(34), (getMeasuredHeight() - menuText.getHeight()) / 2f);
|
||||
menuText.draw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
if (update) {
|
||||
onTranslationChanged((menuText.getWidth() + AndroidUtilities.dp(4)) * expandProgress);
|
||||
}
|
||||
}
|
||||
super.dispatchDraw(canvas);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,8 +144,6 @@ import java.util.Locale;
|
|||
|
||||
public class ChatActivityEnterView extends FrameLayout implements NotificationCenter.NotificationCenterDelegate, SizeNotifierFrameLayout.SizeNotifierFrameLayoutDelegate, StickersAlert.StickersAlertDelegate {
|
||||
|
||||
boolean textTransitionIsRunning;
|
||||
|
||||
public interface ChatActivityEnterViewDelegate {
|
||||
void onMessageSend(CharSequence message, boolean notify, int scheduleDate);
|
||||
|
||||
|
|
@ -243,6 +241,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
|||
|
||||
private Runnable moveToSendStateRunnable;
|
||||
boolean messageTransitionIsRunning;
|
||||
boolean textTransitionIsRunning;
|
||||
|
||||
private BotCommandsMenuView botCommandsMenuButton;
|
||||
public BotCommandsMenuContainer botCommandsMenuContainer;
|
||||
|
|
@ -4121,7 +4120,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
|||
}
|
||||
}
|
||||
if (processSendingText(message, notify, scheduleDate)) {
|
||||
if (delegate.hasForwardingMessages()) {
|
||||
if (delegate.hasForwardingMessages() || (scheduleDate != 0 && !isInScheduleMode()) || isInScheduleMode()) {
|
||||
messageEditText.setText("");
|
||||
if (delegate != null) {
|
||||
delegate.onMessageSend(message, notify, scheduleDate);
|
||||
|
|
|
|||
|
|
@ -2874,7 +2874,7 @@ public class ChatAttachAlertPhotoLayout extends ChatAttachAlert.AttachAlertLayou
|
|||
|
||||
@Override
|
||||
public boolean onSheetKeyDown(int keyCode, KeyEvent event) {
|
||||
if (cameraOpened && (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)) {
|
||||
if (cameraOpened && (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN || keyCode == KeyEvent.KEYCODE_HEADSETHOOK || keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE)) {
|
||||
shutterButton.getDelegate().shutterReleased();
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -209,6 +209,7 @@ public class InstantCameraView extends FrameLayout implements NotificationCenter
|
|||
float pinchScale;
|
||||
|
||||
boolean isInPinchToZoomTouchMode;
|
||||
boolean maybePinchToZoomTouchMode;
|
||||
|
||||
private int pointerId1, pointerId2;
|
||||
|
||||
|
|
@ -2497,7 +2498,7 @@ public class InstantCameraView extends FrameLayout implements NotificationCenter
|
|||
}
|
||||
|
||||
if (ev.getActionMasked() == MotionEvent.ACTION_DOWN || ev.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN) {
|
||||
if (!isInPinchToZoomTouchMode && ev.getPointerCount() == 2 && finishZoomTransition == null && recording) {
|
||||
if (maybePinchToZoomTouchMode && !isInPinchToZoomTouchMode && ev.getPointerCount() == 2 && finishZoomTransition == null && recording) {
|
||||
pinchStartDistance = (float) Math.hypot(ev.getX(1) - ev.getX(0), ev.getY(1) - ev.getY(0));
|
||||
|
||||
pinchScale = 1f;
|
||||
|
|
@ -2508,7 +2509,7 @@ public class InstantCameraView extends FrameLayout implements NotificationCenter
|
|||
}
|
||||
if (ev.getActionMasked() == MotionEvent.ACTION_DOWN) {
|
||||
AndroidUtilities.rectTmp.set(cameraContainer.getX(), cameraContainer.getY(), cameraContainer.getX() + cameraContainer.getMeasuredWidth(), cameraContainer.getY() + cameraContainer.getMeasuredHeight());
|
||||
return AndroidUtilities.rectTmp.contains(ev.getX(), ev.getY());
|
||||
maybePinchToZoomTouchMode = AndroidUtilities.rectTmp.contains(ev.getX(), ev.getY());
|
||||
}
|
||||
return true;
|
||||
} else if (ev.getActionMasked() == MotionEvent.ACTION_MOVE && isInPinchToZoomTouchMode) {
|
||||
|
|
@ -2536,7 +2537,7 @@ public class InstantCameraView extends FrameLayout implements NotificationCenter
|
|||
isInPinchToZoomTouchMode = false;
|
||||
finishZoom();
|
||||
}
|
||||
return isInPinchToZoomTouchMode;
|
||||
return true;
|
||||
}
|
||||
|
||||
ValueAnimator finishZoomTransition;
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ public class MotionBackgroundDrawable extends Drawable {
|
|||
if (Build.VERSION.SDK_INT < 28 && intensity < 0) {
|
||||
int w = right - left;
|
||||
int h = bottom - top;
|
||||
if (legacyBitmap == null || legacyBitmap.getWidth() != w || legacyBitmap.getHeight() != h) {
|
||||
if (w > 0 && h > 0 && (legacyBitmap == null || legacyBitmap.getWidth() != w || legacyBitmap.getHeight() != h)) {
|
||||
if (legacyBitmap != null) {
|
||||
legacyBitmap.recycle();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1090,14 +1090,22 @@ public class PasscodeView extends FrameLayout {
|
|||
FingerprintManagerCompat fingerprintManager = FingerprintManagerCompat.from(ApplicationLoader.applicationContext);
|
||||
if (fingerprintManager.isHardwareDetected() && fingerprintManager.hasEnrolledFingerprints()) {
|
||||
fingerprintView.setVisibility(VISIBLE);
|
||||
} else {
|
||||
fingerprintView.setVisibility(GONE);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
FileLog.e(e);
|
||||
fingerprintView.setVisibility(GONE);
|
||||
}
|
||||
} else {
|
||||
fingerprintView.setVisibility(GONE);
|
||||
}
|
||||
if (SharedConfig.passcodeType == 1) {
|
||||
fingerprintImage.setVisibility(fingerprintView.getVisibility());
|
||||
}
|
||||
if (numberFrameLayouts.size() >= 11) {
|
||||
numberFrameLayouts.get(11).setVisibility(fingerprintView.getVisibility());
|
||||
}
|
||||
}
|
||||
|
||||
public void onShow(boolean fingerprint, boolean animated, int x, int y, Runnable onShow, Runnable onStart) {
|
||||
|
|
@ -1363,7 +1371,7 @@ public class PasscodeView extends FrameLayout {
|
|||
layoutParams = (LayoutParams) numbersFrameLayout.getLayoutParams();
|
||||
layoutParams.height = height;
|
||||
layoutParams.leftMargin = width / 2;
|
||||
layoutParams.topMargin = height - layoutParams.height;
|
||||
layoutParams.topMargin = height - layoutParams.height + (Build.VERSION.SDK_INT >= 21 ? AndroidUtilities.statusBarHeight : 0);
|
||||
layoutParams.width = width / 2;
|
||||
numbersFrameLayout.setLayoutParams(layoutParams);
|
||||
} else {
|
||||
|
|
@ -1390,10 +1398,10 @@ public class PasscodeView extends FrameLayout {
|
|||
passwordFrameLayout.setLayoutParams(layoutParams);
|
||||
|
||||
layoutParams = (LayoutParams) numbersFrameLayout.getLayoutParams();
|
||||
layoutParams.height = height / 3 * 2 + AndroidUtilities.dp(20);
|
||||
layoutParams.height = height / 3 * 2;
|
||||
layoutParams.leftMargin = left;
|
||||
if (AndroidUtilities.isTablet()) {
|
||||
layoutParams.topMargin = height - layoutParams.height + top;
|
||||
layoutParams.topMargin = height - layoutParams.height + top + AndroidUtilities.dp(20);
|
||||
} else {
|
||||
layoutParams.topMargin = height - layoutParams.height + top + (SharedConfig.passcodeType == 0 ? AndroidUtilities.dp(40) : 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -237,13 +237,13 @@ public class SearchCounterView extends View {
|
|||
boolean increment = countAnimationIncrement;
|
||||
if (countAnimationInLayout != null) {
|
||||
canvas.save();
|
||||
canvas.translate(countLeft, countTop + AndroidUtilities.dp(4) + (increment ? AndroidUtilities.dp(13) : -AndroidUtilities.dp(13)) * (1f - countChangeProgress));
|
||||
canvas.translate(countLeft, countTop + AndroidUtilities.dp(2) + (increment ? AndroidUtilities.dp(13) : -AndroidUtilities.dp(13)) * (1f - countChangeProgress));
|
||||
textPaint.setAlpha((int) (255 * countChangeProgress));
|
||||
countAnimationInLayout.draw(canvas);
|
||||
canvas.restore();
|
||||
} else if (countLayout != null) {
|
||||
canvas.save();
|
||||
canvas.translate(countLeft, countTop + AndroidUtilities.dp(4) + (increment ? AndroidUtilities.dp(13) : -AndroidUtilities.dp(13)) * (1f - countChangeProgress));
|
||||
canvas.translate(countLeft, countTop + AndroidUtilities.dp(2) + (increment ? AndroidUtilities.dp(13) : -AndroidUtilities.dp(13)) * (1f - countChangeProgress));
|
||||
textPaint.setAlpha((int) (255 * countChangeProgress));
|
||||
countLayout.draw(canvas);
|
||||
canvas.restore();
|
||||
|
|
@ -251,7 +251,7 @@ public class SearchCounterView extends View {
|
|||
|
||||
if (countOldLayout != null) {
|
||||
canvas.save();
|
||||
canvas.translate(countLeft, countTop + AndroidUtilities.dp(4) + (increment ? -AndroidUtilities.dp(13) : AndroidUtilities.dp(13)) * (countChangeProgress));
|
||||
canvas.translate(countLeft, countTop + AndroidUtilities.dp(2) + (increment ? -AndroidUtilities.dp(13) : AndroidUtilities.dp(13)) * (countChangeProgress));
|
||||
textPaint.setAlpha((int) (255 * (1f - countChangeProgress)));
|
||||
countOldLayout.draw(canvas);
|
||||
canvas.restore();
|
||||
|
|
@ -259,7 +259,7 @@ public class SearchCounterView extends View {
|
|||
|
||||
if (countAnimationStableLayout != null) {
|
||||
canvas.save();
|
||||
canvas.translate(countLeft + dx * (1f - countChangeProgress), countTop + AndroidUtilities.dp(4));
|
||||
canvas.translate(countLeft + dx * (1f - countChangeProgress), countTop + AndroidUtilities.dp(2));
|
||||
textPaint.setAlpha(255);
|
||||
countAnimationStableLayout.draw(canvas);
|
||||
canvas.restore();
|
||||
|
|
@ -267,7 +267,7 @@ public class SearchCounterView extends View {
|
|||
|
||||
if (countAnimationStableLayout2 != null) {
|
||||
canvas.save();
|
||||
canvas.translate(countLeft, countTop + AndroidUtilities.dp(4));
|
||||
canvas.translate(countLeft, countTop + AndroidUtilities.dp(2));
|
||||
textPaint.setAlpha(255);
|
||||
countAnimationStableLayout2.draw(canvas);
|
||||
canvas.restore();
|
||||
|
|
@ -299,7 +299,7 @@ public class SearchCounterView extends View {
|
|||
updateX(countWidth);
|
||||
if (countLayout != null) {
|
||||
canvas.save();
|
||||
canvas.translate(countLeft, countTop + AndroidUtilities.dp(4));
|
||||
canvas.translate(countLeft, countTop + AndroidUtilities.dp(2));
|
||||
countLayout.draw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -254,18 +254,20 @@ public class GroupCallMiniTextureView extends FrameLayout implements GroupCallSt
|
|||
if (animateToFullscreen || showingInFullscreen) {
|
||||
size += (AndroidUtilities.dp(10) + AndroidUtilities.dp(39) * parentContainer.progressToFullscreenMode);
|
||||
} else {
|
||||
size += AndroidUtilities.dp(10) * (1.0f - parentContainer.progressToFullscreenMode);
|
||||
size += AndroidUtilities.dp(10) * Math.max(1.0f - parentContainer.progressToFullscreenMode, showingAsScrimView || animateToScrimView ? parentContainer.progressToScrimView : 0.0f);
|
||||
}
|
||||
|
||||
int x = (getMeasuredWidth() - size) / 2;
|
||||
float smallProgress;
|
||||
float smallProgress2;
|
||||
float scrimProgress = (showingAsScrimView || animateToScrimView ? parentContainer.progressToScrimView : 0);
|
||||
if (showingInFullscreen) {
|
||||
smallProgress = progressToFullscreen;
|
||||
smallProgress = smallProgress2 = progressToFullscreen;
|
||||
} else {
|
||||
smallProgress = animateToFullscreen ? parentContainer.progressToFullscreenMode : scrimProgress;
|
||||
smallProgress2 = showingAsScrimView || animateToScrimView ? parentContainer.progressToScrimView : parentContainer.progressToFullscreenMode;
|
||||
}
|
||||
int y = (int) ((getMeasuredHeight() - size) / 2 - AndroidUtilities.dp(11) - (AndroidUtilities.dp(17) + AndroidUtilities.dp(74) * parentContainer.progressToFullscreenMode) * smallProgress);
|
||||
int y = (int) ((getMeasuredHeight() - size) / 2 - AndroidUtilities.dp(28) - (AndroidUtilities.dp(17) + AndroidUtilities.dp(74) * (showingInFullscreen || animateToFullscreen ? parentContainer.progressToFullscreenMode : 0.0f)) * smallProgress + AndroidUtilities.dp(17) * smallProgress2);
|
||||
castingScreenDrawable.setBounds(x, y, x + size, y + size);
|
||||
castingScreenDrawable.draw(canvas);
|
||||
|
||||
|
|
@ -1102,8 +1104,14 @@ public class GroupCallMiniTextureView extends FrameLayout implements GroupCallSt
|
|||
}
|
||||
|
||||
boolean pausedInternal = false;
|
||||
if (participant.participant.video != null && participant.participant.video.paused) {
|
||||
pausedInternal = true;
|
||||
if (participant.presentation) {
|
||||
if (participant.participant.presentation != null && participant.participant.presentation.paused) {
|
||||
pausedInternal = true;
|
||||
}
|
||||
} else {
|
||||
if (participant.participant.video != null && participant.participant.video.paused) {
|
||||
pausedInternal = true;
|
||||
}
|
||||
}
|
||||
if (videoIsPaused != pausedInternal) {
|
||||
videoIsPaused = pausedInternal;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class ContactsWidgetConfigActivity extends ExternalActionActivity {
|
|||
args.putBoolean("onlySelect", true);
|
||||
args.putInt("dialogsType", 10);
|
||||
args.putBoolean("allowSwitchAccount", true);
|
||||
EditWidgetActivity fragment = new EditWidgetActivity(EditWidgetActivity.TYPE_CONTACTS, creatingAppWidgetId, false);
|
||||
EditWidgetActivity fragment = new EditWidgetActivity(EditWidgetActivity.TYPE_CONTACTS, creatingAppWidgetId);
|
||||
fragment.setDelegate(dialogs -> {
|
||||
Intent resultValue = new Intent();
|
||||
resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, creatingAppWidgetId);
|
||||
|
|
|
|||
|
|
@ -104,7 +104,6 @@ public class EditWidgetActivity extends BaseFragment {
|
|||
|
||||
private int widgetType;
|
||||
private int currentWidgetId;
|
||||
private boolean isEdit;
|
||||
|
||||
private EditWidgetActivityDelegate delegate;
|
||||
|
||||
|
|
@ -733,18 +732,15 @@ public class EditWidgetActivity extends BaseFragment {
|
|||
}
|
||||
}
|
||||
|
||||
public EditWidgetActivity(int type, int widgetId, boolean edit) {
|
||||
public EditWidgetActivity(int type, int widgetId) {
|
||||
super();
|
||||
widgetType = type;
|
||||
currentWidgetId = widgetId;
|
||||
isEdit = edit;
|
||||
if (edit) {
|
||||
ArrayList<TLRPC.User> users = new ArrayList<>();
|
||||
ArrayList<TLRPC.Chat> chats = new ArrayList<>();
|
||||
getMessagesStorage().getWidgetDialogIds(currentWidgetId, widgetType, selectedDialogs, users, chats, true);
|
||||
getMessagesController().putUsers(users, true);
|
||||
getMessagesController().putChats(chats, true);
|
||||
}
|
||||
ArrayList<TLRPC.User> users = new ArrayList<>();
|
||||
ArrayList<TLRPC.Chat> chats = new ArrayList<>();
|
||||
getMessagesStorage().getWidgetDialogIds(currentWidgetId, widgetType, selectedDialogs, users, chats, true);
|
||||
getMessagesController().putUsers(users, true);
|
||||
getMessagesController().putChats(chats, true);
|
||||
updateRows();
|
||||
}
|
||||
|
||||
|
|
@ -810,14 +806,16 @@ public class EditWidgetActivity extends BaseFragment {
|
|||
getMessagesStorage().putWidgetDialogs(currentWidgetId, selectedDialogs);
|
||||
|
||||
SharedPreferences preferences = getParentActivity().getSharedPreferences("shortcut_widget", Activity.MODE_PRIVATE);
|
||||
preferences.edit().putInt("account" + currentWidgetId, currentAccount).commit();
|
||||
preferences.edit().putInt("type" + currentWidgetId, widgetType).commit();
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
editor.putInt("account" + currentWidgetId, currentAccount);
|
||||
editor.putInt("type" + currentWidgetId, widgetType);
|
||||
editor.commit();
|
||||
|
||||
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(getParentActivity());
|
||||
if (widgetType == TYPE_CHATS) {
|
||||
ChatsWidgetProvider.updateWidget(getParentActivity(), appWidgetManager, currentWidgetId, isEdit);
|
||||
ChatsWidgetProvider.updateWidget(getParentActivity(), appWidgetManager, currentWidgetId);
|
||||
} else {
|
||||
ContactsWidgetProvider.updateWidget(getParentActivity(), appWidgetManager, currentWidgetId, isEdit);
|
||||
ContactsWidgetProvider.updateWidget(getParentActivity(), appWidgetManager, currentWidgetId);
|
||||
}
|
||||
if (delegate != null) {
|
||||
delegate.didSelectDialogs(selectedDialogs);
|
||||
|
|
|
|||
|
|
@ -35,8 +35,10 @@ public class FeedWidgetConfigActivity extends ExternalActionActivity {
|
|||
AccountInstance.getInstance(fragment1.getCurrentAccount()).getMessagesStorage().putWidgetDialogs(creatingAppWidgetId, dids);
|
||||
|
||||
SharedPreferences preferences = FeedWidgetConfigActivity.this.getSharedPreferences("shortcut_widget", Activity.MODE_PRIVATE);
|
||||
preferences.edit().putInt("account" + creatingAppWidgetId, fragment1.getCurrentAccount()).commit();
|
||||
preferences.edit().putLong("dialogId" + creatingAppWidgetId, dids.get(0)).commit();
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
editor.putInt("account" + creatingAppWidgetId, fragment1.getCurrentAccount());
|
||||
editor.putLong("dialogId" + creatingAppWidgetId, dids.get(0));
|
||||
editor.commit();
|
||||
|
||||
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(FeedWidgetConfigActivity.this);
|
||||
FeedWidgetProvider.updateWidget(FeedWidgetConfigActivity.this, appWidgetManager, creatingAppWidgetId);
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
|||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
AndroidUtilities.isInMultiwindow = isInMultiWindowMode();
|
||||
}
|
||||
Theme.createCommonChatResources(this);
|
||||
Theme.createCommonChatResources();
|
||||
Theme.createDialogsResources(this);
|
||||
if (SharedConfig.passcodeHash.length() != 0 && SharedConfig.appLocked) {
|
||||
SharedConfig.lastPauseTime = (int) (SystemClock.elapsedRealtime() / 1000);
|
||||
|
|
@ -2273,7 +2273,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
|||
fragment = new ActionIntroActivity(ActionIntroActivity.ACTION_TYPE_CHANGE_PHONE_NUMBER);
|
||||
closePrevious = true;
|
||||
} else if (open_settings == 6) {
|
||||
fragment = new EditWidgetActivity(open_widget_edit_type, open_widget_edit, true);
|
||||
fragment = new EditWidgetActivity(open_widget_edit_type, open_widget_edit);
|
||||
} else {
|
||||
fragment = null;
|
||||
}
|
||||
|
|
@ -3657,18 +3657,19 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
|||
if (SharedConfig.pendingAppUpdate != null && SharedConfig.pendingAppUpdate.version.equals(res.version)) {
|
||||
return;
|
||||
}
|
||||
SharedConfig.setNewAppVersionAvailable(res);
|
||||
if (res.can_not_skip) {
|
||||
showUpdateActivity(accountNum, res, false);
|
||||
} else {
|
||||
drawerLayoutAdapter.notifyDataSetChanged();
|
||||
try {
|
||||
(new UpdateAppAlertDialog(LaunchActivity.this, res, accountNum)).show();
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
if (SharedConfig.setNewAppVersionAvailable(res)) {
|
||||
if (res.can_not_skip) {
|
||||
showUpdateActivity(accountNum, res, false);
|
||||
} else {
|
||||
drawerLayoutAdapter.notifyDataSetChanged();
|
||||
try {
|
||||
(new UpdateAppAlertDialog(LaunchActivity.this, res, accountNum)).show();
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
}
|
||||
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.appUpdateAvailable);
|
||||
}
|
||||
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.appUpdateAvailable);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -676,7 +676,12 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
|||
BulletinFactory.of(containerView).createSimpleBulletin(R.raw.voip_invite, bulletinMessage).show();
|
||||
}
|
||||
});
|
||||
builder.create().show();
|
||||
BottomSheet bottomSheet = builder.create();
|
||||
bottomSheet.show();
|
||||
bottomSheet.setItemColor(0,0xffffffff, 0xffffffff);
|
||||
bottomSheet.setItemColor(1,0xffffffff, 0xffffffff);
|
||||
bottomSheet.setBackgroundColor(0xff1C2229);
|
||||
bottomSheet.setTitleColor(0xff8A8A8A);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1480,6 +1480,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||
@Override
|
||||
public View createView(Context context) {
|
||||
Theme.createProfileResources(context);
|
||||
Theme.createChatResources(context, false);
|
||||
|
||||
searchTransitionOffset = 0;
|
||||
searchTransitionProgress = 1f;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import android.graphics.Shader;
|
|||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.text.Layout;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.StaticLayout;
|
||||
import android.text.TextPaint;
|
||||
|
|
@ -114,6 +115,9 @@ public class TextMessageEnterTransition implements MessageEnterTransitionContain
|
|||
enterView = chatActivity.getChatActivityEnterView();
|
||||
|
||||
ChatActivityEnterView chatActivityEnterView = chatActivity.getChatActivityEnterView();
|
||||
if (chatActivityEnterView == null || chatActivityEnterView.getEditField() == null || chatActivityEnterView.getEditField().getLayout() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
fromRadius = chatActivityEnterView.getRecordCicle().drawingCircleRadius;
|
||||
bitmapPaint.setFilterBitmap(true);
|
||||
|
|
@ -145,7 +149,18 @@ public class TextMessageEnterTransition implements MessageEnterTransitionContain
|
|||
emojiSize = AndroidUtilities.dp(24);
|
||||
}
|
||||
}
|
||||
if (editText.length() != text.length()) {
|
||||
boolean containsSpans = false;
|
||||
if (text instanceof Spannable) {
|
||||
Spannable spannable = (Spannable) text;
|
||||
Object[] objects = spannable.getSpans(0, text.length(), Object.class);
|
||||
for (int i = 0; i < objects.length; i++) {
|
||||
if (!(objects[i] instanceof Emoji.EmojiSpan)) {
|
||||
containsSpans = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (editText.length() != text.length() || containsSpans) {
|
||||
crossfade = true;
|
||||
String str = editText.toString();
|
||||
String trimmedStr = str.trim();
|
||||
|
|
@ -543,78 +558,78 @@ public class TextMessageEnterTransition implements MessageEnterTransitionContain
|
|||
}
|
||||
|
||||
canvas.save();
|
||||
{
|
||||
canvas.clipRect(drawableX + AndroidUtilities.dp(4), drawableTop + AndroidUtilities.dp(4), drawableRight - AndroidUtilities.dp(4), drawableBottom - AndroidUtilities.dp(4));
|
||||
|
||||
float scale = progressX + scaleFrom * (1f - progressX);
|
||||
float scale2;
|
||||
if (drawBitmaps) {
|
||||
scale2 = progressX + scaleY * (1f - progressX);
|
||||
canvas.clipRect(drawableX + AndroidUtilities.dp(4), drawableTop + AndroidUtilities.dp(4), drawableRight - AndroidUtilities.dp(4), drawableBottom - AndroidUtilities.dp(4));
|
||||
|
||||
float scale = progressX + scaleFrom * (1f - progressX);
|
||||
float scale2;
|
||||
if (drawBitmaps) {
|
||||
scale2 = progressX + scaleY * (1f - progressX);
|
||||
} else {
|
||||
scale2 = 1f;
|
||||
}
|
||||
|
||||
canvas.save();
|
||||
canvas.translate(fromX * (1f - progressX) + (toX - toXOffset) * progressX, fromY * (1f - progress) + (toY + textLayoutBlock.textYOffset) * progress);
|
||||
canvas.scale(scale, scale * scale2, 0, 0);
|
||||
// canvas.translate(0, textLayoutBlock.textYOffset / 2);
|
||||
if (drawBitmaps) {
|
||||
if (crossfade) {
|
||||
bitmapPaint.setAlpha((int) (255 * (1f - alphaProgress)));
|
||||
}
|
||||
canvas.drawBitmap(textLayoutBitmap, 0, 0, bitmapPaint);
|
||||
} else {
|
||||
if (crossfade) {
|
||||
int oldAlpha = Theme.chat_msgTextPaint.getAlpha();
|
||||
Theme.chat_msgTextPaint.setAlpha((int) (oldAlpha * (1f - alphaProgress)));
|
||||
layout.draw(canvas);
|
||||
Theme.chat_msgTextPaint.setAlpha(oldAlpha);
|
||||
} else {
|
||||
scale2 = 1f;
|
||||
layout.draw(canvas);
|
||||
}
|
||||
|
||||
}
|
||||
canvas.restore();
|
||||
|
||||
if (rtlLayout != null) {
|
||||
canvas.save();
|
||||
canvas.translate(fromX * (1f - progressX) + (toX - toXOffset) * progressX, fromY * (1f - progress) + (toY + textLayoutBlock.textYOffset) * progress);
|
||||
canvas.translate(fromX * (1f - progressX) + (toX - toXOffsetRtl) * progressX, fromY * (1f - progress) + (toY + textLayoutBlock.textYOffset) * progress);
|
||||
canvas.scale(scale, scale * scale2, 0, 0);
|
||||
// canvas.translate(0, textLayoutBlock.textYOffset / 2);
|
||||
if (drawBitmaps) {
|
||||
if (crossfade) {
|
||||
bitmapPaint.setAlpha((int) (255 * (1f - alphaProgress)));
|
||||
}
|
||||
canvas.drawBitmap(textLayoutBitmap, 0, 0, bitmapPaint);
|
||||
canvas.drawBitmap(textLayoutBitmapRtl, 0, 0, bitmapPaint);
|
||||
} else {
|
||||
if (crossfade) {
|
||||
int oldAlpha = Theme.chat_msgTextPaint.getAlpha();
|
||||
Theme.chat_msgTextPaint.setAlpha((int) (oldAlpha * (1f - alphaProgress)));
|
||||
layout.draw(canvas);
|
||||
rtlLayout.draw(canvas);
|
||||
Theme.chat_msgTextPaint.setAlpha(oldAlpha);
|
||||
} else {
|
||||
layout.draw(canvas);
|
||||
rtlLayout.draw(canvas);
|
||||
}
|
||||
|
||||
}
|
||||
canvas.restore();
|
||||
|
||||
if (rtlLayout != null) {
|
||||
canvas.save();
|
||||
canvas.translate(fromX * (1f - progressX) + (toX - toXOffsetRtl) * progressX, fromY * (1f - progress) + (toY + textLayoutBlock.textYOffset) * progress);
|
||||
canvas.scale(scale, scale * scale2, 0, 0);
|
||||
if (drawBitmaps) {
|
||||
if (crossfade) {
|
||||
bitmapPaint.setAlpha((int) (255 * (1f - alphaProgress)));
|
||||
}
|
||||
canvas.drawBitmap(textLayoutBitmapRtl, 0, 0, bitmapPaint);
|
||||
} else {
|
||||
if (crossfade) {
|
||||
int oldAlpha = Theme.chat_msgTextPaint.getAlpha();
|
||||
Theme.chat_msgTextPaint.setAlpha((int) (oldAlpha * (1f - alphaProgress)));
|
||||
rtlLayout.draw(canvas);
|
||||
Theme.chat_msgTextPaint.setAlpha(oldAlpha);
|
||||
} else {
|
||||
rtlLayout.draw(canvas);
|
||||
}
|
||||
|
||||
}
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
if (crossfade) {
|
||||
canvas.save();
|
||||
canvas.translate(messageView.getLeft() + listView.getX() - container.getX() + (fromX - toX) * (1f - progressX), messageViewY + (fromY - toY) * (1f - progress));
|
||||
canvas.scale(scale, scale * scale2, messageView.getTextX(), messageView.getTextY());
|
||||
canvas.translate(0, -crossfadeTextOffset);
|
||||
|
||||
if (drawBitmaps) {
|
||||
bitmapPaint.setAlpha((int) (255 * alphaProgress));
|
||||
canvas.drawBitmap(crossfadeTextBitmap, 0, 0, bitmapPaint);
|
||||
} else {
|
||||
messageView.drawMessageText(canvas, messageView.getMessageObject().textLayoutBlocks, true, alphaProgress, true);
|
||||
}
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (crossfade) {
|
||||
canvas.save();
|
||||
canvas.translate(messageView.getLeft() + listView.getX() - container.getX() + (fromX - toX) * (1f - progressX), messageViewY + (fromY - toY) * (1f - progress));
|
||||
canvas.scale(scale, scale * scale2, messageView.getTextX(), messageView.getTextY());
|
||||
canvas.translate(0, -crossfadeTextOffset);
|
||||
|
||||
if (crossfadeTextBitmap != null) {
|
||||
bitmapPaint.setAlpha((int) (255 * alphaProgress));
|
||||
canvas.drawBitmap(crossfadeTextBitmap, 0, 0, bitmapPaint);
|
||||
} else {
|
||||
messageView.drawMessageText(canvas, messageView.getMessageObject().textLayoutBlocks, true, alphaProgress, true);
|
||||
}
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
|
||||
canvas.restore();
|
||||
|
||||
if (clipBottomWithAlpha) {
|
||||
|
|
@ -631,8 +646,8 @@ public class TextMessageEnterTransition implements MessageEnterTransitionContain
|
|||
}
|
||||
if (enterView.getSendButton().getVisibility() == View.VISIBLE && sendProgress < 1f) {
|
||||
canvas.save();
|
||||
canvas.translate(enterView.getX() + enterView.getSendButton().getX() + ((View) enterView.getSendButton().getParent()).getX() + ((View) enterView.getSendButton().getParent().getParent()).getX() - container.getX() + AndroidUtilities.dp(52) * sendProgress, enterView.getY() + enterView.getSendButton().getY() + ((View) enterView.getSendButton().getParent()).getY() + ((View) enterView.getSendButton().getParent().getParent()).getY()- container.getY());
|
||||
// canvas.saveLayerAlpha(0, 0, enterView.getSendButton().getWidth(), enterView.getSendButton().getHeight(), (int) (enterView.getSendButton().getAlpha() * 255), Canvas.ALL_SAVE_FLAG);
|
||||
canvas.translate(enterView.getX() + enterView.getSendButton().getX() + ((View) enterView.getSendButton().getParent()).getX() + ((View) enterView.getSendButton().getParent().getParent()).getX() - container.getX() + AndroidUtilities.dp(52) * sendProgress, enterView.getY() + enterView.getSendButton().getY() + ((View) enterView.getSendButton().getParent()).getY() + ((View) enterView.getSendButton().getParent().getParent()).getY() - container.getY());
|
||||
// canvas.saveLayerAlpha(0, 0, enterView.getSendButton().getWidth(), enterView.getSendButton().getHeight(), (int) (enterView.getSendButton().getAlpha() * 255), Canvas.ALL_SAVE_FLAG);
|
||||
//canvas.scale(enterView.getSendButton().getScaleX(), enterView.getSendButton().getScaleY(), enterView.getSendButton().getWidth() / 2f, enterView.getSendButton().getHeight() / 2f);
|
||||
enterView.getSendButton().draw(canvas);
|
||||
canvas.restore();
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class VoIPPermissionActivity extends Activity {
|
|||
if (isVideoCall && checkSelfPermission(Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
|
||||
permissions.add(Manifest.permission.CAMERA);
|
||||
}
|
||||
if (permissions.isEmpty()) {
|
||||
if (!permissions.isEmpty()) {
|
||||
try {
|
||||
requestPermissions(permissions.toArray(new String[0]), isVideoCall ? 102 : 101);
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue