浏览代码

FlipperLayout优化

huangbo 9 年之前
父节点
当前提交
b44b3018cc
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      wade-mobile-func/src/com/wade/mobile/func/MobileUI.java

+ 5 - 4
wade-mobile-func/src/com/wade/mobile/func/MobileUI.java

@ -152,7 +152,7 @@ public class MobileUI extends Plugin {
152 152
		context.runOnUiThread(new Runnable() {
153 153
			public void run() {
154 154
				try {
155
					TemplateWebView webview = initFlipperPage(isAnimation);
155
					TemplateWebView webview = initFlipperPage(pageAction, isAnimation);
156 156
					webview.loadTemplate(templatePath, data);
157 157
				} catch (Exception e) {
158 158
					MobileLog.e(TAG, e.getMessage(), e);
@ -260,7 +260,7 @@ public class MobileUI extends Plugin {
260 260
	}
261 261

262 262
	/************************ 多WebView 开始 *****************************/
263
	private TemplateWebView initFlipperPage(boolean isAnimation) {
263
	private TemplateWebView initFlipperPage(String pageAction, boolean isAnimation) {
264 264
		FlipperLayout mainFlipper = wademobile.getFlipperLayout();
265 265
		TemplateWebView webview = (TemplateWebView) mainFlipper.getNextView();
266 266
		
@ -274,6 +274,8 @@ public class MobileUI extends Plugin {
274 274
			mainFlipper.setBackAnimation(AnimationResource.pushRight[0],
275 275
					AnimationResource.pushRight[1]);
276 276
		}
277
		webview.setTag(pageAction); //记录当前页面名称
278
		mainFlipper.setPreCurrView(webview);
277 279
		return webview;
278 280
	}
279 281

@ -293,8 +295,7 @@ public class MobileUI extends Plugin {
293 295
		};
294 296
		webview.setLayoutParams(ConstantParams
295 297
				.getFillParams(LinearLayout.LayoutParams.class));
296
		((WadeMobileActivity) wademobile).getWebviewSetting().setWebViewStyle(
297
				webview);// 设置webview的样式
298
		((WadeMobileActivity) wademobile).getWebviewSetting().setWebViewStyle(webview);// 设置webview的样式
298 299

299 300
		mainFlipper.addNextView(webview);// 增加view
300 301
//		webview.postInvalidate();// 刷新页面