TimePlaybackDualFragment_Three_Eyes.java 源代码
package timeaxis;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.provider.MediaStore;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.NestedScrollView;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.RadioButton;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import base.HiFragment;
import bean.MyCamera;
import butterknife.ButterKnife;
import com.dasu.blur.DBlur;
import com.dasu.blur.OnBlurListener;
import com.hichip.base.HiLog;
import com.hichip.callback.ICameraIOSessionCallback;
import com.hichip.callback.ICameraPlayStateCallback;
import com.hichip.campro.R;
import com.hichip.content.HiChipDefines;
import com.hichip.control.HiCamera;
import com.hichip.tools.Packet;
import com.meizu.cloud.pushsdk.constants.PushConstants;
import com.xiaomi.mipush.sdk.Constants;
import common.HiDataValue;
import common.MyPlaybackGLMonitor;
import custom.NoSlidingViewPager;
import java.io.File;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import main.MainActivity;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import timeaxis.TimePlaybackDualFragment_Three_Eyes;
import timeaxis.bean.FilePlaybackModel;
import timeaxis.bean.MsyIsStop;
import timeaxis.bean.PlaybackVo;
import timeaxis.bean.VideoList;
import timeaxis.calender.MsgCalenderDay;
import timeaxis.calender.MyLinearLayout;
import timeaxis.calender.MyPagerAdapter;
import timeaxis.calender.TitleGridAdapter;
import timeaxis.view.TimeLineNew;
import utils.BitmapUtils;
import utils.HiLogcatUtil;
import utils.HiTools;
import utils.MyToast;
import utils.OrientationWatchDog;
import utils.SystemUtils;
import utils.TimeUtil;
public class TimePlaybackDualFragment_Three_Eyes extends HiFragment implements ICameraIOSessionCallback, ICameraPlayStateCallback, View.OnTouchListener, View.OnClickListener, OrientationWatchDog.OnOrientationListener {
private static final int HANDLE_VIDEO_RUN = -1879048183;
public static int mMonth;
public static int mYear;
private float action_down_x;
private float action_down_y;
public float bottom;
ImageView bt_landdualswitch;
ImageView bt_portraitdualswitch;
private int currentPlayPosition;
private long currentPlayVideoStartTime;
boolean currentTypeIs2;
int fileType;
private long firstVideoStartTime;
public float height;
private boolean isCalenderChangedMonth;
private boolean isNeedShowProgress;
private boolean isOtherDay;
private boolean isQuit;
ImageView iv_full_screen;
ImageView iv_left;
ImageView iv_placeholder;
ImageView iv_return;
ImageView iv_right;
ImageView iv_snapshot;
ImageView iv_snapshot_land;
private long lastClickTime;
float lastX;
float lastY;
public float left;
MyLinearLayout ll_bottom;
LinearLayout ll_top;
private boolean loadingViewIsShowing;
private TimeAxisActivity mAct;
private int mHeight;
private boolean mIsDataReceveEnd;
ImageView mIvLoading;
RelativeLayout mLayoutMonitor;
private MyCamera mMyCamera;
private OrientationWatchDog mOrientationWatchDog;
View mReplaceView;
NestedScrollView mScrollView;
public MyPlaybackGLMonitor monitor_1dual;
public MyPlaybackGLMonitor monitor_2dual;
public MyPlaybackGLMonitor monitor_3dual;
int moveX;
int moveY;
float move_x;
float move_y;
TimeLineNew myTimeLineView;
private int nearVideoDay;
private boolean noFileNeedJump;
private MyPagerAdapter pagerAdapter;
private int preModle;
RadioButton rb_alarm;
RadioButton rb_all;
private Point realSize;
private int recentHaveVideoDay;
RelativeLayout rl_2monitor;
ImageView rl_close2monitor;
ImageView rl_close3monitor;
ImageView rl_closemonitor;
RelativeLayout rl_monitor;
RelativeLayout rl_portraittopview;
public LinearLayout root_lock_screen;
private HiChipDefines.SD_FILEDAY sd_fileday;
View shadowView;
LinearLayout stc_calendar_layout;
private TimeAxisActivity timeAxisActivity;
public boolean timePlayStart;
private GridView title_gView;
private boolean todayHasVideo;
TextView tv_osd_time1;
TextView tv_osd_time3;
TextView tv_time;
TextView tv_years_month;
private boolean videoIsPause;
private boolean videoIsPlaying;
private View view;
NoSlidingViewPager viewpager;
public float width;
int xlenOld;
int ylenOld;
private boolean isDrag = false;
private int setpos = 0;
private long oldTime = 0;
private long savetime = 0;
private long previousStartTime = 0;
private long previousEndTime = 0;
private long mergeStartTime = 0;
private long mergeEndTime = 0;
long mergeStartTime1 = 0;
long mergeEndTime1 = 0;
private List<Integer> alreadyGetVideoDay = new ArrayList();
private List<PlaybackVo> file_list = new ArrayList();
private List<PlaybackVo> file_list1 = new ArrayList();
private List<Integer> allHaveVideoDayList = new ArrayList();
private List<Integer> otherMonthAllHaveVideoDayList = new ArrayList();
private List<VideoList> videoLists = new ArrayList();
private List<VideoList> videoLists1 = new ArrayList();
private List<PlaybackVo> one_day_file_list = new ArrayList();
private List<PlaybackVo> curentDayVideo = new ArrayList();
private List<VideoList> videoLists2 = new ArrayList();
private Calendar calStartDate = Calendar.getInstance();
private int currPager = 999;
private int perPager = 999;
private int mSelectPosition = -1;
private long mTimeInMicros = 0;
private boolean misfull = true;
private boolean mPlayFirst = false;
private boolean isLeft = true;
private boolean isFirstRevolveLand = false;
private boolean isReadyPlay = false;
private int isLarge = 0;
public boolean mIsClickReturn = false;
private boolean mIsPlayback = false;
private boolean isPlayEnd = false;
private boolean isBallShowBig = true;
private int showType = 0;
private boolean mIsCallStop = false;
private boolean mIsVisibleToUser = true;
private boolean isFirstIn = true;
private boolean mBackToNoFile = false;
private Handler lineHandler = new Handler() {
@Override
public void handleMessage(Message message) {
if (message.what == -1879048183 && TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.isCanPlay) {
if (TimePlaybackDualFragment_Three_Eyes.this.tv_time.getVisibility() == 0) {
TimePlaybackDualFragment_Three_Eyes.this.tv_time.setVisibility(8);
}
if (!TimePlaybackDualFragment_Three_Eyes.this.mIsVisibleToUser) {
if (TimePlaybackDualFragment_Three_Eyes.this.mMyCamera != null) {
if (TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView != null) {
HiLog.e("tedG--....()....--" + TimePlaybackDualFragment_Three_Eyes.this.mTimeInMicros + ";;;;");
TimePlaybackDualFragment_Three_Eyes timePlaybackDualFragment_Three_Eyes = TimePlaybackDualFragment_Three_Eyes.this;
timePlaybackDualFragment_Three_Eyes.mTimeInMicros = timePlaybackDualFragment_Three_Eyes.myTimeLineView.getCurrentValue();
HiLog.e("tedG--....()....--" + TimePlaybackDualFragment_Three_Eyes.this.mTimeInMicros + ";;;;");
}
if (TimePlaybackDualFragment_Three_Eyes.this.videoIsPause || !TimePlaybackDualFragment_Three_Eyes.this.videoIsPlaying) {
return;
}
TimePlaybackDualFragment_Three_Eyes.this.pausePlayVideo();
TimePlaybackDualFragment_Three_Eyes.this.videoIsPause = true;
TimePlaybackDualFragment_Three_Eyes.this.videoIsPlaying = false;
return;
}
return;
}
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.setValue(TimePlaybackDualFragment_Three_Eyes.this.firstVideoStartTime + Long.parseLong(message.arg1 + "000000"));
final long j = (TimePlaybackDualFragment_Three_Eyes.this.currentPlayVideoStartTime + ((long) (message.arg1 * 1000000))) / 1000;
TimePlaybackDualFragment_Three_Eyes.this.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
if (TimePlaybackDualFragment_Three_Eyes.this.tv_osd_time3 != null && TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual != null) {
TimePlaybackDualFragment_Three_Eyes.this.tv_osd_time3.setVisibility(TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual.getVisibility());
TimePlaybackDualFragment_Three_Eyes.this.tv_osd_time3.setText(TimeUtil.longToString(j, TimeUtil.FORMAT_DATE_TIME_FULL));
}
if (TimePlaybackDualFragment_Three_Eyes.this.tv_osd_time1 == null || TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual == null) {
return;
}
TimePlaybackDualFragment_Three_Eyes.this.tv_osd_time1.setVisibility(TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual.getVisibility());
TimePlaybackDualFragment_Three_Eyes.this.tv_osd_time1.setText(TimeUtil.longToString(j, TimeUtil.FORMAT_DATE_TIME_FULL));
}
});
if (TimePlaybackDualFragment_Three_Eyes.this.timePlayStart) {
return;
}
TimePlaybackDualFragment_Three_Eyes.this.timePlayStart = true;
}
}
};
private Handler handler = new AnonymousClass8();
double nLenStart = 0.0d;
private Handler mHandler_lockScreen = new Handler() {
@Override
public void handleMessage(Message message) {
if (message.what == 0) {
TimePlaybackDualFragment_Three_Eyes.this.root_lock_screen.setVisibility(0);
TimePlaybackDualFragment_Three_Eyes.this.mHandler_lockScreen.sendEmptyMessageDelayed(1, 3000L);
} else {
TimePlaybackDualFragment_Three_Eyes.this.root_lock_screen.setVisibility(8);
TimePlaybackDualFragment_Three_Eyes.this.mHandler_lockScreen.removeCallbacksAndMessages(null);
}
}
};
@Override
public void callbackPlayUTC2(HiCamera hiCamera, int i, int i2) {
}
@Override
public void callbackPlayUTC2Dual(HiCamera hiCamera, int i, int i2, int i3) {
}
@Override
public void callbackRecordState(HiCamera hiCamera, int i, int i2, int i3, String str) {
}
@Override
public void callbackRecordStateDual(HiCamera hiCamera, int i, int i2, int i3, int i4, String str) {
}
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
return false;
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
HiLog.e("tedG--....onResume()....--");
this.mAct = (TimeAxisActivity) context;
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
HiTools.mDualTimevalue = 0;
HiLog.e("tedG--....onResume()....--");
EventBus.getDefault().register(this);
}
@Override
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
HiLog.e("tedG--....onResume()....--");
this.view = layoutInflater.inflate(R.layout.fragment_time_playback_dual_three_eyes, (ViewGroup) null);
getActivity().getWindow().addFlags(128);
ButterKnife.bind(this, this.view);
getIntentData();
initViewAndData();
initViewPager();
setListeners();
initOrientationWatchdog();
return this.view;
}
private void setListeners() {
this.iv_full_screen.setOnClickListener(this);
this.iv_snapshot.setOnClickListener(this);
this.iv_snapshot_land.setOnClickListener(this);
this.iv_left.setOnClickListener(this);
this.iv_right.setOnClickListener(this);
this.monitor_1dual.setOnClickListener(this);
this.monitor_1dual.setOnTouchListener(this);
this.monitor_2dual.setOnClickListener(this);
this.monitor_2dual.setOnTouchListener(this);
this.monitor_3dual.setOnClickListener(this);
this.monitor_3dual.setOnTouchListener(this);
this.iv_return.setOnClickListener(this);
this.shadowView.setOnClickListener(this);
this.root_lock_screen.setOnClickListener(this);
this.viewpager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrollStateChanged(int i) {
}
@Override
public void onPageScrolled(int i, float f, int i2) {
}
@Override
public void onPageSelected(int i) {
TimePlaybackDualFragment_Three_Eyes.this.calStartDate.add(2, i - TimePlaybackDualFragment_Three_Eyes.this.perPager);
TimePlaybackDualFragment_Three_Eyes.this.calStartDate.set(5, 1);
TimePlaybackDualFragment_Three_Eyes timePlaybackDualFragment_Three_Eyes = TimePlaybackDualFragment_Three_Eyes.this;
timePlaybackDualFragment_Three_Eyes.perPager = timePlaybackDualFragment_Three_Eyes.currPager = i;
TimePlaybackDualFragment_Three_Eyes.this.tv_years_month.setText(TimePlaybackDualFragment_Three_Eyes.this.calStartDate.get(1) + Constants.ACCEPT_TIME_SEPARATOR_SERVER + (TimePlaybackDualFragment_Three_Eyes.this.calStartDate.get(2) + 1));
if (TimePlaybackDualFragment_Three_Eyes.this.calStartDate.get(1) != TimePlaybackDualFragment_Three_Eyes.mYear || TimePlaybackDualFragment_Three_Eyes.this.calStartDate.get(2) + 1 != TimePlaybackDualFragment_Three_Eyes.mMonth) {
TimePlaybackDualFragment_Three_Eyes.this.isCalenderChangedMonth = true;
TimePlaybackDualFragment_Three_Eyes.this.otherMonthAllHaveVideoDayList.clear();
TimePlaybackDualFragment_Three_Eyes.this.viewpager.setScanScroll(false);
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.sendIOCtrl(HiChipDefines.HI_P2P_GET_RECORD_ALLDAY, HiChipDefines.SD_YEARMONTH.parseContent(TimePlaybackDualFragment_Three_Eyes.this.calStartDate.get(1), TimePlaybackDualFragment_Three_Eyes.this.calStartDate.get(2) + 1));
return;
}
HiLog.e("MsgCalenderDay:");
EventBus.getDefault().post(new MsgCalenderDay(TimePlaybackDualFragment_Three_Eyes.this.allHaveVideoDayList, TimePlaybackDualFragment_Three_Eyes.this.alreadyGetVideoDay, TimePlaybackDualFragment_Three_Eyes.this.mSelectPosition, TimePlaybackDualFragment_Three_Eyes.this.currPager));
}
});
this.rb_all.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
TimePlaybackDualFragment_Three_Eyes.this.onClick(view);
}
});
this.rb_alarm.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
TimePlaybackDualFragment_Three_Eyes.this.onClick(view);
}
});
this.rl_closemonitor.setOnClickListener(this);
this.rl_close2monitor.setOnClickListener(this);
this.rl_close3monitor.setOnClickListener(this);
this.bt_landdualswitch.setOnClickListener(this);
this.bt_portraitdualswitch.setOnClickListener(this);
}
protected void reset() {
Handler handler = this.lineHandler;
if (handler != null) {
handler.removeMessages(-1879048183);
}
Handler handler2 = this.handler;
if (handler2 != null) {
handler2.removeMessages(0);
}
Handler handler3 = this.handler;
if (handler3 != null) {
handler3.removeMessages(1);
}
Handler handler4 = this.handler;
if (handler4 != null) {
handler4.removeMessages(2);
}
Handler handler5 = this.handler;
if (handler5 != null) {
handler5.removeMessages(HiDataValue.HANDLE_MESSAGE_SESSION_STATE);
}
Handler handler6 = this.handler;
if (handler6 != null) {
handler6.removeMessages(HiDataValue.HANDLE_MESSAGE_RECEIVE_IOCTRL);
}
this.firstVideoStartTime = 0L;
this.currentPlayPosition = 0;
this.currentPlayVideoStartTime = 0L;
List<PlaybackVo> list = this.one_day_file_list;
if (list != null) {
list.clear();
}
List<VideoList> list2 = this.videoLists;
if (list2 != null) {
list2.clear();
}
List<VideoList> list3 = this.videoLists1;
if (list3 != null) {
list3.clear();
}
List<VideoList> list4 = this.videoLists2;
if (list4 != null) {
list4.clear();
}
List<PlaybackVo> list5 = this.file_list;
if (list5 != null) {
list5.clear();
}
List<PlaybackVo> list6 = this.file_list1;
if (list6 != null) {
list6.clear();
}
List<PlaybackVo> list7 = this.curentDayVideo;
if (list7 != null) {
list7.clear();
}
List<Integer> list8 = this.alreadyGetVideoDay;
if (list8 != null) {
list8.clear();
}
List<Integer> list9 = this.allHaveVideoDayList;
if (list9 != null) {
list9.clear();
}
this.isDrag = false;
this.isNeedShowProgress = false;
this.nearVideoDay = 0;
this.setpos = 0;
this.videoIsPlaying = false;
this.todayHasVideo = false;
this.isOtherDay = false;
this.videoIsPause = false;
this.mergeStartTime = 0L;
this.mergeEndTime = 0L;
this.mergeStartTime1 = 0L;
this.mergeEndTime1 = 0L;
this.previousStartTime = 0L;
this.previousEndTime = 0L;
this.preModle = 0;
this.recentHaveVideoDay = 0;
TimeLineNew timeLineNew = this.myTimeLineView;
if (timeLineNew != null) {
timeLineNew.resetData();
}
this.mSelectPosition = -1;
this.mIsDataReceveEnd = false;
}
private void initViewAndData() {
this.myTimeLineView.setView(this.iv_full_screen);
this.viewpager.setScanScroll(true);
this.monitor_1dual.setCamera(this.mMyCamera);
this.monitor_1dual.setVisibility(0);
this.monitor_2dual.setCamera(this.mMyCamera);
this.monitor_2dual.setVisibility(0);
this.monitor_3dual.setCamera(this.mMyCamera);
this.monitor_3dual.setVisibility(0);
this.mAct.getWindowManager().getDefaultDisplay().getMetrics(new DisplayMetrics());
this.mHeight = (int) ((HiTools.getScreenW(getActivity()) * 2.2d) / 4.0d);
this.iv_placeholder.setLayoutParams(new RelativeLayout.LayoutParams(-1, ((int) (this.mHeight * 1.5d)) + HiTools.dip2px(getActivity(), 4.0f)));
if (this.mMyCamera.snapshot != null) {
DBlur.source(this.mAct, this.mMyCamera.snapshot).mode(1).radius(24).animAlpha().build().doBlur(new OnBlurListener() {
@Override
public void onBlurFailed() {
}
@Override
public void onBlurSuccess(Bitmap bitmap) {
TimePlaybackDualFragment_Three_Eyes.this.iv_placeholder.setImageBitmap(bitmap);
}
});
}
setListenerTimeView();
String[] stringArray = getResources().getStringArray(R.array.event_type);
this.rb_all.setText(stringArray[0]);
this.rb_alarm.setText(stringArray[2]);
this.rb_all.setEnabled(false);
this.rb_alarm.setEnabled(false);
this.showType = 0;
notifyLayout(0, false);
showLoadingView();
Display defaultDisplay = getActivity().getWindowManager().getDefaultDisplay();
Point point = new Point();
this.realSize = point;
defaultDisplay.getRealSize(point);
}
private void initViewPager() {
MyPagerAdapter myPagerAdapter = new MyPagerAdapter(this.mAct, true, true);
this.pagerAdapter = myPagerAdapter;
this.viewpager.setAdapter(myPagerAdapter);
this.viewpager.setCurrentItem(999);
setTitleGirdView();
this.stc_calendar_layout.addView(this.title_gView, new LinearLayout.LayoutParams(-1, -2));
this.pagerAdapter.setOnItemClickListenerPostion(new MyPagerAdapter.OnItemClickListenerPostion() {
@Override
public void onItemPostion(int i) {
boolean z;
boolean z2;
if (HiTools.isCustomFastClick(1000)) {
return;
}
TimePlaybackDualFragment_Three_Eyes.this.calStartDate.set(5, 1);
int i2 = TimePlaybackDualFragment_Three_Eyes.this.calStartDate.get(7) - 1;
int i3 = TimePlaybackDualFragment_Three_Eyes.this.calStartDate.get(2) + 1;
int i4 = (i - i2) + 1;
if (i4 == TimePlaybackDualFragment_Three_Eyes.this.nearVideoDay && i3 == TimePlaybackDualFragment_Three_Eyes.mMonth) {
return;
}
int i5 = TimePlaybackDualFragment_Three_Eyes.this.calStartDate.get(2) + 1;
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.handler.removeMessages(1);
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.handler.removeMessages(0);
if (i5 == TimePlaybackDualFragment_Three_Eyes.mMonth) {
Iterator it = TimePlaybackDualFragment_Three_Eyes.this.allHaveVideoDayList.iterator();
while (true) {
if (it.hasNext()) {
if (((Integer) it.next()).intValue() == i4) {
z2 = true;
break;
}
} else {
z2 = false;
break;
}
}
if (z2) {
TimePlaybackDualFragment_Three_Eyes.this.nearVideoDay = i4;
TimePlaybackDualFragment_Three_Eyes timePlaybackDualFragment_Three_Eyes = TimePlaybackDualFragment_Three_Eyes.this;
timePlaybackDualFragment_Three_Eyes.mSelectPosition = timePlaybackDualFragment_Three_Eyes.nearVideoDay;
HiLog.e("MsgCalenderDay:");
EventBus.getDefault().post(new MsgCalenderDay(TimePlaybackDualFragment_Three_Eyes.this.allHaveVideoDayList, TimePlaybackDualFragment_Three_Eyes.this.alreadyGetVideoDay, TimePlaybackDualFragment_Three_Eyes.this.mSelectPosition, TimePlaybackDualFragment_Three_Eyes.this.currPager));
if (!TimePlaybackDualFragment_Three_Eyes.this.alreadyGetVideoDay.contains(Integer.valueOf(TimePlaybackDualFragment_Three_Eyes.this.nearVideoDay))) {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.stopPlaybackNew();
TimePlaybackDualFragment_Three_Eyes.this.videoIsPlaying = false;
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.isCanPlay = false;
TimePlaybackDualFragment_Three_Eyes.this.one_day_file_list.clear();
TimePlaybackDualFragment_Three_Eyes.this.file_list.clear();
TimePlaybackDualFragment_Three_Eyes.this.file_list1.clear();
TimePlaybackDualFragment_Three_Eyes.this.isOtherDay = true;
TimePlaybackDualFragment_Three_Eyes.this.videoIsPause = false;
TimePlaybackDualFragment_Three_Eyes timePlaybackDualFragment_Three_Eyes2 = TimePlaybackDualFragment_Three_Eyes.this;
timePlaybackDualFragment_Three_Eyes2.removeVideoList(timePlaybackDualFragment_Three_Eyes2.nearVideoDay);
TimePlaybackDualFragment_Three_Eyes.this.showLoadingView();
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.sendIOCtrl(HiChipDefines.HI_P2P_GET_RECORD_ALLFILE_ONEDAY, HiChipDefines.RECORD_ALLFILE.parseContent(0, TimePlaybackDualFragment_Three_Eyes.mYear, TimePlaybackDualFragment_Three_Eyes.mMonth, TimePlaybackDualFragment_Three_Eyes.this.nearVideoDay, TimePlaybackDualFragment_Three_Eyes.this.getFileType()));
TimePlaybackDualFragment_Three_Eyes.this.alreadyGetVideoDay.add(Integer.valueOf(TimePlaybackDualFragment_Three_Eyes.this.nearVideoDay));
return;
}
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.stopPlaybackNew();
TimePlaybackDualFragment_Three_Eyes.this.videoIsPlaying = false;
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.isCanPlay = false;
TimePlaybackDualFragment_Three_Eyes.this.one_day_file_list.clear();
TimePlaybackDualFragment_Three_Eyes timePlaybackDualFragment_Three_Eyes3 = TimePlaybackDualFragment_Three_Eyes.this;
timePlaybackDualFragment_Three_Eyes3.removeVideoList(timePlaybackDualFragment_Three_Eyes3.nearVideoDay);
TimePlaybackDualFragment_Three_Eyes.this.videoIsPause = false;
TimePlaybackDualFragment_Three_Eyes.this.showLoadingView();
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.sendIOCtrl(HiChipDefines.HI_P2P_GET_RECORD_ALLFILE_ONEDAY, HiChipDefines.RECORD_ALLFILE.parseContent(0, TimePlaybackDualFragment_Three_Eyes.mYear, TimePlaybackDualFragment_Three_Eyes.mMonth, TimePlaybackDualFragment_Three_Eyes.this.nearVideoDay, TimePlaybackDualFragment_Three_Eyes.this.getFileType()));
return;
}
return;
}
Iterator it2 = TimePlaybackDualFragment_Three_Eyes.this.otherMonthAllHaveVideoDayList.iterator();
while (true) {
if (it2.hasNext()) {
if (((Integer) it2.next()).intValue() == i4) {
z = true;
break;
}
} else {
z = false;
break;
}
}
if (z) {
TimePlaybackDualFragment_Three_Eyes.this.showLoadingView();
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.stopPlaybackNew();
TimePlaybackDualFragment_Three_Eyes.this.reset();
TimePlaybackDualFragment_Three_Eyes.this.nearVideoDay = i4;
TimePlaybackDualFragment_Three_Eyes timePlaybackDualFragment_Three_Eyes4 = TimePlaybackDualFragment_Three_Eyes.this;
timePlaybackDualFragment_Three_Eyes4.mSelectPosition = timePlaybackDualFragment_Three_Eyes4.nearVideoDay;
TimePlaybackDualFragment_Three_Eyes.this.allHaveVideoDayList.addAll(TimePlaybackDualFragment_Three_Eyes.this.otherMonthAllHaveVideoDayList);
for (int i6 = 0; i6 < TimePlaybackDualFragment_Three_Eyes.this.allHaveVideoDayList.size(); i6++) {
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.date[((Integer) TimePlaybackDualFragment_Three_Eyes.this.allHaveVideoDayList.get(i6)).intValue() - 1] = 1;
}
TimePlaybackDualFragment_Three_Eyes.mYear = TimePlaybackDualFragment_Three_Eyes.this.calStartDate.get(1);
TimePlaybackDualFragment_Three_Eyes.mMonth = TimePlaybackDualFragment_Three_Eyes.this.calStartDate.get(2) + 1;
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.sendIOCtrl(HiChipDefines.HI_P2P_GET_RECORD_ALLFILE_ONEDAY, HiChipDefines.RECORD_ALLFILE.parseContent(0, TimePlaybackDualFragment_Three_Eyes.mYear, TimePlaybackDualFragment_Three_Eyes.mMonth, TimePlaybackDualFragment_Three_Eyes.this.nearVideoDay, TimePlaybackDualFragment_Three_Eyes.this.getFileType()));
TimePlaybackDualFragment_Three_Eyes.this.alreadyGetVideoDay.add(Integer.valueOf(TimePlaybackDualFragment_Three_Eyes.this.nearVideoDay));
if (TimePlaybackDualFragment_Three_Eyes.this.allHaveVideoDayList == null || TimePlaybackDualFragment_Three_Eyes.this.allHaveVideoDayList.size() <= 0) {
return;
}
TimePlaybackDualFragment_Three_Eyes timePlaybackDualFragment_Three_Eyes5 = TimePlaybackDualFragment_Three_Eyes.this;
timePlaybackDualFragment_Three_Eyes5.recentHaveVideoDay = ((Integer) timePlaybackDualFragment_Three_Eyes5.allHaveVideoDayList.get(TimePlaybackDualFragment_Three_Eyes.this.allHaveVideoDayList.size() - 1)).intValue();
}
}
});
}
public byte getFileType() {
return this.currentTypeIs2 ? (byte) 2 : (byte) 0;
}
private void setTitleGirdView() {
this.title_gView = setGirdView();
this.title_gView.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
this.title_gView.setVerticalSpacing(1);
this.title_gView.setHorizontalSpacing(1);
this.title_gView.setAdapter((ListAdapter) new TitleGridAdapter(this.mAct));
}
private GridView setGirdView() {
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
GridView gridView = new GridView(this.mAct);
gridView.setLayoutParams(layoutParams);
gridView.setNumColumns(7);
gridView.setGravity(16);
gridView.setVerticalSpacing(1);
gridView.setHorizontalSpacing(1);
gridView.setBackgroundColor(0);
gridView.setSelector(new ColorDrawable(0));
return gridView;
}
private void getIntentData() {
String string = getArguments().getString(HiDataValue.EXTRAS_KEY_UID);
if (!TextUtils.isEmpty(string)) {
Iterator<MyCamera> it = HiDataValue.CameraList.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
MyCamera next = it.next();
if (string.equals(next.getUid())) {
this.mMyCamera = next;
break;
}
}
}
MyCamera myCamera = this.mMyCamera;
if (myCamera != null) {
myCamera.registerIOSessionListener(this);
this.mMyCamera.registerPlayStateListener(this);
}
}
private void searchmonvideo() {
Calendar calendar = Calendar.getInstance();
mYear = calendar.get(1);
mMonth = calendar.get(2) + 1;
setYearMonth(calendar.getTimeInMillis() * 1000);
this.mMyCamera.sendIOCtrl(HiChipDefines.HI_P2P_GET_RECORD_ALLDAY, HiChipDefines.SD_YEARMONTH.parseContent(mYear, mMonth));
}
public class AnonymousClass4 implements TimeLineNew.PlaybackViewListener {
AnonymousClass4() {
}
@Override
public void onValueChanged(String str, long j, boolean z) {
if (z && TimePlaybackDualFragment_Three_Eyes.this.isNeedShowProgress) {
TimePlaybackDualFragment_Three_Eyes.this.tv_time.setVisibility(0);
TimePlaybackDualFragment_Three_Eyes.this.timePlayStart = false;
}
TimePlaybackDualFragment_Three_Eyes.this.tv_time.setText(str);
if (str.contains("23:59:59")) {
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.isCanPlay = false;
}
}
@Override
public void onVideoStart(String str, long j, int i) {
TimePlaybackDualFragment_Three_Eyes.this.tv_time.setVisibility(8);
TimePlaybackDualFragment_Three_Eyes.this.handler.postDelayed(new Runnable() {
@Override
public final void run() {
TimePlaybackDualFragment_Three_Eyes.AnonymousClass4.this.lambda$onVideoStart$0$TimePlaybackDualFragment_Three_Eyes$4();
}
}, 500L);
if (TimePlaybackDualFragment_Three_Eyes.this.getDay(j) != -1) {
TimePlaybackDualFragment_Three_Eyes timePlaybackDualFragment_Three_Eyes = TimePlaybackDualFragment_Three_Eyes.this;
timePlaybackDualFragment_Three_Eyes.nearVideoDay = timePlaybackDualFragment_Three_Eyes.getDay(j);
}
if (TimePlaybackDualFragment_Three_Eyes.this.isDrag) {
if (TimePlaybackDualFragment_Three_Eyes.this.mBackToNoFile) {
final int findVideoFile = TimePlaybackDualFragment_Three_Eyes.this.findVideoFile(j, i);
if (findVideoFile == -1) {
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.listener.onNoneVideo(str, j);
return;
}
if (TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.isScroll()) {
return;
}
final PlaybackVo playbackVo = (PlaybackVo) TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.get(findVideoFile);
TimePlaybackDualFragment_Three_Eyes.this.oldTime = 0L;
TimePlaybackDualFragment_Three_Eyes.this.firstVideoStartTime = j;
TimePlaybackDualFragment_Three_Eyes.this.setpos = 1;
TimePlaybackDualFragment_Three_Eyes.this.currentPlayPosition = findVideoFile;
final byte[] bArr = new byte[8];
System.arraycopy(playbackVo.getTest(), 0, bArr, 0, 8);
final long startTime = playbackVo.getStartTime() / 1000;
final long endTime = playbackVo.getEndTime() / 1000;
final byte flag = playbackVo.getFlag();
new Thread() {
@Override
public void run() {
super.run();
if (TimePlaybackDualFragment_Three_Eyes.this.isQuit) {
return;
}
TimePlaybackDualFragment_Three_Eyes.this.mBackToNoFile = false;
if (!TimePlaybackDualFragment_Three_Eyes.this.misfull) {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.startPlaybackNewExt(new HiChipDefines.STimeDay(bArr, 0), startTime, endTime, 0, TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.size() - findVideoFile, 0, flag, TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual);
} else {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.startPlaybackNewExt(new HiChipDefines.STimeDay(bArr, 0), startTime, endTime, 0, TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.size() - findVideoFile, 0, flag, TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual);
}
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.moveToValue(playbackVo.getStartTime());
}
}.start();
TimePlaybackDualFragment_Three_Eyes.this.videoIsPause = false;
TimePlaybackDualFragment_Three_Eyes.this.videoIsPlaying = true;
return;
}
TimePlaybackDualFragment_Three_Eyes.this.handPlayStart(str, j, i);
return;
}
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.isCanPlay = true;
TimePlaybackDualFragment_Three_Eyes.this.isPlayEnd = false;
if (TimePlaybackDualFragment_Three_Eyes.this.one_day_file_list.size() > 0) {
PlaybackVo playbackVo2 = (PlaybackVo) TimePlaybackDualFragment_Three_Eyes.this.one_day_file_list.get(0);
TimePlaybackDualFragment_Three_Eyes.this.setpos = 0;
TimePlaybackDualFragment_Three_Eyes.this.oldTime = 0L;
TimePlaybackDualFragment_Three_Eyes.this.firstVideoStartTime = playbackVo2.getStartTime();
TimePlaybackDualFragment_Three_Eyes.this.currentPlayVideoStartTime = playbackVo2.getStartTime();
byte[] bArr2 = new byte[8];
System.arraycopy(playbackVo2.getTest(), 0, bArr2, 0, 8);
TimePlaybackDualFragment_Three_Eyes.this.startPlayBack(bArr2, playbackVo2.getStartTime() / 1000, playbackVo2.getEndTime() / 1000, 0L, 0, 0, playbackVo2.getFlag());
TimePlaybackDualFragment_Three_Eyes.this.isDrag = true;
TimePlaybackDualFragment_Three_Eyes.this.isNeedShowProgress = true;
}
}
public void lambda$onVideoStart$0$TimePlaybackDualFragment_Three_Eyes$4() {
TimePlaybackDualFragment_Three_Eyes.this.iv_full_screen.setEnabled(true);
TimePlaybackDualFragment_Three_Eyes.this.iv_snapshot.setEnabled(true);
}
@Override
public void onNoneVideo(String str, long j) {
final int i;
TimePlaybackDualFragment_Three_Eyes.this.dismissLoadingView();
if (TimePlaybackDualFragment_Three_Eyes.this.videoIsPlaying && TimePlaybackDualFragment_Three_Eyes.this.one_day_file_list.size() > 0) {
TimePlaybackDualFragment_Three_Eyes.this.tv_time.postDelayed(new Runnable() {
@Override
public void run() {
if (TimePlaybackDualFragment_Three_Eyes.this.showType == 0) {
TimePlaybackDualFragment_Three_Eyes.this.iv_placeholder.setVisibility(0);
TimePlaybackDualFragment_Three_Eyes.this.iv_placeholder.setLayoutParams(new RelativeLayout.LayoutParams(-1, ((int) (TimePlaybackDualFragment_Three_Eyes.this.mHeight * 1.5d)) + HiTools.dip2px(TimePlaybackDualFragment_Three_Eyes.this.getActivity(), 4.0f)));
}
if (TimePlaybackDualFragment_Three_Eyes.this.mAct != null && !TimePlaybackDualFragment_Three_Eyes.this.mAct.isFinishing()) {
Toast.makeText(TimePlaybackDualFragment_Three_Eyes.this.mAct, TimePlaybackDualFragment_Three_Eyes.this.getString(R.string.current_not_video), 1).show();
}
if (TimePlaybackDualFragment_Three_Eyes.this.videoIsPause || !TimePlaybackDualFragment_Three_Eyes.this.videoIsPlaying) {
return;
}
TimePlaybackDualFragment_Three_Eyes.this.pausePlayVideo();
TimePlaybackDualFragment_Three_Eyes.this.videoIsPlaying = false;
TimePlaybackDualFragment_Three_Eyes.this.videoIsPause = true;
}
}, 500L);
} else if (TimePlaybackDualFragment_Three_Eyes.this.iv_placeholder.getVisibility() == 0) {
if (TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.size() > 0) {
i = TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.getCurrentValue() / 1000000 < ((PlaybackVo) TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.get(0)).getStartTime() / 1000000 ? 0 : TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.getCurrentValue() / 1000000 > ((PlaybackVo) TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.get(TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.size() - 1)).getEndTime() / 1000000 ? TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.size() - 1 : -1;
} else {
i = -1;
}
if (i != -1) {
final PlaybackVo playbackVo = (PlaybackVo) TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.get(i);
if (TimePlaybackDualFragment_Three_Eyes.this.mBackToNoFile) {
TimePlaybackDualFragment_Three_Eyes.this.oldTime = 0L;
TimePlaybackDualFragment_Three_Eyes.this.firstVideoStartTime = j;
TimePlaybackDualFragment_Three_Eyes.this.setpos = 1;
TimePlaybackDualFragment_Three_Eyes.this.currentPlayPosition = i;
final byte[] bArr = new byte[8];
System.arraycopy(playbackVo.getTest(), 0, bArr, 0, 8);
final long startTime = playbackVo.getStartTime() / 1000;
final long endTime = playbackVo.getEndTime() / 1000;
final byte flag = playbackVo.getFlag();
new Thread() {
@Override
public void run() {
super.run();
if (TimePlaybackDualFragment_Three_Eyes.this.isQuit) {
return;
}
TimePlaybackDualFragment_Three_Eyes.this.mBackToNoFile = false;
if (!TimePlaybackDualFragment_Three_Eyes.this.misfull) {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.startPlaybackNewExt(new HiChipDefines.STimeDay(bArr, 0), startTime, endTime, 0, TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.size() - i, 0, flag, TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual);
} else {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.startPlaybackNewExt(new HiChipDefines.STimeDay(bArr, 0), startTime, endTime, 0, TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.size() - i, 0, flag, TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual);
}
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.moveToValue(playbackVo.getStartTime());
}
}.start();
} else {
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.moveToValue(playbackVo.getStartTime());
}
}
}
if (TimePlaybackDualFragment_Three_Eyes.this.videoIsPause && !TimePlaybackDualFragment_Three_Eyes.this.videoIsPlaying && TimePlaybackDualFragment_Three_Eyes.this.iv_placeholder.getVisibility() != 0 && TimePlaybackDualFragment_Three_Eyes.this.showType == 0) {
TimePlaybackDualFragment_Three_Eyes.this.iv_placeholder.setVisibility(0);
TimePlaybackDualFragment_Three_Eyes.this.iv_placeholder.setLayoutParams(new RelativeLayout.LayoutParams(-1, ((int) (TimePlaybackDualFragment_Three_Eyes.this.mHeight * 1.5d)) + HiTools.dip2px(TimePlaybackDualFragment_Three_Eyes.this.getActivity(), 4.0f)));
}
TimePlaybackDualFragment_Three_Eyes.this.timePlayStart = true;
}
@Override
public void onChangedScaleMode() {
if (TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.getScaleMode() == 120 || TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.getScaleMode() == 600) {
if (TimePlaybackDualFragment_Three_Eyes.this.preModle != TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.getScaleMode()) {
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.setVideos(TimePlaybackDualFragment_Three_Eyes.this.file_list, false, 0L);
TimePlaybackDualFragment_Three_Eyes timePlaybackDualFragment_Three_Eyes = TimePlaybackDualFragment_Three_Eyes.this;
timePlaybackDualFragment_Three_Eyes.preModle = timePlaybackDualFragment_Three_Eyes.myTimeLineView.getScaleMode();
return;
}
return;
}
if (TimePlaybackDualFragment_Three_Eyes.this.preModle != TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.getScaleMode()) {
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.setVideos(TimePlaybackDualFragment_Three_Eyes.this.file_list1, false, 0L);
TimePlaybackDualFragment_Three_Eyes timePlaybackDualFragment_Three_Eyes2 = TimePlaybackDualFragment_Three_Eyes.this;
timePlaybackDualFragment_Three_Eyes2.preModle = timePlaybackDualFragment_Three_Eyes2.myTimeLineView.getScaleMode();
}
}
}
private void setListenerTimeView() {
this.myTimeLineView.setOnPlaybackViewListener(new AnonymousClass4());
}
public void handPlayStart(String str, long j, int i) {
int findVideoFile = findVideoFile(j, i);
if (findVideoFile == -1) {
this.myTimeLineView.listener.onNoneVideo(str, j);
return;
}
if (this.myTimeLineView.isScroll()) {
return;
}
PlaybackVo playbackVo = this.curentDayVideo.get(findVideoFile);
if (this.noFileNeedJump) {
this.myTimeLineView.moveToValue(playbackVo.getStartTime());
return;
}
this.oldTime = 0L;
this.firstVideoStartTime = j;
this.setpos = 1;
this.currentPlayPosition = findVideoFile;
byte[] bArr = new byte[8];
System.arraycopy(playbackVo.getTest(), 0, bArr, 0, 8);
if (this.videoIsPlaying || this.videoIsPause) {
this.iv_placeholder.setVisibility(4);
startPlayBack(bArr, playbackVo.getStartTime() / 1000, playbackVo.getEndTime() / 1000, (j - playbackVo.getStartTime()) / 1000, findVideoFile, 1, playbackVo.getFlag());
} else {
this.iv_placeholder.setVisibility(4);
startPlayBack(bArr, playbackVo.getStartTime() / 1000, playbackVo.getEndTime() / 1000, (j - playbackVo.getStartTime()) / 1000, findVideoFile, 0, playbackVo.getFlag());
}
this.videoIsPause = false;
this.videoIsPlaying = true;
}
private void setYearMonth(long j) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(j / 1000);
if (isAdded()) {
this.tv_years_month.setText(calendar.get(1) + Constants.ACCEPT_TIME_SEPARATOR_SERVER + (calendar.get(2) + 1));
}
}
public void pausePlayVideo() {
MyCamera myCamera = this.mMyCamera;
if (myCamera != null) {
myCamera.sendIOCtrl(HiChipDefines.HI_P2P_RECORD_PLAY, HiChipDefines.PB_RECORDPLAY_REQ.parseContent(0, (short) 3, 0L, 0L, 0, 0, 0, 0));
this.mMyCamera.SetPlaybackTimePause();
}
}
protected int findVideoFile(long j, int i) {
HiLog.e("tedG--....()....--" + j + ";;;;" + i);
this.curentDayVideo.clear();
if (!this.alreadyGetVideoDay.contains(Integer.valueOf(this.nearVideoDay))) {
HiLog.e("tedG--....()....--");
return -1;
}
int i2 = 0;
while (true) {
if (i2 >= this.videoLists.size()) {
break;
}
if (this.nearVideoDay == this.videoLists.get(i2).getDay_of_month()) {
this.curentDayVideo.addAll(this.videoLists.get(i2).getTodayVideos());
break;
}
i2++;
}
if (this.curentDayVideo.size() == 0) {
return -1;
}
int size = this.curentDayVideo.size() - 1;
int i3 = 0;
while (i3 <= size) {
int i4 = (i3 + size) / 2;
long j2 = j / 1000000;
if (this.curentDayVideo.get(i4).getStartTime() / 1000000 <= j2 && this.curentDayVideo.get(i4).getEndTime() / 1000000 >= j2) {
this.noFileNeedJump = false;
return i4;
}
if (this.curentDayVideo.get(i4).getEndTime() / 1000000 <= j2) {
i3 = i4 + 1;
} else if (this.curentDayVideo.get(i4).getStartTime() / 1000000 > j2) {
size = i4 - 1;
}
}
int i5 = (i3 + size) / 2;
HiLog.e("tedG--....()....--" + size + "::" + i3 + ":::" + this.curentDayVideo.size());
if (size < 0 || i3 > this.curentDayVideo.size() - 1) {
HiLog.e("tedG--....()....--");
return -1;
}
if (i == 1) {
this.noFileNeedJump = true;
return i5 + 1;
}
if (i == 0) {
this.noFileNeedJump = true;
return i5;
}
HiLog.e("tedG--....()....--");
return -1;
}
public void startPlayBack(final byte[] bArr, final long j, final long j2, final long j3, final int i, final int i2, final byte b) {
new Thread() {
@Override
public void run() {
super.run();
if (TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.size() == 0) {
if (TimePlaybackDualFragment_Three_Eyes.this.isQuit) {
return;
}
TimePlaybackDualFragment_Three_Eyes.this.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
TimePlaybackDualFragment_Three_Eyes.this.showLoadingView();
}
});
if (!TimePlaybackDualFragment_Three_Eyes.this.misfull) {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.startPlaybackNewExt(new HiChipDefines.STimeDay(bArr, 0), j, j2, (int) (j3 / 1000), TimePlaybackDualFragment_Three_Eyes.this.one_day_file_list.size() - i, i2, b, TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual);
return;
} else {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.startPlaybackNewExt(new HiChipDefines.STimeDay(bArr, 0), j, j2, (int) (j3 / 1000), TimePlaybackDualFragment_Three_Eyes.this.one_day_file_list.size() - i, i2, b, TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual);
return;
}
}
if (TimePlaybackDualFragment_Three_Eyes.this.isQuit) {
return;
}
if (!TimePlaybackDualFragment_Three_Eyes.this.mIsPlayback || !TimePlaybackDualFragment_Three_Eyes.this.isPlayEnd) {
if (!TimePlaybackDualFragment_Three_Eyes.this.misfull) {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.startPlaybackNewExt(new HiChipDefines.STimeDay(bArr, 0), j, j2, (int) (j3 / 1000), TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.size() - i, i2, b, TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual);
return;
} else {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.startPlaybackNewExt(new HiChipDefines.STimeDay(bArr, 0), j, j2, (int) (j3 / 1000), TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.size() - i, i2, b, TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual);
return;
}
}
TimePlaybackDualFragment_Three_Eyes.this.isPlayEnd = false;
TimePlaybackDualFragment_Three_Eyes.this.mIsPlayback = false;
if (!TimePlaybackDualFragment_Three_Eyes.this.misfull) {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.startPlaybackNewExt(new HiChipDefines.STimeDay(bArr, 0), j, j2, (int) (j3 / 1000), TimePlaybackDualFragment_Three_Eyes.this.one_day_file_list.size() - i, 0, b, TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual);
} else {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.startPlaybackNewExt(new HiChipDefines.STimeDay(bArr, 0), j, j2, (int) (j3 / 1000), TimePlaybackDualFragment_Three_Eyes.this.one_day_file_list.size() - i, 0, b, TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual);
}
if (!TimePlaybackDualFragment_Three_Eyes.this.misfull) {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.startPlaybackNewExt(new HiChipDefines.STimeDay(bArr, 0), j, j2, (int) (j3 / 1000), TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.size() - i, 1, b, TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual);
} else {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.startPlaybackNewExt(new HiChipDefines.STimeDay(bArr, 0), j, j2, (int) (j3 / 1000), TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.size() - i, 1, b, TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual);
}
}
}.start();
}
protected void removeVideoList(int i) {
this.mIsDataReceveEnd = false;
this.firstVideoStartTime = 0L;
this.currentPlayPosition = 0;
this.currentPlayVideoStartTime = 0L;
this.one_day_file_list.clear();
this.file_list.clear();
this.file_list1.clear();
this.curentDayVideo.clear();
this.videoLists.clear();
this.videoLists1.clear();
this.videoLists2.clear();
}
protected void switchVideoList(int i, int i2) {
this.file_list.clear();
this.file_list1.clear();
findThreeDayFile(this.file_list, i, this.videoLists1);
findThreeDayFile(this.file_list1, i, this.videoLists2);
this.curentDayVideo.clear();
if (this.alreadyGetVideoDay.contains(Integer.valueOf(this.nearVideoDay))) {
int i3 = 0;
while (true) {
if (i3 >= this.videoLists.size()) {
break;
}
if (this.nearVideoDay == this.videoLists.get(i3).getDay_of_month()) {
this.curentDayVideo.addAll(this.videoLists.get(i3).getTodayVideos());
break;
}
i3++;
}
}
if (this.myTimeLineView.getScaleMode() != 120) {
if (this.curentDayVideo.size() > 0) {
this.isNeedShowProgress = true;
this.myTimeLineView.setVideos(this.file_list1, true, this.curentDayVideo.get(0).getStartTime());
return;
}
pausePlayVideo();
this.videoIsPause = true;
this.videoIsPlaying = false;
this.isNeedShowProgress = false;
if (this.showType == 0) {
this.iv_placeholder.setVisibility(0);
this.iv_placeholder.setLayoutParams(new RelativeLayout.LayoutParams(-1, ((int) (this.mHeight * 1.5d)) + HiTools.dip2px(getActivity(), 4.0f)));
}
MyToast.showToast(this.mAct, getString(R.string.current_day_novideo));
Calendar calendar = Calendar.getInstance();
calendar.set(1, mYear);
calendar.set(2, mMonth - 1);
calendar.set(5, i);
calendar.set(11, 0);
calendar.set(12, 0);
calendar.set(13, 1);
this.myTimeLineView.setVideos(new ArrayList(), false, calendar.getTimeInMillis() * 1000);
return;
}
if (this.curentDayVideo.size() > 0) {
this.isNeedShowProgress = true;
this.myTimeLineView.setVideos(this.file_list, true, this.curentDayVideo.get(0).getStartTime());
return;
}
pausePlayVideo();
this.videoIsPause = true;
this.videoIsPlaying = false;
this.isNeedShowProgress = false;
if (this.showType == 0) {
this.iv_placeholder.setVisibility(0);
this.iv_placeholder.setLayoutParams(new RelativeLayout.LayoutParams(-1, ((int) (this.mHeight * 1.5d)) + HiTools.dip2px(getActivity(), 4.0f)));
}
MyToast.showToast(this.mAct, getString(R.string.current_day_novideo));
Calendar calendar2 = Calendar.getInstance();
calendar2.set(1, mYear);
calendar2.set(2, mMonth - 1);
calendar2.set(5, i);
calendar2.set(11, 0);
calendar2.set(12, 0);
calendar2.set(13, 1);
this.myTimeLineView.setVideos(new ArrayList(), false, calendar2.getTimeInMillis() * 1000);
}
private void findThreeDayFile(List<PlaybackVo> list, int i, List<VideoList> list2) {
for (int i2 = 0; i2 < this.allHaveVideoDayList.size(); i2++) {
if (i == this.allHaveVideoDayList.get(i2).intValue()) {
getDayVideos(i, list2, list);
return;
}
}
}
private void getDayVideos(int i, List<VideoList> list, List<PlaybackVo> list2) {
for (int i2 = 0; i2 < list.size(); i2++) {
if (i == list.get(i2).getDay_of_month()) {
list2.addAll(list.get(i2).getTodayVideos());
return;
}
}
}
public int getDay(long j) {
if (j == 0) {
return -1;
}
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(j / 1000);
return calendar.get(5);
}
@Override
public void onResume() {
super.onResume();
HiLog.e("tedG--....onResume()....--");
if (!((TimeAxisActivity) getActivity()).isDoPause) {
((TimeAxisActivity) getActivity()).isDoPause = true;
return;
}
MyCamera myCamera = this.mMyCamera;
if (myCamera != null) {
myCamera.registerIOSessionListener(this);
this.mMyCamera.registerPlayStateListener(this);
}
if (this.videoIsPause && !this.videoIsPlaying && this.mIsVisibleToUser) {
HiLog.i("tedG--....onResume() 我去暂停了....--" + this.mTimeInMicros);
if (findVideoFile(this.mTimeInMicros, -1) == -1) {
return;
}
HiLog.i("tedG--....onResume() 我去暂停了....--");
pausePlayVideo();
this.videoIsPause = false;
this.videoIsPlaying = true;
}
TimeAxisActivity timeAxisActivity = this.mAct;
if (timeAxisActivity instanceof TimeAxisActivity) {
this.timeAxisActivity = timeAxisActivity;
}
if (getResources().getConfiguration().orientation == 1) {
this.mMyCamera.setPlaybackMonitorExt(this.monitor_1dual, this.monitor_2dual, this.monitor_3dual);
TimeLineNew timeLineNew = this.myTimeLineView;
if (timeLineNew != null && !timeLineNew.isCanPlay && !this.videoIsPlaying && this.videoIsPause && this.showType == 0) {
this.iv_placeholder.setVisibility(0);
this.iv_placeholder.setLayoutParams(new RelativeLayout.LayoutParams(-1, ((int) (this.mHeight * 1.5d)) + HiTools.dip2px(getActivity(), 4.0f)));
}
} else {
handLandscape();
}
this.monitor_1dual.setVisibility(0);
this.monitor_2dual.setVisibility(0);
this.monitor_3dual.setVisibility(0);
}
@Override
public void onPause() {
super.onPause();
HiLog.e("tedG--....onResume() 我去暂停了....--" + this.mTimeInMicros);
if (((TimeAxisActivity) getActivity()).isDoPause) {
if (this.mMyCamera != null) {
if (this.myTimeLineView != null) {
HiLog.e("tedG--....()....--" + this.mTimeInMicros + ";;;;");
this.mTimeInMicros = this.myTimeLineView.getCurrentValue();
HiLog.e("tedG--....()....--" + this.mTimeInMicros + ";;;;");
}
this.mMyCamera.unregisterIOSessionListener(this);
this.mMyCamera.unregisterPlayStateListener(this);
if (!this.videoIsPause && this.videoIsPlaying) {
pausePlayVideo();
this.videoIsPlaying = false;
this.videoIsPause = true;
}
MyPlaybackGLMonitor myPlaybackGLMonitor = this.monitor_1dual;
if (myPlaybackGLMonitor != null) {
myPlaybackGLMonitor.FreeMonitor();
}
MyPlaybackGLMonitor myPlaybackGLMonitor2 = this.monitor_2dual;
if (myPlaybackGLMonitor2 != null) {
myPlaybackGLMonitor2.FreeMonitor();
}
MyPlaybackGLMonitor myPlaybackGLMonitor3 = this.monitor_3dual;
if (myPlaybackGLMonitor3 != null) {
myPlaybackGLMonitor3.FreeMonitor();
}
}
if (getResources().getConfiguration().orientation == 2 && getActivity() != null) {
getActivity().setRequestedOrientation(1);
}
HiLog.e("tedG--....onResume() 我去暂停了....--" + this.mTimeInMicros);
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void getIsStop(MsyIsStop msyIsStop) {
boolean ismIsStop = msyIsStop.ismIsStop();
this.mIsCallStop = ismIsStop;
if (ismIsStop) {
this.videoIsPause = false;
this.videoIsPlaying = false;
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void getIsPlay(FilePlaybackModel filePlaybackModel) {
this.mIsPlayback = filePlaybackModel.ismIsPlay();
}
@Override
public void setUserVisibleHint(boolean z) {
super.setUserVisibleHint(z);
HiLog.e("tedG--....onResume()....--");
if (z) {
this.mIsVisibleToUser = true;
HiChipDefines.SD_FILEDAY sd_fileday = this.sd_fileday;
if (sd_fileday != null && sd_fileday.num > 1) {
this.timePlayStart = false;
}
if (this.myTimeLineView != null) {
if (this.isFirstIn) {
this.timePlayStart = false;
this.isFirstIn = false;
this.mIsCallStop = false;
searchmonvideo();
} else {
Log.e("test111", "mIsCallStop: " + this.mIsCallStop);
if (this.mIsCallStop) {
this.videoIsPause = false;
this.videoIsPlaying = true;
MyPlaybackGLMonitor myPlaybackGLMonitor = this.monitor_1dual;
if (myPlaybackGLMonitor != null) {
myPlaybackGLMonitor.setmIsFullScreen(0);
}
hand0And1();
this.mIsCallStop = false;
} else {
if (this.isPlayEnd) {
this.timePlayStart = true;
return;
}
if (this.videoIsPause && !this.videoIsPlaying) {
HiLog.e("tedG--....()....--" + this.mTimeInMicros + ";;;;");
int findVideoFile = findVideoFile(this.mTimeInMicros, -1);
if (findVideoFile == -1) {
this.timePlayStart = true;
return;
}
pausePlayVideo();
this.videoIsPause = false;
this.videoIsPlaying = true;
try {
HiLog.e("tedG--....()....--" + this.mTimeInMicros + ";;;;");
if (findVideoFile == this.curentDayVideo.size() - 1 && Math.abs((this.mTimeInMicros - this.curentDayVideo.get(findVideoFile).getEndTime()) / 1000000) < 3) {
this.timePlayStart = true;
}
HiLog.e("tedG--....()....--" + this.mTimeInMicros + ";;;;");
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
}
this.tv_osd_time1.setVisibility(this.monitor_1dual.getVisibility());
this.tv_osd_time3.setVisibility(this.monitor_3dual.getVisibility());
return;
}
this.mIsVisibleToUser = false;
if (this.mMyCamera != null) {
if (this.myTimeLineView != null) {
HiLog.e("tedG--....()....--" + this.mTimeInMicros + ";;;;");
this.mTimeInMicros = this.myTimeLineView.getCurrentValue();
HiLog.e("tedG--....()....--" + this.mTimeInMicros + ";;;;");
}
if (!this.videoIsPlaying || this.videoIsPause) {
return;
}
pausePlayVideo();
this.videoIsPause = true;
this.videoIsPlaying = false;
}
}
private void hand0And1() {
if (this.isPlayEnd) {
this.timePlayStart = true;
return;
}
long j = this.mTimeInMicros;
final int findVideoFile = findVideoFile(j, -1);
if (findVideoFile == -1) {
this.myTimeLineView.listener.onNoneVideo("", j);
this.mBackToNoFile = true;
return;
}
if (this.myTimeLineView.isScroll()) {
return;
}
PlaybackVo playbackVo = this.curentDayVideo.get(findVideoFile);
this.oldTime = 0L;
this.firstVideoStartTime = j;
this.setpos = 1;
this.currentPlayPosition = findVideoFile;
final byte[] bArr = new byte[8];
System.arraycopy(playbackVo.getTest(), 0, bArr, 0, 8);
final long startTime = playbackVo.getStartTime() / 1000;
final long endTime = playbackVo.getEndTime() / 1000;
final int startTime2 = (int) ((j - playbackVo.getStartTime()) / 1000);
final byte flag = playbackVo.getFlag();
showLoadingView();
new Thread() {
@Override
public void run() {
super.run();
if (TimePlaybackDualFragment_Three_Eyes.this.isQuit) {
return;
}
if (!TimePlaybackDualFragment_Three_Eyes.this.misfull) {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.startPlaybackNewExt(new HiChipDefines.STimeDay(bArr, 0), startTime, endTime, startTime2 / 1000, TimePlaybackDualFragment_Three_Eyes.this.one_day_file_list.size() - findVideoFile, 0, flag, TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual);
} else {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.startPlaybackNewExt(new HiChipDefines.STimeDay(bArr, 0), startTime, endTime, startTime2 / 1000, TimePlaybackDualFragment_Three_Eyes.this.one_day_file_list.size() - findVideoFile, 0, flag, TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual);
}
if (!TimePlaybackDualFragment_Three_Eyes.this.misfull) {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.startPlaybackNewExt(new HiChipDefines.STimeDay(bArr, 0), startTime, endTime, startTime2 / 1000, TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.size() - findVideoFile, 1, flag, TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual);
} else {
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.startPlaybackNewExt(new HiChipDefines.STimeDay(bArr, 0), startTime, endTime, startTime2 / 1000, TimePlaybackDualFragment_Three_Eyes.this.curentDayVideo.size() - findVideoFile, 1, flag, TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual, TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual);
}
}
}.start();
}
@Override
public void onDestroyView() {
super.onDestroyView();
HiLog.e("tedG--....onResume()....--");
MyPlaybackGLMonitor myPlaybackGLMonitor = this.monitor_1dual;
if (myPlaybackGLMonitor != null) {
myPlaybackGLMonitor.FreeMonitor();
}
MyPlaybackGLMonitor myPlaybackGLMonitor2 = this.monitor_2dual;
if (myPlaybackGLMonitor2 != null) {
myPlaybackGLMonitor2.FreeMonitor();
}
MyPlaybackGLMonitor myPlaybackGLMonitor3 = this.monitor_3dual;
if (myPlaybackGLMonitor3 != null) {
myPlaybackGLMonitor3.FreeMonitor();
}
Handler handler = this.lineHandler;
if (handler != null) {
handler.removeMessages(-1879048183);
}
if (this.mHandler_lockScreen != null) {
this.root_lock_screen.setVisibility(8);
this.mHandler_lockScreen.removeCallbacksAndMessages(null);
}
if (this.mMyCamera != null) {
this.isQuit = true;
}
stopWatchOrientation();
EventBus.getDefault().unregister(this);
}
public class AnonymousClass8 extends Handler {
AnonymousClass8() {
}
@Override
public void handleMessage(Message message) {
int i = message.what;
if (i == -1879048191) {
int i2 = message.arg1;
if ((i2 == 0 || i2 == 5) && TimePlaybackDualFragment_Three_Eyes.this.mIsVisibleToUser) {
Log.i("tedu", "--CAMERA_CONNECTION_STATE_DISCONNECTED--");
TimePlaybackDualFragment_Three_Eyes.this.dismissLoadingView();
MyToast.showToast(TimePlaybackDualFragment_Three_Eyes.this.mAct, TimePlaybackDualFragment_Three_Eyes.this.getString(R.string.disconnect));
HiLogcatUtil.e("############################# mMyCamera.stopPlaybackNew ###################### ");
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.stopPlaybackNew();
TimePlaybackDualFragment_Three_Eyes.this.mAct.finish();
return;
}
return;
}
if (i == -1879048189) {
if (message.arg2 >= 0) {
TimePlaybackDualFragment_Three_Eyes.this.handIOCTRLSuccess(message);
return;
}
TimePlaybackDualFragment_Three_Eyes.this.dismissLoadingView();
MyToast.showToast(TimePlaybackDualFragment_Three_Eyes.this.mAct, TimePlaybackDualFragment_Three_Eyes.this.getString(R.string.get_data_fail));
if (message.arg1 != 16779) {
return;
}
TimePlaybackDualFragment_Three_Eyes.this.mAct.iv_return.setEnabled(true);
return;
}
if (i == -6) {
HiLogcatUtil.e("################# timeline PLAY_ONLINESTATE_ERROR ############## ");
if (TimePlaybackDualFragment_Three_Eyes.this.getActivity() != null) {
Toast.makeText(TimePlaybackDualFragment_Three_Eyes.this.getActivity(), TimePlaybackDualFragment_Three_Eyes.this.getString(R.string.play_4k_sd_error), 1).show();
}
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.stopPlaybackNew();
TimePlaybackDualFragment_Three_Eyes.this.mMyCamera.setReconnectTimes(10);
TimePlaybackDualFragment_Three_Eyes.this.startActivity(new Intent(TimePlaybackDualFragment_Three_Eyes.this.mAct, (Class<?>) MainActivity.class));
return;
}
if (i != 0) {
if (i != 1) {
if (i != 2) {
return;
}
Log.i("tedu", "--PLAY_STATE_POS--");
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.isCanPlay = true;
TimePlaybackDualFragment_Three_Eyes.this.isPlayEnd = false;
TimePlaybackDualFragment_Three_Eyes.this.dismissLoadingView();
return;
}
Log.i("tedu", "--PLAY_STATE_EDN--");
TimePlaybackDualFragment_Three_Eyes.this.isPlayEnd = true;
MyToast.showToast(TimePlaybackDualFragment_Three_Eyes.this.mAct, TimePlaybackDualFragment_Three_Eyes.this.getString(R.string.tips_stop_video));
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.isCanPlay = false;
if (!TimePlaybackDualFragment_Three_Eyes.this.videoIsPause && TimePlaybackDualFragment_Three_Eyes.this.videoIsPlaying) {
TimePlaybackDualFragment_Three_Eyes.this.pausePlayVideo();
TimePlaybackDualFragment_Three_Eyes.this.videoIsPause = true;
TimePlaybackDualFragment_Three_Eyes.this.videoIsPlaying = false;
}
TimePlaybackDualFragment_Three_Eyes.this.shadowView.setVisibility(8);
TimePlaybackDualFragment_Three_Eyes.this.rb_all.setEnabled(true);
TimePlaybackDualFragment_Three_Eyes.this.rb_alarm.setEnabled(true);
return;
}
TimePlaybackDualFragment_Three_Eyes.this.isReadyPlay = true;
Log.i("tedu", "-播放开始-PLAY_STATE_START--");
if (!TimePlaybackDualFragment_Three_Eyes.this.mPlayFirst) {
TimePlaybackDualFragment_Three_Eyes.this.mPlayFirst = true;
TimePlaybackDualFragment_Three_Eyes.this.mReplaceView.setVisibility(8);
TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual.setVisibility(0);
TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual.setVisibility(0);
TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual.setVisibility(0);
if (TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual.getVisibility() == 0 && TimePlaybackDualFragment_Three_Eyes.this.showType == 0 && TimePlaybackDualFragment_Three_Eyes.this.getResources().getConfiguration().orientation == 2) {
TimePlaybackDualFragment_Three_Eyes.this.rl_closemonitor.setVisibility(TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual.getVisibility());
} else {
TimePlaybackDualFragment_Three_Eyes.this.rl_closemonitor.setVisibility(8);
}
if (TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual.getVisibility() == 0 && TimePlaybackDualFragment_Three_Eyes.this.showType == 0 && TimePlaybackDualFragment_Three_Eyes.this.getResources().getConfiguration().orientation == 2) {
TimePlaybackDualFragment_Three_Eyes.this.rl_close3monitor.setVisibility(TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual.getVisibility());
} else {
TimePlaybackDualFragment_Three_Eyes.this.rl_close3monitor.setVisibility(8);
}
}
TimePlaybackDualFragment_Three_Eyes.this.monitor_1dual.setVisibility(0);
TimePlaybackDualFragment_Three_Eyes.this.monitor_2dual.setVisibility(0);
TimePlaybackDualFragment_Three_Eyes.this.monitor_3dual.setVisibility(0);
TimePlaybackDualFragment_Three_Eyes.this.handler.postDelayed(new Runnable() {
@Override
public final void run() {
TimePlaybackDualFragment_Three_Eyes.AnonymousClass8.this.lambda$handleMessage$0$TimePlaybackDualFragment_Three_Eyes$8();
}
}, 100L);
TimePlaybackDualFragment_Three_Eyes.this.myTimeLineView.isCanPlay = true;
TimePlaybackDualFragment_Three_Eyes.this.isPlayEnd = false;
TimePlaybackDualFragment_Three_Eyes.this.videoIsPlaying = true;
TimePlaybackDualFragment_Three_Eyes.this.iv_placeholder.setVisibility(8);
TimePlaybackDualFragment_Three_Eyes.this.dismissLoadingView();
TimePlaybackDualFragment_Three_Eyes.this.startWatchOrientation();
TimePlaybackDualFragment_Three_Eyes.this.rb_all.setEnabled(true);
TimePlaybackDualFragment_Three_Eyes.this.rb_alarm.setEnabled(true);
}
public void lambda$handleMessage$0$TimePlaybackDualFragment_Three_Eyes$8() {
TimePlaybackDualFragment_Three_Eyes.this.shadowView.setVisibility(8);
}
}
public void handIOCTRLSuccess(Message message) {
byte b;
int i;
boolean z;
int i2;
PlaybackVo playbackVo;
byte[] byteArray = message.getData().getByteArray("data");
int i3 = message.arg1;
if (i3 == 16777) {
this.viewpager.setScanScroll(true);
this.sd_fileday = new HiChipDefines.SD_FILEDAY(byteArray);
if (this.calStartDate.get(1) == this.sd_fileday.year && this.calStartDate.get(2) + 1 == this.sd_fileday.month) {
HiLog.e("--case HiChipDefines.HI_P2P_GET_RECORD_ALLDAY:::" + ((int) this.sd_fileday.year) + "年:::" + ((int) this.sd_fileday.month) + "月::::::" + ((int) this.sd_fileday.num) + "有录像的总天数");
if (!this.isCalenderChangedMonth) {
if (this.sd_fileday.num < 1) {
dismissLoadingView();
if (this.showType == 0) {
this.iv_placeholder.setLayoutParams(new RelativeLayout.LayoutParams(-1, ((int) (this.mHeight * 1.5d)) + HiTools.dip2px(getActivity(), 4.0f)));
this.iv_placeholder.setVisibility(0);
}
HiLog.e("MsgCalenderDay:");
EventBus.getDefault().post(new MsgCalenderDay(this.allHaveVideoDayList, this.alreadyGetVideoDay, this.mSelectPosition, this.currPager));
MyToast.showToast(this.mAct, getString(R.string.current_moth_novideo));
this.timePlayStart = true;
this.mIsDataReceveEnd = true;
this.iv_full_screen.setVisibility(8);
this.iv_snapshot.setVisibility(8);
return;
}
this.iv_placeholder.setVisibility(4);
int i4 = Calendar.getInstance().get(5);
boolean z2 = true;
for (int i5 = i4 - 1; i5 > -1; i5--) {
if (this.sd_fileday.day[i5] != 1) {
b = 1;
} else if (z2) {
this.one_day_file_list.clear();
this.file_list.clear();
this.file_list1.clear();
Log.i("tedu", "--sendIOCtrl(HiChipDefines.HI_P2P_GET_RECORD_ALLFILE_ONEDAY 2222--:");
this.mAct.iv_return.setEnabled(false);
Log.i("tedu", "--我去请求当天录像文件了 返回键禁掉--");
this.mIsDataReceveEnd = false;
int i6 = i5 + 1;
this.mMyCamera.sendIOCtrl(HiChipDefines.HI_P2P_GET_RECORD_ALLFILE_ONEDAY, HiChipDefines.RECORD_ALLFILE.parseContent(0, this.sd_fileday.year, this.sd_fileday.month, i6, getFileType()));
this.alreadyGetVideoDay.add(Integer.valueOf(i6));
this.nearVideoDay = i6;
this.recentHaveVideoDay = i6;
if (i6 == i4) {
b = 1;
this.todayHasVideo = true;
} else {
b = 1;
this.todayHasVideo = false;
}
z2 = false;
} else {
b = 1;
}
if (this.sd_fileday.day[i5] == b) {
this.myTimeLineView.date[i5] = b;
this.allHaveVideoDayList.add(Integer.valueOf(i5 + 1));
}
}
Collections.reverse(this.allHaveVideoDayList);
Iterator<Integer> it = this.allHaveVideoDayList.iterator();
while (it.hasNext()) {
Log.i("tedu", "--当月有录像的天数--:" + it.next().intValue());
}
HiLog.e("MsgCalenderDay:");
EventBus.getDefault().post(new MsgCalenderDay(this.allHaveVideoDayList, this.alreadyGetVideoDay, this.mSelectPosition, this.currPager));
HiLog.e("-11-被观察者发出通知---allHaveVideoDayList-:" + this.allHaveVideoDayList.size() + "-alreadyGetVideoDay-:" + this.alreadyGetVideoDay.size() + "-mSelectPosition-:" + this.mSelectPosition + "-currPager-:" + this.currPager);
return;
}
if (this.sd_fileday.num < 1) {
dismissLoadingView();
HiLog.e("MsgCalenderDay:");
EventBus.getDefault().post(new MsgCalenderDay(new ArrayList(), new ArrayList(), -1, this.currPager));
return;
}
int i7 = 30;
for (int i8 = -1; i7 > i8; i8 = -1) {
if (this.sd_fileday.day[i7] == 1) {
this.otherMonthAllHaveVideoDayList.add(Integer.valueOf(i7 + 1));
}
i7--;
}
Collections.reverse(this.otherMonthAllHaveVideoDayList);
HiLog.e("MsgCalenderDay:");
EventBus.getDefault().post(new MsgCalenderDay(this.otherMonthAllHaveVideoDayList, new ArrayList(), -1, this.currPager));
return;
}
return;
}
long j = 0;
if (i3 != 16779) {
if (i3 != 1174405123) {
return;
}
long timeInMillis2 = new HiChipDefines.Record_FILE_INFO(byteArray).sStartTime.getTimeInMillis2() / 1000;
if (message.arg2 > 0) {
timeInMillis2 += message.arg2 / 1000;
}
if (this.currentPlayVideoStartTime / 1000000 != timeInMillis2) {
if (this.setpos == 0 || this.isOtherDay) {
this.firstVideoStartTime = timeInMillis2 * 1000000;
this.currentPlayPosition = findVideoFile(timeInMillis2 * 1000, -1);
}
this.oldTime = 0L;
}
this.setpos = 0;
this.isOtherDay = false;
this.currentPlayVideoStartTime = timeInMillis2 * 1000000;
return;
}
int i9 = 12;
if (byteArray.length >= 12) {
byte b2 = byteArray[8];
short byteArrayToShort_Little = Packet.byteArrayToShort_Little(byteArray, 10);
if (byteArrayToShort_Little > 0) {
int i10 = 0;
PlaybackVo playbackVo2 = null;
while (i10 < byteArrayToShort_Little) {
int sizeof = HiChipDefines.HI_P2P_FILE_INFO.sizeof();
int i11 = 24;
byte[] bArr = new byte[24];
int i12 = (i10 * sizeof) + 12;
if (byteArray.length >= i12 + 24) {
System.arraycopy(byteArray, i12, bArr, 0, 24);
HiChipDefines.HI_P2P_FILE_INFO hi_p2p_file_info = new HiChipDefines.HI_P2P_FILE_INFO(bArr);
this.fileType = hi_p2p_file_info.EventType;
long timeInMillis = hi_p2p_file_info.sEndTime.getTimeInMillis() - hi_p2p_file_info.sStartTime.getTimeInMillis();
if (timeInMillis <= 1000000 && timeInMillis > j) {
PlaybackVo playbackVo3 = new PlaybackVo(hi_p2p_file_info.sStartTime.getTimeInMillis2() * 1000, hi_p2p_file_info.sEndTime.getTimeInMillis2() * 1000, hi_p2p_file_info.sStartTime.parseContent(), this.fileType, hi_p2p_file_info.sReserved[0]);
this.one_day_file_list.add(playbackVo3);
handFileList(this.fileType, playbackVo3);
if (playbackVo2 == null) {
playbackVo = new PlaybackVo(hi_p2p_file_info.sStartTime.getTimeInMillis2() * 1000, hi_p2p_file_info.sEndTime.getTimeInMillis2() * 1000, hi_p2p_file_info.sStartTime.parseContent(), this.fileType, Byte.parseByte(PushConstants.PUSH_TYPE_NOTIFY));
playbackVo.setEventType(this.fileType);
} else {
playbackVo = playbackVo2;
}
if (i10 == byteArrayToShort_Little - 1) {
playbackVo.getEndTA().setTimeInMillis(hi_p2p_file_info.sEndTime.getTimeInMillis2());
this.file_list1.add(playbackVo);
} else {
int i13 = i10 + 1;
System.arraycopy(byteArray, (i13 * sizeof) + i9, bArr, 0, 24);
HiChipDefines.HI_P2P_FILE_INFO hi_p2p_file_info2 = new HiChipDefines.HI_P2P_FILE_INFO(bArr);
if (playbackVo.getEventType() != 2) {
if (hi_p2p_file_info2.EventType == 2 || hi_p2p_file_info2.sStartTime.getTimeInMillis2() - hi_p2p_file_info.sEndTime.getTimeInMillis2() > 300000) {
playbackVo.getEndTA().setTimeInMillis(hi_p2p_file_info.sEndTime.getTimeInMillis2());
this.file_list1.add(playbackVo);
} else {
playbackVo2 = playbackVo;
}
} else {
int i14 = i13;
while (i14 < byteArrayToShort_Little) {
System.arraycopy(byteArray, (i14 * sizeof) + i9, bArr, 0, i11);
HiChipDefines.HI_P2P_FILE_INFO hi_p2p_file_info3 = new HiChipDefines.HI_P2P_FILE_INFO(bArr);
if (hi_p2p_file_info3.sStartTime.getTimeInMillis2() - hi_p2p_file_info.sEndTime.getTimeInMillis2() > 60000) {
break;
}
if (hi_p2p_file_info3.EventType == 2) {
i10 = i14;
hi_p2p_file_info = hi_p2p_file_info3;
}
i14++;
i11 = 24;
}
while (i13 <= i10) {
System.arraycopy(byteArray, (i13 * sizeof) + i9, bArr, 0, 24);
HiChipDefines.HI_P2P_FILE_INFO hi_p2p_file_info4 = new HiChipDefines.HI_P2P_FILE_INFO(bArr);
PlaybackVo playbackVo4 = new PlaybackVo(hi_p2p_file_info4.sStartTime.getTimeInMillis2() * 1000, hi_p2p_file_info4.sEndTime.getTimeInMillis2() * 1000, hi_p2p_file_info4.sStartTime.parseContent(), this.fileType, hi_p2p_file_info4.sReserved[0]);
handFileList(hi_p2p_file_info4.EventType, playbackVo4);
this.one_day_file_list.add(playbackVo4);
i13++;
i9 = 12;
}
playbackVo.getEndTA().setTimeInMillis(hi_p2p_file_info.sEndTime.getTimeInMillis2());
this.file_list1.add(playbackVo);
}
}
i2 = 1;
playbackVo2 = null;
i10 += i2;
i9 = 12;
j = 0;
}
}
i2 = 1;
i10 += i2;
i9 = 12;
j = 0;
}
}
if (b2 == 1) {
this.mIsDataReceveEnd = true;
dismissLoadingView();
this.mAct.iv_return.setEnabled(true);
this.previousStartTime = 0L;
this.previousEndTime = 0L;
this.mergeStartTime = 0L;
this.mergeEndTime = 0L;
this.mergeStartTime1 = 0L;
this.mergeEndTime1 = 0L;
if (this.one_day_file_list.size() > 0) {
ArrayList arrayList = new ArrayList();
arrayList.addAll(this.one_day_file_list);
this.videoLists.add(new VideoList(this.nearVideoDay, arrayList));
ArrayList arrayList2 = new ArrayList();
arrayList2.addAll(this.file_list);
this.videoLists1.add(new VideoList(this.nearVideoDay, arrayList2));
ArrayList arrayList3 = new ArrayList();
arrayList3.addAll(this.file_list1);
this.videoLists2.add(new VideoList(this.nearVideoDay, arrayList3));
long startTime = this.one_day_file_list.get(0).getStartTime();
if (this.calStartDate.get(1) != mYear || this.calStartDate.get(2) + 1 != mMonth) {
z = true;
jumpCurrentYM(mYear, this.calStartDate.get(1), mMonth, this.calStartDate.get(2) + 1);
} else {
HiLog.e("MsgCalenderDay:");
EventBus.getDefault().post(new MsgCalenderDay(this.allHaveVideoDayList, this.alreadyGetVideoDay, this.mSelectPosition, this.currPager));
z = true;
}
this.isNeedShowProgress = z;
if (this.myTimeLineView.getScaleMode() != 120) {
this.myTimeLineView.setVideos(this.file_list1, z, startTime);
return;
} else {
this.myTimeLineView.setVideos(this.file_list, z, startTime);
return;
}
}
this.rb_all.setEnabled(true);
this.rb_alarm.setEnabled(true);
if (this.showType == 0) {
this.iv_placeholder.setVisibility(0);
this.iv_placeholder.setLayoutParams(new RelativeLayout.LayoutParams(-1, ((int) (this.mHeight * 1.5d)) + HiTools.dip2px(getActivity(), 4.0f)));
}
if (this.currentTypeIs2) {
MyToast.showToast(this.mAct, getString(R.string.time_no_alarm));
} else {
MyToast.showToast(this.mAct, getString(R.string.current_day_novideo));
}
this.shadowView.setVisibility(8);
this.timePlayStart = true;
if (this.calStartDate.get(1) != mYear || this.calStartDate.get(2) + 1 != mMonth) {
i = 1;
jumpCurrentYM(mYear, this.calStartDate.get(1), mMonth, this.calStartDate.get(2) + 1);
} else {
HiLog.e("MsgCalenderDay:");
EventBus.getDefault().post(new MsgCalenderDay(this.allHaveVideoDayList, this.alreadyGetVideoDay, this.mSelectPosition, this.currPager));
i = 1;
}
Calendar calendar = Calendar.getInstance();
calendar.set(i, mYear);
calendar.set(2, mMonth + i);
calendar.set(5, this.nearVideoDay);
calendar.set(11, 0);
calendar.set(12, 0);
calendar.set(13, i);
this.isNeedShowProgress = false;
this.myTimeLineView.setVideos(new ArrayList(), false, calendar.getTimeInMillis() * 1000);
}
}
}
private void jumpCurrentYM(int i, int i2, int i3, int i4) {
int i5 = 0;
if (i > i2) {
int i6 = ((i - i2) * 12) + 0;
i5 = i3 >= i4 ? i6 + (i3 - i4) : i6 + (12 - i4);
} else if (i == i2) {
i5 = i3 >= i4 ? i3 - i4 : -(i4 - i3);
}
NoSlidingViewPager noSlidingViewPager = this.viewpager;
if (noSlidingViewPager != null) {
noSlidingViewPager.setCurrentItem(this.currPager + i5);
}
}
private void handFileList(int i, PlaybackVo playbackVo) {
if (this.file_list.size() <= 0) {
playbackVo.setEventType(i);
this.file_list.add(playbackVo);
return;
}
PlaybackVo playbackVo2 = this.file_list.get(r0.size() - 1);
int eventType = playbackVo2.getEventType();
if (i == 2 && eventType == 2 && playbackVo.getStartTime() - playbackVo2.getEndTime() <= 1000000) {
playbackVo2.getEndTA().setTimeInMillis(playbackVo.getEndTime() / 1000);
return;
}
if (i != 2 && eventType != 2 && playbackVo.getStartTime() - playbackVo2.getEndTime() <= 1000000) {
playbackVo2.getEndTA().setTimeInMillis(playbackVo.getEndTime() / 1000);
} else {
playbackVo.setEventType(i);
this.file_list.add(playbackVo);
}
}
@Override
public void receiveIOCtrlData(HiCamera hiCamera, int i, byte[] bArr, int i2) {
Bundle bundle = new Bundle();
bundle.putByteArray("data", bArr);
Message obtainMessage = this.handler.obtainMessage();
obtainMessage.what = HiDataValue.HANDLE_MESSAGE_RECEIVE_IOCTRL;
obtainMessage.obj = hiCamera;
obtainMessage.arg1 = i;
obtainMessage.arg2 = i2;
obtainMessage.setData(bundle);
this.handler.sendMessage(obtainMessage);
}
@Override
public void receiveSessionState(HiCamera hiCamera, int i) {
Message obtainMessage = this.handler.obtainMessage();
obtainMessage.what = HiDataValue.HANDLE_MESSAGE_SESSION_STATE;
obtainMessage.arg1 = i;
obtainMessage.obj = hiCamera;
this.handler.sendMessage(obtainMessage);
}
@Override
public void callbackStateDual(HiCamera hiCamera, int i, int i2, int i3, int i4) {
HiLog.e(i + Constants.COLON_SEPARATOR + i2 + Constants.COLON_SEPARATOR + i3 + Constants.COLON_SEPARATOR + i4);
if (HiTools.mDualTimevalue == 0 || HiTools.mDualTimevalue == 1) {
if (i == 2) {
return;
}
} else if (HiTools.mDualTimevalue == 2 && i == 1) {
return;
}
if (this.mMyCamera != hiCamera) {
return;
}
Message obtainMessage = this.handler.obtainMessage();
obtainMessage.what = i2;
obtainMessage.arg1 = i3;
obtainMessage.arg2 = i4;
this.handler.sendMessage(obtainMessage);
}
@Override
public void callbackState(HiCamera hiCamera, int i, int i2, int i3) {
if (this.mMyCamera != hiCamera) {
return;
}
Message obtainMessage = this.handler.obtainMessage();
obtainMessage.what = i;
obtainMessage.arg1 = i2;
obtainMessage.arg2 = i3;
this.handler.sendMessage(obtainMessage);
}
@Override
public void callbackPlayUTC(HiCamera hiCamera, int i) {
if (this.mMyCamera != hiCamera) {
return;
}
if (this.oldTime == 0) {
this.oldTime = i;
}
long j = i;
long j2 = j - this.oldTime;
long j3 = 60;
if (j2 < 0) {
this.oldTime = j;
j2 = 60;
}
if (this.savetime == 0) {
this.savetime = j;
}
if (j - this.savetime > 1000) {
this.oldTime = j;
} else {
j3 = j2;
}
this.savetime = j;
Message obtainMessage = this.handler.obtainMessage();
obtainMessage.what = -1879048183;
obtainMessage.arg1 = (int) (j3 / 1000);
this.lineHandler.sendMessage(obtainMessage);
}
@Override
public void callbackPlayUTCDual(HiCamera hiCamera, int i, int i2) {
if (HiTools.mDualTimevalue == 0 || HiTools.mDualTimevalue == 1) {
if (i == 2) {
return;
}
} else if (HiTools.mDualTimevalue == 2 && i == 1) {
return;
}
if (this.mMyCamera != hiCamera) {
return;
}
if (this.oldTime == 0) {
this.oldTime = i2;
}
long j = i2;
long j2 = j - this.oldTime;
long j3 = 60;
if (j2 < 0) {
this.oldTime = j;
j2 = 60;
}
if (this.savetime == 0) {
this.savetime = j;
}
if (j - this.savetime > 1000) {
this.oldTime = j;
} else {
j3 = j2;
}
this.savetime = j;
Message obtainMessage = this.handler.obtainMessage();
obtainMessage.what = -1879048183;
obtainMessage.arg1 = (int) (j3 / 1000);
this.lineHandler.sendMessage(obtainMessage);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.bt_landdualswitch:
doswitchview(true);
this.misfull = !this.misfull;
return;
case R.id.bt_portraitdualswitch:
if (this.showType == 0) {
this.showType = 1;
} else {
this.showType = 0;
}
notifyLayout(this.showType, true);
return;
case R.id.iv_full_screen:
this.mIsClickReturn = false;
if (getResources().getConfiguration().orientation == 1) {
this.mAct.setRequestedOrientation(0);
} else if (getResources().getConfiguration().orientation == 2) {
this.mAct.setRequestedOrientation(1);
}
this.monitor_1dual.setVisibility(4);
this.monitor_2dual.setVisibility(4);
this.monitor_3dual.setVisibility(4);
return;
case R.id.iv_left:
if (HiTools.isCustomFastClick(500)) {
return;
}
showPreMonth();
return;
case R.id.iv_return:
if (getResources().getConfiguration().orientation == 1) {
return;
}
this.mIsClickReturn = true;
releaseLockScreen();
this.mAct.setRequestedOrientation(1);
return;
case R.id.iv_right:
if (HiTools.isCustomFastClick(500)) {
return;
}
showNextMonth();
return;
case R.id.iv_snapshot:
case R.id.iv_snapshot_land:
if (System.currentTimeMillis() - this.lastClickTime <= 500) {
return;
}
this.lastClickTime = System.currentTimeMillis();
if (HiTools.HiPermission(getActivity(), getActivity(), 1, 10046)) {
return;
}
clickSnapshot();
return;
case R.id.monitor_1dual:
case R.id.monitor_2dual:
case R.id.monitor_3dual:
if (getResources().getConfiguration().orientation == 2) {
LinearLayout linearLayout = this.ll_top;
linearLayout.setVisibility(linearLayout.getVisibility() == 0 ? 8 : 0);
this.iv_snapshot_land.setVisibility(this.ll_top.getVisibility());
if (this.ll_top.getVisibility() == 0) {
if (this.isBallShowBig) {
this.rl_closemonitor.setVisibility(this.monitor_1dual.getVisibility());
this.rl_close3monitor.setVisibility(this.monitor_3dual.getVisibility());
this.rl_close2monitor.setVisibility(8);
return;
} else {
this.rl_close2monitor.setVisibility(this.monitor_2dual.getVisibility());
this.rl_close2monitor.setVisibility(8);
this.rl_closemonitor.setVisibility(8);
this.rl_close3monitor.setVisibility(8);
return;
}
}
this.rl_closemonitor.setVisibility(8);
this.rl_close2monitor.setVisibility(8);
this.rl_close3monitor.setVisibility(8);
return;
}
if (getResources().getConfiguration().orientation == 1 && this.mPlayFirst) {
RelativeLayout relativeLayout = this.rl_portraittopview;
relativeLayout.setVisibility(relativeLayout.getVisibility() == 0 ? 8 : 0);
this.rl_close2monitor.setVisibility(8);
this.iv_full_screen.setVisibility(this.rl_portraittopview.getVisibility());
if (this.rl_portraittopview.getVisibility() == 0) {
this.iv_snapshot.setVisibility(0);
this.rl_closemonitor.setVisibility(8);
this.rl_close3monitor.setVisibility(8);
return;
} else {
this.iv_snapshot.setVisibility(8);
this.rl_closemonitor.setVisibility(8);
this.rl_close3monitor.setVisibility(8);
return;
}
}
return;
case R.id.rb_alarm:
if (this.mIsDataReceveEnd && !this.currentTypeIs2) {
this.currentTypeIs2 = true;
this.rb_alarm.setChecked(true);
this.rb_all.setChecked(false);
this.rb_all.setEnabled(false);
this.rb_alarm.setEnabled(false);
resetRequestData();
showLoadingView();
this.mMyCamera.stopPlaybackNew();
this.mMyCamera.sendIOCtrl(HiChipDefines.HI_P2P_GET_RECORD_ALLFILE_ONEDAY, HiChipDefines.RECORD_ALLFILE.parseContent(0, mYear, mMonth, this.nearVideoDay, getFileType()));
return;
}
return;
case R.id.rb_all:
if (this.mIsDataReceveEnd && this.currentTypeIs2) {
this.currentTypeIs2 = false;
this.rb_alarm.setChecked(false);
this.rb_all.setChecked(true);
this.rb_all.setEnabled(false);
this.rb_alarm.setEnabled(false);
resetRequestData();
showLoadingView();
this.mMyCamera.stopPlaybackNew();
this.mMyCamera.sendIOCtrl(HiChipDefines.HI_P2P_GET_RECORD_ALLFILE_ONEDAY, HiChipDefines.RECORD_ALLFILE.parseContent(0, mYear, mMonth, this.nearVideoDay, getFileType()));
return;
}
return;
case R.id.rl_close2monitor:
this.monitor_2dual.setVisibility(8);
this.rl_close2monitor.setVisibility(4);
return;
case R.id.rl_close3monitor:
this.monitor_3dual.setVisibility(8);
this.rl_close3monitor.setVisibility(4);
this.tv_osd_time3.setVisibility(8);
return;
case R.id.rl_closemonitor:
this.monitor_1dual.setVisibility(8);
this.rl_closemonitor.setVisibility(4);
this.tv_osd_time1.setVisibility(8);
return;
case R.id.root_lock_screen:
OrientationWatchDog orientationWatchDog = this.mOrientationWatchDog;
if (orientationWatchDog != null) {
orientationWatchDog.setLockScreen(true);
}
this.root_lock_screen.setVisibility(8);
this.mHandler_lockScreen.removeCallbacksAndMessages(null);
return;
default:
return;
}
}
private void resetRequestData() {
this.mIsDataReceveEnd = false;
this.firstVideoStartTime = 0L;
this.currentPlayPosition = 0;
this.currentPlayVideoStartTime = 0L;
this.videoIsPlaying = false;
this.videoIsPause = false;
this.myTimeLineView.isCanPlay = false;
this.one_day_file_list.clear();
this.file_list.clear();
this.file_list1.clear();
this.videoLists.clear();
this.videoLists1.clear();
this.videoLists2.clear();
this.isDrag = false;
this.curentDayVideo.clear();
}
@Override
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
TimeAxisActivity timeAxisActivity = this.mAct;
if (timeAxisActivity instanceof TimeAxisActivity) {
this.timeAxisActivity = timeAxisActivity;
}
if (getResources().getConfiguration().orientation == 1) {
handPortrait();
TimeLineNew timeLineNew = this.myTimeLineView;
if (timeLineNew != null && !timeLineNew.isCanPlay && !this.videoIsPlaying && this.videoIsPause && this.showType == 0) {
this.iv_placeholder.setVisibility(0);
this.iv_placeholder.setLayoutParams(new RelativeLayout.LayoutParams(-1, ((int) (this.mHeight * 1.5d)) + HiTools.dip2px(getActivity(), 4.0f)));
}
this.mScrollView.setBackgroundColor(getResources().getColor(R.color.white));
} else {
handLandscape();
this.mScrollView.setBackgroundColor(getResources().getColor(R.color.colorBlack));
}
if (this.timeAxisActivity.isShowPermissionDialog) {
HiTools.dialogUtilsAgreements.build().show();
}
this.monitor_1dual.setVisibility(0);
this.monitor_2dual.setVisibility(0);
this.monitor_3dual.setVisibility(0);
}
private void handPortrait() {
if (getActivity() == null || this.monitor_1dual == null) {
return;
}
this.misfull = true;
showBottomUIMenu(getActivity());
this.monitor_1dual.setmIsFullScreen(0);
this.monitor_2dual.setmIsFullScreen(0);
this.monitor_3dual.setmIsFullScreen(0);
this.mAct.getWindow().clearFlags(1024);
this.iv_snapshot_land.setVisibility(8);
this.timeAxisActivity.ll_title.setVisibility(0);
this.timeAxisActivity.rl_head.setVisibility(0);
this.myTimeLineView.setVisibility(0);
this.ll_bottom.setVisibility(0);
this.ll_top.setVisibility(8);
this.iv_full_screen.setVisibility(8);
this.iv_snapshot.setVisibility(8);
this.rl_portraittopview.setVisibility(8);
this.bt_portraitdualswitch.setBackgroundResource(R.mipmap.dualswitch_s);
HiTools.mDualTimevalue = 0;
this.mMyCamera.setPlaybackMonitorExt(this.monitor_1dual, this.monitor_2dual, this.monitor_3dual);
this.showType = 0;
notifyLayout(0, true);
}
private void handLandscape() {
if (getActivity() == null) {
return;
}
hideBottomUIMenu(getActivity());
this.misfull = true;
getActivity().getWindow().setFlags(1024, 1024);
this.monitor_1dual.setmIsFullScreen(1);
this.monitor_2dual.setmIsFullScreen(1);
this.monitor_3dual.setmIsFullScreen(1);
this.iv_snapshot_land.setVisibility(8);
this.timeAxisActivity.ll_title.setVisibility(8);
this.timeAxisActivity.rl_head.setVisibility(8);
this.myTimeLineView.setVisibility(8);
this.ll_bottom.setVisibility(8);
this.ll_top.setVisibility(8);
this.iv_full_screen.setVisibility(4);
this.iv_snapshot.setVisibility(4);
this.rl_close2monitor.setVisibility(8);
this.rl_portraittopview.setVisibility(8);
this.bt_landdualswitch.setBackgroundResource(R.mipmap.dualswitch);
HiTools.mDualTimevalue = 0;
this.mMyCamera.setPlaybackMonitorExt(this.monitor_1dual, this.monitor_2dual, this.monitor_3dual);
if (this.showType == 0) {
this.misfull = false;
} else {
this.misfull = true;
}
this.misfull = false;
doswitchview(false);
this.misfull = true ^ this.misfull;
}
private void showPreMonth() {
NoSlidingViewPager noSlidingViewPager = this.viewpager;
int i = this.currPager - 1;
this.currPager = i;
noSlidingViewPager.setCurrentItem(i, true);
}
private void showNextMonth() {
int i = this.currPager;
if (i >= 999) {
return;
}
NoSlidingViewPager noSlidingViewPager = this.viewpager;
int i2 = i + 1;
this.currPager = i2;
noSlidingViewPager.setCurrentItem(i2, true);
}
public void showLoadingView() {
this.loadingViewIsShowing = true;
Animation loadAnimation = AnimationUtils.loadAnimation(getContext(), R.anim.rotate);
this.mIvLoading.setVisibility(0);
this.mIvLoading.startAnimation(loadAnimation);
this.shadowView.setVisibility(0);
}
public void dismissLoadingView() {
this.loadingViewIsShowing = false;
this.mIvLoading.clearAnimation();
this.mIvLoading.setVisibility(8);
this.shadowView.setVisibility(8);
}
public void resetMonitorSize(boolean z, double d) {
if (this.mIsClickReturn) {
return;
}
this.isLarge = z ? 1 : 2;
if (this.monitor_2dual.getmIsFullScreen() == 0) {
this.monitor_2dual.screen_height = this.mHeight;
}
if (this.monitor_2dual.height == 0 && this.monitor_2dual.width == 0) {
initMatrix(this.monitor_2dual.screen_width, this.monitor_2dual.screen_height);
}
this.moveX = (int) (d / 2.0d);
this.moveY = (int) (((d * this.monitor_2dual.screen_height) / this.monitor_2dual.screen_width) / 2.0d);
if (z) {
if (this.monitor_2dual.width <= this.monitor_2dual.screen_width * 2 && this.monitor_2dual.height <= this.monitor_2dual.screen_height * 2) {
this.monitor_2dual.left -= this.moveX / 2;
this.monitor_2dual.bottom -= this.moveY / 2;
this.monitor_2dual.width += this.moveX;
this.monitor_2dual.height += this.moveY;
}
} else {
this.monitor_2dual.left += this.moveX / 2;
this.monitor_2dual.bottom += this.moveY / 2;
this.monitor_2dual.width -= this.moveX;
this.monitor_2dual.height -= this.moveY;
if (this.monitor_2dual.bottom + this.monitor_2dual.height < this.monitor_2dual.screen_height) {
MyPlaybackGLMonitor myPlaybackGLMonitor = this.monitor_2dual;
myPlaybackGLMonitor.bottom = myPlaybackGLMonitor.screen_height - this.monitor_2dual.height;
}
if (this.monitor_2dual.left + this.monitor_2dual.width < this.monitor_2dual.screen_width) {
MyPlaybackGLMonitor myPlaybackGLMonitor2 = this.monitor_2dual;
myPlaybackGLMonitor2.left = myPlaybackGLMonitor2.screen_width - this.monitor_2dual.width;
}
}
if (this.monitor_2dual.left > 0 || this.monitor_2dual.width < this.monitor_2dual.screen_width || this.monitor_2dual.height < this.monitor_2dual.screen_height || this.monitor_2dual.bottom > 0) {
initMatrix(this.monitor_2dual.screen_width, this.monitor_2dual.screen_height);
}
if (this.monitor_2dual.width > this.monitor_2dual.screen_width) {
this.monitor_2dual.setState(1);
} else {
this.monitor_2dual.setState(0);
}
MyPlaybackGLMonitor myPlaybackGLMonitor3 = this.monitor_2dual;
myPlaybackGLMonitor3.setMatrix(myPlaybackGLMonitor3.left, this.monitor_2dual.bottom, this.monitor_2dual.width, this.monitor_2dual.height);
if (getResources().getConfiguration().orientation == 1) {
this.isLarge = 0;
}
}
private void initMatrix(int i, int i2) {
this.monitor_1dual.left = 0;
this.monitor_1dual.bottom = 0;
this.monitor_1dual.width = i;
this.monitor_1dual.height = i2;
}
private void init2Matrix(int i, int i2) {
this.monitor_2dual.left = 0;
this.monitor_2dual.bottom = 0;
this.monitor_2dual.width = i;
this.monitor_2dual.height = i2;
}
private void init3Matrix(int i, int i2) {
this.monitor_3dual.left = 0;
this.monitor_3dual.bottom = 0;
this.monitor_3dual.width = i;
this.monitor_3dual.height = i2;
}
public void startWatchOrientation() {
OrientationWatchDog orientationWatchDog;
if (this.iv_placeholder.getVisibility() == 0 || !this.myTimeLineView.isCanPlay || (orientationWatchDog = this.mOrientationWatchDog) == null) {
return;
}
orientationWatchDog.startWatch();
}
public void stopWatchOrientation() {
OrientationWatchDog orientationWatchDog = this.mOrientationWatchDog;
if (orientationWatchDog != null) {
orientationWatchDog.stopWatch();
}
}
public void releaseLockScreen() {
OrientationWatchDog orientationWatchDog = this.mOrientationWatchDog;
if (orientationWatchDog != null) {
orientationWatchDog.setLockScreen(false);
}
this.root_lock_screen.setVisibility(8);
this.mHandler_lockScreen.removeCallbacksAndMessages(null);
}
private void initOrientationWatchdog() {
OrientationWatchDog orientationWatchDog = new OrientationWatchDog(getActivity());
this.mOrientationWatchDog = orientationWatchDog;
orientationWatchDog.setOnOrientationListener(this);
}
@Override
public void changedScreenDirection(int i) {
if (this.isReadyPlay && this.iv_placeholder.getVisibility() != 0) {
if (i == 90) {
if (this.myTimeLineView.isCanPlay) {
if (this.mOrientationWatchDog.getLastOrientation() == 270) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
if (TimePlaybackDualFragment_Three_Eyes.this.isLarge != 1) {
if (TimePlaybackDualFragment_Three_Eyes.this.isLarge == 2) {
TimePlaybackDualFragment_Three_Eyes timePlaybackDualFragment_Three_Eyes = TimePlaybackDualFragment_Three_Eyes.this;
timePlaybackDualFragment_Three_Eyes.resetMonitorSize(false, timePlaybackDualFragment_Three_Eyes.nLenStart);
return;
}
return;
}
TimePlaybackDualFragment_Three_Eyes timePlaybackDualFragment_Three_Eyes2 = TimePlaybackDualFragment_Three_Eyes.this;
timePlaybackDualFragment_Three_Eyes2.resetMonitorSize(true, timePlaybackDualFragment_Three_Eyes2.nLenStart);
}
}, 200L);
}
if (!this.mIsClickReturn) {
getActivity().setRequestedOrientation(8);
}
if (!this.isFirstRevolveLand) {
this.isFirstRevolveLand = true;
}
if (this.mIsClickReturn) {
return;
}
if (this.root_lock_screen.getVisibility() == 0) {
this.mHandler_lockScreen.removeCallbacksAndMessages(null);
this.mHandler_lockScreen.sendEmptyMessageDelayed(1, 3000L);
return;
} else {
this.mHandler_lockScreen.removeCallbacksAndMessages(null);
this.mHandler_lockScreen.sendEmptyMessageDelayed(0, 3000L);
return;
}
}
return;
}
if (i == 270) {
if (this.myTimeLineView.isCanPlay) {
if (this.mOrientationWatchDog.getLastOrientation() == 90) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
if (TimePlaybackDualFragment_Three_Eyes.this.isLarge != 1) {
if (TimePlaybackDualFragment_Three_Eyes.this.isLarge == 2) {
TimePlaybackDualFragment_Three_Eyes timePlaybackDualFragment_Three_Eyes = TimePlaybackDualFragment_Three_Eyes.this;
timePlaybackDualFragment_Three_Eyes.resetMonitorSize(false, timePlaybackDualFragment_Three_Eyes.nLenStart);
return;
}
return;
}
TimePlaybackDualFragment_Three_Eyes timePlaybackDualFragment_Three_Eyes2 = TimePlaybackDualFragment_Three_Eyes.this;
timePlaybackDualFragment_Three_Eyes2.resetMonitorSize(true, timePlaybackDualFragment_Three_Eyes2.nLenStart);
}
}, 200L);
}
if (!this.mIsClickReturn) {
getActivity().setRequestedOrientation(0);
}
if (!this.isFirstRevolveLand) {
this.isFirstRevolveLand = true;
return;
}
if (this.mIsClickReturn) {
return;
}
if (this.root_lock_screen.getVisibility() == 0) {
this.mHandler_lockScreen.removeCallbacksAndMessages(null);
this.mHandler_lockScreen.sendEmptyMessageDelayed(1, 3000L);
return;
} else {
this.mHandler_lockScreen.removeCallbacksAndMessages(null);
this.mHandler_lockScreen.sendEmptyMessageDelayed(0, 3000L);
return;
}
}
return;
}
this.mIsClickReturn = false;
getActivity().setRequestedOrientation(1);
this.root_lock_screen.setVisibility(8);
this.mHandler_lockScreen.removeCallbacksAndMessages(null);
}
}
public void clickSnapshot() {
ArrayList arrayList = new ArrayList();
if (this.mMyCamera != null) {
if (HiTools.isSDCardValid()) {
File file = new File(HiDataValue.getPathCameraSnapshot(this.mMyCamera.getUid(), getActivity()));
if (!file.exists()) {
file.mkdirs();
}
String fileNameWithTime = HiTools.getFileNameWithTime(0);
String str = file.getAbsoluteFile() + "/" + fileNameWithTime;
MyCamera myCamera = this.mMyCamera;
Bitmap snap2shot = myCamera != null ? myCamera.getSnap2shot() : null;
MyCamera myCamera2 = this.mMyCamera;
Bitmap snapshotCut1 = myCamera2 != null ? myCamera2.getSnapshotCut1() : null;
MyCamera myCamera3 = this.mMyCamera;
Bitmap snapshotCut2 = myCamera3 != null ? myCamera3.getSnapshotCut2() : null;
if (snap2shot != null) {
arrayList.add(snap2shot);
}
if (snapshotCut1 != null) {
arrayList.add(snapshotCut1);
}
if (snapshotCut2 != null) {
arrayList.add(snapshotCut2);
}
if (arrayList.size() > 0) {
Bitmap drawMultiV = BitmapUtils.drawMultiV(null, arrayList);
if (drawMultiV != null && HiTools.saveImage(str, drawMultiV)) {
SaveToPhone(str, fileNameWithTime);
Toast.makeText(getActivity(), getText(R.string.tips_snapshot_success), 0).show();
return;
} else {
Toast.makeText(getActivity(), getText(R.string.tips_snapshot_failed), 0).show();
return;
}
}
return;
}
Toast.makeText(getActivity(), getText(R.string.tips_no_sdcard).toString(), 0).show();
}
}
private void SaveToPhone(final String str, final String str2) {
new Thread(new Runnable() {
@Override
public void run() {
try {
MediaStore.Images.Media.insertImage(TimePlaybackDualFragment_Three_Eyes.this.getActivity().getContentResolver(), str, str2, (String) null);
} catch (Exception e) {
e.printStackTrace();
}
TimePlaybackDualFragment_Three_Eyes.this.getActivity().sendBroadcast(new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", Uri.parse("file://" + str)));
}
}).start();
}
@Override
public void onDestroy() {
super.onDestroy();
MyPlaybackGLMonitor myPlaybackGLMonitor = this.monitor_1dual;
if (myPlaybackGLMonitor != null) {
myPlaybackGLMonitor.FreeMonitor();
MyCamera myCamera = this.mMyCamera;
if (myCamera != null) {
myCamera.clearMonitor(this.monitor_1dual);
}
}
MyPlaybackGLMonitor myPlaybackGLMonitor2 = this.monitor_2dual;
if (myPlaybackGLMonitor2 != null) {
myPlaybackGLMonitor2.FreeMonitor();
MyCamera myCamera2 = this.mMyCamera;
if (myCamera2 != null) {
myCamera2.clearMonitor(this.monitor_2dual);
}
}
MyPlaybackGLMonitor myPlaybackGLMonitor3 = this.monitor_3dual;
if (myPlaybackGLMonitor3 != null) {
myPlaybackGLMonitor3.FreeMonitor();
MyCamera myCamera3 = this.mMyCamera;
if (myCamera3 != null) {
myCamera3.clearMonitor(this.monitor_3dual);
}
}
if (HiTools.dialogUtilsAgreements != null) {
HiTools.dialogUtilsAgreements.build().dismiss();
}
}
private void notifyLayout(int i, boolean z) {
DisplayMetrics displayMetrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
if (i == 1) {
this.rl_monitor.setLayoutParams(new LinearLayout.LayoutParams(-1, -1));
this.rl_2monitor.setLayoutParams(new RelativeLayout.LayoutParams(-1, this.mHeight));
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -2);
layoutParams.setMargins(0, this.mHeight + HiTools.dip2px(getActivity(), 2.0f), 0, HiTools.dip2px(getActivity(), 2.0f));
this.mLayoutMonitor.setLayoutParams(layoutParams);
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(-2, -2);
MyPlaybackGLMonitor myPlaybackGLMonitor = this.monitor_1dual;
int i2 = displayMetrics.widthPixels;
layoutParams2.width = i2;
myPlaybackGLMonitor.screen_width = i2;
MyPlaybackGLMonitor myPlaybackGLMonitor2 = this.monitor_1dual;
int i3 = this.mHeight;
layoutParams2.height = i3;
myPlaybackGLMonitor2.screen_height = i3;
layoutParams2.setMargins(0, 0, 0, 0);
this.monitor_1dual.setLayoutParams(layoutParams2);
RelativeLayout.LayoutParams layoutParams3 = (RelativeLayout.LayoutParams) this.rl_closemonitor.getLayoutParams();
layoutParams3.setMargins(HiTools.dip2px(getContext(), 5.0f), (this.mHeight * 2) / 3, 0, 0);
this.rl_closemonitor.setLayoutParams(layoutParams3);
this.rl_closemonitor.setVisibility(8);
RelativeLayout.LayoutParams layoutParams4 = new RelativeLayout.LayoutParams(-1, -2);
MyPlaybackGLMonitor myPlaybackGLMonitor3 = this.monitor_2dual;
int i4 = displayMetrics.widthPixels;
layoutParams4.width = i4;
myPlaybackGLMonitor3.screen_width = i4;
MyPlaybackGLMonitor myPlaybackGLMonitor4 = this.monitor_2dual;
int i5 = this.mHeight;
layoutParams4.height = i5;
myPlaybackGLMonitor4.screen_height = i5;
layoutParams4.setMargins(0, 0, 0, 0);
this.monitor_2dual.setLayoutParams(layoutParams4);
this.rl_close2monitor.setVisibility(8);
RelativeLayout.LayoutParams layoutParams5 = new RelativeLayout.LayoutParams(-2, -2);
MyPlaybackGLMonitor myPlaybackGLMonitor5 = this.monitor_3dual;
int i6 = displayMetrics.widthPixels;
layoutParams5.width = i6;
myPlaybackGLMonitor5.screen_width = i6;
MyPlaybackGLMonitor myPlaybackGLMonitor6 = this.monitor_3dual;
int i7 = this.mHeight;
layoutParams5.height = i7;
myPlaybackGLMonitor6.screen_height = i7;
layoutParams5.setMargins(0, HiTools.dip2px(getActivity(), 2.0f), 0, 0);
layoutParams5.addRule(3, R.id.monitor_1dual);
this.monitor_3dual.setLayoutParams(layoutParams5);
RelativeLayout.LayoutParams layoutParams6 = (RelativeLayout.LayoutParams) this.rl_close3monitor.getLayoutParams();
layoutParams6.addRule(21);
layoutParams6.setMargins(0, (this.mHeight * 2) / 3, this.monitor_3dual.screen_width - HiTools.dip2px(getContext(), 30.0f), 0);
this.rl_close3monitor.setLayoutParams(layoutParams6);
this.rl_close3monitor.setVisibility(8);
RelativeLayout.LayoutParams layoutParams7 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams7.addRule(21);
layoutParams7.setMargins(0, this.mHeight + HiTools.dip2px(getActivity(), 2.0f), 0, 0);
this.tv_osd_time1.setTextSize(0, HiTools.dip2px(getActivity(), 9.0f));
this.tv_osd_time1.setLayoutParams(layoutParams7);
RelativeLayout.LayoutParams layoutParams8 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams8.addRule(21);
layoutParams8.setMargins(0, (this.mHeight * 2) + HiTools.dip2px(getActivity(), 4.0f), 0, 0);
this.tv_osd_time3.setTextSize(0, HiTools.dip2px(getActivity(), 9.0f));
this.tv_osd_time3.setLayoutParams(layoutParams8);
this.ll_bottom.setVisibility(8);
} else {
this.rl_monitor.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
this.rl_2monitor.setLayoutParams(new RelativeLayout.LayoutParams(-1, this.mHeight));
RelativeLayout.LayoutParams layoutParams9 = new RelativeLayout.LayoutParams(-1, -2);
layoutParams9.setMargins(0, this.mHeight + HiTools.dip2px(getActivity(), 2.0f), 0, HiTools.dip2px(getActivity(), 2.0f));
this.mLayoutMonitor.setLayoutParams(layoutParams9);
RelativeLayout.LayoutParams layoutParams10 = new RelativeLayout.LayoutParams(-2, -2);
MyPlaybackGLMonitor myPlaybackGLMonitor7 = this.monitor_1dual;
int dip2px = (displayMetrics.widthPixels / 2) - HiTools.dip2px(getActivity(), 1.0f);
layoutParams10.width = dip2px;
myPlaybackGLMonitor7.screen_width = dip2px;
MyPlaybackGLMonitor myPlaybackGLMonitor8 = this.monitor_1dual;
int i8 = this.mHeight / 2;
layoutParams10.height = i8;
myPlaybackGLMonitor8.screen_height = i8;
layoutParams10.setMargins(0, 0, HiTools.dip2px(getActivity(), 1.0f), 0);
this.monitor_1dual.setLayoutParams(layoutParams10);
RelativeLayout.LayoutParams layoutParams11 = (RelativeLayout.LayoutParams) this.rl_closemonitor.getLayoutParams();
layoutParams11.setMargins(HiTools.dip2px(getContext(), 5.0f), this.mHeight, 0, 0);
this.rl_closemonitor.setLayoutParams(layoutParams11);
this.rl_closemonitor.setVisibility(8);
RelativeLayout.LayoutParams layoutParams12 = new RelativeLayout.LayoutParams(-1, -2);
MyPlaybackGLMonitor myPlaybackGLMonitor9 = this.monitor_2dual;
int i9 = displayMetrics.widthPixels;
layoutParams12.width = i9;
myPlaybackGLMonitor9.screen_width = i9;
MyPlaybackGLMonitor myPlaybackGLMonitor10 = this.monitor_2dual;
int i10 = this.mHeight;
layoutParams12.height = i10;
myPlaybackGLMonitor10.screen_height = i10;
layoutParams12.setMargins(0, 0, 0, 0);
this.monitor_2dual.setLayoutParams(layoutParams12);
this.rl_close2monitor.setVisibility(8);
RelativeLayout.LayoutParams layoutParams13 = new RelativeLayout.LayoutParams(-2, -2);
MyPlaybackGLMonitor myPlaybackGLMonitor11 = this.monitor_3dual;
int dip2px2 = (displayMetrics.widthPixels / 2) - HiTools.dip2px(getActivity(), 1.0f);
layoutParams13.width = dip2px2;
myPlaybackGLMonitor11.screen_width = dip2px2;
MyPlaybackGLMonitor myPlaybackGLMonitor12 = this.monitor_3dual;
int i11 = this.mHeight / 2;
layoutParams13.height = i11;
myPlaybackGLMonitor12.screen_height = i11;
layoutParams13.addRule(21);
layoutParams13.setMargins(HiTools.dip2px(getActivity(), 1.0f), 0, 0, 0);
this.monitor_3dual.setLayoutParams(layoutParams13);
RelativeLayout.LayoutParams layoutParams14 = (RelativeLayout.LayoutParams) this.rl_close3monitor.getLayoutParams();
layoutParams14.addRule(21);
layoutParams14.setMargins(0, this.mHeight, this.monitor_3dual.screen_width - HiTools.dip2px(getContext(), 30.0f), 0);
this.rl_close3monitor.setLayoutParams(layoutParams14);
this.rl_close3monitor.setVisibility(8);
RelativeLayout.LayoutParams layoutParams15 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams15.addRule(21);
layoutParams15.setMargins(0, this.mHeight + HiTools.dip2px(getActivity(), 2.0f), (displayMetrics.widthPixels / 2) + 2, 0);
this.tv_osd_time1.setTextSize(0, HiTools.dip2px(getActivity(), 9.0f));
this.tv_osd_time1.setLayoutParams(layoutParams15);
RelativeLayout.LayoutParams layoutParams16 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams16.addRule(21);
layoutParams16.setMargins(0, this.mHeight + HiTools.dip2px(getActivity(), 2.0f), 0, 0);
this.tv_osd_time3.setTextSize(0, HiTools.dip2px(getActivity(), 9.0f));
this.tv_osd_time3.setLayoutParams(layoutParams16);
this.ll_bottom.setVisibility(0);
if (!this.mPlayFirst) {
this.mReplaceView.setLayoutParams(new RelativeLayout.LayoutParams(-1, ((int) (this.mHeight * 1.5d)) + HiTools.dip2px(getActivity(), 2.0f)));
}
}
RelativeLayout.LayoutParams layoutParams17 = new RelativeLayout.LayoutParams(HiTools.dip2px(getContext(), 30.0f), HiTools.dip2px(getContext(), 30.0f));
layoutParams17.addRule(21);
layoutParams17.setMargins(0, this.mHeight - HiTools.dip2px(getContext(), 40.0f), HiTools.dip2px(getContext(), 10.0f), 0);
this.iv_full_screen.setLayoutParams(layoutParams17);
RelativeLayout.LayoutParams layoutParams18 = new RelativeLayout.LayoutParams(HiTools.dip2px(getContext(), 40.0f), HiTools.dip2px(getContext(), 40.0f));
layoutParams18.addRule(21);
layoutParams18.addRule(15);
this.iv_snapshot.setLayoutParams(layoutParams18);
initMatrix(this.monitor_1dual.screen_width, this.monitor_1dual.screen_height);
MyPlaybackGLMonitor myPlaybackGLMonitor13 = this.monitor_1dual;
myPlaybackGLMonitor13.setMatrix(myPlaybackGLMonitor13.left, this.monitor_1dual.bottom, this.monitor_1dual.width, this.monitor_1dual.height);
init2Matrix(this.monitor_2dual.screen_width, this.monitor_2dual.screen_height);
MyPlaybackGLMonitor myPlaybackGLMonitor14 = this.monitor_2dual;
myPlaybackGLMonitor14.setMatrix(myPlaybackGLMonitor14.left, this.monitor_2dual.bottom, this.monitor_2dual.width, this.monitor_2dual.height);
init3Matrix(this.monitor_3dual.screen_width, this.monitor_3dual.screen_height);
MyPlaybackGLMonitor myPlaybackGLMonitor15 = this.monitor_3dual;
myPlaybackGLMonitor15.setMatrix(myPlaybackGLMonitor15.left, this.monitor_3dual.bottom, this.monitor_3dual.width, this.monitor_3dual.height);
this.monitor_1dual.setVisibility(0);
this.monitor_2dual.setVisibility(0);
this.monitor_3dual.setVisibility(0);
this.monitor_2dual.setZOrderMediaOverlay(false);
this.monitor_1dual.setZOrderMediaOverlay(true);
this.monitor_3dual.setZOrderMediaOverlay(true);
}
private void doswitchview(boolean z) {
int i;
if (HiTools.isAllScreenDevice(getActivity())) {
i = this.realSize.y - HiTools.getStatusBarHeight(getActivity());
Display defaultDisplay = getActivity().getWindowManager().getDefaultDisplay();
Point point = new Point();
defaultDisplay.getSize(point);
if (SystemUtils.isSamSungMobile(getActivity())) {
if (HiDataValue.isNavigationBarExist) {
i = point.x + HiTools.getNavigationBarHeight(getActivity());
} else if (i != point.x) {
i = point.x;
}
} else if (i < point.x) {
i = point.x;
}
} else {
i = this.realSize.y;
}
int i2 = this.realSize.x;
boolean z2 = this.misfull;
if (!z2) {
this.showType = 0;
this.isBallShowBig = true;
int i3 = i2 / 3;
this.monitor_1dual.screen_height = i3;
int i4 = i / 3;
this.monitor_1dual.screen_width = i4;
this.monitor_3dual.screen_height = i3;
this.monitor_3dual.screen_width = i4;
this.monitor_2dual.screen_height = i2;
this.monitor_2dual.screen_width = i;
this.rl_monitor.setLayoutParams(new LinearLayout.LayoutParams(i, i2));
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -2);
int i5 = (i2 * 2) / 3;
layoutParams.setMargins(0, i5, 0, 0);
this.mLayoutMonitor.setLayoutParams(layoutParams);
this.monitor_1dual.setLayoutParams(new RelativeLayout.LayoutParams(i4, i3));
this.monitor_1dual.setVisibility(0);
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(-1, i2);
this.rl_2monitor.setLayoutParams(layoutParams2);
this.monitor_2dual.setLayoutParams(layoutParams2);
this.rl_2monitor.setVisibility(0);
this.monitor_2dual.setVisibility(0);
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(i4, i3);
layoutParams3.addRule(21);
this.monitor_3dual.setLayoutParams(layoutParams3);
this.monitor_3dual.setVisibility(0);
RelativeLayout.LayoutParams layoutParams4 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams4.addRule(21);
layoutParams4.setMargins(0, i5, (i * 2) / 3, 0);
this.tv_osd_time1.setTextSize(0, HiTools.dip2px(getActivity(), 9.0f));
this.tv_osd_time1.setLayoutParams(layoutParams4);
this.tv_osd_time1.setVisibility(this.monitor_1dual.getVisibility());
RelativeLayout.LayoutParams layoutParams5 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams5.addRule(21);
layoutParams5.setMargins(0, i5, 0, 0);
this.tv_osd_time3.setTextSize(0, HiTools.dip2px(getActivity(), 9.0f));
this.tv_osd_time3.setLayoutParams(layoutParams5);
this.tv_osd_time3.setVisibility(this.monitor_3dual.getVisibility());
RelativeLayout.LayoutParams layoutParams6 = (RelativeLayout.LayoutParams) this.rl_closemonitor.getLayoutParams();
layoutParams6.setMargins(HiTools.dip2px(getActivity(), 10.0f), HiTools.dip2px(getActivity(), 5.0f) + i5, 0, 0);
this.rl_closemonitor.setLayoutParams(layoutParams6);
if (z) {
this.rl_closemonitor.setVisibility(0);
} else {
this.rl_closemonitor.setVisibility(8);
}
this.rl_close2monitor.setLayoutParams((RelativeLayout.LayoutParams) this.rl_close2monitor.getLayoutParams());
this.rl_close2monitor.setVisibility(8);
RelativeLayout.LayoutParams layoutParams7 = (RelativeLayout.LayoutParams) this.rl_close3monitor.getLayoutParams();
layoutParams7.addRule(21);
layoutParams7.setMargins(0, i5 + HiTools.dip2px(getActivity(), 5.0f), this.monitor_3dual.screen_width - HiTools.dip2px(getActivity(), 30.0f), 0);
this.rl_close3monitor.setLayoutParams(layoutParams7);
if (z) {
this.rl_close3monitor.setVisibility(0);
} else {
this.rl_close3monitor.setVisibility(8);
}
} else if (z2) {
this.showType = 1;
this.isBallShowBig = false;
int i6 = i2 / 2;
this.monitor_1dual.screen_height = i6;
int i7 = i / 2;
this.monitor_1dual.screen_width = i7;
this.monitor_3dual.screen_height = i6;
this.monitor_3dual.screen_width = i7;
int i8 = i2 / 3;
this.monitor_2dual.screen_height = i8;
int i9 = i / 3;
this.monitor_2dual.screen_width = i9;
this.rl_monitor.setLayoutParams(new LinearLayout.LayoutParams(i, i2));
RelativeLayout.LayoutParams layoutParams8 = new RelativeLayout.LayoutParams(-1, -2);
int i10 = i2 / 6;
layoutParams8.setMargins(0, i10, 0, 0);
this.mLayoutMonitor.setLayoutParams(layoutParams8);
this.monitor_1dual.setLayoutParams(new RelativeLayout.LayoutParams(i7, i6));
this.monitor_1dual.setVisibility(0);
RelativeLayout.LayoutParams layoutParams9 = new RelativeLayout.LayoutParams(-1, -2);
MyPlaybackGLMonitor myPlaybackGLMonitor = this.monitor_2dual;
layoutParams9.width = i9;
myPlaybackGLMonitor.screen_width = i9;
MyPlaybackGLMonitor myPlaybackGLMonitor2 = this.monitor_2dual;
layoutParams9.height = i8;
myPlaybackGLMonitor2.screen_height = i8;
int i11 = (i2 * 2) / 3;
layoutParams9.setMargins(i9, i11, 0, 0);
this.monitor_2dual.setLayoutParams(layoutParams9);
this.monitor_2dual.setVisibility(0);
RelativeLayout.LayoutParams layoutParams10 = new RelativeLayout.LayoutParams(-2, -2);
MyPlaybackGLMonitor myPlaybackGLMonitor3 = this.monitor_3dual;
layoutParams10.width = i7;
myPlaybackGLMonitor3.screen_width = i7;
MyPlaybackGLMonitor myPlaybackGLMonitor4 = this.monitor_3dual;
layoutParams10.height = i6;
myPlaybackGLMonitor4.screen_height = i6;
layoutParams10.addRule(21);
layoutParams10.setMargins(2, 0, 0, 0);
this.monitor_3dual.setLayoutParams(layoutParams10);
this.monitor_3dual.setVisibility(0);
RelativeLayout.LayoutParams layoutParams11 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams11.addRule(21);
layoutParams11.setMargins(0, i10, i7, 0);
this.tv_osd_time1.setTextSize(0, HiTools.dip2px(getActivity(), 12.0f));
this.tv_osd_time1.setLayoutParams(layoutParams11);
this.tv_osd_time1.setVisibility(this.monitor_1dual.getVisibility());
RelativeLayout.LayoutParams layoutParams12 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams12.addRule(21);
layoutParams12.setMargins(0, i10, 0, 0);
this.tv_osd_time3.setTextSize(0, HiTools.dip2px(getActivity(), 12.0f));
this.tv_osd_time3.setLayoutParams(layoutParams12);
this.tv_osd_time3.setVisibility(this.monitor_3dual.getVisibility());
this.rl_closemonitor.setVisibility(8);
RelativeLayout.LayoutParams layoutParams13 = (RelativeLayout.LayoutParams) this.rl_close2monitor.getLayoutParams();
layoutParams13.setMargins(i9 + HiTools.dip2px(getActivity(), 10.0f), i11 + HiTools.dip2px(getActivity(), 5.0f), 0, 0);
this.rl_close2monitor.setLayoutParams(layoutParams13);
this.rl_close2monitor.setVisibility(8);
this.rl_close3monitor.setVisibility(8);
}
initMatrix(this.monitor_1dual.screen_width, this.monitor_1dual.screen_height);
MyPlaybackGLMonitor myPlaybackGLMonitor5 = this.monitor_1dual;
myPlaybackGLMonitor5.setMatrix(myPlaybackGLMonitor5.left, this.monitor_1dual.bottom, this.monitor_1dual.width, this.monitor_1dual.height);
init3Matrix(this.monitor_3dual.screen_width, this.monitor_3dual.screen_height);
MyPlaybackGLMonitor myPlaybackGLMonitor6 = this.monitor_3dual;
myPlaybackGLMonitor6.setMatrix(myPlaybackGLMonitor6.left, this.monitor_3dual.bottom, this.monitor_3dual.width, this.monitor_3dual.height);
init2Matrix(this.monitor_2dual.screen_width, this.monitor_2dual.screen_height);
MyPlaybackGLMonitor myPlaybackGLMonitor7 = this.monitor_2dual;
myPlaybackGLMonitor7.setMatrix(myPlaybackGLMonitor7.left, this.monitor_2dual.bottom, this.monitor_2dual.width, this.monitor_2dual.height);
}
}