main menu icons with text + layout modifications on checkout items
authordrizea <danielrizea27@gmail.com>
Wed, 8 Aug 2012 20:33:37 +0000 (23:33 +0300)
committerdrizea <danielrizea27@gmail.com>
Wed, 8 Aug 2012 20:33:37 +0000 (23:33 +0300)
16 files changed:
Open-ILS/src/Android/AndroidManifest.xml
Open-ILS/src/Android/res/drawable/advanced_search.png
Open-ILS/src/Android/res/drawable/background_grey_image.xml
Open-ILS/src/Android/res/drawable/barcode_scan.png
Open-ILS/src/Android/res/drawable/evergreen_1_256x256x32_color.png [new file with mode: 0644]
Open-ILS/src/Android/res/drawable/evergreen_1_256x256x32_grey.png
Open-ILS/src/Android/res/drawable/library_hours.png
Open-ILS/src/Android/res/drawable/preferences.png
Open-ILS/src/Android/res/layout-land/search_result_list.xml
Open-ILS/src/Android/res/layout/checkout_list.xml
Open-ILS/src/Android/res/layout/checkout_list_item.xml
Open-ILS/src/Android/res/layout/search_result_list.xml
Open-ILS/src/Android/res/values/strings.xml
Open-ILS/src/Android/res/values/styles.xml
Open-ILS/src/Android/src/org/evergreen/android/accountAccess/checkout/ItemsCheckOutListView.java
Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/SearchCatalogListView.java

index 1c653d3..f01cd3f 100644 (file)
@@ -14,6 +14,9 @@
        <uses-permission android:name="android.permission.WAKE_LOCK" />
        <uses-feature android:name="android.hardware.camera" />
        <uses-feature android:name="android.hardware.camera.autofocus" />
+       <uses-permission android:name="android.permission.READ_CALENDAR" />
+    <uses-permission android:name="android.permission.WRITE_CALENDAR" />
+       
        
     <application
         android:icon="@drawable/evergreen_launcher_icon"
index 133fb2a..6f8de5a 100644 (file)
Binary files a/Open-ILS/src/Android/res/drawable/advanced_search.png and b/Open-ILS/src/Android/res/drawable/advanced_search.png differ
index a44cd59..182ff99 100644 (file)
@@ -1,3 +1,16 @@
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
-    android:src="@drawable/evergreen_1_256x256x32_grey"
-    android:gravity="center"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<layer-list>
+    <item>
+        <shape
+            xmlns:android="http://schemas.android.com/apk/res/android"
+            android:shape="rectangle" >
+             <solid android:color="@color/background" /> 
+        </shape>
+    </item>
+    <item>
+        <bitmap
+            xmlns:android="http://schemas.android.com/apk/res/android"
+            android:gravity="center"
+            android:src="@drawable/evergreen_1_256x256x32_grey" />
+    </item>
+</layer-list>
\ No newline at end of file
index e5b0024..210b15e 100644 (file)
Binary files a/Open-ILS/src/Android/res/drawable/barcode_scan.png and b/Open-ILS/src/Android/res/drawable/barcode_scan.png differ
diff --git a/Open-ILS/src/Android/res/drawable/evergreen_1_256x256x32_color.png b/Open-ILS/src/Android/res/drawable/evergreen_1_256x256x32_color.png
new file mode 100644 (file)
index 0000000..256d172
Binary files /dev/null and b/Open-ILS/src/Android/res/drawable/evergreen_1_256x256x32_color.png differ
index fe7aace..e37e387 100644 (file)
Binary files a/Open-ILS/src/Android/res/drawable/evergreen_1_256x256x32_grey.png and b/Open-ILS/src/Android/res/drawable/evergreen_1_256x256x32_grey.png differ
index 5eac49d..cc027d3 100644 (file)
Binary files a/Open-ILS/src/Android/res/drawable/library_hours.png and b/Open-ILS/src/Android/res/drawable/library_hours.png differ
index 819cb8d..0db4e84 100644 (file)
Binary files a/Open-ILS/src/Android/res/drawable/preferences.png and b/Open-ILS/src/Android/res/drawable/preferences.png differ
index f245754..6e60915 100644 (file)
          android:orientation="horizontal"
          android:layout_below="@id/header"
          android:layout_centerHorizontal="true"
+         android:background="@drawable/background_grey_image"
+         android:gravity="center"
          >
 
              
-             <ImageButton
+              <Button
                 android:id="@+id/menu_advanced_search_button"
                 style="@style/MenuListButton"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:src="@drawable/advanced_search" />
+                android:layout_width="96dp"
+                android:layout_height="96dp"
+                android:background="@drawable/advanced_search"
+                       android:text="@string/menu_advanced_search"
+                
+                 />
 
-            <ImageButton
+            <Button
                 android:id="@+id/library_hours_button"
                 style="@style/MenuListButton"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:src="@drawable/library_hours" />
-            
+                android:layout_width="96dp"
+                android:layout_height="96dp"
+                android:background="@drawable/library_hours"
+                android:text="@string/menu_library_hours"
+                 />
+
 
-            <ImageButton
+            <Button
                 android:id="@+id/preference_button"
                 style="@style/MenuListButton"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:src="@drawable/preferences"
+                android:layout_width="96dp"
+                android:layout_height="96dp"
+                android:background="@drawable/preferences"
+                android:text="@string/menu_preferences"
                 />
             
-                <ImageButton
+                <Button
                 android:id="@+id/barcode_scan_button"
                 style="@style/MenuListButton"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:src="@drawable/barcode_scan"/>
+                android:layout_width="96dp"
+                android:layout_height="96dp"
+                android:background="@drawable/barcode_scan"
+                android:text="@string/menu_barcode_scan"
+                />
+            
             
             
      </LinearLayout>
index 3e80402..723a074 100644 (file)
@@ -2,21 +2,25 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
-    android:orientation="vertical" >
+    android:orientation="vertical"
+    android:padding="4dip"
+     >
     
     
        <include android:id="@+id/header_actionbar" layout="@layout/simple_actionbar"/>
     
     <LinearLayout android:layout_width="fill_parent"
-         android:layout_height="wrap_content">
+         android:layout_height="wrap_content"
+         android:layout_marginTop="2dip"
+         >
          <TextView 
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
-             android:text="@string/search_result_text"
+             android:text="@string/checkout_item_txt"
              />
          
          <TextView 
-             android:id="@+id/search_result_number"
+             android:id="@+id/checkout_items_number"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textStyle="bold"
index bbda1fb..80242e7 100644 (file)
@@ -1,53 +1,68 @@
 <?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:gravity="left|center"
-       android:paddingBottom="3dip"
-       android:paddingTop="3dip" 
-       android:paddingLeft="3dip" 
-    android:orientation="horizontal" >
-
-       <LinearLayout 
-       android:layout_width="fill_parent"
-    android:layout_height="wrap_content"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
     android:orientation="vertical"
-    android:gravity="center_vertical" 
-       android:paddingLeft="5dip"
-       android:layout_alignParentLeft="true"
-       >
-       
-       
-           
-               <TextView
-               android:id="@+id/checkout_record_title"
-               style="@style/TitleSearchStyleList"
-               android:layout_width="fill_parent"
-               android:layout_height="wrap_content"/>   
-           
-               <TextView
-               android:id="@+id/checkout_record_author"
-               style="@style/AuthorSearchStyleList"
-               android:layout_width="fill_parent"
-               android:layout_height="wrap_content"/>
-               
-               
-               <TextView
-               android:id="@+id/checkout_due_date"
-               style="@style/PubSearchStyleList"
-               android:layout_width="fill_parent"
-               android:layout_height="wrap_content"
-               android:text="due date"
-               />
-               
-       </LinearLayout>
-               <Button 
-                android:id="@+id/renew_button"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/renew_button" 
-                android:layout_gravity="right"  
-                android:layout_alignParentRight="true"
-                   />
-
-</RelativeLayout>
\ No newline at end of file
+    android:paddingBottom="3dip"
+    android:paddingLeft="3dip"
+    android:paddingTop="3dip" >
+
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal" >
+
+        <TextView
+            android:id="@+id/checkout_record_title"
+            style="@style/TitleSearchStyleList"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_weight="1" />
+
+        <Button
+            android:id="@+id/renew_button"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/renew_button" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal" >
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:orientation="vertical" >
+
+            <TextView
+                android:id="@+id/checkout_record_author"
+                style="@style/AuthorSearchStyleList"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content" />
+
+            <TextView
+                android:id="@+id/checkout_due_date"
+                style="@style/PubSearchStyleList"
+                android:layout_width="fill_parent"
+                android:gravity="left"
+                android:layout_height="wrap_content" />
+        </LinearLayout>
+
+        
+        <TextView 
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/add_to_calendar"
+            />
+        
+        <CheckBox
+            android:id="@+id/add_reminder_to_calendar"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" />
+        
+    </LinearLayout>
+
+</LinearLayout>
\ No newline at end of file
index a2e1dd7..8ead6e9 100644 (file)
@@ -99,6 +99,8 @@
         android:layout_marginTop="5dip"
         android:gravity="center"
         android:orientation="vertical"
+        android:background="@drawable/background_grey_image"
+        
          >
 
         <LinearLayout
             android:gravity="center"
              >
 
-            <ImageButton
+            <Button
                 android:id="@+id/menu_advanced_search_button"
                 style="@style/MenuListButton"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:src="@drawable/advanced_search" />
-
-            <ImageButton
+                android:layout_width="96dp"
+                android:layout_height="96dp"
+                android:background="@drawable/advanced_search"
+                       android:text="@string/menu_advanced_search"
+                
+                 />
+
+            <Button
                 android:id="@+id/library_hours_button"
                 style="@style/MenuListButton"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:src="@drawable/library_hours" />
+                android:layout_width="96dp"
+                android:layout_height="96dp"
+                android:background="@drawable/library_hours"
+                android:text="@string/menu_library_hours"
+                 />
         </LinearLayout>
 
         <LinearLayout
             android:layout_height="wrap_content"
             android:gravity="center" >
 
-            <ImageButton
+            <Button
                 android:id="@+id/preference_button"
                 style="@style/MenuListButton"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:src="@drawable/preferences"
+                android:layout_width="96dp"
+                android:layout_height="96dp"
+                android:background="@drawable/preferences"
+                android:text="@string/menu_preferences"
                 />
             
-                <ImageButton
+                <Button
                 android:id="@+id/barcode_scan_button"
                 style="@style/MenuListButton"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:src="@drawable/barcode_scan"/>
+                android:layout_width="96dp"
+                android:layout_height="96dp"
+                android:background="@drawable/barcode_scan"
+                android:text="@string/menu_barcode_scan"
+                />
             
         </LinearLayout>
     </LinearLayout>
index b1adcc2..8098c89 100644 (file)
@@ -1,6 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
 
+    <!-- Main menu button text -->
+    <string name="menu_advanced_search">advanced search</string>
+    <string name="menu_preferences">settings</string>
+    <string name="menu_library_hours">library hours</string>
+    <string name="menu_barcode_scan">barcode scan</string>
+    
     <!-- Header portion  -->
     <string name="library_text_logo"> Evergreen </string>
     <string name="my_account_button_text">My Account</string>
     <string name="hold_expire_time_hint">Hold expire time</string>
     <string name="hold_thaw_date_hint">Date when the hold is frozen</string>
     
+    <!-- Checkout items -->
+    <string name="checkout_item_txt">Checkout items: </string>
+    <string name="add_to_calendar">Calendar reminder</string>
+    
     <!-- Fines Activity -->
     <string name="total_owned">Total Owned </string>
     <string name="total_paid">Total Paid</string>
index 2df4733..76ffad8 100644 (file)
     
     <!--  Menu List Buttons -->
    <style name="MenuListButton">
-               <item name="android:background">@android:color/transparent</item>
                <item name="android:layout_margin">5dip</item>
+               <item name="android:gravity">top|center_horizontal</item>
+               <item name="android:paddingTop">5dip</item>
+               <item name="android:textColor">#eee</item>
+               <item name="android:textStyle">bold</item>
+               
    </style>
     
    <style name="MenuListRedButton">
index c0319d0..42c0c06 100644 (file)
@@ -1,6 +1,8 @@
 package org.evergreen.android.accountAccess.checkout;
 
+import java.sql.Date;
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.List;
 
 import org.evergreen.android.R;
@@ -15,9 +17,15 @@ import org.evergreen.android.views.AccountScreenDashboard;
 
 import android.app.Activity;
 import android.app.ProgressDialog;
+import android.content.ContentResolver;
+import android.content.ContentValues;
 import android.content.Context;
 import android.content.Intent;
+import android.database.Cursor;
+import android.net.ParseException;
+import android.net.Uri;
 import android.os.Bundle;
+import android.text.format.Time;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.Menu;
@@ -28,7 +36,9 @@ import android.view.View.OnClickListener;
 import android.view.ViewGroup;
 import android.widget.ArrayAdapter;
 import android.widget.Button;
-import android.widget.ImageButton;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.CompoundButton.OnCheckedChangeListener;
 import android.widget.ListView;
 import android.widget.TextView;
 import android.widget.Toast;
@@ -55,11 +65,18 @@ public class ItemsCheckOutListView extends Activity{
        
        private TextView headerTitle;
        
+       private TextView itemsNo;
+       
+
+       
+       private Activity thisActivity;
+       
        @Override
        public void onCreate(Bundle savedInstanceState) {
                // TODO Auto-generated method stub
                super.onCreate(savedInstanceState);
                
+               thisActivity = this;
                setContentView(R.layout.checkout_list);
                setTitle("Checkout items");
                
@@ -87,6 +104,7 @@ public class ItemsCheckOutListView extends Activity{
         //end header portion actions
                
                context = this;
+               itemsNo = (TextView) findViewById(R.id.checkout_items_number);
                accountAccess = AccountAccess.getAccountAccess();
                lv = (ListView) findViewById(R.id.checkout_items_list);
                circRecords = new ArrayList<CircRecord>();
@@ -126,6 +144,7 @@ public class ItemsCheckOutListView extends Activity{
                                                for(int i=0;i<circRecords.size();i++)
                                                        listAdapter.add(circRecords.get(i));
                                                
+                                               itemsNo.setText(" " + circRecords.size() + "");
                                                
                                                progressDialog.dismiss();       
                                                
@@ -149,6 +168,9 @@ public class ItemsCheckOutListView extends Activity{
                else
                        Toast.makeText(context, "You must be authenticated to retrieve circ records", Toast.LENGTH_LONG);
 
+               
+               
+               
 
        }
        @Override
@@ -174,6 +196,7 @@ public class ItemsCheckOutListView extends Activity{
                private TextView recordDueDate;
                private TextView recordRenewals;
                private TextView renewButton;
+               private CheckBox reminderNotification;
                
                private List<CircRecord> records = new ArrayList<CircRecord>();
 
@@ -232,6 +255,8 @@ public class ItemsCheckOutListView extends Activity{
                    
                                renewButton = (TextView) row.findViewById(R.id.renew_button);
                                
+                               reminderNotification = (CheckBox) row.findViewById(R.id.add_reminder_to_calendar);
+                               
                                renewButton.setText("renew : " + record.getRenewals());
                                
                                renewButton.setOnClickListener(new OnClickListener() {
@@ -322,6 +347,18 @@ public class ItemsCheckOutListView extends Activity{
                                                                renew.start();
                                                }
                                        });
+                               
+                               reminderNotification.setOnCheckedChangeListener(new OnCheckedChangeListener() {
+                                       
+                                       @Override
+                                       public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+
+                                               if(isChecked == true){
+                                       Toast.makeText(context, "Add ", Toast.LENGTH_SHORT).show();
+                                               }
+                                       }
+                               });
+                               
                                //set text
                                System.out.println("Row" + record.getTitle() + " " + record.getAuthor() + " " + record.getDueDate() + " " + record.getRenewals());
                                recordTitle.setText(record.getTitle());
index 12fdd1d..8a570d7 100644 (file)
@@ -96,13 +96,13 @@ public class SearchCatalogListView extends Activity{
        
        private View searchOptionsMenu = null;
        
-       private ImageButton advancedSearchButton = null;
+       private Button advancedSearchButton = null;
        
-       private ImageButton libraryHoursButton = null;
+       private Button libraryHoursButton = null;
        
-       private ImageButton preferenceButton = null;
+       private Button preferenceButton = null;
        
-       private ImageButton barcodeScanButton = null;
+       private Button barcodeScanButton = null;
        
        private Button homeButton = null;
        
@@ -137,7 +137,7 @@ public class SearchCatalogListView extends Activity{
                });
         //end header portion actions
 
-        advancedSearchButton = (ImageButton) findViewById(R.id.menu_advanced_search_button);
+        advancedSearchButton = (Button) findViewById(R.id.menu_advanced_search_button);
         
         advancedSearchButton.setOnClickListener(new OnClickListener() {
                        @Override
@@ -151,7 +151,7 @@ public class SearchCatalogListView extends Activity{
         AccountAccess ac = AccountAccess.getAccountAccess();
         bookBags = ac.bookBags;
         
-        libraryHoursButton = (ImageButton) findViewById(R.id.library_hours_button);
+        libraryHoursButton = (Button) findViewById(R.id.library_hours_button);
         libraryHoursButton.setOnClickListener(new OnClickListener() {
                        @Override
                        public void onClick(View v) {
@@ -159,7 +159,7 @@ public class SearchCatalogListView extends Activity{
                        }
                });
         
-        preferenceButton = (ImageButton) findViewById(R.id.preference_button);
+        preferenceButton = (Button) findViewById(R.id.preference_button);
         preferenceButton.setOnClickListener(new OnClickListener() {
                        @Override
                        public void onClick(View v) {
@@ -168,7 +168,7 @@ public class SearchCatalogListView extends Activity{
                        }
                });
         
-        barcodeScanButton = (ImageButton) findViewById(R.id.barcode_scan_button);
+        barcodeScanButton = (Button) findViewById(R.id.barcode_scan_button);
         barcodeScanButton.setOnClickListener(new OnClickListener() {
                        
                        @Override