Commit 8510cba8ad85a904a2477185ab03eae7eccb7052
1 parent
f7a6aa86
Exists in
yxb_dev
and in
2 other branches
no message
Showing
8 changed files
with
215 additions
and
207 deletions
Show diff stats
app/src/main/AndroidManifest.xml
@@ -109,11 +109,10 @@ | @@ -109,11 +109,10 @@ | ||
109 | android:name=".ui.activity.binding.InviteCodeActivity" | 109 | android:name=".ui.activity.binding.InviteCodeActivity" |
110 | android:screenOrientation="portrait" /> | 110 | android:screenOrientation="portrait" /> |
111 | <activity | 111 | <activity |
112 | - android:name=".ui.activity.web.WebViewActivity" | 112 | + android:name=".ui.activity.mywebview.WebViewActivity" |
113 | android:screenOrientation="portrait" /> | 113 | android:screenOrientation="portrait" /> |
114 | <activity android:name=".ui.activity.consult.ConsultTwoLevelActivity" /> | 114 | <activity android:name=".ui.activity.consult.ConsultTwoLevelActivity" /> |
115 | <activity android:name=".ui.activity.orderdetail.OrderDetailActivity" /> | 115 | <activity android:name=".ui.activity.orderdetail.OrderDetailActivity" /> |
116 | - <activity android:name=".ui.activity.web.WebViewActivity"></activity> | ||
117 | </application> | 116 | </application> |
118 | 117 | ||
119 | </manifest> | 118 | </manifest> |
120 | \ No newline at end of file | 119 | \ No newline at end of file |
app/src/main/java/com/shunzhi/parent/presenter/ceping/CePingPresenter.java
@@ -10,7 +10,7 @@ import com.shunzhi.parent.R; | @@ -10,7 +10,7 @@ import com.shunzhi.parent.R; | ||
10 | import com.shunzhi.parent.bean.ToolBean; | 10 | import com.shunzhi.parent.bean.ToolBean; |
11 | import com.shunzhi.parent.contract.ceping.CepingContract; | 11 | import com.shunzhi.parent.contract.ceping.CepingContract; |
12 | import com.shunzhi.parent.model.CePingModel; | 12 | import com.shunzhi.parent.model.CePingModel; |
13 | -import com.shunzhi.parent.ui.activity.web.WebViewActivity; | 13 | +import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; |
14 | import com.shunzhi.parent.util.AttrsUtils; | 14 | import com.shunzhi.parent.util.AttrsUtils; |
15 | import com.shunzhi.parent.views.TextAndImgShowView; | 15 | import com.shunzhi.parent.views.TextAndImgShowView; |
16 | 16 |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/CheckInfoActivity.java
@@ -25,7 +25,6 @@ import com.shunzhi.parent.bean.CurrentBean; | @@ -25,7 +25,6 @@ import com.shunzhi.parent.bean.CurrentBean; | ||
25 | import com.shunzhi.parent.contract.mine.MyChildContract; | 25 | import com.shunzhi.parent.contract.mine.MyChildContract; |
26 | import com.shunzhi.parent.presenter.mine.MyChildPresenter; | 26 | import com.shunzhi.parent.presenter.mine.MyChildPresenter; |
27 | import com.shunzhi.parent.ui.activity.MyChildActivity; | 27 | import com.shunzhi.parent.ui.activity.MyChildActivity; |
28 | -import com.shunzhi.parent.ui.activity.web.WebViewActivity; | ||
29 | 28 | ||
30 | import java.util.List; | 29 | import java.util.List; |
31 | 30 | ||
@@ -150,7 +149,7 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC | @@ -150,7 +149,7 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC | ||
150 | 149 | ||
151 | @Override | 150 | @Override |
152 | public void addChildSuccess() { | 151 | public void addChildSuccess() { |
153 | - WebViewActivity.start_show(CheckInfoActivity.this,AppConfig.BINDING_SUCCESS_HEZUO); | 152 | +// WebViewActivity.start_show(CheckInfoActivity.this,AppConfig.BINDING_SUCCESS_HEZUO); |
154 | finish(); | 153 | finish(); |
155 | } | 154 | } |
156 | 155 |
app/src/main/java/com/shunzhi/parent/ui/activity/mywebview/WebViewActivity.java
0 → 100644
@@ -0,0 +1,200 @@ | @@ -0,0 +1,200 @@ | ||
1 | +package com.shunzhi.parent.ui.activity.mywebview; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | +import android.content.Intent; | ||
5 | +import android.graphics.Bitmap; | ||
6 | +import android.os.Bundle; | ||
7 | +import android.support.v7.app.AppCompatActivity; | ||
8 | +import android.view.View; | ||
9 | +import android.webkit.JavascriptInterface; | ||
10 | +import android.webkit.WebChromeClient; | ||
11 | +import android.webkit.WebSettings; | ||
12 | +import android.webkit.WebView; | ||
13 | +import android.webkit.WebViewClient; | ||
14 | +import android.widget.ProgressBar; | ||
15 | + | ||
16 | +import com.share.mvpsdk.utils.AppUtils; | ||
17 | +import com.share.mvpsdk.utils.NetworkConnectionUtils; | ||
18 | +import com.share.mvpsdk.widgets.NestedScrollWebView; | ||
19 | +import com.shunzhi.parent.R; | ||
20 | + | ||
21 | +public class WebViewActivity extends AppCompatActivity { | ||
22 | + | ||
23 | + NestedScrollWebView nesteScrollWebView; | ||
24 | + | ||
25 | + private ProgressBar pvWeb; | ||
26 | + | ||
27 | + public static void getInstance(Context context,String url) { | ||
28 | + Intent intent = new Intent(context, WebViewActivity.class); | ||
29 | + intent.putExtra("url", url); | ||
30 | + context.startActivity(intent); | ||
31 | + } | ||
32 | + | ||
33 | + @Override | ||
34 | + protected void initView(Bundle savedInstanceState) { | ||
35 | + nesteScrollWebView=findViewById(R.id.nesteScrollWebView); | ||
36 | + pvWeb=findViewById(R.id.pb_web); | ||
37 | + initWebView(); | ||
38 | + initWebSetting(nesteScrollWebView.getSettings()); | ||
39 | + nesteScrollWebView.loadUrl(getIntent().getStringExtra("url")); | ||
40 | + } | ||
41 | + | ||
42 | + @Override | ||
43 | + protected int getLayoutId() { | ||
44 | + return R.layout.activity_web_view; | ||
45 | + } | ||
46 | + | ||
47 | + @Override | ||
48 | + public void onBackPressedSupport() { | ||
49 | + if (nesteScrollWebView.canGoBack()){ | ||
50 | + nesteScrollWebView.goBack(); | ||
51 | + }else { | ||
52 | + super.onBackPressedSupport(); | ||
53 | + } | ||
54 | + } | ||
55 | + | ||
56 | + /** | ||
57 | + * js接口 | ||
58 | + */ | ||
59 | + public class SupportJavascriptInterface { | ||
60 | + private Context context; | ||
61 | + | ||
62 | + public SupportJavascriptInterface(Context context) { | ||
63 | + this.context = context; | ||
64 | + } | ||
65 | + | ||
66 | + @JavascriptInterface | ||
67 | + public void openImage(final String img) { | ||
68 | + AppUtils.runOnUIThread(new Runnable() { | ||
69 | + @Override | ||
70 | + public void run() { | ||
71 | +// gotoImageBrowse(img); | ||
72 | + } | ||
73 | + }); | ||
74 | + } | ||
75 | + } | ||
76 | + | ||
77 | + protected void initWebView() { | ||
78 | + // 添加js交互接口类,并起别名 imagelistner | ||
79 | + nesteScrollWebView.addJavascriptInterface(new SupportJavascriptInterface(this), | ||
80 | + "imagelistner"); | ||
81 | + nesteScrollWebView.setWebViewClient(new WebViewClient() { | ||
82 | + @Override | ||
83 | + public boolean shouldOverrideUrlLoading(WebView view, String url) { | ||
84 | + view.loadUrl(url); | ||
85 | + return true; | ||
86 | + } | ||
87 | + | ||
88 | + @Override | ||
89 | + public void onPageFinished(WebView view, String url) { | ||
90 | + view.getSettings().setJavaScriptEnabled(true); | ||
91 | + super.onPageFinished(view, url); | ||
92 | + // html加载完成之后,添加监听图片的点击js函数 | ||
93 | + addWebImageClickListner(view); | ||
94 | +// toolbar.setTitle(getToolbarTitle()); | ||
95 | + } | ||
96 | + | ||
97 | + @Override | ||
98 | + public void onPageStarted(WebView view, String url, Bitmap favicon) { | ||
99 | + view.getSettings().setJavaScriptEnabled(true); | ||
100 | + super.onPageStarted(view, url, favicon); | ||
101 | + } | ||
102 | + | ||
103 | + // 注入js函数监听 | ||
104 | + protected void addWebImageClickListner(WebView webView) { | ||
105 | + // 这段js函数的功能就是,遍历所有的img节点,并添加onclick函数, | ||
106 | + // 函数的功能是在图片点击的时候调用本地java接口并传递url过去 | ||
107 | + webView.loadUrl("javascript:(function(){" + | ||
108 | + "var objs = document.getElementsByTagName(\"img\"); " + | ||
109 | + "for(var i=0;i<objs.length;i++) " + | ||
110 | + "{" | ||
111 | + + " objs[i].onclick=function() " + | ||
112 | + " { " | ||
113 | + + " window.imagelistner.openImage(this.src); " + | ||
114 | + " } " + | ||
115 | + "}" + | ||
116 | + "})()"); | ||
117 | + } | ||
118 | + }); | ||
119 | + | ||
120 | + nesteScrollWebView.setWebChromeClient(new WebChromeClient() { | ||
121 | + @Override | ||
122 | + public void onProgressChanged(WebView view, int newProgress) { | ||
123 | + if (newProgress == 100) { | ||
124 | + pvWeb.setVisibility(View.GONE);//加载完网页进度条消失 | ||
125 | + } else { | ||
126 | + pvWeb.setVisibility(View.VISIBLE);//开始加载网页时显示进度条 | ||
127 | + pvWeb.setProgress(newProgress);//设置进度值 | ||
128 | + } | ||
129 | + } | ||
130 | + }); | ||
131 | + | ||
132 | + nesteScrollWebView.setOnLongClickListener(new View.OnLongClickListener() { | ||
133 | + @Override | ||
134 | + public boolean onLongClick(View v) { | ||
135 | + WebView.HitTestResult result = ((WebView) v).getHitTestResult(); | ||
136 | + if (null == result) | ||
137 | + return false; | ||
138 | + | ||
139 | +// mPresenter.imageLongClicked(result); | ||
140 | +// mImgurl = result.getExtra(); | ||
141 | + | ||
142 | + return true; | ||
143 | + } | ||
144 | + }); | ||
145 | + | ||
146 | +// nswvDetailContent.setOnTouchListener(WebViewOnTouchListener); | ||
147 | + } | ||
148 | + | ||
149 | + | ||
150 | + /** | ||
151 | + * 初始化WebSetting | ||
152 | + * | ||
153 | + * @param settings WebSetting | ||
154 | + */ | ||
155 | + protected void initWebSetting(WebSettings settings) { | ||
156 | + // 缩放至屏幕的大小 | ||
157 | + settings.setLoadWithOverviewMode(true); | ||
158 | + // 保存表单数据 | ||
159 | + settings.setSaveFormData(true); | ||
160 | + // 是否应该支持使用其屏幕缩放控件和手势缩放 | ||
161 | + settings.setSupportZoom(true); | ||
162 | + // //是否支持手势缩放控制 | ||
163 | + // settings.setBuiltInZoomControls(true); | ||
164 | + // 是否隐藏原生的缩放控件 | ||
165 | + // settings.setDisplayZoomControls(false); | ||
166 | + // 启动应用缓存 | ||
167 | + settings.setAppCacheEnabled(true); | ||
168 | + // 排版适应屏幕,只显示一列 | ||
169 | + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN); | ||
170 | + // settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); | ||
171 | + // 页面加载好以后,再放开图片 | ||
172 | + settings.setBlockNetworkImage(false); | ||
173 | + // 使用localStorage则必须打开 | ||
174 | + settings.setDomStorageEnabled(true); | ||
175 | + settings.setDatabaseEnabled(true); | ||
176 | + // WebView启用JavaScript执行。默认的是false。 | ||
177 | + settings.setJavaScriptEnabled(true); // 设置支持javascript脚本 | ||
178 | + settings.setJavaScriptCanOpenWindowsAutomatically(true);//设置支持js脚本 | ||
179 | + if (NetworkConnectionUtils.isConnected(mContext)) { | ||
180 | + settings.setCacheMode(WebSettings.LOAD_DEFAULT); | ||
181 | + } else { | ||
182 | + settings.setCacheMode(WebSettings.LOAD_CACHE_ONLY); | ||
183 | + } | ||
184 | + | ||
185 | + // settings.setBlockNetworkImage(false); | ||
186 | + // settings.setAppCacheEnabled(true); | ||
187 | + // settings.setDomStorageEnabled(true); | ||
188 | + // settings.setDatabaseEnabled(true); | ||
189 | + // if (NetworkConnectionUtils.isConnected(mContext)) { | ||
190 | + // settings.setCacheMode(WebSettings.LOAD_DEFAULT); | ||
191 | + // } else { | ||
192 | + // settings.setCacheMode(WebSettings.LOAD_CACHE_ONLY); | ||
193 | + // } | ||
194 | + // settings.setJavaScriptEnabled(true); | ||
195 | + // settings.setLoadWithOverviewMode(true); | ||
196 | + // settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN); | ||
197 | + // settings.setSupportZoom(true); | ||
198 | + } | ||
199 | + | ||
200 | +} |
app/src/main/java/com/shunzhi/parent/ui/activity/web/WebViewActivity.java
@@ -1,200 +0,0 @@ | @@ -1,200 +0,0 @@ | ||
1 | -package com.shunzhi.parent.ui.activity.web; | ||
2 | - | ||
3 | -import android.content.Context; | ||
4 | -import android.content.Intent; | ||
5 | -import android.graphics.Bitmap; | ||
6 | -import android.os.Bundle; | ||
7 | -import android.view.View; | ||
8 | -import android.webkit.JavascriptInterface; | ||
9 | -import android.webkit.WebChromeClient; | ||
10 | -import android.webkit.WebSettings; | ||
11 | -import android.webkit.WebView; | ||
12 | -import android.webkit.WebViewClient; | ||
13 | -import android.widget.ProgressBar; | ||
14 | - | ||
15 | -import com.share.mvpsdk.base.activity.BaseCompatActivity; | ||
16 | -import com.share.mvpsdk.utils.AppUtils; | ||
17 | -import com.share.mvpsdk.utils.NetworkConnectionUtils; | ||
18 | -import com.share.mvpsdk.widgets.NestedScrollWebView; | ||
19 | -import com.shunzhi.parent.R; | ||
20 | - | ||
21 | -public class WebViewActivity extends BaseCompatActivity { | ||
22 | - | ||
23 | - NestedScrollWebView nesteScrollWebView; | ||
24 | - | ||
25 | - private ProgressBar pvWeb; | ||
26 | - | ||
27 | - public static void getInstance(Context context,String url) { | ||
28 | - Intent intent = new Intent(context, WebViewActivity.class); | ||
29 | - intent.putExtra("url", url); | ||
30 | - context.startActivity(intent); | ||
31 | - } | ||
32 | - | ||
33 | - @Override | ||
34 | - protected void initView(Bundle savedInstanceState) { | ||
35 | - nesteScrollWebView=findViewById(R.id.nesteScrollWebView); | ||
36 | - pvWeb=findViewById(R.id.pb_web); | ||
37 | - initWebView(); | ||
38 | - initWebSetting(nesteScrollWebView.getSettings()); | ||
39 | - nesteScrollWebView.loadUrl(getIntent().getStringExtra("url")); | ||
40 | - } | ||
41 | - | ||
42 | - @Override | ||
43 | - protected int getLayoutId() { | ||
44 | - return R.layout.activity_web_view; | ||
45 | - } | ||
46 | - | ||
47 | - @Override | ||
48 | - public void onBackPressedSupport() { | ||
49 | - if (nesteScrollWebView.canGoBack()){ | ||
50 | - nesteScrollWebView.goBack(); | ||
51 | - }else { | ||
52 | - super.onBackPressedSupport(); | ||
53 | - } | ||
54 | - } | ||
55 | - | ||
56 | - /** | ||
57 | - * js接口 | ||
58 | - */ | ||
59 | - public class SupportJavascriptInterface { | ||
60 | - private Context context; | ||
61 | - | ||
62 | - public SupportJavascriptInterface(Context context) { | ||
63 | - this.context = context; | ||
64 | - } | ||
65 | - | ||
66 | - @JavascriptInterface | ||
67 | - public void openImage(final String img) { | ||
68 | - AppUtils.runOnUIThread(new Runnable() { | ||
69 | - @Override | ||
70 | - public void run() { | ||
71 | -// gotoImageBrowse(img); | ||
72 | - } | ||
73 | - }); | ||
74 | - } | ||
75 | - } | ||
76 | - | ||
77 | - protected void initWebView() { | ||
78 | - // 添加js交互接口类,并起别名 imagelistner | ||
79 | - nesteScrollWebView.addJavascriptInterface(new SupportJavascriptInterface(this), | ||
80 | - "imagelistner"); | ||
81 | - nesteScrollWebView.setWebViewClient(new WebViewClient() { | ||
82 | - @Override | ||
83 | - public boolean shouldOverrideUrlLoading(WebView view, String url) { | ||
84 | - view.loadUrl(url); | ||
85 | - return true; | ||
86 | - } | ||
87 | - | ||
88 | - @Override | ||
89 | - public void onPageFinished(WebView view, String url) { | ||
90 | - view.getSettings().setJavaScriptEnabled(true); | ||
91 | - super.onPageFinished(view, url); | ||
92 | - // html加载完成之后,添加监听图片的点击js函数 | ||
93 | - addWebImageClickListner(view); | ||
94 | -// toolbar.setTitle(getToolbarTitle()); | ||
95 | - } | ||
96 | - | ||
97 | - @Override | ||
98 | - public void onPageStarted(WebView view, String url, Bitmap favicon) { | ||
99 | - view.getSettings().setJavaScriptEnabled(true); | ||
100 | - super.onPageStarted(view, url, favicon); | ||
101 | - } | ||
102 | - | ||
103 | - // 注入js函数监听 | ||
104 | - protected void addWebImageClickListner(WebView webView) { | ||
105 | - // 这段js函数的功能就是,遍历所有的img节点,并添加onclick函数, | ||
106 | - // 函数的功能是在图片点击的时候调用本地java接口并传递url过去 | ||
107 | - webView.loadUrl("javascript:(function(){" + | ||
108 | - "var objs = document.getElementsByTagName(\"img\"); " + | ||
109 | - "for(var i=0;i<objs.length;i++) " + | ||
110 | - "{" | ||
111 | - + " objs[i].onclick=function() " + | ||
112 | - " { " | ||
113 | - + " window.imagelistner.openImage(this.src); " + | ||
114 | - " } " + | ||
115 | - "}" + | ||
116 | - "})()"); | ||
117 | - } | ||
118 | - }); | ||
119 | - | ||
120 | - nesteScrollWebView.setWebChromeClient(new WebChromeClient() { | ||
121 | - @Override | ||
122 | - public void onProgressChanged(WebView view, int newProgress) { | ||
123 | - if (newProgress == 100) { | ||
124 | - pvWeb.setVisibility(View.GONE);//加载完网页进度条消失 | ||
125 | - } else { | ||
126 | - pvWeb.setVisibility(View.VISIBLE);//开始加载网页时显示进度条 | ||
127 | - pvWeb.setProgress(newProgress);//设置进度值 | ||
128 | - } | ||
129 | - } | ||
130 | - }); | ||
131 | - | ||
132 | - nesteScrollWebView.setOnLongClickListener(new View.OnLongClickListener() { | ||
133 | - @Override | ||
134 | - public boolean onLongClick(View v) { | ||
135 | - WebView.HitTestResult result = ((WebView) v).getHitTestResult(); | ||
136 | - if (null == result) | ||
137 | - return false; | ||
138 | - | ||
139 | -// mPresenter.imageLongClicked(result); | ||
140 | -// mImgurl = result.getExtra(); | ||
141 | - | ||
142 | - return true; | ||
143 | - } | ||
144 | - }); | ||
145 | - | ||
146 | -// nswvDetailContent.setOnTouchListener(WebViewOnTouchListener); | ||
147 | - } | ||
148 | - | ||
149 | - | ||
150 | - /** | ||
151 | - * 初始化WebSetting | ||
152 | - * | ||
153 | - * @param settings WebSetting | ||
154 | - */ | ||
155 | - protected void initWebSetting(WebSettings settings) { | ||
156 | - // 缩放至屏幕的大小 | ||
157 | - settings.setLoadWithOverviewMode(true); | ||
158 | - // 保存表单数据 | ||
159 | - settings.setSaveFormData(true); | ||
160 | - // 是否应该支持使用其屏幕缩放控件和手势缩放 | ||
161 | - settings.setSupportZoom(true); | ||
162 | - // //是否支持手势缩放控制 | ||
163 | - // settings.setBuiltInZoomControls(true); | ||
164 | - // 是否隐藏原生的缩放控件 | ||
165 | - // settings.setDisplayZoomControls(false); | ||
166 | - // 启动应用缓存 | ||
167 | - settings.setAppCacheEnabled(true); | ||
168 | - // 排版适应屏幕,只显示一列 | ||
169 | - settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN); | ||
170 | - // settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); | ||
171 | - // 页面加载好以后,再放开图片 | ||
172 | - settings.setBlockNetworkImage(false); | ||
173 | - // 使用localStorage则必须打开 | ||
174 | - settings.setDomStorageEnabled(true); | ||
175 | - settings.setDatabaseEnabled(true); | ||
176 | - // WebView启用JavaScript执行。默认的是false。 | ||
177 | - settings.setJavaScriptEnabled(true); // 设置支持javascript脚本 | ||
178 | - settings.setJavaScriptCanOpenWindowsAutomatically(true);//设置支持js脚本 | ||
179 | - if (NetworkConnectionUtils.isConnected(mContext)) { | ||
180 | - settings.setCacheMode(WebSettings.LOAD_DEFAULT); | ||
181 | - } else { | ||
182 | - settings.setCacheMode(WebSettings.LOAD_CACHE_ONLY); | ||
183 | - } | ||
184 | - | ||
185 | - // settings.setBlockNetworkImage(false); | ||
186 | - // settings.setAppCacheEnabled(true); | ||
187 | - // settings.setDomStorageEnabled(true); | ||
188 | - // settings.setDatabaseEnabled(true); | ||
189 | - // if (NetworkConnectionUtils.isConnected(mContext)) { | ||
190 | - // settings.setCacheMode(WebSettings.LOAD_DEFAULT); | ||
191 | - // } else { | ||
192 | - // settings.setCacheMode(WebSettings.LOAD_CACHE_ONLY); | ||
193 | - // } | ||
194 | - // settings.setJavaScriptEnabled(true); | ||
195 | - // settings.setLoadWithOverviewMode(true); | ||
196 | - // settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN); | ||
197 | - // settings.setSupportZoom(true); | ||
198 | - } | ||
199 | - | ||
200 | -} |
app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java
@@ -23,10 +23,11 @@ import com.shunzhi.parent.presenter.mine.MinePresenter; | @@ -23,10 +23,11 @@ import com.shunzhi.parent.presenter.mine.MinePresenter; | ||
23 | import com.shunzhi.parent.ui.activity.MyChildActivity; | 23 | import com.shunzhi.parent.ui.activity.MyChildActivity; |
24 | import com.shunzhi.parent.ui.activity.PersonInfoActivity; | 24 | import com.shunzhi.parent.ui.activity.PersonInfoActivity; |
25 | import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; | 25 | import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; |
26 | +import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | ||
26 | 27 | ||
27 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> | 28 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> |
28 | implements MineContract.IMineView, View.OnClickListener { | 29 | implements MineContract.IMineView, View.OnClickListener { |
29 | - LinearLayout childlayout, personinfo,layout_orderDetail; | 30 | + LinearLayout childlayout, personinfo,layout_orderDetail,layout_order; |
30 | RoundedImageView user_photo; | 31 | RoundedImageView user_photo; |
31 | TextView user_name, user_mobile; | 32 | TextView user_name, user_mobile; |
32 | 33 | ||
@@ -45,9 +46,11 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -45,9 +46,11 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
45 | public void initUI(View view, @Nullable Bundle savedInstanceState) { | 46 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
46 | childlayout = view.findViewById(R.id.childlayout); | 47 | childlayout = view.findViewById(R.id.childlayout); |
47 | personinfo = view.findViewById(R.id.personinfo); | 48 | personinfo = view.findViewById(R.id.personinfo); |
49 | + layout_order=view.findViewById(R.id.layout_order); | ||
48 | layout_orderDetail=view.findViewById(R.id.layout_orderDetail); | 50 | layout_orderDetail=view.findViewById(R.id.layout_orderDetail); |
49 | childlayout.setOnClickListener(this); | 51 | childlayout.setOnClickListener(this); |
50 | personinfo.setOnClickListener(this); | 52 | personinfo.setOnClickListener(this); |
53 | + layout_order.setOnClickListener(this); | ||
51 | layout_orderDetail.setOnClickListener(this); | 54 | layout_orderDetail.setOnClickListener(this); |
52 | user_photo = view.findViewById(R.id.user_photo); | 55 | user_photo = view.findViewById(R.id.user_photo); |
53 | user_name = view.findViewById(R.id.user_name); | 56 | user_name = view.findViewById(R.id.user_name); |
@@ -84,6 +87,12 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -84,6 +87,12 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
84 | case R.id.layout_orderDetail: | 87 | case R.id.layout_orderDetail: |
85 | startNewActivity(OrderDetailActivity.class); | 88 | startNewActivity(OrderDetailActivity.class); |
86 | break; | 89 | break; |
90 | + case R.id.layout_order: | ||
91 | + Bundle bundle=new Bundle(); | ||
92 | + bundle.putString("url",AppConfig.BASE_URL+"ParentOrderCenter.aspx?userid="+ | ||
93 | + AppConfig.getAppConfig(getContext()).get(AppConfig.USER_ID)); | ||
94 | + startNewActivity(WebViewActivity.class,bundle); | ||
95 | + break; | ||
87 | default: | 96 | default: |
88 | break; | 97 | break; |
89 | } | 98 | } |
app/src/main/res/layout/activity_web_view.xml
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | android:orientation="vertical" | 7 | android:orientation="vertical" |
8 | android:background="@color/bgColor" | 8 | android:background="@color/bgColor" |
9 | - tools:context="com.shunzhi.parent.ui.activity.web.WebViewActivity"> | 9 | + tools:context="com.shunzhi.parent.ui.activity.mywebview.WebViewActivity"> |
10 | <ProgressBar | 10 | <ProgressBar |
11 | android:id="@+id/pb_web" | 11 | android:id="@+id/pb_web" |
12 | style="?android:attr/progressBarStyleHorizontal" | 12 | style="?android:attr/progressBarStyleHorizontal" |
app/src/main/res/layout/fragment_mine.xml
@@ -163,6 +163,7 @@ | @@ -163,6 +163,7 @@ | ||
163 | android:layout_marginRight="15dp" | 163 | android:layout_marginRight="15dp" |
164 | android:background="@color/bottomline" /> | 164 | android:background="@color/bottomline" /> |
165 | <LinearLayout | 165 | <LinearLayout |
166 | + android:id="@+id/layout_order" | ||
166 | android:layout_width="match_parent" | 167 | android:layout_width="match_parent" |
167 | android:layout_height="40dp" | 168 | android:layout_height="40dp" |
168 | android:gravity="center_vertical" | 169 | android:gravity="center_vertical" |