]> iEval git - unical.git/commitdiff
Add alarm wip
authorPetru <l3asketballplayer@yahoo.com>
Mon, 19 Aug 2013 12:44:39 +0000 (15:44 +0300)
committerPetru <l3asketballplayer@yahoo.com>
Mon, 19 Aug 2013 12:44:39 +0000 (15:44 +0300)
Creates activity for adding alarms

AndroidManifest.xml
res/layout/add_alarm.xml [new file with mode: 0644]
res/menu/add_alarm.xml [new file with mode: 0644]
src/ro/ieval/unical/AddAlarmActivity.java [new file with mode: 0644]
src/ro/ieval/unical/DisplayEventActivity.java

index 25a418b153bb97f93b0fbae7f97ad1987bdfeab3..d7c2032d9034853850b6c374f8bc4d2bfc2d19da 100644 (file)
@@ -26,6 +26,7 @@
         <activity android:name=".AddEventActivity"></activity>
         <activity android:name=".DisplayEventActivity"></activity>
         <activity android:name=".AlarmReceiverActivity"></activity>
+        <activity android:name=".AddAlarmActivity"></activity>
     </application>
 
 </manifest>
diff --git a/res/layout/add_alarm.xml b/res/layout/add_alarm.xml
new file mode 100644 (file)
index 0000000..ea4959f
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:orientation="vertical"
+              android:layout_width="match_parent"
+              android:layout_height="match_parent">
+
+    <TimePicker
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:id="@+id/timePicker" android:layout_gravity="left|center_vertical"/>
+    <DatePicker
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:id="@+id/datePicker" android:layout_gravity="left|center_vertical"/>
+</LinearLayout>
\ No newline at end of file
diff --git a/res/menu/add_alarm.xml b/res/menu/add_alarm.xml
new file mode 100644 (file)
index 0000000..80a3a14
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:id="@+id/save"
+          android:title="@string/save"
+          android:showAsAction="always"
+          android:icon="@android:drawable/ic_menu_save">
+    </item>
+</menu>
\ No newline at end of file
diff --git a/src/ro/ieval/unical/AddAlarmActivity.java b/src/ro/ieval/unical/AddAlarmActivity.java
new file mode 100644 (file)
index 0000000..b4833a7
--- /dev/null
@@ -0,0 +1,22 @@
+package ro.ieval.unical;
+
+import android.app.ListActivity;
+import android.os.Bundle;
+import android.view.Menu;
+import android.view.MenuInflater;
+
+public class AddAlarmActivity  extends ListActivity {
+    @Override
+    protected void onCreate(final Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.add_alarm);
+        setTitle(R.string.add_alarm);
+    }
+
+    @Override
+    public boolean onCreateOptionsMenu(final Menu menu) {
+        final MenuInflater inflater = getMenuInflater();
+        inflater.inflate(R.menu.add_alarm, menu);
+        return true;
+    }
+}
index af4fe159379eda508d0d3741b9ad9c3458545397..45da8dc740312b8c563a1a409d77d0e5d8828c61 100644 (file)
@@ -82,7 +82,7 @@ public class DisplayEventActivity extends Activity {
                        AddEventActivity.editEvent(DisplayEventActivity.this,event);
                        return true;
                case R.id.add_alarm:
-
+            startActivity(new Intent(this,AddAlarmActivity.class));
                        return true;
                default:
                        return true;
This page took 0.030348 seconds and 4 git commands to generate.