瀏覽代碼

openUrl插件增加参数控制悬浮按钮是否显示

zhanglong7 3 年之前
父節點
當前提交
dc1987ebf3
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      ipu-plugin-basic/src/main/java/com/ai/ipu/mobile/plugin/MobileUI.java

+ 4 - 2
ipu-plugin-basic/src/main/java/com/ai/ipu/mobile/plugin/MobileUI.java

94
        JSONArray arrayStyles = param.optJSONArray(3);
94
        JSONArray arrayStyles = param.optJSONArray(3);
95
        boolean isHideTopBar = param.optBoolean(4, false);
95
        boolean isHideTopBar = param.optBoolean(4, false);
96
        JSONArray isHideIcons = param.optJSONArray(5);
96
        JSONArray isHideIcons = param.optJSONArray(5);
97
        openUrl(url, !isHideTopBar, title, buttons, arrayStyles,isHideIcons);
97
		boolean isShowFloatButton = param.optBoolean(6, isHideTopBar);
98
		openUrl(url, !isHideTopBar, isShowFloatButton, title, buttons, arrayStyles,isHideIcons);
98
	}
99
	}
99
	
100
	
100
	private void openUrl(String url, boolean isShowTopBar, String title, JSONArray buttons, JSONArray arrayStyles,JSONArray isHideIcons) throws Exception {
101
	private void openUrl(String url, boolean isShowTopBar, boolean isShowFloatButton, String title, JSONArray buttons, JSONArray arrayStyles,JSONArray isHideIcons) throws Exception {
101
        String[] styleNames = {"topbarbg", "iconcolor", "textcolor"};
102
        String[] styleNames = {"topbarbg", "iconcolor", "textcolor"};
102
        url = URLDecoder.decode(url);
103
        url = URLDecoder.decode(url);
103
	    Intent intent = new Intent();
104
	    Intent intent = new Intent();
105
        if(!isShowTopBar){
106
        if(!isShowTopBar){
106
        	intent.putExtra("isShowTopBar", isShowTopBar);
107
        	intent.putExtra("isShowTopBar", isShowTopBar);
107
        }
108
        }
109
		intent.putExtra("isShowFloatButton", isShowFloatButton);
108
        if (!isNull(title)) {
110
        if (!isNull(title)) {
109
            intent.putExtra("title", title);
111
            intent.putExtra("title", title);
110
        }
112
        }