VMOS Pro v2.9.9版本的 MD5 值为:ef77d106fdbb0e499b9232be74ffc054
以下内容为反编译后的 View$OnClickListenerC2156.java 源代码,内容仅作参考
package com.vmos.pro.window;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Pair;
import android.util.Size;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import androidx.cardview.widget.CardView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.blankj.utilcode.util.LogUtils;
import com.tencent.mars.xlog.Log;
import com.tencent.mmkv.MMKV;
import com.vmos.commonuilibrary.C1417;
import com.vmos.pro.R;
import com.vmos.pro.activities.main.viewmodels.VmSettingsViewModel;
import com.vmos.pro.bean.window.FloatingWindowSize;
import com.vmos.pro.vmsupport.MultiVmSupport;
import com.vmos.pro.window.InterceptBackLayout;
import com.vmos.pro.window.View$OnClickListenerC2156;
import com.vmos.sdk.view.VMOSTextureView;
import com.vmos.utillibrary.bean.VmSizeInfo;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class View$OnClickListenerC2156 extends AbstractC8050 implements View.OnClickListener, wi3, fk3 {
public static final int ONCLICK_TYPE_CLOSE_VIEW = 2131297342;
public static final int ONCLICK_TYPE_CONTENT_VIEW = -1;
public static final int ONCLICK_TYPE_FIANL_VIEW = 2131297130;
public static final int ONCLICK_TYPE_ROTATION_VIEW = 2131297207;
public static final int ONCLICK_TYPE_SOUCND_VIEW = 2131297223;
private static final String TAG = "WINDOW-WindowSurfaceView";
public int GapValueX;
public int GapValueY;
public View cl_top;
private CardView cvRoot;
public View cv_vm;
public boolean firstShow;
private boolean fullScreenMode;
public int iSpeed;
private boolean isLandScape;
public boolean isReset;
private boolean isShowFullScreen;
public boolean isVolumesWitch;
public ImageView iv_close;
public ImageView iv_final;
public ImageView iv_menu;
public ImageView iv_rotation;
public ImageView iv_sound;
private long lastBackPressedTime;
private List<FloatingWindowSize> list;
private LinearLayout llRunningVmRoot;
public LinearLayout ll_close;
private InterceptBackLayout.InterfaceC2147 mDispatchKeyEventListener;
public InterfaceC2160 mFullScrollScreenLinstener;
public WindowManager.LayoutParams mFullWindowParams;
public int notybarHeight;
public InterfaceC2163 onClickLinstener;
public Pair<Integer, Integer> orientation_0;
public Pair<Integer, Integer> orientation_90;
public int phoneHeight;
private float realHeight;
private float realWidth;
public float romScale;
private RunningVmAdapter runningVmAdapter;
private RecyclerView rvRunningVm;
public ScaleGestureDetector scaleGestureDetector;
public boolean scaleTouch;
private boolean screenLocked;
public boolean showFullScreenIng;
public int startTouchX;
public int startTouchY;
public long time;
public long timeDetector;
public int[] topSize;
private VMOSTextureView vmosTextureView;
public class RunnableC2157 implements Runnable {
public RunnableC2157() {
}
@Override
public void run() {
View$OnClickListenerC2156 view$OnClickListenerC2156 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams = view$OnClickListenerC2156.mFullWindowParams;
if (layoutParams == null) {
return;
}
if (view$OnClickListenerC2156.isReset) {
view$OnClickListenerC2156.m59450(view$OnClickListenerC2156.mRootView, layoutParams);
InterfaceC2160 interfaceC2160 = View$OnClickListenerC2156.this.mFullScrollScreenLinstener;
if (interfaceC2160 != null) {
interfaceC2160.mo15371(true);
return;
}
return;
}
view$OnClickListenerC2156.showFullScreenIng = true;
InterfaceC2160 interfaceC21602 = view$OnClickListenerC2156.mFullScrollScreenLinstener;
if (interfaceC21602 != null) {
interfaceC21602.mo15372();
}
if (!View$OnClickListenerC2156.this.isLandScape) {
View$OnClickListenerC2156 view$OnClickListenerC21562 = View$OnClickListenerC2156.this;
float m15345 = view$OnClickListenerC21562.m15345(view$OnClickListenerC21562.mFullWindowParams.x);
View$OnClickListenerC2156 view$OnClickListenerC21563 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams2 = view$OnClickListenerC21563.mFullWindowParams;
layoutParams2.alpha = (m15345 * 0.7f) + 0.3f;
layoutParams2.y = -view$OnClickListenerC21563.m15359();
View$OnClickListenerC2156 view$OnClickListenerC21564 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams3 = view$OnClickListenerC21564.mFullWindowParams;
int i = (layoutParams3.x - 25) - view$OnClickListenerC21564.iSpeed;
layoutParams3.x = i;
if (i <= 0) {
view$OnClickListenerC21564.isShowFullScreen = true;
ij6.m25108(View$OnClickListenerC2156.this.mWindowService.m15275().m11460(), true);
View$OnClickListenerC2156 view$OnClickListenerC21565 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams4 = view$OnClickListenerC21565.mFullWindowParams;
layoutParams4.x = 0;
layoutParams4.alpha = 1.0f;
layoutParams4.y = -view$OnClickListenerC21565.m15359();
View$OnClickListenerC2156.this.showFullScreenIng = false;
ee1 m18853 = ee1.m18853();
View$OnClickListenerC2156 view$OnClickListenerC21566 = View$OnClickListenerC2156.this;
m18853.m18856(view$OnClickListenerC21566.mRootView, view$OnClickListenerC21566.mWindowService.m15275().m11460());
View$OnClickListenerC2156 view$OnClickListenerC21567 = View$OnClickListenerC2156.this;
view$OnClickListenerC21567.m59450(view$OnClickListenerC21567.mRootView, view$OnClickListenerC21567.mFullWindowParams);
InterfaceC2160 interfaceC21603 = View$OnClickListenerC2156.this.mFullScrollScreenLinstener;
if (interfaceC21603 != null) {
interfaceC21603.mo15371(true);
}
View$OnClickListenerC2156.this.firstShow = true;
return;
}
} else {
View$OnClickListenerC2156 view$OnClickListenerC21568 = View$OnClickListenerC2156.this;
float m153452 = view$OnClickListenerC21568.m15345(view$OnClickListenerC21568.mFullWindowParams.y);
View$OnClickListenerC2156 view$OnClickListenerC21569 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams5 = view$OnClickListenerC21569.mFullWindowParams;
layoutParams5.alpha = (m153452 * 0.7f) + 0.3f;
layoutParams5.x = -view$OnClickListenerC21569.m15359();
View$OnClickListenerC2156 view$OnClickListenerC215610 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams6 = view$OnClickListenerC215610.mFullWindowParams;
int i2 = layoutParams6.y + 25 + view$OnClickListenerC215610.iSpeed;
layoutParams6.y = i2;
if (i2 >= 0) {
view$OnClickListenerC215610.isShowFullScreen = true;
ij6.m25108(View$OnClickListenerC2156.this.mWindowService.m15275().m11460(), true);
View$OnClickListenerC2156 view$OnClickListenerC215611 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams7 = view$OnClickListenerC215611.mFullWindowParams;
layoutParams7.y = 0;
layoutParams7.alpha = 1.0f;
layoutParams7.x = -view$OnClickListenerC215611.m15359();
View$OnClickListenerC2156 view$OnClickListenerC215612 = View$OnClickListenerC2156.this;
view$OnClickListenerC215612.showFullScreenIng = false;
view$OnClickListenerC215612.m59450(view$OnClickListenerC215612.mRootView, view$OnClickListenerC215612.mFullWindowParams);
ee1 m188532 = ee1.m18853();
View$OnClickListenerC2156 view$OnClickListenerC215613 = View$OnClickListenerC2156.this;
m188532.m18856(view$OnClickListenerC215613.mRootView, view$OnClickListenerC215613.mWindowService.m15275().m11460());
InterfaceC2160 interfaceC21604 = View$OnClickListenerC2156.this.mFullScrollScreenLinstener;
if (interfaceC21604 != null) {
interfaceC21604.mo15371(true);
}
View$OnClickListenerC2156.this.firstShow = true;
return;
}
}
View$OnClickListenerC2156 view$OnClickListenerC215614 = View$OnClickListenerC2156.this;
view$OnClickListenerC215614.iSpeed = (int) (view$OnClickListenerC215614.iSpeed * 1.2f);
view$OnClickListenerC215614.m59450(view$OnClickListenerC215614.mRootView, view$OnClickListenerC215614.mFullWindowParams);
View$OnClickListenerC2156.this.m15336();
}
}
public class RunnableC2158 implements Runnable {
public RunnableC2158() {
}
@Override
public void run() {
WindowManager.LayoutParams layoutParams;
View$OnClickListenerC2156 view$OnClickListenerC2156 = View$OnClickListenerC2156.this;
if (view$OnClickListenerC2156.showFullScreenIng || (layoutParams = view$OnClickListenerC2156.mFullWindowParams) == null) {
return;
}
if (view$OnClickListenerC2156.isReset) {
view$OnClickListenerC2156.m59450(view$OnClickListenerC2156.mRootView, layoutParams);
InterfaceC2160 interfaceC2160 = View$OnClickListenerC2156.this.mFullScrollScreenLinstener;
if (interfaceC2160 != null) {
interfaceC2160.mo15371(false);
return;
}
return;
}
InterfaceC2160 interfaceC21602 = view$OnClickListenerC2156.mFullScrollScreenLinstener;
if (interfaceC21602 != null) {
interfaceC21602.mo15372();
}
int m19877 = ey4.m19877();
View$OnClickListenerC2156 view$OnClickListenerC21562 = View$OnClickListenerC2156.this;
if (view$OnClickListenerC21562.mOrientation == 0) {
float m15345 = view$OnClickListenerC21562.m15345(view$OnClickListenerC21562.mFullWindowParams.x);
View$OnClickListenerC2156 view$OnClickListenerC21563 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams2 = view$OnClickListenerC21563.mFullWindowParams;
layoutParams2.x = layoutParams2.x + 25 + view$OnClickListenerC21563.iSpeed;
layoutParams2.y = -view$OnClickListenerC21563.m15359();
View$OnClickListenerC2156 view$OnClickListenerC21564 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams3 = view$OnClickListenerC21564.mFullWindowParams;
layoutParams3.alpha = (m15345 * 0.7f) + 0.3f;
if (layoutParams3.x >= m19877) {
view$OnClickListenerC21564.isShowFullScreen = false;
ij6.m25108(View$OnClickListenerC2156.this.mWindowService.m15275().m11460(), false);
View$OnClickListenerC2156 view$OnClickListenerC21565 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams4 = view$OnClickListenerC21565.mFullWindowParams;
layoutParams4.alpha = 0.0f;
layoutParams4.y = -view$OnClickListenerC21565.m15359();
View$OnClickListenerC2156 view$OnClickListenerC21566 = View$OnClickListenerC2156.this;
view$OnClickListenerC21566.mFullWindowParams.x = m19877;
view$OnClickListenerC21566.m59447(view$OnClickListenerC21566.mRootView);
InterfaceC2160 interfaceC21603 = View$OnClickListenerC2156.this.mFullScrollScreenLinstener;
if (interfaceC21603 != null) {
interfaceC21603.mo15371(false);
}
ee1 m18853 = ee1.m18853();
View$OnClickListenerC2156 view$OnClickListenerC21567 = View$OnClickListenerC2156.this;
m18853.m18857(view$OnClickListenerC21567.mRootView, view$OnClickListenerC21567.mWindowService.m15275().m11460());
return;
}
} else {
float m153452 = view$OnClickListenerC21562.m15345(view$OnClickListenerC21562.mFullWindowParams.y);
View$OnClickListenerC2156 view$OnClickListenerC21568 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams5 = view$OnClickListenerC21568.mFullWindowParams;
layoutParams5.y = (layoutParams5.y - 25) - view$OnClickListenerC21568.iSpeed;
layoutParams5.x = -view$OnClickListenerC21568.m15359();
View$OnClickListenerC2156 view$OnClickListenerC21569 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams6 = view$OnClickListenerC21569.mFullWindowParams;
layoutParams6.alpha = (m153452 * 0.7f) + 0.3f;
int i = -m19877;
if (layoutParams6.y <= i) {
view$OnClickListenerC21569.isShowFullScreen = false;
ij6.m25108(View$OnClickListenerC2156.this.mWindowService.m15275().m11460(), false);
View$OnClickListenerC2156 view$OnClickListenerC215610 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams7 = view$OnClickListenerC215610.mFullWindowParams;
layoutParams7.alpha = 0.0f;
layoutParams7.x = -view$OnClickListenerC215610.m15359();
View$OnClickListenerC2156 view$OnClickListenerC215611 = View$OnClickListenerC2156.this;
view$OnClickListenerC215611.mFullWindowParams.y = i;
view$OnClickListenerC215611.m59447(view$OnClickListenerC215611.mRootView);
InterfaceC2160 interfaceC21604 = View$OnClickListenerC2156.this.mFullScrollScreenLinstener;
if (interfaceC21604 != null) {
interfaceC21604.mo15371(false);
}
ee1 m188532 = ee1.m18853();
View$OnClickListenerC2156 view$OnClickListenerC215612 = View$OnClickListenerC2156.this;
m188532.m18857(view$OnClickListenerC215612.mRootView, view$OnClickListenerC215612.mWindowService.m15275().m11460());
return;
}
}
View$OnClickListenerC2156 view$OnClickListenerC215613 = View$OnClickListenerC2156.this;
view$OnClickListenerC215613.iSpeed = (int) (view$OnClickListenerC215613.iSpeed * 1.2f);
view$OnClickListenerC215613.m59450(view$OnClickListenerC215613.mRootView, view$OnClickListenerC215613.mFullWindowParams);
View$OnClickListenerC2156.this.m15347();
}
}
public class C2159 implements Observer<va6> {
public final InterfaceC2164 val$prePareResult;
public C2159(InterfaceC2164 interfaceC2164) {
this.val$prePareResult = interfaceC2164;
}
@Override
public void onComplete() {
}
@Override
public void onError(Throwable th) {
}
@Override
public void onSubscribe(Disposable disposable) {
}
@Override
public void onNext(va6 va6Var) {
View$OnClickListenerC2156.this.vmosTextureView.prepare(View$OnClickListenerC2156.this.mWindowService.m15287().m11460(), 2, View$OnClickListenerC2156.this.m15346());
View$OnClickListenerC2156.this.vmosTextureView.setVisibility(0);
InterfaceC2164 interfaceC2164 = this.val$prePareResult;
if (interfaceC2164 != null) {
interfaceC2164.mo15374();
}
}
}
public interface InterfaceC2160 {
void mo15371(boolean z);
void mo15372();
}
public class C2161 implements InterceptBackLayout.InterfaceC2147 {
public C2161() {
}
@Override
public boolean dispatchKeyEvent(KeyEvent keyEvent) {
Log.d(View$OnClickListenerC2156.TAG, "dispatchKeyEvent() called with: event = [" + keyEvent + "]");
if (keyEvent.getKeyCode() == 4 && keyEvent.getAction() == 1) {
if (View$OnClickListenerC2156.this.isShowFullScreen) {
if (View$OnClickListenerC2156.this.lastBackPressedTime + ds.f14123 <= SystemClock.uptimeMillis()) {
C1417.m8786(View$OnClickListenerC2156.this.cvRoot, "再按一次返回真机").m8791();
} else {
View$OnClickListenerC2156.this.m15347();
}
View$OnClickListenerC2156.this.lastBackPressedTime = SystemClock.uptimeMillis();
}
return true;
}
return false;
}
}
public class C2162 extends ScaleGestureDetector.SimpleOnScaleGestureListener {
private C2162() {
}
@Override
public boolean onScale(ScaleGestureDetector scaleGestureDetector) {
return m15373(scaleGestureDetector.getScaleFactor());
}
@Override
public boolean onScaleBegin(ScaleGestureDetector scaleGestureDetector) {
View$OnClickListenerC2156.this.scaleTouch = true;
return super.onScaleBegin(scaleGestureDetector);
}
@Override
public void onScaleEnd(ScaleGestureDetector scaleGestureDetector) {
super.onScaleEnd(scaleGestureDetector);
View$OnClickListenerC2156.this.scaleTouch = false;
}
public boolean m15373(float f) {
WindowManager.LayoutParams layoutParams;
WindowManager.LayoutParams layoutParams2;
View$OnClickListenerC2156 view$OnClickListenerC2156;
WindowManager.LayoutParams layoutParams3;
WindowManager.LayoutParams layoutParams4;
WindowManager.LayoutParams layoutParams5;
WindowManager.LayoutParams layoutParams6;
WindowManager.LayoutParams layoutParams7;
WindowManager.LayoutParams layoutParams8;
View$OnClickListenerC2156 view$OnClickListenerC21562;
WindowManager.LayoutParams layoutParams9;
WindowManager.LayoutParams layoutParams10;
WindowManager.LayoutParams layoutParams11;
int m19876 = ey4.m19876();
int m19877 = ey4.m19877();
Log.e(View$OnClickListenerC2156.TAG, "screenHeight=" + m19876 + " screenWidth=" + m19877);
Log.e(View$OnClickListenerC2156.TAG, "mLayoutParams height=" + View$OnClickListenerC2156.this.mLayoutParams.height + " width=" + View$OnClickListenerC2156.this.mLayoutParams.width);
if (Float.isNaN(f)) {
f = 1.0f;
}
if (View$OnClickListenerC2156.this.mLayoutParams.height * f > m19876 - ey4.m19866() && f > 1.0f) {
f = 1.0f;
}
Log.e(View$OnClickListenerC2156.TAG, "curScale=" + f);
Log.e(View$OnClickListenerC2156.TAG, "mOrientation=" + View$OnClickListenerC2156.this.mOrientation);
Log.e(View$OnClickListenerC2156.TAG, "Surface.ROTATION_0=0");
int m19869 = ey4.m19869(xy.f41602);
int m198692 = ey4.m19869(xy.f41601);
Log.e(View$OnClickListenerC2156.TAG, "phone_vertical_floatview_hor_min=" + m19869);
View$OnClickListenerC2156 view$OnClickListenerC21563 = View$OnClickListenerC2156.this;
if (view$OnClickListenerC21563.mOrientation == 0) {
WindowManager.LayoutParams layoutParams12 = view$OnClickListenerC21563.mLayoutParams;
int i = (int) (layoutParams12.height * f);
int i2 = (int) (layoutParams12.width * f);
Log.e(View$OnClickListenerC2156.TAG, "ROTATION_0 goWidth=" + i2 + " goHeight=" + i);
if (i2 >= m19877) {
View$OnClickListenerC2156.this.m15358("before");
View$OnClickListenerC2156 view$OnClickListenerC21564 = View$OnClickListenerC2156.this;
view$OnClickListenerC21564.mLayoutParams.width = m19877;
if (!view$OnClickListenerC21564.m15352()) {
View$OnClickListenerC2156 view$OnClickListenerC21565 = View$OnClickListenerC2156.this;
view$OnClickListenerC21565.mLayoutParams.height = (int) (layoutParams11.width / view$OnClickListenerC21565.romScale);
} else {
View$OnClickListenerC2156 view$OnClickListenerC21566 = View$OnClickListenerC2156.this;
view$OnClickListenerC21566.mLayoutParams.height = (int) (layoutParams10.width * view$OnClickListenerC21566.romScale);
}
View$OnClickListenerC2156.this.m15364(2, 0.0f);
View$OnClickListenerC2156.this.m15358("after");
} else if (i >= m19876) {
View$OnClickListenerC2156.this.m15358("before");
View$OnClickListenerC2156 view$OnClickListenerC21567 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams13 = view$OnClickListenerC21567.mLayoutParams;
layoutParams13.height = m19876;
layoutParams13.width = (int) (m19876 * view$OnClickListenerC21567.romScale);
view$OnClickListenerC21567.m15364(2, 0.0f);
View$OnClickListenerC2156.this.m15358("after");
} else if (i2 > m198692 || View$OnClickListenerC2156.this.m15352()) {
if (i2 > m19869 || !View$OnClickListenerC2156.this.m15352()) {
View$OnClickListenerC2156.this.m15358("before");
View$OnClickListenerC2156 view$OnClickListenerC21568 = View$OnClickListenerC2156.this;
view$OnClickListenerC21568.mLayoutParams.width = i2;
if (!view$OnClickListenerC21568.m15352()) {
View$OnClickListenerC2156 view$OnClickListenerC21569 = View$OnClickListenerC2156.this;
view$OnClickListenerC21569.mLayoutParams.height = (int) (layoutParams9.width / view$OnClickListenerC21569.romScale);
} else {
View$OnClickListenerC2156 view$OnClickListenerC215610 = View$OnClickListenerC2156.this;
view$OnClickListenerC215610.mLayoutParams.height = (int) (layoutParams8.width * view$OnClickListenerC215610.romScale);
}
View$OnClickListenerC2156.this.m15364(3, view$OnClickListenerC21562.mLayoutParams.width);
View$OnClickListenerC2156.this.m15358("after");
} else {
View$OnClickListenerC2156.this.m15358("before");
View$OnClickListenerC2156 view$OnClickListenerC215611 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams14 = view$OnClickListenerC215611.mLayoutParams;
layoutParams14.width = m19869;
layoutParams14.height = (int) (m19869 * view$OnClickListenerC215611.romScale);
view$OnClickListenerC215611.m15364(1, 0.0f);
View$OnClickListenerC2156.this.m15358("after");
}
} else {
View$OnClickListenerC2156.this.m15358("before");
View$OnClickListenerC2156 view$OnClickListenerC215612 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams15 = view$OnClickListenerC215612.mLayoutParams;
layoutParams15.width = m198692;
layoutParams15.height = (int) (m198692 / view$OnClickListenerC215612.romScale);
view$OnClickListenerC215612.m15364(1, 0.0f);
View$OnClickListenerC2156.this.m15358("after");
}
View$OnClickListenerC2156.this.m15358("before");
View$OnClickListenerC2156 view$OnClickListenerC215613 = View$OnClickListenerC2156.this;
view$OnClickListenerC215613.mLayoutParams.height += view$OnClickListenerC215613.topSize[1];
view$OnClickListenerC215613.m15358("after");
} else {
int i3 = view$OnClickListenerC21563.mLayoutParams.height;
int[] iArr = view$OnClickListenerC21563.topSize;
int i4 = (int) ((i3 - iArr[1]) * f);
int i5 = (int) (layoutParams.width * f);
if (i4 >= m19876) {
view$OnClickListenerC21563.m15358("before");
View$OnClickListenerC2156 view$OnClickListenerC215614 = View$OnClickListenerC2156.this;
view$OnClickListenerC215614.mLayoutParams.height = m19876;
if (!view$OnClickListenerC215614.m15352()) {
View$OnClickListenerC2156 view$OnClickListenerC215615 = View$OnClickListenerC2156.this;
view$OnClickListenerC215615.mLayoutParams.width = (int) (layoutParams7.height * view$OnClickListenerC215615.romScale);
} else {
View$OnClickListenerC2156 view$OnClickListenerC215616 = View$OnClickListenerC2156.this;
view$OnClickListenerC215616.mLayoutParams.width = (int) (layoutParams6.height / view$OnClickListenerC215616.romScale);
}
View$OnClickListenerC2156.this.m15364(2, 0.0f);
View$OnClickListenerC2156.this.m15358("after");
} else if (f <= 1.0f || i4 < m19876 - iArr[1]) {
if (i5 > m198692 || view$OnClickListenerC21563.m15352()) {
if (i5 > m19869 || !View$OnClickListenerC2156.this.m15352()) {
View$OnClickListenerC2156.this.m15358("before");
View$OnClickListenerC2156 view$OnClickListenerC215617 = View$OnClickListenerC2156.this;
view$OnClickListenerC215617.mLayoutParams.width = i5;
if (!view$OnClickListenerC215617.m15352()) {
View$OnClickListenerC2156 view$OnClickListenerC215618 = View$OnClickListenerC2156.this;
view$OnClickListenerC215618.mLayoutParams.height = (int) (layoutParams3.width / view$OnClickListenerC215618.romScale);
} else {
View$OnClickListenerC2156 view$OnClickListenerC215619 = View$OnClickListenerC2156.this;
view$OnClickListenerC215619.mLayoutParams.height = (int) (layoutParams2.width * view$OnClickListenerC215619.romScale);
}
View$OnClickListenerC2156.this.m15364(4, view$OnClickListenerC2156.mLayoutParams.width);
View$OnClickListenerC2156.this.m15358("after");
} else {
View$OnClickListenerC2156.this.m15358("before");
View$OnClickListenerC2156 view$OnClickListenerC215620 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams16 = view$OnClickListenerC215620.mLayoutParams;
layoutParams16.width = m19869;
layoutParams16.height = (int) (m19869 * view$OnClickListenerC215620.romScale);
view$OnClickListenerC215620.m15364(1, 0.0f);
View$OnClickListenerC2156.this.m15358("after");
}
} else {
View$OnClickListenerC2156.this.m15358("before");
View$OnClickListenerC2156 view$OnClickListenerC215621 = View$OnClickListenerC2156.this;
WindowManager.LayoutParams layoutParams17 = view$OnClickListenerC215621.mLayoutParams;
layoutParams17.width = m198692;
layoutParams17.height = (int) (m198692 / view$OnClickListenerC215621.romScale);
view$OnClickListenerC215621.m15364(1, 0.0f);
View$OnClickListenerC2156.this.m15358("after");
}
} else {
view$OnClickListenerC21563.m15358("before");
View$OnClickListenerC2156 view$OnClickListenerC215622 = View$OnClickListenerC2156.this;
view$OnClickListenerC215622.mLayoutParams.height = m19876 - view$OnClickListenerC215622.topSize[1];
if (!view$OnClickListenerC215622.m15352()) {
View$OnClickListenerC2156 view$OnClickListenerC215623 = View$OnClickListenerC2156.this;
view$OnClickListenerC215623.mLayoutParams.width = (int) (layoutParams5.height * view$OnClickListenerC215623.romScale);
} else {
View$OnClickListenerC2156 view$OnClickListenerC215624 = View$OnClickListenerC2156.this;
view$OnClickListenerC215624.mLayoutParams.width = (int) (layoutParams4.height / view$OnClickListenerC215624.romScale);
}
View$OnClickListenerC2156.this.m15364(2, 0.0f);
View$OnClickListenerC2156.this.m15358("after");
}
View$OnClickListenerC2156.this.m15358("before");
View$OnClickListenerC2156 view$OnClickListenerC215625 = View$OnClickListenerC2156.this;
view$OnClickListenerC215625.mLayoutParams.height += view$OnClickListenerC215625.topSize[1];
view$OnClickListenerC215625.m15358("after");
}
View$OnClickListenerC2156.this.mo15356();
View$OnClickListenerC2156.this.timeDetector = System.currentTimeMillis();
boolean z = false;
Iterator it = View$OnClickListenerC2156.this.list.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
FloatingWindowSize floatingWindowSize = (FloatingWindowSize) it.next();
if (floatingWindowSize.m11897() == View$OnClickListenerC2156.this.mWindowService.m15275().m11460()) {
floatingWindowSize.m11900(View$OnClickListenerC2156.this.mLayoutParams.width);
floatingWindowSize.m11899(View$OnClickListenerC2156.this.mLayoutParams.height);
floatingWindowSize.m11891(View$OnClickListenerC2156.this.romScale);
floatingWindowSize.m11892(View$OnClickListenerC2156.this.m15352());
z = true;
break;
}
}
if (View$OnClickListenerC2156.this.list.size() == 0 || !z) {
FloatingWindowSize floatingWindowSize2 = new FloatingWindowSize();
floatingWindowSize2.m11893(View$OnClickListenerC2156.this.mWindowService.m15275().m11460());
floatingWindowSize2.m11900(View$OnClickListenerC2156.this.mLayoutParams.width);
floatingWindowSize2.m11899(View$OnClickListenerC2156.this.mLayoutParams.height);
floatingWindowSize2.m11891(View$OnClickListenerC2156.this.romScale);
floatingWindowSize2.m11892(View$OnClickListenerC2156.this.m15352());
View$OnClickListenerC2156.this.list.add(floatingWindowSize2);
}
return true;
}
public C2162(View$OnClickListenerC2156 view$OnClickListenerC2156, C2161 c2161) {
this();
}
}
public interface InterfaceC2163 {
void onClick(int i);
}
public interface InterfaceC2164 {
void mo15374();
}
public class View$OnTouchListenerC2165 implements View.OnTouchListener {
public View$OnTouchListenerC2165() {
}
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
View$OnClickListenerC2156.this.m15344();
return true;
}
}
public class C2166 implements InterfaceC2164 {
public C2166() {
}
@Override
public void mo15374() {
View$OnClickListenerC2156.this.m15335();
View$OnClickListenerC2156.this.m15366();
View$OnClickListenerC2156.this.mo15343();
View$OnClickListenerC2156.this.mo15350();
}
}
public View$OnClickListenerC2156(Context context, WindowManager windowManager, WindowService windowService) {
super(context, windowManager, windowService);
this.iSpeed = 1;
this.GapValueY = 0;
this.GapValueX = 0;
this.screenLocked = false;
this.isLandScape = false;
this.mDispatchKeyEventListener = new C2161();
}
public void m15325() {
m15335();
m15366();
mo15343();
mo15350();
}
public void m15327(ObservableEmitter observableEmitter) throws Exception {
va6 m30960 = ma6.m30942().m30960(this.mWindowService.m15291(), true);
Log.i(TAG, "VMOSEngineClient :" + this.mWindowService.m15291());
if (m30960 != null && !m30960.m46733()) {
m30960 = m30960.m46644();
}
observableEmitter.onNext(m30960);
}
public boolean m15328(View view, MotionEvent motionEvent) {
int i;
int i2;
int i3;
if (!this.isShowFullScreen && m15351()) {
if (motionEvent.getPointerCount() >= 2) {
return this.scaleGestureDetector.onTouchEvent(motionEvent);
}
if (System.currentTimeMillis() - this.timeDetector <= 500) {
return true;
}
int m19876 = ey4.m19876();
int m19877 = ey4.m19877();
int action = motionEvent.getAction();
if (action != 0) {
if (action == 1) {
this.time = System.currentTimeMillis() - this.time;
Log.e(TAG, "ACTION_UP " + this.time);
if (this.time < 150) {
InterfaceC2163 interfaceC2163 = this.onClickLinstener;
if (interfaceC2163 != null) {
interfaceC2163.onClick(-1);
}
return false;
}
} else if (action == 2) {
int rawX = (int) motionEvent.getRawX();
int rawY = (int) motionEvent.getRawY();
int i4 = rawX - this.startTouchX;
int i5 = rawY - this.startTouchY;
this.startTouchX = rawX;
this.startTouchY = rawY;
if (this.mOrientation == 0) {
if (!m15352()) {
WindowManager.LayoutParams layoutParams = this.mLayoutParams;
if (layoutParams.y <= 0) {
i3 = (m19876 / 2) - (layoutParams.height / 2);
} else {
i3 = (m19876 / 2) + wu.OTHER_ERROR;
}
i = (m19877 / 2) + 100;
} else {
WindowManager.LayoutParams layoutParams2 = this.mLayoutParams;
if (layoutParams2.y <= 0) {
i3 = (m19876 / 2) - (layoutParams2.height / 2);
} else {
i3 = (m19876 / 2) + 100;
}
i = (m19877 / 2) + wu.OTHER_ERROR;
}
WindowManager.LayoutParams layoutParams3 = this.mLayoutParams;
int i6 = layoutParams3.y;
if (i3 >= i6 + i5 && (-i3) + 90 <= i6 + i5) {
layoutParams3.y = i6 + i5;
} else if (i6 > 0) {
layoutParams3.y = i3;
} else {
layoutParams3.y = (-i3) + 90;
}
} else {
if (!m15352()) {
WindowManager.LayoutParams layoutParams4 = this.mLayoutParams;
if (layoutParams4.x <= 0) {
i = (m19877 / 2) - (layoutParams4.width / 2);
} else {
i = (m19877 / 2) + 100;
}
i2 = (m19876 / 2) + 200;
} else {
WindowManager.LayoutParams layoutParams5 = this.mLayoutParams;
if (layoutParams5.x <= 0) {
i = (m19877 / 2) - (layoutParams5.width / 2);
} else {
i = (m19877 / 2) + 200;
}
i2 = (m19876 / 2) + 100;
}
if (i2 < Math.abs(this.mLayoutParams.y + i5)) {
WindowManager.LayoutParams layoutParams6 = this.mLayoutParams;
if (layoutParams6.y > 0) {
layoutParams6.y = i2;
} else {
layoutParams6.y = -i2;
}
} else {
this.mLayoutParams.y += i5;
}
}
if (i < Math.abs(this.mLayoutParams.x + i4)) {
WindowManager.LayoutParams layoutParams7 = this.mLayoutParams;
if (layoutParams7.x > 0) {
layoutParams7.x = i;
} else {
layoutParams7.x = -i;
}
} else {
this.mLayoutParams.x += i4;
}
mo15356();
}
int i7 = m19876 / 2;
return false;
}
this.time = System.currentTimeMillis();
this.startTouchX = (int) motionEvent.getRawX();
this.startTouchY = (int) motionEvent.getRawY();
}
return true;
}
@Override
public void onClick(View view) {
if (view.getId() == R.id.iv_window_menu_for_vm) {
m15338();
return;
}
InterfaceC2163 interfaceC2163 = this.onClickLinstener;
if (interfaceC2163 != null) {
interfaceC2163.onClick(view.getId());
}
}
@Override
public void onItemClick(View view, int i) {
m15344();
if (this.runningVmAdapter.m15250().get(i).m11460() != this.mWindowService.m15275().m11460()) {
Log.i("prepareSurfaceView_test", "onItemClick");
this.mWindowService.m15284(this.runningVmAdapter.m15250().get(i).m11460());
m15363(new C2166());
}
}
@Override
public void onReceivedEvent(int i, int i2, int i3, Bundle bundle) {
if (2002 == i3 && 42 == i2 && bundle != null) {
String format = String.format("id = %d : type = %s(%d), state = %s(%d), extras = %s", Integer.valueOf(i), za6.m53280(Integer.valueOf(i2)), Integer.valueOf(i2), za6.m53280(Integer.valueOf(i3)), Integer.valueOf(i3), za6.m53281(bundle));
bundle.getString("data", null);
Log.i(TAG, "message :" + format);
Intent intent = new Intent(this.mWindowService, MultiVmSupport.m15055(i));
intent.putExtra("vm_local_id", i);
intent.addFlags(268566528);
C7580.m56052(this.mWindowService, intent);
}
}
public final void m15330(int i, int i2) {
}
public void m15331() {
this.screenLocked = !this.screenLocked;
m15349();
}
public void m15332() {
}
@SuppressLint({"ClickableViewAccessibility"})
public final void m15333() {
this.cvRoot.setOnTouchListener(new View.OnTouchListener() {
@Override
public final boolean onTouch(View view, MotionEvent motionEvent) {
boolean m15328;
m15328 = View$OnClickListenerC2156.this.m15328(view, motionEvent);
return m15328;
}
});
}
public void m15334(InterfaceC2163 interfaceC2163) {
this.onClickLinstener = interfaceC2163;
}
public final void m15335() {
int i;
dc6 dc6Var = dc6.f13598;
MMKV m16936 = dc6Var.m16936();
int i2 = m16936.getInt(ku.f23780 + this.mWindowService.m15291(), 0);
MMKV m169362 = dc6Var.m16936();
int i3 = m169362.getInt(ku.f23783 + this.mWindowService.m15291(), 0);
MMKV m169363 = dc6Var.m16936();
int i4 = m169363.getInt(ku.f23786 + this.mWindowService.m15291(), -1);
MMKV m169364 = dc6Var.m16936();
int i5 = m169364.getInt(ku.f23787 + this.mWindowService.m15291(), -1);
Size m15346 = m15346();
float width = ((float) m15346.getWidth()) / ((float) m15346.getHeight());
int m19877 = ey4.m19877();
int m19876 = ey4.m19876();
int min = (int) (Math.min(m19877, m19876) * 0.5f);
int i6 = (int) (min / width);
if (i4 < 0 || i5 < 0 || Math.abs((i4 / i5) - (m15346.getWidth() / m15346.getHeight())) > 0.001d) {
i = min;
i5 = i6;
} else {
i = i4;
}
int i7 = this.mOrientation;
if (i7 == 0 && this.isLandScape && i5 > m19877) {
WindowManager.LayoutParams layoutParams = this.mLayoutParams;
layoutParams.height = ((int) (m19877 * width)) + this.topSize[1];
layoutParams.width = m19877;
} else {
if ((i7 == 1 || i7 == 3) && !this.isLandScape) {
int[] iArr = this.topSize;
if (iArr[1] + i5 > m19876) {
WindowManager.LayoutParams layoutParams2 = this.mLayoutParams;
layoutParams2.height = m19876;
layoutParams2.width = (int) ((m19876 - iArr[1]) * width);
}
}
WindowManager.LayoutParams layoutParams3 = this.mLayoutParams;
boolean z = this.isLandScape;
layoutParams3.width = z ? i5 : i;
layoutParams3.height = (z ? i : i5) + this.topSize[1];
}
Log.i(TAG, "romScale -> " + width);
Log.i(TAG, "screenRealWidth -> " + m19877 + " screenHeight -> " + m19876);
Log.i(TAG, "halfWidth -> " + i + " halfHeight -> " + i5);
Log.i(TAG, "width -> " + this.mLayoutParams.width + " height -> " + this.mLayoutParams.height);
WindowManager.LayoutParams layoutParams4 = this.mLayoutParams;
layoutParams4.gravity = 17;
layoutParams4.x = i2;
layoutParams4.y = i3;
mo15356();
}
public final void m15336() {
boolean z = this.mRootView.getContext() instanceof FragmentActivity;
ma6.m30942().m30970(this);
this.mRootView.post(new RunnableC2157());
}
@Override
public void mo15337(int i) {
}
public final void m15338() {
if (this.llRunningVmRoot.getVisibility() == 0) {
m15344();
return;
}
RunningVmAdapter runningVmAdapter = this.runningVmAdapter;
if (runningVmAdapter == null) {
RunningVmAdapter runningVmAdapter2 = new RunningVmAdapter(this.mWindowService.m15289(), this.mWindowService, this);
this.runningVmAdapter = runningVmAdapter2;
this.rvRunningVm.setAdapter(runningVmAdapter2);
} else {
runningVmAdapter.m15253();
}
if6.m24979(this.llRunningVmRoot);
}
public void m15339(int i) {
if (m59451()) {
m15366();
mo15343();
}
this.fullScreenMode = true;
this.vmosTextureView.setTouchable(true);
Log.e(TAG, "touchFullScreen position:" + i);
float m15345 = m15345(i);
if (this.mRootView.getParent() == null || this.mFullWindowParams == null) {
this.iv_final.setVisibility(8);
this.ll_close.setVisibility(8);
this.iv_rotation.setVisibility(8);
this.iv_sound.setVisibility(8);
this.cl_top.setVisibility(8);
WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
this.mFullWindowParams = layoutParams;
if (Build.VERSION.SDK_INT > 25) {
layoutParams.type = 2038;
} else {
layoutParams.type = 2002;
}
layoutParams.format = -3;
layoutParams.flags = yb3.f42113;
layoutParams.alpha = (m15345 * 0.7f) + 0.3f;
layoutParams.gravity = 51;
m15368(i);
m59448(this.mRootView, this.mFullWindowParams);
Log.e(TAG, "addd:mFullWindowParams.x" + this.mFullWindowParams.x + " -mFullWindowParams.y:" + this.mFullWindowParams.y);
StringBuilder sb = new StringBuilder();
sb.append("addd:mFullWindowParams.height");
sb.append(this.mFullWindowParams.height);
Log.e(TAG, sb.toString());
}
this.mFullWindowParams.alpha = (m15345 * 0.7f) + 0.3f;
m15369(i);
Log.e(TAG, "updata:mFullWindowParams.x" + this.mFullWindowParams.x + " -mFullWindowParams.y:" + this.mFullWindowParams.y);
StringBuilder sb2 = new StringBuilder();
sb2.append("updata:mFullWindowParams.height");
sb2.append(this.mFullWindowParams.height);
Log.e(TAG, sb2.toString());
Log.e(TAG, "updata:mFullWindowParams.width" + this.mFullWindowParams.width);
m59450(this.mRootView, this.mFullWindowParams);
}
public void m15340(float f, int i) {
if (this.mFullWindowParams == null || m15351()) {
return;
}
this.isReset = false;
this.iSpeed = i;
int m19877 = ey4.m19877();
Log.d(TAG, "touchFullScreenUp coefficeient = " + f + " speed = " + i);
if (this.mOrientation == 0) {
if (f > 1.0f) {
m15336();
} else if (f < -1.0f) {
m15347();
} else if (this.mFullWindowParams.x > m19877 / 2) {
m15347();
} else {
m15336();
}
} else if (f > 1.0f) {
m15347();
} else if (f < -1.0f) {
m15336();
} else if (this.mFullWindowParams.y < (-m19877) / 2) {
m15347();
} else {
m15336();
}
}
public int[] m15341(View view) {
return new int[]{ey4.m19869(24), ey4.m19869(24)};
}
@Override
public void mo15342(boolean z) {
super.mo15342(z);
if (z) {
return;
}
m15366();
mo15343();
}
@Override
public void mo15343() {
m15330(24, 32);
ma6.m30942().m30990(this);
m15344();
int i = 0;
this.isShowFullScreen = false;
ij6.m25108(this.mWindowService.m15275().m11460(), false);
WindowManager.LayoutParams layoutParams = this.mFullWindowParams;
if (layoutParams != null) {
layoutParams.y = 0;
layoutParams.x = 0;
}
this.isReset = true;
this.showFullScreenIng = false;
int i2 = this.mOrientation;
this.isLandScape = i2 == 1 || i2 == 3;
this.vmosTextureView.setSurfaceRotation((i2 == 1 || i2 == 3) ? 1 : 1);
Log.i(TAG, "dismissView : current vmid :" + this.mWindowService.m15291());
super.mo15343();
}
public void m15344() {
if6.m24972(this.llRunningVmRoot);
}
public final float m15345(int i) {
ey4.m19877();
return 1.0f;
}
public final Size m15346() {
VmSizeInfo m36028;
int m11460 = this.mWindowService.m15275().m11460();
MMKV mmkvWithID = MMKV.mmkvWithID(VmSettingsViewModel.SETTING_KEY, 2);
if (mmkvWithID.getBoolean("FULL_SCREEN_KEY_" + m11460, true)) {
m36028 = pi6.f29613.m36029(mmkvWithID.getString("current_vm_resolution_" + m11460, null));
} else {
m36028 = pi6.f29613.m36028(mmkvWithID.getString("CUT_HAIR_CURRENT_VM_RESOLUTION_" + m11460, null));
}
if (this.isLandScape) {
this.romScale = m36028.m15778() / m36028.m15783();
} else {
this.romScale = m36028.m15783() / m36028.m15778();
}
Log.i(TAG, "surfa3 width: " + m36028.m15783() + " height: " + m36028.m15778());
return new Size(m36028.m15783(), m36028.m15778());
}
public void m15347() {
this.vmosTextureView.setTouchable(this.screenLocked);
this.mRootView.post(new RunnableC2158());
}
@Override
public void mo15348(int i) {
super.mo15348(i);
if (i != 1 && i != 3) {
this.isLandScape = false;
this.vmosTextureView.setSurfaceRotation(0);
return;
}
this.isLandScape = true;
this.vmosTextureView.setSurfaceRotation(1);
}
public void m15349() {
if (this.screenLocked) {
this.iv_final.setImageResource(R.mipmap.ic_window_lock);
this.iv_rotation.setVisibility(4);
this.iv_sound.setVisibility(4);
} else {
this.iv_final.setImageResource(R.mipmap.ic_window_unlock);
this.iv_rotation.setVisibility(0);
this.iv_sound.setVisibility(0);
}
this.vmosTextureView.setTouchable(this.screenLocked);
}
@Override
public void mo15350() {
this.fullScreenMode = true;
Log.e(TAG, "showView");
this.iv_final.setVisibility(0);
this.ll_close.setVisibility(0);
this.cl_top.setVisibility(0);
ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) this.cv_vm.getLayoutParams();
((ViewGroup.MarginLayoutParams) layoutParams).height = 0;
((ViewGroup.MarginLayoutParams) layoutParams).width = 0;
layoutParams.topToBottom = this.cl_top.getId();
layoutParams.startToStart = 0;
layoutParams.endToEnd = 0;
layoutParams.bottomToBottom = 0;
this.cv_vm.setLayoutParams(layoutParams);
FrameLayout.LayoutParams layoutParams2 = (FrameLayout.LayoutParams) this.vmosTextureView.getLayoutParams();
layoutParams2.height = -1;
layoutParams2.width = -1;
layoutParams2.topMargin = 0;
boolean z = MMKV.mmkvWithID(VmSettingsViewModel.SETTING_KEY, 2).getBoolean(ku.f23839, false);
this.isLandScape = z;
this.vmosTextureView.setSurfaceRotation(z ? 1 : 0);
m15349();
m15335();
RunningVmAdapter runningVmAdapter = this.runningVmAdapter;
if (runningVmAdapter != null) {
runningVmAdapter.m15253();
}
Log.i(RunningVmAdapter.TAG, "current vmid " + this.mWindowService.m15287().m11460());
super.mo15350();
}
public boolean m15351() {
int i;
int i2;
int m19877 = ey4.m19877();
if (this.mOrientation == 0) {
WindowManager.LayoutParams layoutParams = this.mFullWindowParams;
if (layoutParams == null || (i2 = layoutParams.x) <= 0 || i2 >= m19877) {
return true;
}
Log.e(TAG, "mFullWindowParams x:" + this.mFullWindowParams.x);
return false;
}
WindowManager.LayoutParams layoutParams2 = this.mFullWindowParams;
if (layoutParams2 == null || (i = layoutParams2.y) <= (-m19877) || i >= 0) {
return true;
}
Log.e(TAG, "mFullWindowParams y:" + this.mFullWindowParams.y);
return false;
}
public final boolean m15352() {
return C2167.Companion.m15381().m15377(this.mWindowService.m15275().m11460());
}
public boolean m15353() {
return this.fullScreenMode;
}
public final boolean m15354() {
return C7305.m55292().getConfiguration().orientation == 1;
}
public boolean m15355() {
return this.isShowFullScreen;
}
@Override
public void mo15356() {
super.mo15356();
}
@Override
public View mo15357() {
this.screenLocked = false;
this.notybarHeight = ey4.m19876() - r83.m39055().m39065();
this.phoneHeight = r83.m39055().m39065();
this.isVolumesWitch = true;
CardView cardView = (CardView) View.inflate(this.mWindowService, R.layout.windowlayout, null);
this.cvRoot = cardView;
ImageView imageView = (ImageView) cardView.findViewById(R.id.iv_window_menu_for_vm);
this.iv_menu = imageView;
imageView.setOnClickListener(this);
LinearLayout linearLayout = (LinearLayout) this.cvRoot.findViewById(R.id.ll_running_vm_root);
this.llRunningVmRoot = linearLayout;
linearLayout.setOnTouchListener(new View$OnTouchListenerC2165());
RecyclerView recyclerView = (RecyclerView) this.cvRoot.findViewById(R.id.rv_running_vm);
this.rvRunningVm = recyclerView;
recyclerView.setLayoutManager(new LinearLayoutManager(this.mWindowService));
View findViewById = this.cvRoot.findViewById(R.id.cl_top);
this.cl_top = findViewById;
this.topSize = m15341(findViewById);
this.cv_vm = this.cvRoot.findViewById(R.id.cv_vm);
this.vmosTextureView = (VMOSTextureView) this.cvRoot.findViewById(R.id.vm_surface);
this.iv_final = (ImageView) this.cvRoot.findViewById(R.id.iv_final);
this.iv_close = (ImageView) this.cvRoot.findViewById(R.id.iv_close);
this.iv_rotation = (ImageView) this.cvRoot.findViewById(R.id.iv_rotation);
this.iv_sound = (ImageView) this.cvRoot.findViewById(R.id.iv_sound);
this.ll_close = (LinearLayout) this.cvRoot.findViewById(R.id.ll_close);
this.iv_final.setOnClickListener(this);
this.ll_close.setOnClickListener(this);
this.iv_rotation.setOnClickListener(this);
this.iv_sound.setOnClickListener(this);
this.cvRoot.setOnSystemUiVisibilityChangeListener(ee1.m18853().m18855(this.cvRoot));
this.scaleGestureDetector = new ScaleGestureDetector(this.mContext, new C2162(this, null));
this.list = new ArrayList();
m15335();
m15333();
m15349();
Log.i("prepareSurfaceView_test", "initView");
m15363(null);
return this.cvRoot;
}
public final void m15358(String str) {
}
public int m15359() {
int i;
int i2 = this.mOrientation;
if (i2 == 0) {
int[] iArr = new int[2];
this.mRootView.getLocationOnScreen(iArr);
i = this.GapValueY;
if (i <= 0) {
i = iArr[1];
this.GapValueY = i;
}
if (iArr[1] < 0) {
this.mScreenRealHeight = ey4.m19876() + 1;
this.GapValueY = 1;
return 1;
}
} else if (i2 != 1) {
return 0;
} else {
int[] iArr2 = new int[2];
this.mRootView.getLocationOnScreen(iArr2);
i = this.GapValueX;
if (i <= 0) {
i = iArr2[0];
this.GapValueX = i;
}
if (iArr2[0] < 0) {
this.GapValueX = 1;
this.mScreenRealHeight = ey4.m19876() + 1;
return this.GapValueX;
}
}
return i;
}
public void m15360() {
this.isLandScape = false;
ij6.m25108(this.mWindowService.m15287().m11460(), true);
Log.i(TAG, "onChangeVm :" + this.isShowIcon);
m15363(new InterfaceC2164() {
@Override
public final void mo15374() {
View$OnClickListenerC2156.this.m15325();
}
});
}
public void m15361() {
if (this.isVolumesWitch) {
this.isVolumesWitch = false;
this.iv_sound.setImageResource(R.mipmap.ic_window_volume_off);
} else {
this.isVolumesWitch = true;
this.iv_sound.setImageResource(R.mipmap.ic_window_volume_on);
}
va6 m30960 = ma6.m30942().m30960(this.mWindowService.mCurVmInfo.m11460(), true);
if (m30960 != null) {
m30960.m46720(3, this.isVolumesWitch);
}
}
public void m15362() {
}
public void m15363(InterfaceC2164 interfaceC2164) {
Observable.create(new ObservableOnSubscribe() {
@Override
public final void subscribe(ObservableEmitter observableEmitter) {
View$OnClickListenerC2156.this.m15327(observableEmitter);
}
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new C2159(interfaceC2164));
}
public final void m15364(int i, float f) {
if (i == 1) {
m15330(24, 32);
return;
}
if (i == 2) {
m15330(44, 52);
} else if (i == 3) {
if (!m15352()) {
float m19877 = ey4.m19877() / 2;
if (f <= m19877) {
int i2 = (int) ((m19877 / f) * 24.0f);
int i3 = i2 <= 44 ? i2 : 44;
m15330(i3, i3 + 8);
return;
}
m15330(44, 52);
return;
}
m15330(44, 52);
} else if (!m15352()) {
m15330(44, 52);
} else {
m15330(44, 52);
}
}
public void m15365() {
boolean z = !this.isLandScape ? 1 : 0;
this.isLandScape = z;
this.vmosTextureView.setSurfaceRotation(z ? 1 : 0);
MMKV.mmkvWithID(VmSettingsViewModel.SETTING_KEY, 2).putBoolean(ku.f23839, this.isLandScape);
m15349();
m15335();
}
public void m15366() {
Log.i(TAG, "saveParams :" + this.mWindowService.m15291());
dc6 dc6Var = dc6.f13598;
MMKV m16936 = dc6Var.m16936();
m16936.putInt(ku.f23780 + this.mWindowService.m15291(), this.mLayoutParams.x);
MMKV m169362 = dc6Var.m16936();
m169362.putInt(ku.f23783 + this.mWindowService.m15291(), this.mLayoutParams.y);
MMKV m169363 = dc6Var.m16936();
m169363.putInt(ku.f23786 + this.mWindowService.m15291(), this.mLayoutParams.width);
MMKV m169364 = dc6Var.m16936();
m169364.putInt(ku.f23787 + this.mWindowService.m15291(), this.mLayoutParams.height - this.topSize[1]);
}
public void m15367(InterfaceC2160 interfaceC2160) {
this.mFullScrollScreenLinstener = interfaceC2160;
}
public final void m15368(int i) {
Log.d(TAG, "setFullWindowParam() called with: position = [" + i + "]");
float[] m15290 = this.mWindowService.m15290();
int m19876 = ey4.m19876();
if (TextUtils.equals("Meizu", Build.BRAND) && Build.VERSION.SDK_INT == 27) {
ee1.m18853().m18856(this.mRootView, this.mWindowService.m15275().m11460());
}
Log.i(TAG, "setFullWindowParam: " + this.mOrientation);
int i2 = this.mOrientation;
if (i2 == 0) {
WindowManager.LayoutParams layoutParams = this.mFullWindowParams;
layoutParams.width = -1;
layoutParams.height = m19876;
Log.e(TAG, "addd:setFullWindowParam mScreenRealHeight:" + m19876);
Log.e(TAG, "addd:setFullWindowParam notchTopAdapterGapValue():" + m15359());
Log.e("vmos-binlog", "windowsurfaceview 538");
ConstraintLayout.LayoutParams layoutParams2 = (ConstraintLayout.LayoutParams) this.cv_vm.getLayoutParams();
((ViewGroup.MarginLayoutParams) layoutParams2).height = ey4.m19876();
((ViewGroup.MarginLayoutParams) layoutParams2).width = ey4.m19877();
Log.i(TAG, "setFullWindowParam: " + layoutParams2.topToTop);
layoutParams2.topToBottom = -1;
this.cv_vm.setLayoutParams(layoutParams2);
FrameLayout.LayoutParams layoutParams3 = (FrameLayout.LayoutParams) this.vmosTextureView.getLayoutParams();
layoutParams3.height = (int) m15290[1];
layoutParams3.width = (int) m15290[0];
layoutParams3.gravity = 17;
Log.e("vmos-binlog", "windowsurfaceview 538 surfaceLayoutParams.height = " + layoutParams3.height + " surfaceLayoutParams.width = " + layoutParams3.width);
Log.e(TAG, "windowsurfaceview 538 surfaceLayoutParams.height = " + layoutParams3.height + " surfaceLayoutParams.width = " + layoutParams3.width);
this.vmosTextureView.setLayoutParams(layoutParams3);
} else if (i2 == 1 || i2 == 3) {
this.mFullWindowParams.width = ey4.m19877();
this.mFullWindowParams.height = -1;
Log.e("vmos-binlog", "windowsurfaceview 556");
ConstraintLayout.LayoutParams layoutParams4 = (ConstraintLayout.LayoutParams) this.cv_vm.getLayoutParams();
((ViewGroup.MarginLayoutParams) layoutParams4).height = ey4.m19876();
((ViewGroup.MarginLayoutParams) layoutParams4).width = ey4.m19877();
Log.i(TAG, "setFullWindowParam: " + ey4.m19877());
if (this.mOrientation == 1) {
layoutParams4.startToStart = -1;
layoutParams4.endToEnd = 0;
} else {
layoutParams4.endToEnd = -1;
layoutParams4.startToStart = 0;
}
this.cv_vm.setLayoutParams(layoutParams4);
FrameLayout.LayoutParams layoutParams5 = (FrameLayout.LayoutParams) this.vmosTextureView.getLayoutParams();
layoutParams5.height = (int) m15290[0];
layoutParams5.width = (int) m15290[1];
layoutParams5.gravity = 17;
Log.e("vmos-binlog", "windowsurfaceview 556 surfaceLayoutParams.height=" + layoutParams5.height + "surfaceLayoutParams.width=" + layoutParams5.width);
Log.i(TAG, "setFullWindowParam: " + m15290[0] + LogUtils.f3842 + m15290[1]);
this.vmosTextureView.setLayoutParams(layoutParams5);
}
if (this.cvRoot != null) {
Log.i(TAG, "setFullWindowParam: 111");
((InterceptBackLayout) this.cvRoot.findViewById(R.id.ibl_root)).setDispatchKeyEventListener(this.mDispatchKeyEventListener);
}
}
public final void m15369(int i) {
int m19876 = ey4.m19876();
int i2 = this.mOrientation;
if (i2 == 0) {
WindowManager.LayoutParams layoutParams = this.mFullWindowParams;
layoutParams.x = i;
layoutParams.y = -m15359();
WindowManager.LayoutParams layoutParams2 = this.mFullWindowParams;
layoutParams2.width = -1;
layoutParams2.height = m19876;
} else if (i2 == 1 || i2 == 3) {
this.mFullWindowParams.x = -m15359();
WindowManager.LayoutParams layoutParams3 = this.mFullWindowParams;
layoutParams3.y = (-m19876) + i;
layoutParams3.width = ey4.m19877();
this.mFullWindowParams.height = -1;
}
}
}