Преглед изворни кода

Initial commit for PermissionLaunchTheMissilesUser project.

Cristian Tanas пре 11 година
родитељ
комит
15576ca61e

+ 29 - 0
PermissionLaunchTheMissilesUser/AndroidManifest.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="org.uab.android.permission.launchthemissilesuser"
+    android:versionCode="1"
+    android:versionName="1.0" >
+
+    <uses-sdk
+        android:minSdkVersion="14"
+        android:targetSdkVersion="19" />
+    
+    <uses-permission android:name="org.uab.android.permission.lauchthemissiles.LAUNCH_PERMISSION"/>
+
+    <application
+        android:allowBackup="true"
+        android:icon="@drawable/ic_launcher"
+        android:label="@string/app_name"
+        android:theme="@style/AppTheme" >
+        <activity
+            android:name=".MainActivity"
+            android:label="@string/app_name" >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+
+</manifest>

BIN
PermissionLaunchTheMissilesUser/ic_launcher-web.png


BIN
PermissionLaunchTheMissilesUser/libs/android-support-v4.jar


BIN
PermissionLaunchTheMissilesUser/res/drawable-hdpi/ic_launcher.png


BIN
PermissionLaunchTheMissilesUser/res/drawable-hdpi/launch.png


BIN
PermissionLaunchTheMissilesUser/res/drawable-mdpi/ic_launcher.png


BIN
PermissionLaunchTheMissilesUser/res/drawable-xhdpi/ic_launcher.png


BIN
PermissionLaunchTheMissilesUser/res/drawable-xxhdpi/ic_launcher.png


+ 16 - 0
PermissionLaunchTheMissilesUser/res/layout/activity_main.xml

@@ -0,0 +1,16 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context="${relativePackage}.${activityClass}" >
+
+    <ImageButton
+        android:id="@+id/launchMissiles"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerHorizontal="true"
+        android:layout_centerVertical="true"
+        android:src="@drawable/launch"
+        android:contentDescription="@string/launch_missiles" />
+
+</RelativeLayout>

+ 11 - 0
PermissionLaunchTheMissilesUser/res/values-v11/styles.xml

@@ -0,0 +1,11 @@
+<resources>
+
+    <!--
+        Base application theme for API 11+. This theme completely replaces
+        AppBaseTheme from res/values/styles.xml on API 11+ devices.
+    -->
+    <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
+        <!-- API 11 theme customizations can go here. -->
+    </style>
+
+</resources>

+ 12 - 0
PermissionLaunchTheMissilesUser/res/values-v14/styles.xml

@@ -0,0 +1,12 @@
+<resources>
+
+    <!--
+        Base application theme for API 14+. This theme completely replaces
+        AppBaseTheme from BOTH res/values/styles.xml and
+        res/values-v11/styles.xml on API 14+ devices.
+    -->
+    <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
+        <!-- API 14 theme customizations can go here. -->
+    </style>
+
+</resources>

+ 8 - 0
PermissionLaunchTheMissilesUser/res/values/strings.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <string name="app_name">PermissionLaunchTheMissilesUser</string>
+    <string name="hello_world">Hello world!</string>
+    <string name="launch_missiles">Hello world!</string>
+
+</resources>

+ 20 - 0
PermissionLaunchTheMissilesUser/res/values/styles.xml

@@ -0,0 +1,20 @@
+<resources>
+
+    <!--
+        Base application theme, dependent on API level. This theme is replaced
+        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
+    -->
+    <style name="AppBaseTheme" parent="android:Theme.Light">
+        <!--
+            Theme customizations available in newer API levels can go in
+            res/values-vXX/styles.xml, while customizations related to
+            backward-compatibility can go here.
+        -->
+    </style>
+
+    <!-- Application theme. -->
+    <style name="AppTheme" parent="AppBaseTheme">
+        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
+    </style>
+
+</resources>

+ 29 - 0
PermissionLaunchTheMissilesUser/src/org/uab/android/permission/launchthemissilesuser/MainActivity.java

@@ -0,0 +1,29 @@
+package org.uab.android.permission.launchthemissilesuser;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.ImageButton;
+
+public class MainActivity extends Activity {
+	
+	private static final String LAUNCH_MISSILES = "org.uab.android.permission.lauchthemissiles.LAUNCH";
+
+	@Override
+	protected void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		setContentView(R.layout.activity_main);
+		
+		ImageButton launchMissiles = (ImageButton) findViewById(R.id.launchMissiles);
+		launchMissiles.setOnClickListener(new OnClickListener() {
+			
+			@Override
+			public void onClick(View v) {
+				
+				startActivity(new Intent(LAUNCH_MISSILES));
+			}
+		});
+	}
+}