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

View File

@ -5,8 +5,8 @@
android:versionName="1.0" > android:versionName="1.0" >
<uses-sdk <uses-sdk
android:minSdkVersion="15" android:minSdkVersion="17"
android:targetSdkVersion="18" /> android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
@ -14,16 +14,19 @@
android:allowBackup="true" android:allowBackup="true"
android:icon="@drawable/ic_launcher" android:icon="@drawable/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/AppTheme" > android:theme="@android:style/Theme.Holo.Light.NoActionBar">
<activity <activity
android:uiOptions="splitActionBarWhenNarrow"
android:name="com.thunder.simtech.MainActivity" 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> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
</application> </application>
</manifest> </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 int activity_vertical_margin=0x7f040001;
} }
public static final class drawable { 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 class id {
public static final int action_settings=0x7f080002; public static final int editText=0x7f080000;
public static final int editText=0x7f080001; public static final int webView=0x7f080001;
public static final int webView=0x7f080000;
} }
public static final class layout { public static final class layout {
public static final int activity_main=0x7f030000; public static final int activity_main=0x7f030000;
@ -35,9 +36,7 @@ public final class R {
public static final int main=0x7f070000; public static final int main=0x7f070000;
} }
public static final class string { public static final class string {
public static final int action_settings=0x7f050001;
public static final int app_name=0x7f050000; public static final int app_name=0x7f050000;
public static final int hello_world=0x7f050002;
} }
public static final class style { 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:layout_height="fill_parent"
android:orientation="vertical" > 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 <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="bottom" > android:background="@drawable/ab_bottom_solid_dark_holo"
android:gravity="top" >
<EditText <EditText
android:textCursorDrawable="@null"
android:id="@+id/editText" android:id="@+id/editText"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="fill_parent"
android:layout_weight="0.61" android:layout_weight="0.61"
android:ems="10" android:ems="10"
android:singleLine="true" android:singleLine="true"
android:inputType="textUri"> android:inputType="textUri"
android:textColor="#ffffff">
<requestFocus /> <requestFocus />
</EditText> </EditText>
<Button <ImageButton
android:onClick="onGo"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="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> </LinearLayout>
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.63">
</WebView>
</LinearLayout> </LinearLayout>

View File

@ -1,9 +1,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" > <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
<item xmlns:simtech="http://schemas.android.com/apk/res-auto" >
android:id="@+id/action_settings" <!-- <item android:id="@+id/action_url"
android:orderInCategory="100" android:title="@string/action_url"
android:showAsAction="never" simtech:actionViewClass="android.support.v7.widget.SearchView" /> -->
android:title="@string/action_settings"/> </menu>
</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"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">Simtech &lt;thunder></string> <string name="app_name">Simtech &lt;thunder&gt;</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
</resources> </resources>

View File

@ -11,41 +11,28 @@ import android.webkit.WebViewClient;
import android.widget.EditText; import android.widget.EditText;
public class MainActivity extends Activity { public class MainActivity extends Activity {
@Override
// The onCreate method is called when the Activity is created. Code to instantiate the UI should be placed here.
@Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// 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.
final WebView webView = (WebView) findViewById(R.id.webView); final WebView webView = (WebView) findViewById(R.id.webView);
webView.setWebViewClient(new WebViewClient() { webView.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url){ public boolean shouldOverrideUrlLoading(WebView view, String url){
view.loadUrl(url); view.loadUrl(url);
// Gets the editText
EditText editText = (EditText) findViewById(R.id.editText); EditText editText = (EditText) findViewById(R.id.editText);
// Updates the URL
editText.setText(webView.getUrl()); editText.setText(webView.getUrl());
// Hides the soft keyboard
editText.clearFocus(); editText.clearFocus();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(editText.getWindowToken(), 0); imm.hideSoftInputFromWindow(editText.getWindowToken(), 0);
return false;
return false; // Tells the system not to continue propagating the event.
} }
}); });
webView.loadUrl("http://beta.typega.me:4006/dl/"); webView.loadUrl("http://www.google.com/");
// You can add other code here if you want. // 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){ public void onGo(View view){
WebView webView = (WebView) findViewById(R.id.webView); WebView webView = (WebView) findViewById(R.id.webView);
EditText editText = (EditText) findViewById(R.id.editText); EditText editText = (EditText) findViewById(R.id.editText);
@ -53,12 +40,6 @@ public class MainActivity extends Activity {
if (editText.getText()==null)return; if (editText.getText()==null)return;
String url = editText.getText().toString(); 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; if (!url.contains("http://"))url = "http://"+url;
webView.loadUrl(url); webView.loadUrl(url);
Log.i("AndroidDemo", "Visiting: "+url); Log.i("AndroidDemo", "Visiting: "+url);