Fix links
This commit is contained in:
parent
b5c8aabb75
commit
997d56d8dc
1 changed files with 14 additions and 1 deletions
|
@ -15,7 +15,9 @@ import net.osmand.PlatformUtil;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
import net.osmand.plus.OsmandSettings;
|
import net.osmand.plus.OsmandSettings;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -38,7 +40,6 @@ public class HelpArticleDialogFragment extends DialogFragment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
setRetainInstance(true);
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
boolean isLightTheme = (getOsmandApplication())
|
boolean isLightTheme = (getOsmandApplication())
|
||||||
.getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
|
.getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
|
||||||
|
@ -82,6 +83,18 @@ public class HelpArticleDialogFragment extends DialogFragment {
|
||||||
|
|
||||||
webView.loadDataWithBaseURL("http://osmand.net", sb.toString(), null, "utf-8", null);
|
webView.loadDataWithBaseURL("http://osmand.net", sb.toString(), null, "utf-8", null);
|
||||||
}
|
}
|
||||||
|
webView.setWebViewClient(new WebViewClient() {
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
|
if (url.startsWith("http://osmand.net/features?id=")) {
|
||||||
|
String id = url.substring("http://osmand.net/features?id=".length());
|
||||||
|
dismiss();
|
||||||
|
instantiateWithAsset(id, getString(R.string.shared_string_help)).show(
|
||||||
|
getActivity().getSupportFragmentManager(), "DIALOG_HELP_ARTICLE");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (url != null) {
|
} else if (url != null) {
|
||||||
|
|
||||||
webView.getSettings().setLoadWithOverviewMode(true);
|
webView.getSettings().setLoadWithOverviewMode(true);
|
||||||
|
|
Loading…
Reference in a new issue