mirror of
https://github.com/ethauvin/Clever.git
synced 2025-04-25 08:57:12 -07:00
Lots of tweaks...
This commit is contained in:
parent
c2c70a4325
commit
c5edd6a501
4 changed files with 53 additions and 20 deletions
|
@ -18,7 +18,7 @@
|
||||||
android:label="@string/title_activity_main"
|
android:label="@string/title_activity_main"
|
||||||
android:screenOrientation="landscape"
|
android:screenOrientation="landscape"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
android:windowSoftInputMode="adjustPan"
|
android:windowSoftInputMode="adjustResize"
|
||||||
android:immersive="true">
|
android:immersive="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
|
@ -20,14 +20,14 @@
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
input{
|
input{
|
||||||
width: 500px;
|
width: 600px;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
input, button{
|
input, button{
|
||||||
font-size: 25px;
|
font-size: 30px;
|
||||||
border: 3px solid #333;
|
border: 3px solid #333;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
padding: 10px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo{
|
.logo{
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:id="@+id/linearLayout1"
|
||||||
android:layout_height="fill_parent">
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
>
|
||||||
|
|
||||||
<WebView android:id="@+id/webView1"
|
<WebView
|
||||||
android:layout_width="fill_parent"
|
android:id="@+id/webView1"
|
||||||
android:layout_height="fill_parent"/>
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -2,9 +2,12 @@ package io.clever;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.webkit.*;
|
import android.webkit.*;
|
||||||
import android.webkit.WebSettings.*;
|
import android.webkit.WebSettings.*;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
|
|
||||||
public class MainActivity extends Activity {
|
public class MainActivity extends Activity {
|
||||||
|
@ -18,34 +21,60 @@ public class MainActivity extends Activity {
|
||||||
|
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
webView = (WebView) findViewById(R.id.webView1);
|
LinearLayout linearLayout = (LinearLayout) findViewById(R.id.linearLayout1);
|
||||||
|
|
||||||
|
linearLayout.setBackgroundColor(Color.BLACK);
|
||||||
|
|
||||||
|
|
||||||
|
webView = (WebView) findViewById(R.id.webView1);
|
||||||
|
|
||||||
WebSettings webSettings = webView.getSettings();
|
WebSettings webSettings = webView.getSettings();
|
||||||
|
|
||||||
webView.setWebChromeClient(new WebChromeClient());
|
webView.setWebChromeClient(new WebChromeClient());
|
||||||
webView.setWebViewClient(new WebViewClient());
|
|
||||||
|
|
||||||
|
webView.setWebViewClient(new WebViewClient() {
|
||||||
|
|
||||||
|
public void onPageFinished(WebView view, String url) {
|
||||||
|
|
||||||
|
Log.d("scale", view.getScale() + "");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onScaleChanged (WebView view, float oldScale, float newScale){
|
||||||
|
|
||||||
|
Log.d("scale changed", oldScale + " - " + newScale);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
webView.setInitialScale(100);
|
||||||
|
webView.setMapTrackballToArrowKeys(true);
|
||||||
|
webView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
|
||||||
|
webView.setVerticalScrollBarEnabled(false);
|
||||||
|
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
|
||||||
|
webView.setOverScrollMode(WebView.OVER_SCROLL_NEVER);
|
||||||
|
|
||||||
|
webSettings.setDefaultZoom(ZoomDensity.FAR);
|
||||||
|
webSettings.setUseWideViewPort(true);
|
||||||
|
webSettings.setLoadWithOverviewMode(true);
|
||||||
|
|
||||||
|
webSettings.setSupportZoom(true);
|
||||||
webSettings.setJavaScriptEnabled(true);
|
webSettings.setJavaScriptEnabled(true);
|
||||||
webSettings.setDomStorageEnabled(true);
|
webSettings.setDomStorageEnabled(true);
|
||||||
//webSettings.setBuiltInZoomControls(false);
|
|
||||||
//webSettings.setSupportZoom(false);
|
|
||||||
//webSettings.setTextZoom(80);
|
|
||||||
//webSettings.setDefaultZoom(ZoomDensity.FAR);
|
|
||||||
webSettings.setSaveFormData(false);
|
|
||||||
webSettings.setDatabaseEnabled(true);
|
webSettings.setDatabaseEnabled(true);
|
||||||
webSettings.setDatabasePath("/data/data/" + webView.getContext().getPackageName() + "/databases/");
|
webSettings.setDatabasePath("/data/data/" + webView.getContext().getPackageName() + "/databases/");
|
||||||
|
webSettings.setSaveFormData(false);
|
||||||
webSettings.setLightTouchEnabled(false);
|
webSettings.setLightTouchEnabled(false);
|
||||||
webSettings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
|
webSettings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
|
||||||
webSettings.setUserAgentString("Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.77 Large Screen Safari/534.24 GoogleTV");
|
webSettings.setUserAgentString("Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.77 Large Screen Safari/534.24 GoogleTV");
|
||||||
|
|
||||||
webView.setInitialScale(90);
|
|
||||||
|
|
||||||
webView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
|
|
||||||
|
|
||||||
webView.loadUrl("file:///android_asset/www/index.html");
|
webView.loadUrl("file:///android_asset/www/index.html");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue