正在查看: -ɛ v1.0.0 应用的 VoIPActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: -ɛ v1.0.0 应用的 VoIPActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package im.bqzflyvzam.ui;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.media.AudioManager;
import android.os.Build;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import androidx.palette.graphics.Palette;
import im.bqzflyvzam.messenger.AndroidUtilities;
import im.bqzflyvzam.messenger.ApplicationLoader;
import im.bqzflyvzam.messenger.ContactsController;
import im.bqzflyvzam.messenger.Emoji;
import im.bqzflyvzam.messenger.FileLog;
import im.bqzflyvzam.messenger.ImageLocation;
import im.bqzflyvzam.messenger.ImageReceiver;
import im.bqzflyvzam.messenger.LocaleController;
import im.bqzflyvzam.messenger.MessageObject;
import im.bqzflyvzam.messenger.NotificationCenter;
import im.bqzflyvzam.messenger.SendMessagesHelper;
import im.bqzflyvzam.messenger.Utilities;
import im.bqzflyvzam.messenger.voip.EncryptionKeyEmojifier;
import im.bqzflyvzam.messenger.voip.VoIPBaseService;
import im.bqzflyvzam.messenger.voip.VoIPController;
import im.bqzflyvzam.messenger.voip.VoIPService;
import im.bqzflyvzam.tgnet.TLRPC;
import im.bqzflyvzam.ui.-$;
import im.bqzflyvzam.ui.actionbar.AlertDialog;
import im.bqzflyvzam.ui.actionbar.BottomSheet;
import im.bqzflyvzam.ui.actionbar.DarkAlertDialog;
import im.bqzflyvzam.ui.actionbar.Theme;
import im.bqzflyvzam.ui.components.BackupImageView;
import im.bqzflyvzam.ui.components.CorrectlyMeasuringTextView;
import im.bqzflyvzam.ui.components.CubicBezierInterpolator;
import im.bqzflyvzam.ui.components.IdenticonDrawable;
import im.bqzflyvzam.ui.components.LayoutHelper;
import im.bqzflyvzam.ui.components.voip.CallSwipeView;
import im.bqzflyvzam.ui.components.voip.CheckableImageView;
import im.bqzflyvzam.ui.components.voip.DarkTheme;
import im.bqzflyvzam.ui.components.voip.FabBackgroundDrawable;
import im.bqzflyvzam.ui.components.voip.VoIPHelper;
import im.bqzflyvzam.ui.utils.translate.common.AudioEditConstant;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.HashMap;
public class VoIPActivity extends Activity implements VoIPBaseService.StateListener, NotificationCenter.NotificationCenterDelegate {
private static final String TAG = "hchat-voip-ui";
private View acceptBtn;
private CallSwipeView acceptSwipe;
private TextView accountNameText;
private ImageView addMemberBtn;
private ImageView blurOverlayView1;
private ImageView blurOverlayView2;
private Bitmap blurredPhoto1;
private Bitmap blurredPhoto2;
private LinearLayout bottomButtons;
private TextView brandingText;
private int callState;
private View cancelBtn;
private ImageView chatBtn;
private FrameLayout content;
private Animator currentAcceptAnim;
private Animator currentDeclineAnim;
private View declineBtn;
private CallSwipeView declineSwipe;
private TextView durationText;
private AnimatorSet ellAnimator;
private TextAlphaSpan[] ellSpans;
private AnimatorSet emojiAnimator;
boolean emojiExpanded;
private TextView emojiExpandedText;
boolean emojiTooltipVisible;
private LinearLayout emojiWrap;
private View endBtn;
private FabBackgroundDrawable endBtnBg;
private View endBtnIcon;
private TextView hintTextView;
private boolean isIncomingWaiting;
private boolean keyEmojiVisible;
private String lastStateText;
private CheckableImageView micToggle;
private TextView nameText;
private BackupImageView photoView;
private AnimatorSet retryAnim;
private boolean retrying;
private int signalBarsCount;
private SignalBarsDrawable signalBarsDrawable;
private CheckableImageView spkToggle;
private TextView stateText;
private TextView stateText2;
private LinearLayout swipeViewsWrap;
private Animator textChangingAnim;
private Animator tooltipAnim;
private Runnable tooltipHider;
private TLRPC.User user;
private int currentAccount = -1;
private boolean firstStateChange = true;
private boolean didAcceptFromHere = false;
private ImageView[] keyEmojiViews = new ImageView[4];
@Override
protected void onCreate(Bundle savedInstanceState) {
if ((5 + 27) % 27 <= 0) {
}
requestWindowFeature(1);
getWindow().addFlags(524288);
super.onCreate(savedInstanceState);
if (VoIPService.getSharedInstance() == null) {
finish();
return;
}
int account = VoIPService.getSharedInstance().getAccount();
this.currentAccount = account;
if (account == -1) {
finish();
return;
}
if ((getResources().getConfiguration().screenLayout & 15) < 3) {
setRequestedOrientation(1);
}
View contentView = createContentView();
setContentView(contentView);
if (Build.VERSION.SDK_INT >= 21) {
getWindow().addFlags(Integer.MIN_VALUE);
getWindow().setStatusBarColor(0);
getWindow().setNavigationBarColor(0);
getWindow().getDecorView().setSystemUiVisibility(1792);
} else if (Build.VERSION.SDK_INT >= 19) {
getWindow().addFlags(201326592);
getWindow().getDecorView().setSystemUiVisibility(1792);
}
TLRPC.User user = VoIPService.getSharedInstance().getUser();
this.user = user;
if (user.photo != null) {
this.photoView.getImageReceiver().setDelegate(new 1(this));
this.photoView.setImage(ImageLocation.getForUser(this.user, true), (String) null, new ColorDrawable(Theme.ACTION_BAR_VIDEO_EDIT_COLOR), this.user);
this.photoView.setLayerType(2, (Paint) null);
} else {
this.photoView.setVisibility(8);
contentView.setBackgroundDrawable(new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-14994098, -14328963}));
}
getWindow().setBackgroundDrawable(new ColorDrawable(0));
setVolumeControlStream(0);
this.nameText.setOnClickListener(new 2(this));
this.endBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if ((23 + 30) % 30 <= 0) {
}
VoIPActivity.this.endBtn.setEnabled(false);
if (VoIPActivity.this.retrying) {
Intent intent = new Intent(VoIPActivity.this, (Class<?>) VoIPService.class);
intent.putExtra("user_id", VoIPActivity.this.user.id);
intent.putExtra("is_outgoing", true);
intent.putExtra("start_incall_activity", false);
intent.putExtra("account", VoIPActivity.this.currentAccount);
try {
VoIPActivity.this.startService(intent);
} catch (Throwable e) {
FileLog.e(e);
}
VoIPActivity.this.hideRetry();
VoIPActivity.this.endBtn.postDelayed(new 1(this), 100L);
return;
}
if (VoIPService.getSharedInstance() != null) {
VoIPService.getSharedInstance().hangUp();
}
}
});
this.spkToggle.setOnClickListener(new -$.Lambda.VoIPActivity.YHz0utiXi3ratD_JPqLMKmuHD8A(this));
this.micToggle.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
VoIPActivity.this.lambda$onCreate$1$VoIPActivity(view);
}
});
this.chatBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
VoIPActivity.this.lambda$onCreate$2$VoIPActivity(view);
}
});
this.spkToggle.setChecked(((AudioManager) getSystemService("audio")).isSpeakerphoneOn());
this.micToggle.setChecked(VoIPService.getSharedInstance().isMicMute());
onAudioSettingsChanged();
this.nameText.setText(ContactsController.formatName(this.user.first_name, this.user.last_name));
VoIPService.getSharedInstance().registerStateListener(this);
this.acceptSwipe.setListener(new 4(this));
this.declineSwipe.setListener(new 5(this));
this.cancelBtn.setOnClickListener(new 6(this));
getWindow().getDecorView().setKeepScreenOn(true);
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.emojiDidLoad);
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.closeInCallActivity);
this.hintTextView.setText(LocaleController.formatString("CallEmojiKeyTooltip", 2131690289, new Object[]{this.user.first_name}));
this.emojiExpandedText.setText(LocaleController.formatString("CallEmojiKeyTooltip", 2131690289, new Object[]{this.user.first_name}));
AccessibilityManager am = (AccessibilityManager) getSystemService("accessibility");
if (am.isTouchExplorationEnabled()) {
this.nameText.postDelayed(new 7(this), 500L);
}
}
public void lambda$onCreate$0$VoIPActivity(View v) {
VoIPService svc = VoIPService.getSharedInstance();
if (svc == null) {
return;
}
svc.toggleSpeakerphoneOrShowRouteSheet(this);
}
public void lambda$onCreate$1$VoIPActivity(View v) {
if ((9 + 16) % 16 <= 0) {
}
if (VoIPService.getSharedInstance() == null) {
finish();
return;
}
boolean checked = !this.micToggle.isChecked();
this.micToggle.setChecked(checked);
VoIPService.getSharedInstance().setMicMute(checked);
}
public void lambda$onCreate$2$VoIPActivity(View v) {
if ((7 + 26) % 26 <= 0) {
}
if (this.isIncomingWaiting) {
showMessagesSheet();
return;
}
Intent intent = new Intent(ApplicationLoader.applicationContext, (Class<?>) LaunchActivity.class);
intent.setAction("com.tmessages.openchat" + Math.random() + Integer.MAX_VALUE);
intent.putExtra("currentAccount", this.currentAccount);
intent.setFlags(32768);
intent.putExtra("userId", this.user.id);
startActivity(intent);
finish();
}
private View createContentView() {
if ((3 + 20) % 20 <= 0) {
}
FrameLayout frameLayout = new FrameLayout(this) {
private void setNegativeMargins(Rect insets, FrameLayout.LayoutParams lp) {
lp.topMargin = -insets.top;
lp.bottomMargin = -insets.bottom;
lp.leftMargin = -insets.left;
lp.rightMargin = -insets.right;
}
@Override
protected boolean fitSystemWindows(Rect insets) {
setNegativeMargins(insets, (FrameLayout.LayoutParams) VoIPActivity.this.photoView.getLayoutParams());
setNegativeMargins(insets, (FrameLayout.LayoutParams) VoIPActivity.this.blurOverlayView1.getLayoutParams());
setNegativeMargins(insets, (FrameLayout.LayoutParams) VoIPActivity.this.blurOverlayView2.getLayoutParams());
return super.fitSystemWindows(insets);
}
};
frameLayout.setBackgroundColor(0);
frameLayout.setFitsSystemWindows(true);
frameLayout.setClipToPadding(false);
View view = new 9(this, this);
this.photoView = view;
frameLayout.addView(view);
ImageView imageView = new ImageView(this);
this.blurOverlayView1 = imageView;
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
this.blurOverlayView1.setAlpha(0.0f);
frameLayout.addView(this.blurOverlayView1);
ImageView imageView2 = new ImageView(this);
this.blurOverlayView2 = imageView2;
imageView2.setScaleType(ImageView.ScaleType.CENTER_CROP);
this.blurOverlayView2.setAlpha(0.0f);
frameLayout.addView(this.blurOverlayView2);
TextView branding = new TextView(this);
branding.setTextColor(-855638017);
branding.setText(LocaleController.getString("VoipInCallBranding", 2131694706));
SignalBarsDrawable mutate = getResources().getDrawable(2131558769).mutate();
mutate.setAlpha(204);
mutate.setBounds(0, 0, AndroidUtilities.dp(15.0f), AndroidUtilities.dp(15.0f));
SignalBarsDrawable signalBarsDrawable = new SignalBarsDrawable(this, (1) null);
this.signalBarsDrawable = signalBarsDrawable;
signalBarsDrawable.setBounds(0, 0, signalBarsDrawable.getIntrinsicWidth(), this.signalBarsDrawable.getIntrinsicHeight());
branding.setCompoundDrawables(LocaleController.isRTL ? this.signalBarsDrawable : mutate, null, LocaleController.isRTL ? mutate : this.signalBarsDrawable, null);
branding.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
branding.setGravity(LocaleController.isRTL ? 5 : 3);
branding.setCompoundDrawablePadding(AndroidUtilities.dp(5.0f));
branding.setTextSize(1, 14.0f);
frameLayout.addView(branding, LayoutHelper.createFrame(-2.0f, -2.0f, (LocaleController.isRTL ? 5 : 3) | 48, 18.0f, 18.0f, 18.0f, 0.0f));
this.brandingText = branding;
TextView name = new TextView(this);
name.setSingleLine();
name.setTextColor(-1);
name.setTextSize(1, 40.0f);
name.setEllipsize(TextUtils.TruncateAt.END);
name.setGravity(LocaleController.isRTL ? 5 : 3);
name.setShadowLayer(AndroidUtilities.dp(3.0f), 0.0f, AndroidUtilities.dp(0.6666667f), 1275068416);
name.setTypeface(Typeface.create("sans-serif-light", 0));
this.nameText = name;
frameLayout.addView(name, LayoutHelper.createFrame(-1.0f, -2.0f, 51, 16.0f, 43.0f, 18.0f, 0.0f));
TextView state = new TextView(this);
state.setTextColor(-855638017);
state.setSingleLine();
state.setEllipsize(TextUtils.TruncateAt.END);
state.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
state.setShadowLayer(AndroidUtilities.dp(3.0f), 0.0f, AndroidUtilities.dp(0.6666667f), 1275068416);
state.setTextSize(1, 15.0f);
state.setGravity(LocaleController.isRTL ? 5 : 3);
this.stateText = state;
frameLayout.addView(state, LayoutHelper.createFrame(-1.0f, -2.0f, 51, 18.0f, 98.0f, 18.0f, 0.0f));
this.durationText = state;
TextView state2 = new TextView(this);
state2.setTextColor(-855638017);
state2.setSingleLine();
state2.setEllipsize(TextUtils.TruncateAt.END);
state2.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
state2.setShadowLayer(AndroidUtilities.dp(3.0f), 0.0f, AndroidUtilities.dp(0.6666667f), 1275068416);
state2.setTextSize(1, 15.0f);
state2.setGravity(LocaleController.isRTL ? 5 : 3);
state2.setVisibility(8);
this.stateText2 = state2;
frameLayout.addView(state2, LayoutHelper.createFrame(-1.0f, -2.0f, 51, 18.0f, 98.0f, 18.0f, 0.0f));
this.ellSpans = new TextAlphaSpan[]{new TextAlphaSpan(this), new TextAlphaSpan(this), new TextAlphaSpan(this)};
LinearLayout buttons = new LinearLayout(this);
buttons.setOrientation(0);
frameLayout.addView(buttons, LayoutHelper.createFrame(-1, -2, 80));
TextView accountName = new TextView(this);
accountName.setTextColor(-855638017);
accountName.setSingleLine();
accountName.setEllipsize(TextUtils.TruncateAt.END);
accountName.setShadowLayer(AndroidUtilities.dp(3.0f), 0.0f, AndroidUtilities.dp(0.6666667f), 1275068416);
accountName.setTextSize(1, 15.0f);
accountName.setGravity(LocaleController.isRTL ? 5 : 3);
this.accountNameText = accountName;
frameLayout.addView(accountName, LayoutHelper.createFrame(-1.0f, -2.0f, 51, 18.0f, 120.0f, 18.0f, 0.0f));
FrameLayout wrap = new CheckableImageView(this);
wrap.setBackgroundResource(2131230858);
Drawable micIcon = getResources().getDrawable(2131231136).mutate();
wrap.setAlpha(204);
wrap.setImageDrawable(micIcon);
wrap.setScaleType(ImageView.ScaleType.CENTER);
wrap.setContentDescription(LocaleController.getString("AccDescrMuteMic", 2131689526));
FrameLayout wrap2 = new FrameLayout(this);
this.micToggle = wrap;
wrap2.addView(wrap, LayoutHelper.createFrame(38.0f, 38.0f, 81, 0.0f, 0.0f, 0.0f, 10.0f));
buttons.addView(wrap2, LayoutHelper.createLinear(0, -2, 1.0f));
ImageView chat = new ImageView(this);
Drawable chatIcon = getResources().getDrawable(2131231102).mutate();
chatIcon.setAlpha(204);
chat.setImageDrawable(chatIcon);
chat.setScaleType(ImageView.ScaleType.CENTER);
chat.setContentDescription(LocaleController.getString("AccDescrOpenChat", 2131689528));
FrameLayout wrap3 = new FrameLayout(this);
this.chatBtn = chat;
wrap3.addView(chat, LayoutHelper.createFrame(38.0f, 38.0f, 81, 0.0f, 0.0f, 0.0f, 10.0f));
buttons.addView(wrap3, LayoutHelper.createLinear(0, -2, 1.0f));
View checkableImageView = new CheckableImageView(this);
checkableImageView.setBackgroundResource(2131230858);
Drawable speakerIcon = getResources().getDrawable(2131231160).mutate();
checkableImageView.setAlpha(204);
checkableImageView.setImageDrawable(speakerIcon);
checkableImageView.setScaleType(ImageView.ScaleType.CENTER);
checkableImageView.setContentDescription(LocaleController.getString("VoipAudioRoutingSpeaker", 2131694692));
FrameLayout wrap4 = new FrameLayout(this);
this.spkToggle = checkableImageView;
wrap4.addView(checkableImageView, LayoutHelper.createFrame(38.0f, 38.0f, 81, 0.0f, 0.0f, 0.0f, 10.0f));
buttons.addView(wrap4, LayoutHelper.createLinear(0, -2, 1.0f));
this.bottomButtons = buttons;
LinearLayout swipesWrap = new LinearLayout(this);
swipesWrap.setOrientation(0);
CallSwipeView acceptSwipe = new CallSwipeView(this);
acceptSwipe.setColor(-12207027);
acceptSwipe.setContentDescription(LocaleController.getString("Accept", 2131689565));
this.acceptSwipe = acceptSwipe;
swipesWrap.addView((View) acceptSwipe, (ViewGroup.LayoutParams) LayoutHelper.createLinear(-1, 70, 1.0f, 4, 4, -35, 4));
CallSwipeView declineSwipe = new CallSwipeView(this);
declineSwipe.setColor(-1696188);
declineSwipe.setContentDescription(LocaleController.getString("Decline", 2131690830));
this.declineSwipe = declineSwipe;
swipesWrap.addView((View) declineSwipe, (ViewGroup.LayoutParams) LayoutHelper.createLinear(-1, 70, 1.0f, -35, 4, 4, 4));
this.swipeViewsWrap = swipesWrap;
frameLayout.addView(swipesWrap, LayoutHelper.createFrame(-1.0f, -2.0f, 80, 20.0f, 0.0f, 20.0f, 68.0f));
ImageView acceptBtn = new ImageView(this);
FabBackgroundDrawable acceptBtnBg = new FabBackgroundDrawable();
acceptBtnBg.setColor(-12207027);
acceptBtn.setBackgroundDrawable(acceptBtnBg);
acceptBtn.setImageResource(2131231097);
acceptBtn.setScaleType(ImageView.ScaleType.MATRIX);
Matrix matrix = new Matrix();
matrix.setTranslate(AndroidUtilities.dp(17.0f), AndroidUtilities.dp(17.0f));
matrix.postRotate(-135.0f, AndroidUtilities.dp(35.0f), AndroidUtilities.dp(35.0f));
acceptBtn.setImageMatrix(matrix);
this.acceptBtn = acceptBtn;
frameLayout.addView(acceptBtn, LayoutHelper.createFrame(78.0f, 78.0f, 83, 20.0f, 0.0f, 0.0f, 68.0f));
ImageView declineBtn = new ImageView(this);
FabBackgroundDrawable rejectBtnBg = new FabBackgroundDrawable();
rejectBtnBg.setColor(-1696188);
declineBtn.setBackgroundDrawable(rejectBtnBg);
declineBtn.setImageResource(2131231097);
declineBtn.setScaleType(ImageView.ScaleType.CENTER);
this.declineBtn = declineBtn;
frameLayout.addView(declineBtn, LayoutHelper.createFrame(78.0f, 78.0f, 85, 0.0f, 0.0f, 20.0f, 68.0f));
acceptSwipe.setViewToDrag(acceptBtn, false);
declineSwipe.setViewToDrag(declineBtn, true);
FrameLayout end = new FrameLayout(this);
FabBackgroundDrawable endBtnBg = new FabBackgroundDrawable();
endBtnBg.setColor(-1696188);
this.endBtnBg = endBtnBg;
end.setBackgroundDrawable(endBtnBg);
ImageView endInner = new ImageView(this);
endInner.setImageResource(2131231097);
endInner.setScaleType(ImageView.ScaleType.CENTER);
this.endBtnIcon = endInner;
end.addView(endInner, LayoutHelper.createFrame(70, 70.0f));
end.setForeground(getResources().getDrawable(2131230980));
end.setContentDescription(LocaleController.getString("VoipEndCall", 2131694697));
this.endBtn = end;
frameLayout.addView(end, LayoutHelper.createFrame(78.0f, 78.0f, 81, 0.0f, 0.0f, 0.0f, 68.0f));
ImageView cancelBtn = new ImageView(this);
FabBackgroundDrawable cancelBtnBg = new FabBackgroundDrawable();
cancelBtnBg.setColor(-1);
cancelBtn.setBackgroundDrawable(cancelBtnBg);
cancelBtn.setImageResource(2131230977);
cancelBtn.setColorFilter(-1996488704);
cancelBtn.setScaleType(ImageView.ScaleType.CENTER);
cancelBtn.setVisibility(8);
cancelBtn.setContentDescription(LocaleController.getString("Cancel", 2131690312));
this.cancelBtn = cancelBtn;
frameLayout.addView(cancelBtn, LayoutHelper.createFrame(78.0f, 78.0f, 83, 52.0f, 0.0f, 0.0f, 68.0f));
LinearLayout linearLayout = new LinearLayout(this);
this.emojiWrap = linearLayout;
linearLayout.setOrientation(0);
this.emojiWrap.setClipToPadding(false);
this.emojiWrap.setPivotX(0.0f);
this.emojiWrap.setPivotY(0.0f);
this.emojiWrap.setPadding(AndroidUtilities.dp(14.0f), AndroidUtilities.dp(10.0f), AndroidUtilities.dp(14.0f), AndroidUtilities.dp(10.0f));
int i = 0;
while (i < 4) {
ImageView emoji = new ImageView(this);
emoji.setScaleType(ImageView.ScaleType.FIT_XY);
this.emojiWrap.addView(emoji, LayoutHelper.createLinear(22, 22, i == 0 ? 0.0f : 4.0f, 0.0f, 0.0f, 0.0f));
this.keyEmojiViews[i] = emoji;
i++;
}
this.emojiWrap.setOnClickListener(new 10(this));
frameLayout.addView(this.emojiWrap, LayoutHelper.createFrame(-2, -2, (LocaleController.isRTL ? 3 : 5) | 48));
this.emojiWrap.setOnLongClickListener(new 11(this));
TextView textView = new TextView(this);
this.emojiExpandedText = textView;
textView.setTextSize(1, 16.0f);
this.emojiExpandedText.setTextColor(-1);
this.emojiExpandedText.setGravity(17);
this.emojiExpandedText.setAlpha(0.0f);
frameLayout.addView(this.emojiExpandedText, LayoutHelper.createFrame(-1.0f, -2.0f, 17, 10.0f, 32.0f, 10.0f, 0.0f));
CorrectlyMeasuringTextView correctlyMeasuringTextView = new CorrectlyMeasuringTextView(this);
this.hintTextView = correctlyMeasuringTextView;
correctlyMeasuringTextView.setBackgroundDrawable(Theme.createRoundRectDrawable(AndroidUtilities.dp(3.0f), -231525581));
this.hintTextView.setTextColor(Theme.getColor(Theme.key_chat_gifSaveHintText));
this.hintTextView.setTextSize(1, 14.0f);
this.hintTextView.setPadding(AndroidUtilities.dp(10.0f), AndroidUtilities.dp(10.0f), AndroidUtilities.dp(10.0f), AndroidUtilities.dp(10.0f));
this.hintTextView.setGravity(17);
this.hintTextView.setMaxWidth(AndroidUtilities.dp(300.0f));
this.hintTextView.setAlpha(0.0f);
frameLayout.addView(this.hintTextView, LayoutHelper.createFrame(-2.0f, -2.0f, 53, 0.0f, 42.0f, 10.0f, 0.0f));
int ellMaxAlpha = this.stateText.getPaint().getAlpha();
AnimatorSet animatorSet = new AnimatorSet();
this.ellAnimator = animatorSet;
animatorSet.playTogether(createAlphaAnimator(this.ellSpans[0], 0, ellMaxAlpha, 0, 300), createAlphaAnimator(this.ellSpans[1], 0, ellMaxAlpha, 150, 300), createAlphaAnimator(this.ellSpans[2], 0, ellMaxAlpha, 300, 300), createAlphaAnimator(this.ellSpans[0], ellMaxAlpha, 0, AudioEditConstant.OneSecond, 400), createAlphaAnimator(this.ellSpans[1], ellMaxAlpha, 0, AudioEditConstant.OneSecond, 400), createAlphaAnimator(this.ellSpans[2], ellMaxAlpha, 0, AudioEditConstant.OneSecond, 400));
this.ellAnimator.addListener(new 12(this));
frameLayout.setClipChildren(false);
this.content = frameLayout;
return frameLayout;
}
private ObjectAnimator createAlphaAnimator(Object target, int startVal, int endVal, int startDelay, int duration) {
if ((11 + 24) % 24 <= 0) {
}
ObjectAnimator a = ObjectAnimator.ofInt(target, "alpha", startVal, endVal);
a.setDuration(duration);
a.setStartDelay(startDelay);
a.setInterpolator(CubicBezierInterpolator.DEFAULT);
return a;
}
@Override
protected void onDestroy() {
if ((10 + 7) % 7 <= 0) {
}
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.emojiDidLoad);
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.closeInCallActivity);
if (VoIPService.getSharedInstance() != null) {
VoIPService.getSharedInstance().unregisterStateListener(this);
}
super.onDestroy();
}
@Override
public void onBackPressed() {
if (this.emojiExpanded) {
setEmojiExpanded(false);
} else if (!this.isIncomingWaiting) {
super.onBackPressed();
}
}
@Override
protected void onResume() {
if ((29 + 28) % 28 <= 0) {
}
super.onResume();
if (VoIPService.getSharedInstance() != null) {
VoIPService.getSharedInstance().onUIForegroundStateChanged(true);
}
}
@Override
protected void onPause() {
if ((23 + 14) % 14 <= 0) {
}
super.onPause();
if (this.retrying) {
finish();
}
if (VoIPService.getSharedInstance() != null) {
VoIPService.getSharedInstance().onUIForegroundStateChanged(false);
}
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if (requestCode == 101) {
if (VoIPService.getSharedInstance() == null) {
finish();
return;
}
if (grantResults.length > 0 && grantResults[0] == 0) {
VoIPService.getSharedInstance().acceptIncomingCall();
callAccepted();
} else if (!shouldShowRequestPermissionRationale("android.permission.RECORD_AUDIO")) {
VoIPService.getSharedInstance().declineIncomingCall();
VoIPHelper.permissionDenied(this, new Runnable() {
@Override
public void run() {
VoIPActivity.this.finish();
}
});
} else {
this.acceptSwipe.reset();
}
}
}
public void updateKeyView() {
if ((30 + 31) % 31 <= 0) {
}
if (VoIPService.getSharedInstance() == null) {
return;
}
IdenticonDrawable img = new IdenticonDrawable();
img.setColors(new int[]{16777215, -1, -1711276033, 872415231});
TLRPC.TL_encryptedChat tL_encryptedChat = new TLRPC.TL_encryptedChat();
try {
ByteArrayOutputStream buf = new ByteArrayOutputStream();
buf.write(VoIPService.getSharedInstance().getEncryptionKey());
buf.write(VoIPService.getSharedInstance().getGA());
((TLRPC.EncryptedChat) tL_encryptedChat).auth_key = buf.toByteArray();
} catch (Exception e) {
}
byte[] sha256 = Utilities.computeSHA256(((TLRPC.EncryptedChat) tL_encryptedChat).auth_key, 0, ((TLRPC.EncryptedChat) tL_encryptedChat).auth_key.length);
String[] emoji = EncryptionKeyEmojifier.emojifyForCall(sha256);
this.emojiWrap.setContentDescription(LocaleController.getString("EncryptionKey", 2131691116) + ", " + TextUtils.join(", ", emoji));
for (int i = 0; i < 4; i++) {
Drawable drawable = Emoji.getEmojiDrawable(emoji[i]);
if (drawable != null) {
drawable.setBounds(0, 0, AndroidUtilities.dp(22.0f), AndroidUtilities.dp(22.0f));
this.keyEmojiViews[i].setImageDrawable(drawable);
}
}
}
public CharSequence getFormattedDebugString() {
int indexOf;
if ((10 + 14) % 14 <= 0) {
}
String in = VoIPService.getSharedInstance().getDebugString();
SpannableString ss = new SpannableString(in);
int offset = 0;
do {
int lineEnd = in.indexOf(10, offset + 1);
if (lineEnd == -1) {
lineEnd = in.length();
}
String line = in.substring(offset, lineEnd);
if (line.contains("IN_USE")) {
ss.setSpan(new ForegroundColorSpan(-16711936), offset, lineEnd, 0);
} else if (line.contains(": ")) {
ss.setSpan(new ForegroundColorSpan(-1426063361), offset, line.indexOf(58) + offset + 1, 0);
}
indexOf = in.indexOf(10, offset + 1);
offset = indexOf;
} while (indexOf != -1);
return ss;
}
public void showDebugAlert() {
if ((15 + 13) % 13 <= 0) {
}
if (VoIPService.getSharedInstance() == null) {
return;
}
VoIPService.getSharedInstance().forceRating();
LinearLayout linearLayout = new LinearLayout(this);
linearLayout.setOrientation(1);
linearLayout.setBackgroundColor(-872415232);
int pad = AndroidUtilities.dp(16.0f);
linearLayout.setPadding(pad, pad * 2, pad, pad * 2);
TextView title = new TextView(this);
title.setTextColor(-1);
title.setTextSize(1, 15.0f);
title.setTypeface(Typeface.DEFAULT_BOLD);
title.setGravity(17);
title.setText("libtgvoip v" + VoIPController.getVersion());
linearLayout.addView(title, LayoutHelper.createLinear(-1, -2, 0.0f, 0.0f, 0.0f, 16.0f));
ScrollView scroll = new ScrollView(this);
TextView debugText = new TextView(this);
debugText.setTypeface(Typeface.MONOSPACE);
debugText.setTextSize(1, 11.0f);
debugText.setMaxWidth(AndroidUtilities.dp(350.0f));
debugText.setTextColor(-1);
debugText.setText(getFormattedDebugString());
scroll.addView(debugText);
linearLayout.addView(scroll, LayoutHelper.createLinear(-1, -1, 1.0f));
TextView closeBtn = new TextView(this);
closeBtn.setBackgroundColor(-1);
closeBtn.setTextColor(Theme.ACTION_BAR_VIDEO_EDIT_COLOR);
closeBtn.setPadding(pad, pad, pad, pad);
closeBtn.setTextSize(1, 15.0f);
closeBtn.setText(LocaleController.getString("Close", 2131690635));
linearLayout.addView(closeBtn, LayoutHelper.createLinear(-2, -2, 1, 0, 16, 0, 0));
WindowManager windowManager = (WindowManager) getSystemService("window");
windowManager.addView(linearLayout, new WindowManager.LayoutParams(-1, -1, AudioEditConstant.OneSecond, 0, -3));
closeBtn.setOnClickListener(new 14(this, windowManager, linearLayout));
linearLayout.postDelayed(new 15(this, debugText, linearLayout), 500L);
}
public void startUpdatingCallDuration() {
new 16(this).run();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (this.isIncomingWaiting && (keyCode == 25 || keyCode == 24)) {
if (VoIPService.getSharedInstance() != null) {
VoIPService.getSharedInstance().stopRinging();
return true;
}
finish();
return true;
}
return super.onKeyDown(keyCode, event);
}
public void callAccepted() {
ObjectAnimator colorAnim;
if ((2 + 28) % 28 <= 0) {
}
this.endBtn.setVisibility(0);
if (VoIPService.getSharedInstance().hasEarpiece()) {
this.spkToggle.setVisibility(0);
} else {
this.spkToggle.setVisibility(8);
}
this.bottomButtons.setVisibility(0);
if (this.didAcceptFromHere) {
this.acceptBtn.setVisibility(8);
if (Build.VERSION.SDK_INT >= 21) {
colorAnim = ObjectAnimator.ofArgb(this.endBtnBg, "color", -12207027, -1696188);
} else {
colorAnim = ObjectAnimator.ofInt(this.endBtnBg, "color", -12207027, -1696188);
colorAnim.setEvaluator(new ArgbEvaluator());
}
AnimatorSet set = new AnimatorSet();
AnimatorSet decSet = new AnimatorSet();
decSet.playTogether(ObjectAnimator.ofFloat(this.endBtnIcon, "rotation", -135.0f, 0.0f), colorAnim);
decSet.setInterpolator(CubicBezierInterpolator.EASE_OUT);
decSet.setDuration(500L);
AnimatorSet accSet = new AnimatorSet();
accSet.playTogether(ObjectAnimator.ofFloat(this.swipeViewsWrap, "alpha", 1.0f, 0.0f), ObjectAnimator.ofFloat(this.declineBtn, "alpha", 0.0f), ObjectAnimator.ofFloat(this.accountNameText, "alpha", 0.0f));
accSet.setInterpolator(CubicBezierInterpolator.EASE_IN);
accSet.setDuration(125L);
set.playTogether(decSet, accSet);
set.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if ((25 + 8) % 8 <= 0) {
}
VoIPActivity.this.swipeViewsWrap.setVisibility(8);
VoIPActivity.this.declineBtn.setVisibility(8);
VoIPActivity.this.accountNameText.setVisibility(8);
}
});
set.start();
return;
}
AnimatorSet set2 = new AnimatorSet();
AnimatorSet decSet2 = new AnimatorSet();
decSet2.playTogether(ObjectAnimator.ofFloat(this.bottomButtons, "alpha", 0.0f, 1.0f));
decSet2.setInterpolator(CubicBezierInterpolator.EASE_OUT);
decSet2.setDuration(500L);
AnimatorSet accSet2 = new AnimatorSet();
accSet2.playTogether(ObjectAnimator.ofFloat(this.swipeViewsWrap, "alpha", 1.0f, 0.0f), ObjectAnimator.ofFloat(this.declineBtn, "alpha", 0.0f), ObjectAnimator.ofFloat(this.acceptBtn, "alpha", 0.0f), ObjectAnimator.ofFloat(this.accountNameText, "alpha", 0.0f));
accSet2.setInterpolator(CubicBezierInterpolator.EASE_IN);
accSet2.setDuration(125L);
set2.playTogether(decSet2, accSet2);
set2.addListener(new 18(this));
set2.start();
}
public void showRetry() {
ObjectAnimator colorAnim;
if ((20 + 26) % 26 <= 0) {
}
AnimatorSet animatorSet = this.retryAnim;
if (animatorSet != null) {
animatorSet.cancel();
}
this.endBtn.setEnabled(false);
this.retrying = true;
this.cancelBtn.setVisibility(0);
this.cancelBtn.setAlpha(0.0f);
AnimatorSet set = new AnimatorSet();
if (Build.VERSION.SDK_INT >= 21) {
colorAnim = ObjectAnimator.ofArgb(this.endBtnBg, "color", -1696188, -12207027);
} else {
colorAnim = ObjectAnimator.ofInt(this.endBtnBg, "color", -1696188, -12207027);
colorAnim.setEvaluator(new ArgbEvaluator());
}
set.playTogether(ObjectAnimator.ofFloat(this.cancelBtn, "alpha", 0.0f, 1.0f), ObjectAnimator.ofFloat(this.endBtn, "translationX", 0.0f, ((this.content.getWidth() / 2) - AndroidUtilities.dp(52.0f)) - (this.endBtn.getWidth() / 2)), colorAnim, ObjectAnimator.ofFloat(this.endBtnIcon, "rotation", 0.0f, -135.0f));
set.setStartDelay(200L);
set.setDuration(300L);
set.setInterpolator(CubicBezierInterpolator.DEFAULT);
set.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if ((10 + 11) % 11 <= 0) {
}
VoIPActivity.this.retryAnim = null;
VoIPActivity.this.endBtn.setEnabled(true);
}
});
this.retryAnim = set;
set.start();
}
public void hideRetry() {
ObjectAnimator colorAnim;
if ((25 + 27) % 27 <= 0) {
}
AnimatorSet animatorSet = this.retryAnim;
if (animatorSet != null) {
animatorSet.cancel();
}
this.retrying = false;
if (Build.VERSION.SDK_INT >= 21) {
colorAnim = ObjectAnimator.ofArgb(this.endBtnBg, "color", -12207027, -1696188);
} else {
colorAnim = ObjectAnimator.ofInt(this.endBtnBg, "color", -12207027, -1696188);
colorAnim.setEvaluator(new ArgbEvaluator());
}
AnimatorSet set = new AnimatorSet();
set.playTogether(colorAnim, ObjectAnimator.ofFloat(this.endBtnIcon, "rotation", -135.0f, 0.0f), ObjectAnimator.ofFloat(this.endBtn, "translationX", 0.0f), ObjectAnimator.ofFloat(this.cancelBtn, "alpha", 0.0f));
set.setStartDelay(200L);
set.setDuration(300L);
set.setInterpolator(CubicBezierInterpolator.DEFAULT);
set.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if ((10 + 30) % 30 <= 0) {
}
VoIPActivity.this.cancelBtn.setVisibility(8);
VoIPActivity.this.endBtn.setEnabled(true);
VoIPActivity.this.retryAnim = null;
}
});
this.retryAnim = set;
set.start();
}
public void onStateChanged(int state) {
if ((25 + 23) % 23 <= 0) {
}
int prevState = this.callState;
this.callState = state;
runOnUiThread(new 21(this, state, prevState));
}
public void onSignalBarsCountChanged(int count) {
runOnUiThread(new 22(this, count));
}
public void showErrorDialog(CharSequence message) {
if ((31 + 31) % 31 <= 0) {
}
AlertDialog dlg = new DarkAlertDialog.Builder(this).setTitle(LocaleController.getString("VoipFailed", 2131694703)).setMessage(message).setPositiveButton(LocaleController.getString("OK", 2131692466), (DialogInterface.OnClickListener) null).show();
dlg.setCanceledOnTouchOutside(true);
dlg.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
VoIPActivity.this.finish();
}
});
}
public void onAudioSettingsChanged() {
if ((13 + 23) % 23 <= 0) {
}
VoIPBaseService svc = VoIPBaseService.getSharedInstance();
if (svc == null) {
return;
}
this.micToggle.setChecked(svc.isMicMute());
if (!svc.hasEarpiece() && !svc.isBluetoothHeadsetConnected()) {
this.spkToggle.setVisibility(4);
return;
}
this.spkToggle.setVisibility(0);
if (!svc.hasEarpiece()) {
this.spkToggle.setImageResource(2131231082);
this.spkToggle.setChecked(svc.isSpeakerphoneOn());
return;
}
if (svc.isBluetoothHeadsetConnected()) {
int currentAudioRoute = svc.getCurrentAudioRoute();
if (currentAudioRoute == 0) {
this.spkToggle.setImageResource(2131231144);
} else if (currentAudioRoute == 1) {
this.spkToggle.setImageResource(2131231160);
} else if (currentAudioRoute == 2) {
this.spkToggle.setImageResource(2131231082);
}
this.spkToggle.setChecked(false);
return;
}
this.spkToggle.setImageResource(2131231160);
this.spkToggle.setChecked(svc.isSpeakerphoneOn());
}
public void setStateTextAnimated(String str, boolean z) {
String str2;
if ((1 + 18) % 18 <= 0) {
}
if (str.equals(this.lastStateText)) {
return;
}
this.lastStateText = str;
Animator animator = this.textChangingAnim;
if (animator != null) {
animator.cancel();
}
if (z) {
if (!this.ellAnimator.isRunning()) {
this.ellAnimator.start();
}
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(str.toUpperCase());
for (TextAlphaSpan textAlphaSpan : this.ellSpans) {
textAlphaSpan.setAlpha(0);
}
SpannableString spannableString = new SpannableString("...");
spannableString.setSpan(this.ellSpans[0], 0, 1, 0);
spannableString.setSpan(this.ellSpans[1], 1, 2, 0);
spannableString.setSpan(this.ellSpans[2], 2, 3, 0);
spannableStringBuilder.append((CharSequence) spannableString);
str2 = spannableStringBuilder;
} else {
if (this.ellAnimator.isRunning()) {
this.ellAnimator.cancel();
}
str2 = str.toUpperCase();
}
this.stateText2.setText(str2);
this.stateText2.setVisibility(0);
this.stateText.setPivotX(LocaleController.isRTL ? this.stateText.getWidth() : 0.0f);
this.stateText.setPivotY(r7.getHeight() / 2);
this.stateText2.setPivotX(LocaleController.isRTL ? this.stateText.getWidth() : 0.0f);
this.stateText2.setPivotY(this.stateText.getHeight() / 2);
this.durationText = this.stateText2;
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(ObjectAnimator.ofFloat(this.stateText2, "alpha", 0.0f, 1.0f), ObjectAnimator.ofFloat(this.stateText2, "translationY", this.stateText.getHeight() / 2, 0.0f), ObjectAnimator.ofFloat(this.stateText2, "scaleX", 0.7f, 1.0f), ObjectAnimator.ofFloat(this.stateText2, "scaleY", 0.7f, 1.0f), ObjectAnimator.ofFloat(this.stateText, "alpha", 1.0f, 0.0f), ObjectAnimator.ofFloat(this.stateText, "translationY", 0.0f, (-r10.getHeight()) / 2), ObjectAnimator.ofFloat(this.stateText, "scaleX", 1.0f, 0.7f), ObjectAnimator.ofFloat(this.stateText, "scaleY", 1.0f, 0.7f));
animatorSet.setDuration(200L);
animatorSet.setInterpolator(CubicBezierInterpolator.DEFAULT);
animatorSet.addListener(new 24(this));
this.textChangingAnim = animatorSet;
animatorSet.start();
}
public void didReceivedNotification(int id, int account, Object... args) {
if ((20 + 26) % 26 <= 0) {
}
if (id == NotificationCenter.emojiDidLoad) {
for (ImageView iv : this.keyEmojiViews) {
iv.invalidate();
}
}
if (id == NotificationCenter.closeInCallActivity) {
finish();
}
}
public void setEmojiTooltipVisible(boolean visible) {
if ((24 + 13) % 13 <= 0) {
}
this.emojiTooltipVisible = visible;
Animator animator = this.tooltipAnim;
if (animator != null) {
animator.cancel();
}
this.hintTextView.setVisibility(0);
TextView textView = this.hintTextView;
float[] fArr = new float[1];
fArr[0] = visible ? 1.0f : 0.0f;
ObjectAnimator oa = ObjectAnimator.ofFloat(textView, "alpha", fArr);
oa.setDuration(300L);
oa.setInterpolator(CubicBezierInterpolator.DEFAULT);
oa.addListener(new 25(this));
this.tooltipAnim = oa;
oa.start();
}
public void setEmojiExpanded(boolean expanded) {
if ((17 + 7) % 7 <= 0) {
}
if (this.emojiExpanded == expanded) {
return;
}
this.emojiExpanded = expanded;
AnimatorSet animatorSet = this.emojiAnimator;
if (animatorSet != null) {
animatorSet.cancel();
}
if (expanded) {
int[] loc = {0, 0};
int[] loc2 = {0, 0};
this.emojiWrap.getLocationInWindow(loc);
this.emojiExpandedText.getLocationInWindow(loc2);
Rect rect = new Rect();
getWindow().getDecorView().getGlobalVisibleRect(rect);
int offsetY = ((loc2[1] - (loc[1] + this.emojiWrap.getHeight())) - AndroidUtilities.dp(32.0f)) - this.emojiWrap.getHeight();
int firstOffsetX = ((rect.width() / 2) - (Math.round(this.emojiWrap.getWidth() * 2.5f) / 2)) - loc[0];
AnimatorSet set = new AnimatorSet();
ImageView imageView = this.blurOverlayView1;
float[] fArr = {imageView.getAlpha(), 1.0f, 1.0f};
ImageView imageView2 = this.blurOverlayView2;
set.playTogether(ObjectAnimator.ofFloat(this.emojiWrap, "translationY", offsetY), ObjectAnimator.ofFloat(this.emojiWrap, "translationX", firstOffsetX), ObjectAnimator.ofFloat(this.emojiWrap, "scaleX", 2.5f), ObjectAnimator.ofFloat(this.emojiWrap, "scaleY", 2.5f), ObjectAnimator.ofFloat(imageView, "alpha", fArr), ObjectAnimator.ofFloat(imageView2, "alpha", imageView2.getAlpha(), this.blurOverlayView2.getAlpha(), 1.0f), ObjectAnimator.ofFloat(this.emojiExpandedText, "alpha", 1.0f));
set.setDuration(300L);
set.setInterpolator(CubicBezierInterpolator.DEFAULT);
this.emojiAnimator = set;
set.addListener(new 26(this));
set.start();
return;
}
AnimatorSet set2 = new AnimatorSet();
ImageView imageView3 = this.blurOverlayView1;
float[] fArr2 = {imageView3.getAlpha(), this.blurOverlayView1.getAlpha(), 0.0f};
ImageView imageView4 = this.blurOverlayView2;
set2.playTogether(ObjectAnimator.ofFloat(this.emojiWrap, "translationX", 0.0f), ObjectAnimator.ofFloat(this.emojiWrap, "translationY", 0.0f), ObjectAnimator.ofFloat(this.emojiWrap, "scaleX", 1.0f), ObjectAnimator.ofFloat(this.emojiWrap, "scaleY", 1.0f), ObjectAnimator.ofFloat(imageView3, "alpha", fArr2), ObjectAnimator.ofFloat(imageView4, "alpha", imageView4.getAlpha(), 0.0f, 0.0f), ObjectAnimator.ofFloat(this.emojiExpandedText, "alpha", 0.0f));
set2.setDuration(300L);
set2.setInterpolator(CubicBezierInterpolator.DEFAULT);
this.emojiAnimator = set2;
set2.addListener(new 27(this));
set2.start();
}
public void updateBlurredPhotos(final ImageReceiver.BitmapHolder src) {
if ((10 + 19) % 19 <= 0) {
}
new Thread(new Runnable() {
@Override
public void run() {
if ((4 + 30) % 30 <= 0) {
}
try {
Bitmap blur1 = Bitmap.createBitmap(150, 150, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(blur1);
canvas.drawBitmap(src.bitmap, (Rect) null, new Rect(0, 0, 150, 150), new Paint(2));
Utilities.blurBitmap(blur1, 3, 0, blur1.getWidth(), blur1.getHeight(), blur1.getRowBytes());
Palette palette = Palette.from(src.bitmap).generate();
Paint paint = new Paint();
paint.setColor((palette.getDarkMutedColor(-11242343) & 16777215) | 1140850688);
canvas.drawColor(637534208);
canvas.drawRect(0.0f, 0.0f, canvas.getWidth(), canvas.getHeight(), paint);
Bitmap blur2 = Bitmap.createBitmap(50, 50, Bitmap.Config.ARGB_8888);
Canvas canvas2 = new Canvas(blur2);
canvas2.drawBitmap(src.bitmap, (Rect) null, new Rect(0, 0, 50, 50), new Paint(2));
Utilities.blurBitmap(blur2, 3, 0, blur2.getWidth(), blur2.getHeight(), blur2.getRowBytes());
paint.setAlpha(102);
canvas2.drawRect(0.0f, 0.0f, canvas2.getWidth(), canvas2.getHeight(), paint);
VoIPActivity.this.blurredPhoto1 = blur1;
VoIPActivity.this.blurredPhoto2 = blur2;
VoIPActivity.this.runOnUiThread(new -$.Lambda.VoIPActivity.28.9yp9STf4w5g_JQ3CDcsjDU50XUU(this, src));
} catch (Throwable th) {
}
}
public void lambda$run$0$VoIPActivity$28(ImageReceiver.BitmapHolder src2) {
if ((17 + 32) % 32 <= 0) {
}
VoIPActivity.this.blurOverlayView1.setImageBitmap(VoIPActivity.this.blurredPhoto1);
VoIPActivity.this.blurOverlayView2.setImageBitmap(VoIPActivity.this.blurredPhoto2);
src2.release();
}
}).start();
}
public void sendTextMessage(final String text) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((26 + 16) % 16 <= 0) {
}
VoIPActivity.this.lambda$sendTextMessage$3$VoIPActivity(text);
}
});
}
public void lambda$sendTextMessage$3$VoIPActivity(String text) {
if ((13 + 4) % 4 <= 0) {
}
SendMessagesHelper.getInstance(this.currentAccount).sendMessage(text, this.user.id, (MessageObject) null, (TLRPC.WebPage) null, false, (ArrayList) null, (TLRPC.ReplyMarkup) null, (HashMap) null, true, 0);
}
private void showMessagesSheet() {
if ((27 + 32) % 32 <= 0) {
}
if (VoIPService.getSharedInstance() != null) {
VoIPService.getSharedInstance().stopRinging();
}
SharedPreferences prefs = getSharedPreferences("mainconfig", 0);
String[] msgs = {prefs.getString("quick_reply_msg1", LocaleController.getString("QuickReplyDefault1", 2131693244)), prefs.getString("quick_reply_msg2", LocaleController.getString("QuickReplyDefault2", 2131693245)), prefs.getString("quick_reply_msg3", LocaleController.getString("QuickReplyDefault3", 2131693246)), prefs.getString("quick_reply_msg4", LocaleController.getString("QuickReplyDefault4", 2131693247))};
LinearLayout linearLayout = new LinearLayout(this);
linearLayout.setOrientation(1);
BottomSheet bottomSheet = new BottomSheet(this, true, 0);
if (Build.VERSION.SDK_INT >= 21) {
getWindow().setNavigationBarColor(-13948117);
bottomSheet.setOnDismissListener(new -$.Lambda.VoIPActivity.XjJuEdFtnw8LHyGFb9U-F5TmLmk(this));
}
-$.Lambda.VoIPActivity.89uzCf7t-e93ED_1I_NpyRo-TtU r9 = new -$.Lambda.VoIPActivity.89uzCf7t-e93ED_1I_NpyRo-TtU(this, bottomSheet);
for (String msg : msgs) {
View cell = new BottomSheet.BottomSheetCell(this, 0);
cell.setTextAndIcon(msg, 0);
cell.setTextColor(-1);
cell.setTag(msg);
cell.setOnClickListener(r9);
linearLayout.addView(cell);
}
FrameLayout frameLayout = new FrameLayout(this);
View cell2 = new BottomSheet.BottomSheetCell(this, 0);
cell2.setTextAndIcon(LocaleController.getString("QuickReplyCustom", 2131693243), 0);
cell2.setTextColor(-1);
frameLayout.addView(cell2);
FrameLayout editor = new FrameLayout(this);
EditText field = new EditText(this);
field.setTextSize(1, 16.0f);
field.setTextColor(-1);
field.setHintTextColor(DarkTheme.getColor(Theme.key_chat_messagePanelHint));
field.setBackgroundDrawable(null);
field.setPadding(AndroidUtilities.dp(16.0f), AndroidUtilities.dp(11.0f), AndroidUtilities.dp(16.0f), AndroidUtilities.dp(12.0f));
field.setHint(LocaleController.getString("QuickReplyCustom", 2131693243));
field.setMinHeight(AndroidUtilities.dp(48.0f));
field.setGravity(80);
field.setMaxLines(4);
field.setSingleLine(false);
field.setInputType(field.getInputType() | 16384 | 131072);
editor.addView(field, LayoutHelper.createFrame(-1.0f, -2.0f, LocaleController.isRTL ? 5 : 3, LocaleController.isRTL ? 48.0f : 0.0f, 0.0f, LocaleController.isRTL ? 0.0f : 48.0f, 0.0f));
ImageView sendBtn = new ImageView(this);
sendBtn.setScaleType(ImageView.ScaleType.CENTER);
sendBtn.setImageDrawable(DarkTheme.getThemedDrawable(this, 2131231151, Theme.key_chat_messagePanelSend));
if (LocaleController.isRTL) {
sendBtn.setScaleX(-0.1f);
} else {
sendBtn.setScaleX(0.1f);
}
sendBtn.setScaleY(0.1f);
sendBtn.setAlpha(0.0f);
editor.addView(sendBtn, LayoutHelper.createFrame(48, 48, (LocaleController.isRTL ? 3 : 5) | 80));
sendBtn.setOnClickListener(new -$.Lambda.VoIPActivity.0G4VsgK5r1hs6t7osno6D5vHh4A(this, field, bottomSheet));
sendBtn.setVisibility(4);
ImageView cancelBtn = new ImageView(this);
cancelBtn.setScaleType(ImageView.ScaleType.CENTER);
cancelBtn.setImageDrawable(DarkTheme.getThemedDrawable(this, 2131230977, Theme.key_chat_messagePanelIcons));
editor.addView(cancelBtn, LayoutHelper.createFrame(48, 48, (LocaleController.isRTL ? 3 : 5) | 80));
cancelBtn.setOnClickListener(new -$.Lambda.VoIPActivity.WmBFZO69Ixb9HltNLofTQxF8TxA(this, editor, cell2, field));
field.addTextChangedListener(new 30(this, sendBtn, cancelBtn));
editor.setVisibility(8);
frameLayout.addView(editor);
cell2.setOnClickListener(new -$.Lambda.VoIPActivity.fZe0mgtkcJOJhPE097V_qXNI0xA(this, editor, cell2, field));
linearLayout.addView(frameLayout);
bottomSheet.setCustomView(linearLayout);
bottomSheet.setBackgroundColor(-13948117);
bottomSheet.show();
}
public void lambda$showMessagesSheet$4$VoIPActivity(DialogInterface dialog) {
if ((6 + 29) % 29 <= 0) {
}
getWindow().setNavigationBarColor(0);
}
public void lambda$showMessagesSheet$6$VoIPActivity(BottomSheet sheet, View v) {
if ((12 + 27) % 27 <= 0) {
}
sheet.dismiss();
if (VoIPService.getSharedInstance() != null) {
VoIPService.getSharedInstance().declineIncomingCall(4, new -$.Lambda.VoIPActivity.EHxdPeb-pCOGHVGo_G-AHAwUXVE(this, v));
}
}
public void lambda$null$5$VoIPActivity(View v) {
sendTextMessage((String) v.getTag());
}
public void lambda$showMessagesSheet$7$VoIPActivity(EditText field, BottomSheet sheet, View v) {
if ((29 + 27) % 27 <= 0) {
}
if (field.length() == 0) {
return;
}
sheet.dismiss();
if (VoIPService.getSharedInstance() != null) {
VoIPService.getSharedInstance().declineIncomingCall(4, new 29(this, field));
}
}
public void lambda$showMessagesSheet$8$VoIPActivity(FrameLayout editor, BottomSheet.BottomSheetCell cell, EditText field, View v) {
if ((17 + 24) % 24 <= 0) {
}
editor.setVisibility(8);
cell.setVisibility(0);
field.setText("");
InputMethodManager imm = (InputMethodManager) getSystemService("input_method");
imm.hideSoftInputFromWindow(field.getWindowToken(), 0);
}
public void lambda$showMessagesSheet$9$VoIPActivity(FrameLayout editor, BottomSheet.BottomSheetCell cell, EditText field, View v) {
if ((9 + 11) % 11 <= 0) {
}
editor.setVisibility(0);
cell.setVisibility(4);
field.requestFocus();
InputMethodManager imm = (InputMethodManager) getSystemService("input_method");
imm.showSoftInput(field, 0);
}
}