Bläddra i källkod

Added initial UI to ownCloud sample client for oc_framework

David A. Velasco 11 år sedan
förälder
incheckning
1fa57db87b

+ 5 - 2
oc_framework/sample_client/AndroidManifest.xml

@@ -7,8 +7,11 @@
         android:minSdkVersion="8"
         android:targetSdkVersion="19" />
     <application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
-        <activity android:name="MainActivity"
-                  android:label="@string/app_name">
+        <activity 	android:name="MainActivity"
+                  	android:label="@string/app_name"
+					android:screenOrientation="portrait"
+   					android:configChanges="orientation|keyboardHidden"                  
+                  >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />

+ 66 - 10
oc_framework/sample_client/res/layout/main.xml

@@ -1,13 +1,69 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
     >
-<TextView
-    android:layout_width="fill_parent"
-    android:layout_height="wrap_content"
-    android:text="@string/hello_word"
-    />
-</LinearLayout>
+
+    <Button
+        android:id="@+id/button_refresh"
+        style="@style/ButtonStyle"
+        android:layout_alignParentLeft="true"
+        android:layout_alignParentTop="true"
+        android:text="@string/refresh" 
+        />
+
+    <ListView
+        android:id="@+id/list_view"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+		android:layout_below="@+id/button_refresh" 
+        android:layout_above="@+id/button_upload"
+        android:layout_alignParentLeft="true"
+        android:layout_alignParentRight="true"
+        >
+    </ListView>
+
+    <Button
+        android:id="@+id/button_upload"
+        style="@style/ButtonStyle"
+        android:layout_alignParentLeft="true"
+        android:layout_above="@+id/frame"
+        android:text="@string/upload"
+        />
+
+    <Button
+        android:id="@+id/button_delete_remote"
+        style="@style/ButtonStyle"
+        android:layout_alignParentRight="true"
+        android:layout_above="@id/frame"
+        android:text="@string/delete_remote_file" 
+        />
+
+    <FrameLayout
+        android:id="@id/frame"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/frame_height"
+        android:layout_alignParentLeft="true"
+        android:layout_alignParentRight="true"
+        android:layout_above="@+id/button_download"
+        >
+    </FrameLayout>
+
+    <Button
+        android:id="@id/button_download"
+        style="@style/ButtonStyle"
+        android:layout_alignParentBottom="true"
+        android:layout_alignParentLeft="true"
+        android:text="@string/download" 
+        />
+
+    <Button
+        android:id="@+id/button_delete_local"
+        style="@style/ButtonStyle"
+        android:layout_alignParentBottom="true"
+        android:layout_alignParentRight="true"
+        android:text="@string/delete_local_file" 
+        />
+
+</RelativeLayout>
 

+ 8 - 0
oc_framework/sample_client/res/values-v11/styles.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+    <style name="ButtonStyle" parent="@android:style/Widget.Holo.Button">
+        <item name="android:layout_width">160dp</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:textSize">14sp</item>
+    </style>
+</resources>

+ 4 - 0
oc_framework/sample_client/res/values/dimensions.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <dimen name="frame_height">160dp</dimen>
+</resources>

+ 5 - 1
oc_framework/sample_client/res/values/strings.xml

@@ -1,5 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
     <string name="app_name">ownCloud Sample Client</string>
-    <string name="hello_word">Hello World. This is the ownCloud sample client app before doing nothing ownCloud-related.</string>
+    <string name="refresh">Refresh</string>
+    <string name="upload">Upload</string>
+    <string name="delete_remote_file">Delete remote file</string>
+    <string name="download">Download</string>
+    <string name="delete_local_file">Delete local file</string>
 </resources>

+ 8 - 0
oc_framework/sample_client/res/values/styles.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+    <style name="ButtonStyle" parent="@android:style/Widget.Button">
+        <item name="android:layout_width">160dp</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:textSize">14sp</item>
+    </style>
+</resources>