1
0
Fork 0

Before cleanup

master
Ambrose Chua 2014-05-21 15:13:35 +08:00
parent 1262400afa
commit 34e2f680a7
35 changed files with 57 additions and 65 deletions

View File

@ -5,8 +5,8 @@
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="18" />
android:minSdkVersion="17"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
@ -14,16 +14,19 @@
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:theme="@android:style/Theme.Holo.Light.NoActionBar">
<activity
android:uiOptions="splitActionBarWhenNarrow"
android:name="com.thunder.simtech.MainActivity"
android:label="@string/app_name" >
android:label="@string/app_name">
<meta-data android:name="android.support.UI_OPTIONS"
android:value="splitActionBarWhenNarrow" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</activity>
</application>
</manifest>

View File

@ -5,8 +5,8 @@
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="18" />
android:minSdkVersion="17"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
@ -14,16 +14,19 @@
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:theme="@android:style/Theme.Holo.Light.NoActionBar">
<activity
android:uiOptions="splitActionBarWhenNarrow"
android:name="com.thunder.simtech.MainActivity"
android:label="@string/app_name" >
android:label="@string/app_name">
<meta-data android:name="android.support.UI_OPTIONS"
android:value="splitActionBarWhenNarrow" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</activity>
</application>
</manifest>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 B

Binary file not shown.

Binary file not shown.

View File

@ -21,12 +21,13 @@ public final class R {
public static final int activity_vertical_margin=0x7f040001;
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
public static final int ab_bottom_solid_dark_holo=0x7f020000;
public static final int ic_launcher=0x7f020001;
public static final int ic_menu_forward=0x7f020002;
}
public static final class id {
public static final int action_settings=0x7f080002;
public static final int editText=0x7f080001;
public static final int webView=0x7f080000;
public static final int editText=0x7f080000;
public static final int webView=0x7f080001;
}
public static final class layout {
public static final int activity_main=0x7f030000;
@ -35,9 +36,7 @@ public final class R {
public static final int main=0x7f070000;
}
public static final class string {
public static final int action_settings=0x7f050001;
public static final int app_name=0x7f050000;
public static final int hello_world=0x7f050002;
}
public static final class style {
/**

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -4,34 +4,42 @@
android:layout_height="fill_parent"
android:orientation="vertical" >
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.63" >
</WebView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom" >
android:background="@drawable/ab_bottom_solid_dark_holo"
android:gravity="top" >
<EditText
android:textCursorDrawable="@null"
android:id="@+id/editText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="0.61"
android:ems="10"
android:singleLine="true"
android:inputType="textUri">
android:inputType="textUri"
android:textColor="#ffffff">
<requestFocus />
</EditText>
<Button
android:onClick="onGo"
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="DIE" />
android:src="@drawable/ic_menu_forward"
android:onClick="onGo"
android:contentDescription="Go!"
style="?android:attr/borderlessButtonStyle" />
</LinearLayout>
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.63">
</WebView>
</LinearLayout>

View File

@ -1,9 +1,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_settings"/>
</menu>
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:simtech="http://schemas.android.com/apk/res-auto" >
<!-- <item android:id="@+id/action_url"
android:title="@string/action_url"
simtech:actionViewClass="android.support.v7.widget.SearchView" /> -->
</menu>

3
res/values/colors.xml Normal file
View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>

View File

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Simtech &lt;thunder></string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="app_name">Simtech &lt;thunder&gt;</string>
</resources>

View File

@ -11,41 +11,28 @@ import android.webkit.WebViewClient;
import android.widget.EditText;
public class MainActivity extends Activity {
// The onCreate method is called when the Activity is created. Code to instantiate the UI should be placed here.
@Override
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// This call tells the system to inflate the user interface defined in main.xml as the User Interface for this Activity.
setContentView(R.layout.activity_main);
// The WebView needs to use a modified WebViewClient that does not delegate the URL to the default browser.
setContentView(R.layout.activity_main);
final WebView webView = (WebView) findViewById(R.id.webView);
webView.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url){
view.loadUrl(url);
// Gets the editText
EditText editText = (EditText) findViewById(R.id.editText);
// Updates the URL
editText.setText(webView.getUrl());
// Hides the soft keyboard
editText.clearFocus();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(editText.getWindowToken(), 0);
return false; // Tells the system not to continue propagating the event.
return false;
}
});
webView.loadUrl("http://beta.typega.me:4006/dl/");
webView.loadUrl("http://www.google.com/");
// You can add other code here if you want.
}
// Tell the Button you create to call this method, by setting the android:onCreate attribute.
public void onGo(View view){
WebView webView = (WebView) findViewById(R.id.webView);
EditText editText = (EditText) findViewById(R.id.editText);
@ -53,12 +40,6 @@ public class MainActivity extends Activity {
if (editText.getText()==null)return;
String url = editText.getText().toString();
// if (url.equals("man man")) {
// Intent i = new Intent(this, AboutActivity.class);
// startActivity(i);
// return;
// }
if (!url.contains("http://"))url = "http://"+url;
webView.loadUrl(url);
Log.i("AndroidDemo", "Visiting: "+url);