@@ -5,7 +5,7 @@ |
||
5 | 5 |
<GradleProjectSettings> |
6 | 6 |
<option name="distributionType" value="LOCAL" /> |
7 | 7 |
<option name="externalProjectPath" value="$PROJECT_DIR$" /> |
8 |
- <option name="gradleHome" value="C:/Android/gradle-3.3" /> |
|
8 |
+ <option name="gradleHome" value="C:/Android/gradle-3.5" /> |
|
9 | 9 |
<option name="modules"> |
10 | 10 |
<set> |
11 | 11 |
<option value="$PROJECT_DIR$" /> |
@@ -37,7 +37,7 @@ |
||
37 | 37 |
<ConfirmationsSetting value="0" id="Add" /> |
38 | 38 |
<ConfirmationsSetting value="0" id="Remove" /> |
39 | 39 |
</component> |
40 |
- <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8 (1)" project-jdk-type="JavaSDK"> |
|
40 |
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="JDK" project-jdk-type="JavaSDK"> |
|
41 | 41 |
<output url="file://$PROJECT_DIR$/build/classes" /> |
42 | 42 |
</component> |
43 | 43 |
<component name="ProjectType"> |
@@ -98,8 +98,8 @@ buildscript { |
||
98 | 98 |
classpath 'com.android.plugin.hotpatch:hotpatch:1.0.0' |
99 | 99 |
} |
100 | 100 |
} |
101 |
-apply plugin: 'plugin.hotpatch' |
|
102 |
- |
|
103 |
-hotpatch{ |
|
104 |
- includePackageDir='ai\\pai\\lensman' |
|
105 |
-} |
|
101 |
+//apply plugin: 'plugin.hotpatch' |
|
102 |
+// |
|
103 |
+//hotpatch{ |
|
104 |
+// includePackageDir='ai\\pai\\lensman' |
|
105 |
+//} |
@@ -27,6 +27,7 @@ import ai.pai.lensman.bean.SessionBean; |
||
27 | 27 |
import ai.pai.lensman.printer.PrinterSettingActivity; |
28 | 28 |
import ai.pai.lensman.qrcode.QRCaptureActivity; |
29 | 29 |
import ai.pai.lensman.utils.UmengEvent; |
30 |
+import ai.pai.lensman.views.ExitSessionConfirmPopup; |
|
30 | 31 |
import butterknife.BindView; |
31 | 32 |
import butterknife.ButterKnife; |
32 | 33 |
import butterknife.OnClick; |
@@ -129,15 +130,13 @@ public class SessionActivity extends BaseActivity implements SessionContract.Vie |
||
129 | 130 |
|
130 | 131 |
@OnClick(R.id.title_bar_back_layout) |
131 | 132 |
void backToMain(){ |
132 |
- presenter.stop(); |
|
133 |
- finish(); |
|
133 |
+ new ExitSessionConfirmPopup(this,this).showPopupWindow(); |
|
134 | 134 |
} |
135 | 135 |
|
136 | 136 |
@OnClick(R.id.btn_session_complete) |
137 | 137 |
void onSessionComplete(){ |
138 | 138 |
MobclickAgent.onEvent(this, UmengEvent.session_finish_btn_click); |
139 |
- presenter.stop(); |
|
140 |
- finish(); |
|
139 |
+ new ExitSessionConfirmPopup(this,this).showPopupWindow(); |
|
141 | 140 |
} |
142 | 141 |
|
143 | 142 |
@Override |
@@ -234,12 +233,16 @@ public class SessionActivity extends BaseActivity implements SessionContract.Vie |
||
234 | 233 |
startActivity(intent); |
235 | 234 |
}else if(view.getId()==R.id.tv_printer_set){ |
236 | 235 |
startActivity(new Intent(this, PrinterSettingActivity.class)); |
236 |
+ }else if(view.getId()==R.id.btn_exit_session_confirm){ |
|
237 |
+ presenter.stop(); |
|
238 |
+ finish(); |
|
237 | 239 |
} |
238 | 240 |
} |
239 | 241 |
|
240 | 242 |
@Override |
241 | 243 |
public void onBackPressed() { |
242 |
- presenter.stop(); |
|
243 |
- super.onBackPressed(); |
|
244 |
+ new ExitSessionConfirmPopup(this,this).showPopupWindow(); |
|
244 | 245 |
} |
246 |
+ |
|
247 |
+ |
|
245 | 248 |
} |
@@ -0,0 +1,69 @@ |
||
1 |
+package ai.pai.lensman.views; |
|
2 |
+ |
|
3 |
+import android.app.Activity; |
|
4 |
+import android.view.LayoutInflater; |
|
5 |
+import android.view.View; |
|
6 |
+import android.view.animation.Animation; |
|
7 |
+ |
|
8 |
+import com.android.views.popup.BasePopupWindow; |
|
9 |
+ |
|
10 |
+import ai.pai.lensman.R; |
|
11 |
+ |
|
12 |
+ |
|
13 |
+/** |
|
14 |
+ * Created by chengzhenyu on 2016/3/4. |
|
15 |
+ */ |
|
16 |
+public class ExitSessionConfirmPopup extends BasePopupWindow implements View.OnClickListener{ |
|
17 |
+ |
|
18 |
+ private View popupView; |
|
19 |
+ private View.OnClickListener listener; |
|
20 |
+ |
|
21 |
+ public ExitSessionConfirmPopup(Activity context, View.OnClickListener clickListener) { |
|
22 |
+ super(context); |
|
23 |
+ this.listener = clickListener; |
|
24 |
+ bindEvent(); |
|
25 |
+ } |
|
26 |
+ |
|
27 |
+ @Override |
|
28 |
+ protected Animation getShowAnimation() { |
|
29 |
+ return getDefaultScaleAnimation(); |
|
30 |
+ } |
|
31 |
+ |
|
32 |
+ @Override |
|
33 |
+ protected View getClickToDismissView() { |
|
34 |
+ return popupView.findViewById(R.id.click_to_dismiss); |
|
35 |
+ } |
|
36 |
+ |
|
37 |
+ @Override |
|
38 |
+ public View getPopupView() { |
|
39 |
+ popupView= LayoutInflater.from(mContext).inflate(R.layout.popup_exit_session_confirm,null); |
|
40 |
+ return popupView; |
|
41 |
+ } |
|
42 |
+ |
|
43 |
+ @Override |
|
44 |
+ public View getAnimaView() { |
|
45 |
+ return popupView.findViewById(R.id.popup_anima); |
|
46 |
+ } |
|
47 |
+ |
|
48 |
+ private void bindEvent() { |
|
49 |
+ if (popupView!=null){ |
|
50 |
+ popupView.findViewById(R.id.btn_cancel_delete).setOnClickListener(this); |
|
51 |
+ popupView.findViewById(R.id.btn_exit_session_confirm).setOnClickListener(this); |
|
52 |
+ } |
|
53 |
+ } |
|
54 |
+ |
|
55 |
+ @Override |
|
56 |
+ public void onClick(View v) { |
|
57 |
+ switch (v.getId()){ |
|
58 |
+ case R.id.btn_cancel_delete: |
|
59 |
+ dismiss(); |
|
60 |
+ break; |
|
61 |
+ case R.id.btn_exit_session_confirm: |
|
62 |
+ dismiss(); |
|
63 |
+ if(listener!=null){ |
|
64 |
+ listener.onClick(v); |
|
65 |
+ } |
|
66 |
+ break; |
|
67 |
+ } |
|
68 |
+ } |
|
69 |
+} |
@@ -0,0 +1,8 @@ |
||
1 |
+<?xml version="1.0" encoding="utf-8"?> |
|
2 |
+<selector xmlns:android="http://schemas.android.com/apk/res/android"> |
|
3 |
+ |
|
4 |
+ <item android:drawable="@drawable/btn_cancel_press" android:state_focused="true"/> |
|
5 |
+ <item android:drawable="@drawable/btn_cancel_press" android:state_pressed="true"/> |
|
6 |
+ <item android:drawable="@drawable/btn_cancel_normal"/> |
|
7 |
+ |
|
8 |
+</selector> |
@@ -0,0 +1,8 @@ |
||
1 |
+<?xml version="1.0" encoding="utf-8"?> |
|
2 |
+<selector xmlns:android="http://schemas.android.com/apk/res/android"> |
|
3 |
+ |
|
4 |
+ <item android:drawable="@drawable/pop_btn_ok_press" android:state_focused="true"/> |
|
5 |
+ <item android:drawable="@drawable/pop_btn_ok_press" android:state_pressed="true"/> |
|
6 |
+ <item android:drawable="@drawable/pop_btn_ok"/> |
|
7 |
+ |
|
8 |
+</selector> |
@@ -0,0 +1,86 @@ |
||
1 |
+<?xml version="1.0" encoding="utf-8"?> |
|
2 |
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
3 |
+ android:layout_width="match_parent" |
|
4 |
+ android:layout_height="match_parent"> |
|
5 |
+ |
|
6 |
+ <RelativeLayout |
|
7 |
+ android:id="@+id/click_to_dismiss" |
|
8 |
+ android:layout_width="match_parent" |
|
9 |
+ android:layout_height="match_parent" |
|
10 |
+ android:background="@color/popup_bg" |
|
11 |
+ android:paddingLeft="25dp" |
|
12 |
+ android:paddingRight="25dp"> |
|
13 |
+ |
|
14 |
+ <LinearLayout |
|
15 |
+ android:id="@+id/popup_anima" |
|
16 |
+ android:layout_width="280dp" |
|
17 |
+ android:layout_height="148dp" |
|
18 |
+ android:layout_centerInParent="true" |
|
19 |
+ android:background="@color/pop_bg_color" |
|
20 |
+ android:orientation="vertical"> |
|
21 |
+ |
|
22 |
+ |
|
23 |
+ <RelativeLayout |
|
24 |
+ android:layout_width="match_parent" |
|
25 |
+ android:layout_height="match_parent"> |
|
26 |
+ |
|
27 |
+ <TextView |
|
28 |
+ android:id="@+id/tv_pop_delete_title" |
|
29 |
+ android:layout_width="match_parent" |
|
30 |
+ android:layout_height="wrap_content" |
|
31 |
+ android:layout_marginTop="20dp" |
|
32 |
+ android:text="@string/exit_session_confirm" |
|
33 |
+ android:textColor="@color/black" |
|
34 |
+ android:layout_marginLeft="24dp" |
|
35 |
+ android:textSize="18sp" /> |
|
36 |
+ |
|
37 |
+ |
|
38 |
+ <TextView |
|
39 |
+ android:id="@+id/tv_pop_delete_hint" |
|
40 |
+ android:layout_width="match_parent" |
|
41 |
+ android:layout_height="wrap_content" |
|
42 |
+ android:layout_marginTop="56dp" |
|
43 |
+ android:layout_marginLeft="24dp" |
|
44 |
+ android:text="@string/exit_session_hint" |
|
45 |
+ android:textColor="@color/grey" |
|
46 |
+ android:textSize="16sp" /> |
|
47 |
+ |
|
48 |
+ |
|
49 |
+ |
|
50 |
+ <LinearLayout |
|
51 |
+ android:layout_width="match_parent" |
|
52 |
+ android:layout_height="wrap_content" |
|
53 |
+ android:layout_alignParentBottom="true" |
|
54 |
+ android:paddingBottom="14dp" |
|
55 |
+ android:gravity="center" |
|
56 |
+ android:orientation="horizontal"> |
|
57 |
+ |
|
58 |
+ |
|
59 |
+ <Button |
|
60 |
+ android:id="@+id/btn_cancel_delete" |
|
61 |
+ android:layout_width="120dp" |
|
62 |
+ android:layout_height="36dp" |
|
63 |
+ android:gravity="center" |
|
64 |
+ android:textColor="@color/dark_grey" |
|
65 |
+ android:background="@drawable/pop_btn_cancel_selector" |
|
66 |
+ android:text="@string/cancel" |
|
67 |
+ android:textSize="16sp" /> |
|
68 |
+ |
|
69 |
+ <Button |
|
70 |
+ android:id="@+id/btn_exit_session_confirm" |
|
71 |
+ android:layout_width="120dp" |
|
72 |
+ android:layout_height="36dp" |
|
73 |
+ android:gravity="center" |
|
74 |
+ android:textColor="@color/white" |
|
75 |
+ android:layout_marginLeft="8dp" |
|
76 |
+ android:background="@drawable/pop_btn_ok_selector" |
|
77 |
+ android:text="@string/ok" |
|
78 |
+ android:textSize="16sp" /> |
|
79 |
+ |
|
80 |
+ </LinearLayout> |
|
81 |
+ |
|
82 |
+ </RelativeLayout> |
|
83 |
+ </LinearLayout> |
|
84 |
+ </RelativeLayout> |
|
85 |
+ |
|
86 |
+</RelativeLayout> |
@@ -197,4 +197,10 @@ |
||
197 | 197 |
|
198 | 198 |
<string name="back_to_work">返回</string> |
199 | 199 |
|
200 |
+ <string name="exit_session_confirm">退出提示</string> |
|
201 |
+ |
|
202 |
+ <string name="exit_session_hint">确定要退出当前拍摄么</string> |
|
203 |
+ |
|
204 |
+ <string name="cancel">取消</string> |
|
205 |
+ |
|
200 | 206 |
</resources> |
@@ -16,7 +16,7 @@ org.gradle.parallel=true |
||
16 | 16 |
android.useDeprecatedNdk=true |
17 | 17 |
org.gradle.configureondemand=true |
18 | 18 |
|
19 |
-COMPILE_SDK_VERSION=24 |
|
19 |
+COMPILE_SDK_VERSION=23 |
|
20 | 20 |
BUILD_TOOLS_VERSION=25.0.2 |
21 | 21 |
MIN_SDK_VERSION=15 |
22 | 22 |
TARGET_SDK_VERSION=21 |