1
0
Fork 0
mirror of https://github.com/ethauvin/Clever.git synced 2025-04-25 00:47:11 -07:00

Lots of tweaks...

This commit is contained in:
Russell Beattie 2012-09-09 02:25:18 -07:00
parent c2c70a4325
commit c5edd6a501
4 changed files with 53 additions and 20 deletions

View file

@ -18,7 +18,7 @@
android:label="@string/title_activity_main"
android:screenOrientation="landscape"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustPan"
android:windowSoftInputMode="adjustResize"
android:immersive="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View file

@ -20,14 +20,14 @@
max-width: 100%;
}
input{
width: 500px;
width: 600px;
max-width: 100%;
}
input, button{
font-size: 25px;
font-size: 30px;
border: 3px solid #333;
border-radius: 10px;
padding: 10px;
padding: 20px;
}
.logo{

View file

@ -1,10 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<WebView android:id="@+id/webView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<WebView
android:id="@+id/webView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>

View file

@ -2,9 +2,12 @@ package io.clever;
import android.os.Bundle;
import android.app.Activity;
import android.graphics.Color;
import android.util.Log;
import android.view.View;
import android.webkit.*;
import android.webkit.WebSettings.*;
import android.widget.LinearLayout;
public class MainActivity extends Activity {
@ -18,34 +21,60 @@ public class MainActivity extends Activity {
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();
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.setDomStorageEnabled(true);
//webSettings.setBuiltInZoomControls(false);
//webSettings.setSupportZoom(false);
//webSettings.setTextZoom(80);
//webSettings.setDefaultZoom(ZoomDensity.FAR);
webSettings.setSaveFormData(false);
webSettings.setDatabaseEnabled(true);
webSettings.setDatabasePath("/data/data/" + webView.getContext().getPackageName() + "/databases/");
webSettings.setSaveFormData(false);
webSettings.setLightTouchEnabled(false);
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");
webView.setInitialScale(90);
webView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
webView.loadUrl("file:///android_asset/www/index.html");
}
@Override