| | |
| | | import org.linphone.core.CoreListenerStub; |
| | | |
| | | /** |
| | | *监视页面 |
| | | * 监视页面 |
| | | */ |
| | | public class HDLLinphoneMonitorActivity extends LPCheckPermissionsActivity implements View.OnClickListener { |
| | | private static final String TAG = "HDLLinphoneMonitorActivity"; |
| | |
| | | |
| | | onDestroyLinphone(); |
| | | |
| | | HDLLog.i(TAG,"onDestroy"); |
| | | HDLLog.i(TAG, "onDestroy"); |
| | | |
| | | } |
| | | |
| | |
| | | video_lp_rendering = findViewById(R.id.video_lp_rendering); |
| | | video_lp_rendering2 = findViewById(R.id.video_lp_rendering2); |
| | | |
| | | setWidthHeightWithRatio(ll_video_lp_rendering,16,9); |
| | | setWidthHeightWithRatio(ll_video_lp_rendering, 16, 9); |
| | | } |
| | | |
| | | /** |
| | | * initData |
| | | */ |
| | | private void initData(){ |
| | | private void initData() { |
| | | Bundle extras = getIntent().getExtras(); |
| | | if(extras != null){ |
| | | String titleName = extras.getString(HDLLinphoneKit.KEY_TITLE_NAME); |
| | | if(!TextUtils.isEmpty(titleName)){ |
| | | if (extras != null) { |
| | | String titleName = extras.getString(HDLLinphoneKit.KEY_TITLE_NAME); |
| | | if (!TextUtils.isEmpty(titleName)) { |
| | | tv_lp_title.setText(titleName); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 初始化开门回调事件 |
| | | */ |
| | | void initCallBack(){ |
| | | void initCallBack() { |
| | | HDLLinphoneKit.getInstance().setOpenOpenDoorCallBack(new OnLPOpenDoorCallBack() { |
| | | @Override |
| | | public void onOpenSuccess() { |
| | |
| | | /** |
| | | * 初始化开锁屏蔽倒计时 |
| | | */ |
| | | void initCountDownTimer(){ |
| | | void initCountDownTimer() { |
| | | |
| | | mCountDownTimer = new CountDownTimer(10*1000, 1000) { |
| | | mCountDownTimer = new CountDownTimer(10 * 1000, 1000) { |
| | | @Override |
| | | public void onTick(long millisUntilFinished) { |
| | | if (!HDLLinphoneMonitorActivity.this.isFinishing()) { |
| | |
| | | private void onClickScreenshot() { |
| | | // Bitmap img = HDLImageUtils.createViewBitmap(video_lp_rendering); |
| | | Bitmap img = video_lp_rendering.getBitmap(); |
| | | boolean isSuccess = HDLImageUtils.saveImageToGallery(this, img); |
| | | boolean isSuccess = HDLImageUtils.saveImageToGallery(this, img); |
| | | |
| | | if(isSuccess){ |
| | | if (isSuccess) { |
| | | showToast(getString(R.string.lp_saveToTheAlbumsStr)); |
| | | }else { |
| | | } else { |
| | | showToast(getString(R.string.lp_operationFailedStr)); |
| | | } |
| | | } |
| | |
| | | iv_lp_unlock.setEnabled(false); |
| | | startOpenDoorCountdown(); |
| | | } |
| | | |
| | | /** |
| | | * 开启倒计时 |
| | | */ |
| | |
| | | core.addListener(mCoreListener); |
| | | core.enableMic(false);//关闭麦克风 |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * onDestroyLinphone |
| | | */ |
| | | void onDestroyLinphone(){ |
| | | void onDestroyLinphone() { |
| | | Core core = HDLLinphoneKit.getInstance().getCore(); |
| | | if (core != null) { |
| | | core.removeListener(mCoreListener); |