more code formatting

This commit is contained in:
Philipp Schaefer
2013-06-16 13:28:41 +02:00
parent e85a6a98ac
commit dc22aaf4dd
7 changed files with 46 additions and 55 deletions

View File

@ -11,10 +11,10 @@ import android.os.Build;
import android.preference.PreferenceManager;
import android.util.AttributeSet;
import android.util.Log;
import android.webkit.GeolocationPermissions;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.GeolocationPermissions;
@SuppressLint("SetJavaScriptEnabled")
public class IITC_WebView extends WebView {
@ -26,7 +26,7 @@ public class IITC_WebView extends WebView {
// init web view
private void iitc_init(Context c) {
if ( this.isInEditMode() ) return;
if (this.isInEditMode()) return;
settings = this.getSettings();
settings.setJavaScriptEnabled(true);
settings.setDomStorageEnabled(true);
@ -44,12 +44,12 @@ public class IITC_WebView extends WebView {
this.setWebChromeClient(new WebChromeClient() {
/**
* our webchromeclient should share geolocation with the iitc script
*
*
* allow access by default
*/
@Override
public void onGeolocationPermissionsShowPrompt(String origin,
GeolocationPermissions.Callback callback) {
GeolocationPermissions.Callback callback) {
callback.invoke(origin, true, false);
}
@ -95,8 +95,7 @@ public class IITC_WebView extends WebView {
public void loadUrl(String url) {
// if in edit text mode, don't load javascript otherwise the keyboard closes.
HitTestResult testResult = this.getHitTestResult();
if (url.startsWith("javascript:") && testResult != null && testResult.getType() == HitTestResult.EDIT_TEXT_TYPE)
{
if (url.startsWith("javascript:") && testResult != null && testResult.getType() == HitTestResult.EDIT_TEXT_TYPE) {
// let window.show(...) interupt input
// window.show(...) is called if one of the action bar buttons
// is clicked