mirror of
https://github.com/ethauvin/Clever.git
synced 2025-04-25 08:57:12 -07:00
Formatting with Eclipse
This commit is contained in:
parent
eadd6e7963
commit
d1f4326ca7
2 changed files with 176 additions and 181 deletions
|
@ -6,22 +6,23 @@
|
|||
<uses-sdk
|
||||
android:minSdkVersion="15"
|
||||
android:targetSdkVersion="15" />
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application
|
||||
android:icon="@drawable/icon"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
>
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:hardwareAccelerated="true"
|
||||
android:immersive="true"
|
||||
android:label="@string/title_activity_main"
|
||||
android:screenOrientation="landscape"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:immersive="true">
|
||||
android:windowSoftInputMode="adjustResize" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
|
|
@ -15,7 +15,6 @@ import android.webkit.WebSettings.*;
|
|||
import android.widget.*;
|
||||
import android.widget.TextView.OnEditorActionListener;
|
||||
|
||||
|
||||
public class MainActivity extends Activity {
|
||||
|
||||
WebView webView;
|
||||
|
@ -51,7 +50,8 @@ public class MainActivity extends Activity {
|
|||
|
||||
urlField.setOnEditorActionListener(new OnEditorActionListener() {
|
||||
@Override
|
||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||
public boolean onEditorAction(TextView v, int actionId,
|
||||
KeyEvent event) {
|
||||
boolean handled = false;
|
||||
if (actionId == EditorInfo.IME_ACTION_GO) {
|
||||
|
||||
|
@ -68,8 +68,6 @@ public class MainActivity extends Activity {
|
|||
|
||||
urlField.setText(lastUrl);
|
||||
|
||||
|
||||
|
||||
// Navbar animation settings
|
||||
|
||||
AnimationListener slideListener = new AnimationListener() {
|
||||
|
@ -92,21 +90,18 @@ public class MainActivity extends Activity {
|
|||
}
|
||||
};
|
||||
|
||||
slideUp = new TranslateAnimation(
|
||||
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
|
||||
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -1.0f
|
||||
);
|
||||
slideUp = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
|
||||
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
|
||||
0.0f, Animation.RELATIVE_TO_SELF, -1.0f);
|
||||
slideUp.setDuration(500);
|
||||
slideUp.setAnimationListener(slideListener);
|
||||
|
||||
slideDown = new TranslateAnimation(
|
||||
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
|
||||
Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f
|
||||
);
|
||||
slideDown = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
|
||||
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
|
||||
-1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
|
||||
slideDown.setDuration(500);
|
||||
slideDown.setAnimationListener(slideListener);
|
||||
|
||||
|
||||
// WebView setup
|
||||
|
||||
webView = (WebView) findViewById(R.id.webView);
|
||||
|
@ -132,7 +127,8 @@ public class MainActivity extends Activity {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onScaleChanged (WebView view, float oldScale, float newScale){
|
||||
public void onScaleChanged(WebView view, float oldScale,
|
||||
float newScale) {
|
||||
|
||||
Log.d("scale changed", oldScale + " - " + newScale);
|
||||
|
||||
|
@ -145,7 +141,6 @@ public class MainActivity extends Activity {
|
|||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
webView.setInitialScale(70);
|
||||
|
@ -162,12 +157,14 @@ public class MainActivity extends Activity {
|
|||
webSettings.setJavaScriptEnabled(true);
|
||||
webSettings.setDomStorageEnabled(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.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
|
||||
webSettings.setRenderPriority(RenderPriority.HIGH);
|
||||
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.loadUrl(HOME_PAGE);
|
||||
webView.requestFocus();
|
||||
|
@ -187,8 +184,7 @@ public class MainActivity extends Activity {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed()
|
||||
{
|
||||
public void onBackPressed() {
|
||||
if (webView.canGoBack()) {
|
||||
|
||||
webView.goBack();
|
||||
|
@ -209,7 +205,6 @@ public class MainActivity extends Activity {
|
|||
url = "http://" + url;
|
||||
}
|
||||
|
||||
|
||||
urlField.setText(url);
|
||||
|
||||
webView.requestFocus();
|
||||
|
@ -220,5 +215,4 @@ public class MainActivity extends Activity {
|
|||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue