]> iEval git - unical.git/commitdiff
Add interface for adding events
authorPetru Trimbitas <l3asketballplayer@yahoo.com>
Tue, 28 May 2013 17:39:49 +0000 (20:39 +0300)
committerPetru Trimbitas <l3asketballplayer@yahoo.com>
Tue, 28 May 2013 17:39:49 +0000 (20:39 +0300)
AndroidManifest.xml
res/layout/addevent.xml [new file with mode: 0644]
res/layout/login.xml
res/menu/options.xml
res/values/strings.xml
src/ro/ieval/unical/addEventActivity.java [new file with mode: 0644]
src/ro/ieval/unical/mainActivity.java

index 9d72139cb125589287b30451c604daa322ceab23..dfb1e926ff810b07de7e51e002578945cf9679f9 100644 (file)
@@ -23,7 +23,9 @@
         </activity>
         <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/>
         <activity android:name="com.facebook.LoginActivity"></activity>
-        <activity android:name="loginActivity"></activity>
+        <activity android:name="loginActivity">
+        </activity>
+        <activity android:name="ro.ieval.unical.addEventActivity"></activity>
     </application>
 
 </manifest>
\ No newline at end of file
diff --git a/res/layout/addevent.xml b/res/layout/addevent.xml
new file mode 100644 (file)
index 0000000..e9ad032
--- /dev/null
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical" >
+
+    <ScrollView
+        android:id="@+id/scrollView1"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_weight="1.00" >
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="vertical" >
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="2.13" >
+
+                <TextView
+                    android:id="@+id/textView1"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="@string/title"
+                    android:textAppearance="?android:attr/textAppearanceMedium" />
+
+                <EditText
+                    android:id="@+id/editText1"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:ems="10" >
+
+                    <requestFocus />
+                </EditText>
+
+            </LinearLayout>
+
+            <TextView
+                android:id="@+id/textView2"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/description"
+                android:textAppearance="?android:attr/textAppearanceMedium" />
+
+            <EditText
+                android:id="@+id/editText2"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="2.13"
+                android:ems="10"
+                android:inputType="textMultiLine" />
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="2.13" >
+
+                <TimePicker
+                    android:id="@+id/timePicker1"
+                    android:layout_width="171dp"
+                    android:layout_height="wrap_content" />
+
+                <DatePicker
+                    android:id="@+id/datePicker1"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent" />
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="2.13" >
+
+                <CheckBox
+                    android:id="@+id/checkBox1"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="2.13"
+                    android:text="@string/repeatlabel" />
+
+                <Spinner
+                    android:id="@+id/spinner1"
+                    android:layout_width="213dp"
+                    android:layout_height="wrap_content" />
+
+            </LinearLayout>
+
+        </LinearLayout>
+
+    </ScrollView>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_weight="1.00" >
+
+        <TextView
+            android:id="@+id/textView3"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/locationlabel"
+            android:textAppearance="?android:attr/textAppearanceMedium" />
+
+        <EditText
+            android:id="@+id/editText3"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:ems="10" />
+
+    </LinearLayout>
+
+    <Button
+        android:id="@+id/AddEventButton"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="Add Event"
+    />
+
+</LinearLayout>
\ No newline at end of file
index 0a9ac6103d9575159f0450145d60fddd8d619877..12cb589d294ab627428ac3497cfbbc1f41031eca 100644 (file)
@@ -8,7 +8,7 @@
         android:id="@+id/textView1"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:text="Log in"
+        android:text="@string/login"
         android:textAlignment="center"
         android:textAppearance="?android:attr/textAppearanceLarge" />
 
@@ -21,7 +21,7 @@
             android:id="@+id/textView2"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="User:"
+            android:text="@string/userlabel"
             android:textAppearance="?android:attr/textAppearanceMedium" />
 
         <EditText
@@ -40,7 +40,7 @@
             android:id="@+id/textView3"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="Pass:"
+            android:text="@string/passwordlabel"
             android:textAppearance="?android:attr/textAppearanceMedium" />
 
         <EditText
@@ -59,6 +59,6 @@
         android:id="@+id/button1"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:text="Log In" />
+        android:text="@string/login" />
 
 </LinearLayout>
\ No newline at end of file
index 04f173f890ad9b5c6715aee4266e1b1f5af9071e..f95d124958dc3f946893c7a52ce07b2ba34a6b0d 100644 (file)
@@ -1,6 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
 <menu xmlns:android="http://schemas.android.com/apk/res/android" >
-    <item android:id="@+id/item1" android:title="New Event" android:visible="true"></item>
+    <item android:id="@+id/NewEvent" android:title="New Event" 
+        android:visible="true" android:showAsAction="always"
+        android:icon="@android:drawable/ic_menu_add"
+    >
+        
+    </item>
     
 
 </menu>
index 52ff71fe2e3815e0a6b9103d7c8e158e7dd85326..1b3bd9c2a6e7ae86739beebdf32b74ddc63176b1 100644 (file)
@@ -2,5 +2,19 @@
 
     <string name="app_name">Unical</string>
     <string name="app_id">148275978690487</string>
-
-</resources>
\ No newline at end of file
+    <string name="title">Title</string>
+    <string name="description">Description</string>
+    <string name="login">Log In</string>
+    <string name="location">Location</string>
+    <string name="userlabel">User: </string>
+    <string name="passwordlabel">Pass: </string>
+    <string name="locationlabel">Location: </string>
+    <string name="repeatlabel">Repeating </string>
+    
+    <string-array name="Repeat">
+        <item>Daily</item>
+        <item>Weekly</item>
+        <item>Monthly</item>
+        <item>Yearly</item>
+    </string-array>
+</resources>
diff --git a/src/ro/ieval/unical/addEventActivity.java b/src/ro/ieval/unical/addEventActivity.java
new file mode 100644 (file)
index 0000000..d9b04e9
--- /dev/null
@@ -0,0 +1,16 @@
+package ro.ieval.unical;
+import ro.ieval.unical.R;
+import android.R.string;
+import android.app.Activity;
+import android.os.Bundle;
+import android.widget.Spinner;
+
+
+public class addEventActivity extends Activity {
+       @Override
+       protected void onCreate(Bundle savedInstanceState) {
+               super.onCreate(savedInstanceState);
+               Spinner spinner=(Spinner) findViewById(R.id.spinner1);
+               setContentView(R.layout.addevent);
+       }
+}
index e65b571f5160e9bedcd8d4bb9b5eef3dc66e2cee..5457e83d4eefd2f24b1f4496b208da1d3bbd6240 100644 (file)
@@ -21,6 +21,9 @@ import android.os.Bundle;
 import android.os.Handler;
 import android.preference.PreferenceManager;
 import android.util.Base64;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
 import android.view.View;
 import android.widget.Button;
 import android.widget.EditText;
@@ -39,6 +42,7 @@ public class mainActivity extends android.app.Activity {
                
                //log in
                super.onCreate(savedInstanceState);
+               
                final SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(this);
                if(prefs.getBoolean("FirstTime", true)) {
                        prefs.edit().putBoolean("FirstTime", false).commit();
@@ -46,4 +50,25 @@ public class mainActivity extends android.app.Activity {
                        startActivity(i);
                }
        }
+       
+       @Override
+       public boolean onCreateOptionsMenu(Menu menu) {
+               // TODO Auto-generated method stub
+               MenuInflater inflater = getMenuInflater();
+           inflater.inflate(R.menu.options, menu);
+               return true;
+       }
+       
+       @Override
+       public boolean onOptionsItemSelected(MenuItem item) {
+           // Handle item selection
+           switch (item.getItemId()) {
+               case R.id.NewEvent:
+                       Intent i=new Intent(this,addEventActivity.class);
+                               startActivity(i);
+                   return true;
+               default:
+                   return true;
+           }
+       }
 }
This page took 0.039479 seconds and 4 git commands to generate.