本文整理汇总了Java中android.net.UrlQuerySanitizer.parseUrl方法的典型用法代码示例。如果您正苦于以下问题:Java UrlQuerySanitizer.parseUrl方法的具体用法?Java UrlQuerySanitizer.parseUrl怎么用?Java UrlQuerySanitizer.parseUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.net.UrlQuerySanitizer
的用法示例。
在下文中一共展示了UrlQuerySanitizer.parseUrl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: paramLoader
import android.net.UrlQuerySanitizer; //导入方法依赖的package包/类
public static void paramLoader(WebView view, String url) {
UrlQuerySanitizer sanitizer = new UrlQuerySanitizer();
sanitizer.setAllowUnregisteredParamaters(true);
sanitizer.parseUrl(url);
String param = sanitizer.getValue("pageload");
if (param != null) {
switch (param) {
case "composer":
view.loadUrl("javascript:(function()%7Btry%7Bdocument.querySelector('button%5Bname%3D%22view_overview%22%5D').click()%7Dcatch(_)%7B%7D%7D)()");
break;
case "composer_photo":
view.loadUrl("javascript:(function()%7Btry%7Bdocument.querySelector('button%5Bname%3D%22view_photo%22%5D').click()%7Dcatch(_)%7B%7D%7D)()");
break;
case "composer_checkin":
view.loadUrl("javascript:(function()%7Btry%7Bdocument.querySelector('button%5Bname%3D%22view_location%22%5D').click()%7Dcatch(_)%7B%7D%7D)()");
break;
default:
break;
}
}
}
示例2: composeFormParamsMap
import android.net.UrlQuerySanitizer; //导入方法依赖的package包/类
private Map<String, RequestBody> composeFormParamsMap(String source) {
UrlQuerySanitizer sanitizer = new UrlQuerySanitizer();
sanitizer.registerParameter(ApiConstants.AMAZON_EXPIRES, UrlQuerySanitizer.getSpaceLegal());
sanitizer.setAllowUnregisteredParamaters(true);
sanitizer.parseUrl(source);
Map<String, RequestBody> result = new HashMap<>();
result.put(ApiConstants.AMAZON_CONTENT_TYPE,
createPartFromString(sanitizer.getValue(ApiConstants.AMAZON_CONTENT_TYPE)));
result.put(ApiConstants.AMAZON_EXPIRES,
createPartFromString(sanitizer.getValue(ApiConstants.AMAZON_EXPIRES)));
result.put(ApiConstants.AMAZON_ACL,
createPartFromString(sanitizer.getValue(ApiConstants.AMAZON_ACL)));
result.put(ApiConstants.AMAZON_KEY,
createPartFromString(sanitizer.getValue(ApiConstants.AMAZON_KEY)));
result.put(ApiConstants.AMAZON_POLICY,
createPartFromString(sanitizer.getValue(ApiConstants.AMAZON_POLICY)));
result.put(ApiConstants.AMAZON_ACTION_STATUS,
createPartFromString(sanitizer.getValue(ApiConstants.AMAZON_ACTION_STATUS)));
result.put(ApiConstants.AMAZON_ALGORITHM,
createPartFromString(sanitizer.getValue(ApiConstants.AMAZON_ALGORITHM)));
result.put(ApiConstants.AMAZON_CREDENTIAL,
createPartFromString(sanitizer.getValue(ApiConstants.AMAZON_CREDENTIAL)));
result.put(ApiConstants.AMAZON_DATE,
createPartFromString(sanitizer.getValue(ApiConstants.AMAZON_DATE)));
result.put(ApiConstants.AMAZON_SIGNATURE,
createPartFromString(sanitizer.getValue(ApiConstants.AMAZON_SIGNATURE)));
return result;
}
示例3: c
import android.net.UrlQuerySanitizer; //导入方法依赖的package包/类
private void c(Uri paramUri)
{
String str1 = paramUri.getPath();
an localan = (an)this.iU.get(str1);
if (localan != null)
{
HashMap localHashMap = new HashMap();
UrlQuerySanitizer localUrlQuerySanitizer = new UrlQuerySanitizer();
localUrlQuerySanitizer.setAllowUnregisteredParamaters(true);
localUrlQuerySanitizer.setUnregisteredParameterValueSanitizer(UrlQuerySanitizer.getAllButNulLegal());
localUrlQuerySanitizer.parseUrl(paramUri.toString());
Iterator localIterator1 = localUrlQuerySanitizer.getParameterList().iterator();
while (localIterator1.hasNext())
{
UrlQuerySanitizer.ParameterValuePair localParameterValuePair = (UrlQuerySanitizer.ParameterValuePair)localIterator1.next();
localHashMap.put(localParameterValuePair.mParameter, localParameterValuePair.mValue);
}
if (ct.n(2))
{
ct.u("Received GMSG: " + str1);
Iterator localIterator2 = localHashMap.keySet().iterator();
while (localIterator2.hasNext())
{
String str2 = (String)localIterator2.next();
ct.u(" " + str2 + ": " + (String)localHashMap.get(str2));
}
}
localan.a(this.gv, localHashMap);
return;
}
ct.v("No GMSG handler found for GMSG: " + paramUri);
}
示例4: onPageFinished
import android.net.UrlQuerySanitizer; //导入方法依赖的package包/类
@Override
public void onPageFinished(String url) {
// Only do things if logged in
if (mActivity.checkLoggedInState()) {
// Load a certain page if there is a parameter
JavaScriptHelpers.paramLoader(mWebView, url);
// Hide Orange highlight on focus
String css = HIDE_ORANGE_FOCUS;
// Hide the menu bar (but not on the composer or if disabled)
if (mPreferences.getBoolean(SettingsActivity.KEY_PREF_HIDE_MENU_BAR, true) && !url.contains("/composer/") && !url.contains("/friends/")) {
css += HIDE_MENU_BAR_CSS;
mActivity.swipeView.setEnabled(true);
} else {
mActivity.swipeView.setEnabled(false);
}
if (url.contains("mbasic.facebook.com/composer/?text=")) {
UrlQuerySanitizer sanitizer = new UrlQuerySanitizer();
sanitizer.setAllowUnregisteredParamaters(true);
sanitizer.parseUrl(url);
String param = sanitizer.getValue("text");
mWebView.loadUrl("javascript:(function()%7Bdocument.querySelector('%23composerInput').innerHTML%3D'" + param + "'%7D)()");
}
// Hide the status editor on the News Feed if setting is enabled
if (mPreferences.getBoolean(SettingsActivity.KEY_PREF_HIDE_EDITOR, true)) {
css += HIDE_COMPOSER_CSS;
}
// Hide 'Sponsored' content (ads)
if (mPreferences.getBoolean(SettingsActivity.KEY_PREF_HIDE_SPONSORED, true)) {
css += HIDE_SPONSORED;
}
// Hide birthday content from News Feed
if (mPreferences.getBoolean(SettingsActivity.KEY_PREF_HIDE_BIRTHDAYS, true)) {
css += HIDE_BIRTHDAYS;
}
// Hide Top Stories button on News Feed
if (mPreferences.getBoolean(SettingsActivity.KEY_PREF_MOST_RECENT_MENU, true)) {
css += HIDE_TOP_STORIES_BUTTON;
}
// Inject the css
JavaScriptHelpers.loadCSS(mWebView, css);
// Get the currently open tab and check on the navigation menu
JavaScriptHelpers.updateCurrentTab(mWebView);
// Get the notification number
JavaScriptHelpers.updateNumsService(mWebView);
// Stop loading
mActivity.setLoading(false);
}
}