package kr.co.icontrols.wallpadcall.popup; import android.content.Context; import android.graphics.Color; import android.util.Log; import android.view.Gravity; import android.view.MotionEvent; import android.view.View; import android.widget.RelativeLayout; import com.util.LogUtil; import kr.co.icontrols.wallpadcall.MainActivity; import kr.co.icontrols.wallpadcall.R; import kr.co.icontrols.wallpadcall.declare.Common; import kr.co.icontrols.wallpadcall.declare.ID; import kr.co.icontrols.wallpadsupport.WpadImageView; import kr.co.icontrols.wallpadsupport.WpadScreen; import kr.co.icontrols.wallpadsupport.WpadSound; import kr.co.icontrols.wallpadsupport.WpadTextView; /** * 스마트현관카메라 거동수상자 사진촬영상 알림 팝업 */ public class NoticeTakePicture extends WpadScreen { private final String TAG = "NoticeTakePicture"; Context mContext; WpadImageView IMG_BACKGROUND; WpadImageView IMG_ICON; WpadImageView BTN_END; WpadTextView TXT_INSTRUCTION; WpadTextView TXT_INSTRUCTION2; String strINSTRUCTION = "거동수상자 사진 촬영중입니다."; String strINSTRUCTION2 = "사진 촬영을 종료하려면 종료버튼을 누르세요. 현재까지 촬영된 파일만 저장됩니다."; public NoticeTakePicture(Context context, RelativeLayout layout) { super(context, layout); try { mContext = context; IMG_BACKGROUND = new WpadImageView(context, WpadImageView.TOUCH_KIND.NONE, 990, 576, R.drawable.bg_popupalarm, 0, ID.POPUP.NOTICE_TAKEPICTURE.ELEMENT.IMAGE.BACKGROUND); ViewRegistration(layout, IMG_BACKGROUND, 0, 0); IMG_ICON = new WpadImageView(context, WpadImageView.TOUCH_KIND.NONE, 180, 180, R.drawable.icon_recording, 0, ID.POPUP.NOTICE_TAKEPICTURE.ELEMENT.IMAGE.ICON); ViewRegistration(layout, IMG_ICON, Common.PopupAlarmMarginLEFT(550), Common.PopupAlarmMarginTOP(283)); BTN_END = new WpadImageView(context, WpadImageView.TOUCH_KIND.BUTTON, 360, 80, R.drawable.popup_btn_end_normal, R.drawable.popup_btn_end_pressed,ID.POPUP.NOTICE_TAKEPICTURE.ELEMENT.BUTTON.END); ViewRegistration(layout, BTN_END, Common.PopupAlarmMarginLEFT(460), Common.PopupAlarmMarginTOP(585)); TXT_INSTRUCTION = new WpadTextView(context, false, 984, 90, Gravity.CENTER, Color.WHITE, Common.fontsize._44, true, ID.POPUP.NOTICE_TAKEPICTURE.ELEMENT.TEXT.INSTRUCTION); ViewRegistration(layout, TXT_INSTRUCTION, Common.PopupAlarmMarginLEFT(147), Common.PopupAlarmMarginTOP(119)); TXT_INSTRUCTION.setText(strINSTRUCTION); TXT_INSTRUCTION2 = new WpadTextView(context, false, 984, 90, Gravity.CENTER, Color.GRAY, Common.fontsize._20, false, ID.POPUP.NOTICE_TAKEPICTURE.ELEMENT.TEXT.INSTRUCTION2); ViewRegistration(layout, TXT_INSTRUCTION2, Common.PopupAlarmMarginLEFT(147), Common.PopupAlarmMarginTOP(500)); TXT_INSTRUCTION2.setText(strINSTRUCTION2); } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] NoticeTakePicture(Context context, RelativeLayout layout)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } @Override protected void onClose() { super.onClose(); try { Log.d(TAG, "[onClose]"); } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] onClose()"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } @Override protected void onTouchEvent(View v, MotionEvent event) { super.onTouchEvent(v, event); try { int nEvent = event.getAction(); int nID = v.getId(); if (nEvent == MotionEvent.ACTION_UP) { if (nID == ID.POPUP.NOTICE_TAKEPICTURE.ELEMENT.BUTTON.END) { Log.d(TAG, "[onTouchEvent] ID.POPUP.NOTICE_TAKEPICTURE.ELEMENT.BUTTON.END"); MainActivity.mSound.Play(WpadSound.SND.effect.TOUCH_LATCHED); finish(); } } } catch (RuntimeException re) { LogUtil.errorLogInfo("", TAG, re); } catch (Exception e) { Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)"); //e.printStackTrace(); LogUtil.errorLogInfo("", TAG, e); } } }