-13">
|
13
|
+import com.android.views.popup.BasePopupWindow;
|
|
14
|
+
|
|
15
|
+import ai.pai.client.R;
|
|
16
|
+import ai.pai.client.db.Preferences;
|
|
17
|
+import ai.pai.client.utils.PhotoLoader;
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+public class GatherInfoPopup extends BasePopupWindow {
|
|
21
|
+
|
|
22
|
+ private View popupView;
|
|
23
|
+ private ImageView gatherMap;
|
|
24
|
+ private TextView gatherInfoText;
|
|
25
|
+ private Context context;
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+ public GatherInfoPopup(Activity context) {
|
|
29
|
+ super(context);
|
|
30
|
+ this.context = context;
|
|
31
|
+ init();
|
|
32
|
+ }
|
|
33
|
+
|
|
34
|
+ @Override
|
|
35
|
+ protected Animation getShowAnimation() {
|
|
36
|
+ return getDefaultScaleAnimation();
|
|
37
|
+ }
|
|
38
|
+
|
|
39
|
+ @Override
|
|
40
|
+ protected View getClickToDismissView() {
|
|
41
|
+ return popupView.findViewById(R.id.click_to_dismiss);
|
|
42
|
+ }
|
|
43
|
+
|
|
44
|
+ @Override
|
|
45
|
+ public View getPopupView() {
|
|
46
|
+ popupView = LayoutInflater.from(mContext).inflate(R.layout.pop_gather_info, null);
|
|
47
|
+ gatherInfoText = (TextView) popupView.findViewById(R.id.tv_gather_info);
|
|
48
|
+ gatherMap = (ImageView) popupView.findViewById(R.id.iv_gather_map);
|
|
49
|
+ return popupView;
|
|
50
|
+ }
|
|
51
|
+
|
|
52
|
+ private void init(){
|
|
53
|
+ gatherInfoText.setText(context.getString(R.string.gather_info, TimeUtils.getGatherTimeStr(Preferences.getInstance(context).getGatherTime()),Preferences.getInstance(context).getTourGatherLocation()));
|
|
54
|
+ if(!TextUtils.isEmpty(Preferences.getInstance(context).getGatherMap())){
|
|
55
|
+ PhotoLoader.getInstance(context).displayImage(Preferences.getInstance(context).getGatherMap(),gatherMap);
|
|
56
|
+ }else{
|
|
57
|
+ gatherMap.setVisibility(View.GONE);
|
|
58
|
+ }
|
|
59
|
+ }
|
|
60
|
+
|
|
61
|
+ @Override
|
|
62
|
+ public View getAnimaView() {
|
|
63
|
+ return popupView.findViewById(R.id.popup_anima);
|
|
64
|
+ }
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+}
|
|
|
@@ -76,21 +76,4 @@
|
76
|
76
|
android:visibility="invisible"
|
77
|
77
|
android:background="@drawable/ic_gather"/>
|
78
|
78
|
|
79
|
|
-
|
80
|
|
- <TextView
|
81
|
|
- android:id="@+id/tv_gather_info"
|
82
|
|
- android:layout_width="wrap_content"
|
83
|
|
- android:layout_height="wrap_content"
|
84
|
|
- android:layout_gravity="bottom|start"
|
85
|
|
- android:gravity="center"
|
86
|
|
- android:textSize="16sp"
|
87
|
|
- android:padding="10dp"
|
88
|
|
- android:minHeight="60dp"
|
89
|
|
- android:visibility="invisible"
|
90
|
|
- android:textColor="@color/dark_grey"
|
91
|
|
- android:layout_marginRight="80dp"
|
92
|
|
- android:layout_marginLeft="80dp"
|
93
|
|
- android:layout_marginBottom="66dp"
|
94
|
|
- android:background="@drawable/round_edittext"/>
|
95
|
|
-
|
96
|
79
|
</android.support.design.widget.CoordinatorLayout>
|
|
|
@@ -0,0 +1,44 @@
|
|
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
|
+
|
|
12
|
+ <LinearLayout
|
|
13
|
+ android:id="@+id/popup_anima"
|
|
14
|
+ android:layout_width="match_parent"
|
|
15
|
+ android:layout_height="wrap_content"
|
|
16
|
+ android:layout_margin="20dp"
|
|
17
|
+ android:padding="8dp"
|
|
18
|
+ android:layout_centerInParent="true"
|
|
19
|
+ android:gravity="center"
|
|
20
|
+ android:background="@color/pop_bg_color"
|
|
21
|
+ android:orientation="vertical">
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+ <TextView
|
|
26
|
+ android:id="@+id/tv_gather_info"
|
|
27
|
+ android:layout_width="wrap_content"
|
|
28
|
+ android:layout_height="wrap_content"
|
|
29
|
+ android:textColor="@color/dark_grey"
|
|
30
|
+ android:layout_marginTop="4dp"
|
|
31
|
+ android:textSize="16sp" />
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+ <ImageView
|
|
35
|
+ android:id="@+id/iv_gather_map"
|
|
36
|
+ android:layout_width="240dp"
|
|
37
|
+ android:layout_height="240dp"
|
|
38
|
+ android:layout_marginTop="16dp"/>
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+ </LinearLayout>
|
|
42
|
+
|
|
43
|
+ </RelativeLayout>
|
|
44
|
+</RelativeLayout>
|