Browse files

added menu icons

  • Loading branch information...
1 parent e88bc33 commit 5377941adb9753d25eeb447cf51d0c22feeee6c5 @gregkh committed Jun 8, 2010
View
5 AndroidManifest.xml
@@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kroah.clock"
android:versionCode="1"
- android:versionName="1.0">
+ android:versionName="001">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Clock"
android:label="@string/app_name">
@@ -13,6 +13,9 @@
</activity>
</application>
+
+ <uses-permission android:name="android.permission.BATTERY_STATS"/>
+ <uses-permission android:name="android.permission_group.STORAGE"/>
</manifest>
View
BIN bin/classes.dex
Binary file not shown.
View
BIN bin/clock.apk
Binary file not shown.
View
BIN bin/com/kroah/clock/Clock.class
Binary file not shown.
View
BIN bin/com/kroah/clock/R$drawable.class
Binary file not shown.
View
BIN bin/com/kroah/clock/R$id.class
Binary file not shown.
View
BIN bin/com/kroah/clock/R$layout.class
Binary file not shown.
View
BIN bin/com/kroah/clock/R$menu.class
Binary file not shown.
View
BIN bin/com/kroah/clock/R$string.class
Binary file not shown.
View
BIN bin/com/kroah/clock/R.class
Binary file not shown.
View
BIN bin/resources.ap_
Binary file not shown.
View
12 gen/com/kroah/clock/R.java
@@ -12,10 +12,22 @@
}
public static final class drawable {
public static final int icon=0x7f020000;
+ public static final int menu_about=0x7f020001;
+ public static final int menu_add=0x7f020002;
+ public static final int menu_close=0x7f020003;
+ public static final int menu_preferences=0x7f020004;
+ }
+ public static final class id {
+ public static final int delete_contact=0x7f060001;
+ public static final int edit_contact=0x7f060000;
+ public static final int exit=0x7f060002;
}
public static final class layout {
public static final int main=0x7f030000;
}
+ public static final class menu {
+ public static final int menu=0x7f050000;
+ }
public static final class string {
public static final int app_name=0x7f040001;
public static final int hello=0x7f040000;
View
BIN res/drawable-hdpi/menu_about.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-hdpi/menu_add.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-hdpi/menu_close.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-hdpi/menu_preferences.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-ldpi/menu_about.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-ldpi/menu_add.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-ldpi/menu_close.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-ldpi/menu_preferences.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-mdpi/menu_about.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-mdpi/menu_add.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-mdpi/menu_close.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-mdpi/menu_preferences.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
5 res/menu/menu.xml
@@ -0,0 +1,5 @@
+<menu xmlns:android="https://schemas.android.com/apk/res/android">
+ <item android:id="@+id/edit_contact" android:title="Edit Contact" />
+ <item android:id="@+id/delete_contact" android:title="Delete Contact" />
+ <item android:id="@+id/exit" android:title="Exit" />
+</menu>
View
36 src/com/kroah/clock/Clock.java
@@ -2,8 +2,44 @@
import android.app.Activity;
import android.os.Bundle;
+import android.view.Menu;
+import android.view.MenuItem;
+
public class Clock extends Activity {
+
+ static final private int MENU_ADD = 0;
+ static final private int MENU_SETTINGS = 1;
+ static final private int MENU_ABOUT = 2;
+ static final private int MENU_EXIT = 3;
+
+ /* Creates the menu items */
+ public boolean onCreateOptionsMenu(Menu menu) {
+ menu.add(0, MENU_ADD, 0, "Add").setIcon(R.drawable.menu_add);
+ menu.add(0, MENU_SETTINGS, 0, "Settings").setIcon(R.drawable.menu_preferences);
+ menu.add(0, MENU_ABOUT, 0, "About").setIcon(R.drawable.menu_about);
+ menu.add(0, MENU_EXIT, 0, "Exit").setIcon(R.drawable.menu_close);
+ return true;
+ }
+
+ /* Handles item selections */
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case MENU_ADD:
+ //newGame();
+ return true;
+ case MENU_SETTINGS:
+ //quit();
+ return true;
+ case MENU_ABOUT:
+ return true;
+ case MENU_EXIT:
+ finish();
+ return true;
+ }
+ return false;
+ }
+
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {

0 comments on commit 5377941

Please sign in to comment.