s="lines-code">
+import android.webkit.WebViewClient;
+import android.widget.TextView;
+
+import com.android.views.progressbar.ProgressWheel;
+
+import ai.pai.lensman.R;
+import ai.pai.lensman.base.BaseActivity;
+import ai.pai.lensman.utils.SystemUtils;
+
+
+public class WebViewActivity extends BaseActivity implements View.OnClickListener {
+
+ private ProgressWheel spinner;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_webview);
+ SystemUtils.setImmerseLayout(this, findViewById(R.id.title_layout));
+
+ spinner = (ProgressWheel)findViewById(R.id.wheel_wait_http);
+
+ String url = getIntent().getStringExtra("url");
+ String title = getIntent().getStringExtra("title");
+ ((TextView) findViewById(R.id.title_bar_middle_txt)).setText(title);
+ findViewById(R.id.title_bar_back_layout).setOnClickListener(this);
+ findViewById(R.id.title_bar_option_layout).setVisibility(View.INVISIBLE);
+ WebView webView = (WebView) findViewById(R.id.webview_contract);
+ webView.getSettings().setJavaScriptEnabled(true);
+
+ spinner.setVisibility(View.VISIBLE);
+ spinner.startSpinning();
+
+ spinner.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ spinner.stopSpinning();
+ spinner.setVisibility(View.GONE);
+ }
+ },2000);
+ webView.setWebViewClient(new WebViewClient() {
+
+ @Override
+ public boolean shouldOverrideUrlLoading(WebView view, String url) {
+ view.loadUrl(url);
+ return true;
+ }
+
+ });
+ webView.setWebChromeClient(new WebChromeClient(){
+
+ @Override
+ public void onProgressChanged(WebView view, int newProgress) {
+ super.onProgressChanged(view, newProgress);
+ if(newProgress>90){
+ spinner.stopSpinning();
+ spinner.setVisibility(View.GONE);
+ }
+ }
+ });
+ webView.loadUrl(url);
+
+ }
+
+ @Override
+ public void onClick(View v) {
+ switch (v.getId()) {
+ case R.id.title_bar_back_layout:
+ finish();
+ break;
+ default:
+ break;
+ }
+ }
+}
@@ -1,12 +1,15 @@ |
||
1 | 1 |
package ai.pai.lensman.settings; |
2 | 2 |
|
3 |
+import android.content.Intent; |
|
3 | 4 |
import android.os.Bundle; |
4 | 5 |
import android.support.annotation.Nullable; |
5 |
-import android.support.v7.app.AppCompatActivity; |
|
6 | 6 |
import android.widget.EditText; |
7 | 7 |
import android.widget.Toast; |
8 | 8 |
|
9 | 9 |
import ai.pai.lensman.R; |
10 |
+import ai.pai.lensman.activities.AboutUsActivity; |
|
11 |
+import ai.pai.lensman.activities.FeedbackActivity; |
|
12 |
+import ai.pai.lensman.activities.WebViewActivity; |
|
10 | 13 |
import ai.pai.lensman.base.BaseActivity; |
11 | 14 |
import ai.pai.lensman.utils.BoxUrlContainer; |
12 | 15 |
import butterknife.BindView; |
@@ -33,17 +36,20 @@ public class SettingsActivity extends BaseActivity { |
||
33 | 36 |
|
34 | 37 |
@OnClick(R.id.layout_about_us) |
35 | 38 |
void go2About(){ |
36 |
- |
|
39 |
+ startActivity(new Intent(this, AboutUsActivity.class)); |
|
37 | 40 |
} |
38 | 41 |
|
39 | 42 |
@OnClick(R.id.layout_contact) |
40 | 43 |
void go2Contact(){ |
41 |
- |
|
44 |
+ Intent contactIntent = new Intent(this,WebViewActivity.class); |
|
45 |
+ contactIntent.putExtra("url","http://pai.ai/page/contact_us"); |
|
46 |
+ contactIntent.putExtra("title",getString(R.string.contact_us)); |
|
47 |
+ startActivity(contactIntent); |
|
42 | 48 |
} |
43 | 49 |
|
44 | 50 |
@OnClick(R.id.layout_feedback) |
45 | 51 |
void go2Feedback(){ |
46 |
- |
|
52 |
+ startActivity(new Intent(this, FeedbackActivity.class)); |
|
47 | 53 |
} |
48 | 54 |
|
49 | 55 |
@OnClick(R.id.btn_confirm_ip) |
@@ -39,5 +39,7 @@ public class UrlContainer { |
||
39 | 39 |
|
40 | 40 |
public static final String QUERY_ORDER_URL = HOST_URL+"l/query"; |
41 | 41 |
|
42 |
+ public static final String FEEDBACK_URL = HOST_URL +"op/feedback"; |
|
43 |
+ |
|
42 | 44 |
|
43 | 45 |
} |
@@ -0,0 +1,9 @@ |
||
1 |
+<?xml version="1.0" encoding="utf-8"?> |
|
2 |
+<selector xmlns:android="http://schemas.android.com/apk/res/android"> |
|
3 |
+ |
|
4 |
+ |
|
5 |
+ <item android:drawable="@color/colorPrimary" android:state_selected="true"></item> |
|
6 |
+ <item android:drawable="@color/colorPrimary" android:state_focused="true"></item> |
|
7 |
+ <item android:drawable="@color/silver" android:state_enabled="false" /> |
|
8 |
+ <item android:drawable="@color/colorPrimary"></item> |
|
9 |
+</selector> |
@@ -0,0 +1,117 @@ |
||
1 |
+<?xml version="1.0" encoding="utf-8"?> |
|
2 |
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
3 |
+ android:layout_width="match_parent" |
|
4 |
+ android:layout_height="match_parent" |
|
5 |
+ android:background="@color/white" |
|
6 |
+ android:orientation="vertical"> |
|
7 |
+ |
|
8 |
+ <RelativeLayout |
|
9 |
+ android:id="@+id/title_layout" |
|
10 |
+ android:layout_width="match_parent" |
|
11 |
+ android:layout_height="wrap_content" |
|
12 |
+ android:background="@color/colorPrimaryDark"> |
|
13 |
+ <include layout="@layout/title_bar_with_back_and_option" /> |
|
14 |
+ </RelativeLayout> |
|
15 |
+ |
|
16 |
+ <RelativeLayout |
|
17 |
+ android:layout_width="match_parent" |
|
18 |
+ android:layout_height="215dp" |
|
19 |
+ android:gravity="center_horizontal"> |
|
20 |
+ |
|
21 |
+ <ImageView |
|
22 |
+ android:layout_width="140dp" |
|
23 |
+ android:layout_height="140dp" |
|
24 |
+ android:layout_marginTop="51dp" |
|
25 |
+ android:src="@drawable/logo_in_about"/> |
|
26 |
+ </RelativeLayout> |
|
27 |
+ |
|
28 |
+ <LinearLayout |
|
29 |
+ android:id="@+id/layout_check_update" |
|
30 |
+ android:layout_width="match_parent" |
|
31 |
+ android:layout_height="44dp" |
|
32 |
+ android:paddingLeft="12dp" |
|
33 |
+ android:orientation="horizontal" |
|
34 |
+ android:background="@color/white" |
|
35 |
+ android:gravity="center_vertical"> |
|
36 |
+ |
|
37 |
+ <ImageView |
|
38 |
+ android:layout_width="32dp" |
|
39 |
+ android:layout_height="32dp" |
|
40 |
+ android:src="@drawable/about_update_app" |
|
41 |
+ /> |
|
42 |
+ |
|
43 |
+ <TextView |
|
44 |
+ android:layout_width="0dp" |
|
45 |
+ android:layout_weight="1" |
|
46 |
+ android:layout_height="wrap_content" |
|
47 |
+ android:text="@string/check_update" |
|
48 |
+ android:textSize="16sp" |
|
49 |
+ android:textColor="@color/dark_grey" |
|
50 |
+ android:layout_marginLeft="10dp"/> |
|
51 |
+ |
|
52 |
+ <ImageView |
|
53 |
+ android:layout_width="wrap_content" |
|
54 |
+ android:layout_height="wrap_content" |
|
55 |
+ android:layout_marginRight="12dp" |
|
56 |
+ android:layout_gravity="right|center_vertical" |
|
57 |
+ android:src="@drawable/arrow_right"/> |
|
58 |
+ </LinearLayout> |
|
59 |
+ |
|
60 |
+ |
|
61 |
+ <LinearLayout |
|
62 |
+ android:id="@+id/layout_about_declare" |
|
63 |
+ android:layout_width="match_parent" |
|
64 |
+ android:layout_height="44dp" |
|
65 |
+ android:paddingLeft="12dp" |
|
66 |
+ android:orientation="horizontal" |
|
67 |
+ android:background="@color/white" |
|
68 |
+ android:gravity="center_vertical"> |
|
69 |
+ |
|
70 |
+ <ImageView |
|
71 |
+ android:layout_width="32dp" |
|
72 |
+ android:layout_height="32dp" |
|
73 |
+ android:src="@drawable/about_contract" |
|
74 |
+ /> |
|
75 |
+ |
|
76 |
+ <TextView |
|
77 |
+ android:layout_width="0dp" |
|
78 |
+ android:layout_weight="1" |
|
79 |
+ android:layout_height="wrap_content" |
|
80 |
+ android:text="@string/contract" |
|
81 |
+ android:textSize="16sp" |
|
82 |
+ android:textColor="@color/dark_grey" |
|
83 |
+ android:layout_marginLeft="10dp"/> |
|
84 |
+ |
|
85 |
+ <ImageView |
|
86 |
+ android:layout_width="wrap_content" |
|
87 |
+ android:layout_height="wrap_content" |
|
88 |
+ android:layout_marginRight="12dp" |
|
89 |
+ android:layout_gravity="right|center_vertical" |
|
90 |
+ android:src="@drawable/arrow_right"/> |
|
91 |
+ </LinearLayout> |
|
92 |
+ |
|
93 |
+ |
|
94 |
+ <LinearLayout |
|
95 |
+ android:layout_width="match_parent" |
|
96 |
+ android:layout_height="match_parent" |
|
97 |
+ android:gravity="center|bottom" |
|
98 |
+ android:paddingBottom="8dp" |
|
99 |
+ android:orientation="vertical"> |
|
100 |
+ |
|
101 |
+ <TextView |
|
102 |
+ android:layout_width="wrap_content" |
|
103 |
+ android:layout_height="wrap_content" |
|
104 |
+ android:textColor="@color/grey" |
|
105 |
+ android:textSize="14sp" |
|
106 |
+ android:text="@string/copyright"/> |
|
107 |
+ |
|
108 |
+ <TextView |
|
109 |
+ android:layout_width="wrap_content" |
|
110 |
+ android:layout_height="wrap_content" |
|
111 |
+ android:padding="4dp" |
|
112 |
+ android:textColor="@color/grey" |
|
113 |
+ android:textSize="14sp" |
|
114 |
+ android:text="@string/company_name"/> |
|
115 |
+ |
|
116 |
+ </LinearLayout> |
|
117 |
+</LinearLayout> |
@@ -0,0 +1,41 @@ |
||
1 |
+<?xml version="1.0" encoding="utf-8"?> |
|
2 |
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
3 |
+ android:layout_width="match_parent" |
|
4 |
+ android:layout_height="match_parent" |
|
5 |
+ android:background="@color/background_light_grey_color" |
|
6 |
+ android:orientation="vertical"> |
|
7 |
+ |
|
8 |
+ <RelativeLayout |
|
9 |
+ android:id="@+id/title_layout" |
|
10 |
+ android:layout_width="match_parent" |
|
11 |
+ android:layout_height="wrap_content" |
|
12 |
+ android:background="@color/colorPrimaryDark"> |
|
13 |
+ <include layout="@layout/title_bar_with_back_and_option" /> |
|
14 |
+ </RelativeLayout> |
|
15 |
+ |
|
16 |
+ <EditText |
|
17 |
+ android:id="@+id/et_feedback_content" |
|
18 |
+ android:layout_width="match_parent" |
|
19 |
+ android:textSize="14sp" |
|
20 |
+ android:textColorHint="@color/grey" |
|
21 |
+ android:background="@color/white" |
|
22 |
+ android:textColor="@color/dark_grey" |
|
23 |
+ android:hint="@string/feedback_hint" |
|
24 |
+ android:paddingTop="10dp" |
|
25 |
+ android:paddingLeft="12dp" |
|
26 |
+ android:gravity="top" |
|
27 |
+ android:layout_height="120dp" /> |
|
28 |
+ |
|
29 |
+ <Button |
|
30 |
+ android:id="@+id/btn_feedback_send" |
|
31 |
+ android:layout_width="match_parent" |
|
32 |
+ android:layout_height="48dp" |
|
33 |
+ android:layout_marginTop="30dp" |
|
34 |
+ android:textColor="@color/white" |
|
35 |
+ android:textSize="20sp" |
|
36 |
+ android:enabled="false" |
|
37 |
+ android:background="@drawable/send_btn_bg_selector" |
|
38 |
+ android:text="@string/send"/> |
|
39 |
+ |
|
40 |
+ |
|
41 |
+</LinearLayout> |
@@ -0,0 +1,31 @@ |
||
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 |
+ xmlns:progress="http://schemas.android.com/apk/res-auto" |
|
6 |
+ android:background="@color/background_light_grey_color"> |
|
7 |
+ |
|
8 |
+ <RelativeLayout |
|
9 |
+ android:id="@+id/title_layout" |
|
10 |
+ android:layout_width="match_parent" |
|
11 |
+ android:layout_height="wrap_content" |
|
12 |
+ android:background="@color/colorPrimaryDark"> |
|
13 |
+ <include layout="@layout/title_bar_with_back_and_option" /> |
|
14 |
+ </RelativeLayout> |
|
15 |
+ |
|
16 |
+ <WebView |
|
17 |
+ android:id="@+id/webview_contract" |
|
18 |
+ android:layout_width="match_parent" |
|
19 |
+ android:layout_height="match_parent" |
|
20 |
+ android:layout_below="@id/title_layout"/> |
|
21 |
+ |
|
22 |
+ <com.android.views.progressbar.ProgressWheel |
|
23 |
+ android:id="@+id/wheel_wait_http" |
|
24 |
+ android:layout_width="80dp" |
|
25 |
+ android:layout_height="80dp" |
|
26 |
+ android:layout_centerInParent="true" |
|
27 |
+ android:visibility="gone" |
|
28 |
+ progress:textColor="@color/white" |
|
29 |
+ progress:barColor="@color/colorPrimary"/> |
|
30 |
+ |
|
31 |
+</RelativeLayout> |
@@ -0,0 +1,51 @@ |
||
1 |
+<?xml version="1.0" encoding="utf-8"?> |
|
2 |
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
3 |
+ android:id="@+id/title_bar_with_back_btn" |
|
4 |
+ android:layout_width="match_parent" |
|
5 |
+ android:layout_height="@dimen/action_bar_height" |
|
6 |
+ android:orientation="horizontal" |
|
7 |
+ android:background="@color/colorPrimary"> |
|
8 |
+ |
|
9 |
+ <LinearLayout |
|
10 |
+ android:id="@+id/title_bar_back_layout" |
|
11 |
+ android:layout_width="70dp" |
|
12 |
+ android:layout_height="match_parent" |
|
13 |
+ android:gravity="center_vertical" |
|
14 |
+ android:orientation="horizontal" |
|
15 |
+ android:paddingLeft="12dp"> |
|
16 |
+ |
|
17 |
+ <ImageView |
|
18 |
+ android:layout_width="32dp" |
|
19 |
+ android:layout_height="32dp" |
|
20 |
+ android:src="@drawable/back_selector" /> |
|
21 |
+ |
|
22 |
+ </LinearLayout> |
|
23 |
+ |
|
24 |
+ <TextView |
|
25 |
+ android:id="@+id/title_bar_middle_txt" |
|
26 |
+ android:layout_width="0dp" |
|
27 |
+ android:layout_height="match_parent" |
|
28 |
+ android:layout_weight="1" |
|
29 |
+ android:singleLine="true" |
|
30 |
+ android:gravity="center" |
|
31 |
+ android:paddingLeft="10dp" |
|
32 |
+ android:paddingRight="10dp" |
|
33 |
+ android:textColor="@color/white" |
|
34 |
+ android:textSize="@dimen/action_bar_title_large_text_size" /> |
|
35 |
+ |
|
36 |
+ <LinearLayout |
|
37 |
+ android:id="@+id/title_bar_option_layout" |
|
38 |
+ android:layout_width="70dp" |
|
39 |
+ android:layout_height="match_parent" |
|
40 |
+ android:gravity="center_vertical|right" |
|
41 |
+ android:orientation="horizontal" |
|
42 |
+ android:paddingRight="12dp"> |
|
43 |
+ |
|
44 |
+ <ImageView |
|
45 |
+ android:layout_width="32dp" |
|
46 |
+ android:layout_height="32dp" |
|
47 |
+ android:src="@drawable/option" /> |
|
48 |
+ |
|
49 |
+ </LinearLayout> |
|
50 |
+ |
|
51 |
+</LinearLayout> |
@@ -4,6 +4,7 @@ |
||
4 | 4 |
<color name="colorPrimaryDark">#2E78E5</color> |
5 | 5 |
<color name="colorAccent">#0BBE06</color> |
6 | 6 |
|
7 |
+ <color name="silver">#C0C0C0</color> |
|
7 | 8 |
<color name="light_blue">#1E90FF</color> |
8 | 9 |
<color name="white">#ffffffff</color> |
9 | 10 |
<color name="transparent">#00000000</color> |
@@ -1,6 +1,11 @@ |
||
1 | 1 |
<resources> |
2 | 2 |
<string name="app_name">拍爱</string> |
3 | 3 |
<string name="bar_app_name">拍爱摄影师版</string> |
4 |
+ |
|
5 |
+ <string name="version_text">拍爱 V1.0</string> |
|
6 |
+ <string name="copyright">Copyright © 2016 </string> |
|
7 |
+ <string name="company_name">北京佳艺徕经贸有限责任公司</string> |
|
8 |
+ |
|
4 | 9 |
<string name="bt_connected">已连接</string> |
5 | 10 |
<string name="bt_disconnected">已断开</string> |
6 | 11 |
<string name="briefs">简报</string> |
@@ -118,13 +123,21 @@ |
||
118 | 123 |
<string name="price_manage">价格管理</string> |
119 | 124 |
|
120 | 125 |
<string name="platform_price_rule">分成及结算规则</string> |
121 |
- |
|
126 |
+ |
|
122 | 127 |
<string name="feedback">意见反馈</string> |
123 |
- |
|
128 |
+ |
|
124 | 129 |
<string name="contact_us">联系我们</string> |
125 |
- |
|
130 |
+ |
|
126 | 131 |
<string name="about_us">关于我们</string> |
127 | 132 |
|
128 | 133 |
<string name="box_set_ip">BOX IP设置</string> |
129 | 134 |
|
135 |
+ <string name="send">发送</string> |
|
136 |
+ <string name="feedback_hint">您的建议是我们前进的动力</string> |
|
137 |
+ <string name="thank_feedback">已发送,感谢您的宝贵意见</string> |
|
138 |
+ <string name="check_update">检查更新</string> |
|
139 |
+ <string name="contract">用户协议</string> |
|
140 |
+ |
|
141 |
+ <string name="check_update_processing">正在检查更新</string> |
|
142 |
+ |
|
130 | 143 |
</resources> |