|
@@ -0,0 +1,108 @@
|
|
|
+/*
|
|
|
+ * Copyright (C) 2014 Android WallPad Project
|
|
|
+ *
|
|
|
+ * FileName : PopupMobileSync.java
|
|
|
+ * Project : 성북동 프로젝트
|
|
|
+ */
|
|
|
+
|
|
|
+package kr.co.icontrols.wallpadconfig.screen;
|
|
|
+
|
|
|
+import android.annotation.SuppressLint;
|
|
|
+import android.content.Context;
|
|
|
+import android.content.Intent;
|
|
|
+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 kr.co.icontrols.wallpadconfig.PopupActivity;
|
|
|
+import kr.co.icontrols.wallpadconfig.R;
|
|
|
+import kr.co.icontrols.wallpadconfig.declare.Common;
|
|
|
+import kr.co.icontrols.wallpadconfig.declare.ID;
|
|
|
+import kr.co.icontrols.wallpadsupport.WpadImageView;
|
|
|
+import kr.co.icontrols.wallpadsupport.WpadImageView.TOUCH_KIND;
|
|
|
+import kr.co.icontrols.wallpadsupport.WpadScreen;
|
|
|
+import kr.co.icontrols.wallpadsupport.WpadSound.SND;
|
|
|
+import kr.co.icontrols.wallpadsupport.WpadTextView;
|
|
|
+
|
|
|
+@SuppressLint("ViewConstructor")
|
|
|
+public class PopupMobileSync extends WpadScreen {
|
|
|
+ String TAG = "PopupAsCall";
|
|
|
+
|
|
|
+ // [Image]
|
|
|
+ WpadImageView Background, popupIcon, test;
|
|
|
+
|
|
|
+ // [Button]
|
|
|
+ WpadImageView OkBtn, CancelBtn, CloseBtn;
|
|
|
+
|
|
|
+ // [Text]
|
|
|
+ WpadTextView TitleText, Text1;
|
|
|
+
|
|
|
+ // [Variables]
|
|
|
+
|
|
|
+ public PopupMobileSync(Context context, RelativeLayout layout) {
|
|
|
+ super(context, layout);
|
|
|
+ Log.d(TAG, "[START - Screen] --------------------------------------------");
|
|
|
+ Background = new WpadImageView(context, TOUCH_KIND.NONE, 990, 680, R.drawable.popup_bg_a, 0, ID.popupMobileSync.image.BACKGROUND);
|
|
|
+ ViewRegistration(layout, Background, Common.PopupNomalMarginLEFT(145), Common.PopupNomalMarginTOP(60));
|
|
|
+
|
|
|
+ TitleText = new WpadTextView(context, false, 981, 90, Gravity.CENTER, Color.WHITE, Common.fontsize._46, true, ID.popupMobileSync.text.TITLE);
|
|
|
+ ViewRegistration(layout, TitleText, Common.PopupNomalMarginLEFT(145), Common.PopupNomalMarginTOP(60));
|
|
|
+ TitleText.setText("모바일기기 동기화");
|
|
|
+
|
|
|
+ OkBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 360, 80, R.drawable.popup_but_ok, R.drawable.popup_but_ok_p, ID.popupMobileSync.button.OK);
|
|
|
+ ViewRegistration(layout, OkBtn, Common.PopupNomalMarginLEFT(281), Common.PopupNomalMarginTOP(637));
|
|
|
+ CancelBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 360, 80, R.drawable.but_popup_cancel, R.drawable.but_popup_cancel_p, ID.popupMobileSync.button.CANCEL);
|
|
|
+ ViewRegistration(layout, CancelBtn, Common.PopupNomalMarginLEFT(651), Common.PopupNomalMarginTOP(637));
|
|
|
+ CloseBtn = new WpadImageView(context, TOUCH_KIND.BUTTON, 80, 80, R.drawable.topbar_icon_close_normal, R.drawable.topbar_icon_close_pressed, ID.popupMobileSync.button.CLOSE);
|
|
|
+ ViewRegistration(layout, CloseBtn, Common.PopupNomalMarginLEFT(1048), Common.PopupNomalMarginTOP(67));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //test = new WpadImageView(context, TOUCH_KIND.NONE, 990, 260, R.drawable.add_notice_bgr, 0, ID.popupMobileSync.image.IMAGE);
|
|
|
+ //ViewRegistration(layout, test, Common.PopupNomalMarginLEFT(147), Common.PopupNomalMarginTOP(152));
|
|
|
+
|
|
|
+ Text1 = new WpadTextView(context, false, 990, 260, Gravity.CENTER, Color.WHITE, Common.fontsize._46, true, ID.popupMobileSync.text.TEXT1);
|
|
|
+ ViewRegistration(layout, Text1, Common.PopupAlarmMarginLEFT(147), Common.PopupNomalMarginTOP(160));
|
|
|
+ Text1.setText("모든 월패드에 등록된 모바일 정보는\n해당 월패드 기준으로 동기화됩니다.\n동기화 하시겠습니까?");
|
|
|
+
|
|
|
+ popupIcon = new WpadImageView(context, TOUCH_KIND.NONE, 180, 180, R.drawable.icon_sync_1, 0, ID.popupMobileSync.image.IMAGE);
|
|
|
+ ViewRegistration(layout, popupIcon, Common.PopupNomalMarginLEFT(556), Common.PopupNomalMarginTOP(422));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onClose() {
|
|
|
+ super.onClose();
|
|
|
+ Log.d(TAG, "[END - Screen] ********************************************");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onTouchEvent(View v, MotionEvent event) {
|
|
|
+ super.onTouchEvent(v, event);
|
|
|
+
|
|
|
+ int TargetId = v.getId();
|
|
|
+ int MoveEvent = event.getAction();
|
|
|
+
|
|
|
+ if (MoveEvent == MotionEvent.ACTION_UP) {
|
|
|
+ if (TargetId == ID.popupMobileSync.button.OK) {
|
|
|
+ Sound().Play(SND.effect.TOUCH_LATCHED);
|
|
|
+ Log.d(TAG, "OK BUTTON !!!");
|
|
|
+ StartSync();
|
|
|
+ } else if (TargetId == ID.popupMobileSync.button.CANCEL || TargetId == ID.popupMobileSync.button.CLOSE) {
|
|
|
+ Sound().Play(SND.effect.TOUCH_LATCHED);
|
|
|
+ ((PopupActivity) (super.getContext())).finish();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 모바일 기기 등록 동기화를 MainActivity 에서 수행하도록 한다.
|
|
|
+ */
|
|
|
+ private void StartSync() {
|
|
|
+ Intent intent = new Intent();
|
|
|
+ ((PopupActivity) (super.getContext())).setResult(ID.popupMobileSync.ResultCode.OK, intent);
|
|
|
+ super.finish();
|
|
|
+ }
|
|
|
+}
|