Before cleanup
|
@ -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>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
BIN
bin/classes.dex
After Width: | Height: | Size: 213 B |
After Width: | Height: | Size: 927 B |
After Width: | Height: | Size: 199 B |
After Width: | Height: | Size: 700 B |
After Width: | Height: | Size: 227 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 276 B |
After Width: | Height: | Size: 728 B |
|
@ -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 {
|
||||||
/**
|
/**
|
||||||
|
|
After Width: | Height: | Size: 144 B |
After Width: | Height: | Size: 977 B |
After Width: | Height: | Size: 134 B |
After Width: | Height: | Size: 769 B |
After Width: | Height: | Size: 165 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
|
@ -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>
|
|
@ -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>
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
</resources>
|
|
@ -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 <thunder></string>
|
<string name="app_name">Simtech <thunder></string>
|
||||||
<string name="action_settings">Settings</string>
|
|
||||||
<string name="hello_world">Hello world!</string>
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -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);
|
||||||
|
|