fixed renew checkout item button crash and modified checkout item layout
authordrizea <danielrizea27@gmail.com>
Wed, 18 Jul 2012 08:56:13 +0000 (11:56 +0300)
committerdrizea <danielrizea27@gmail.com>
Wed, 18 Jul 2012 08:56:13 +0000 (11:56 +0300)
Open-ILS/src/Android/res/layout/checkout_list_item.xml
Open-ILS/src/Android/src/org/evergreen/android/accountAccess/AccountAccess.java
Open-ILS/src/Android/src/org/evergreen/android/accountAccess/checkout/ItemsCheckOutListView.java
Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/SearchCatalog.java

index 1ad3164..bbda1fb 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:gravity="left|center"
@@ -13,7 +13,8 @@
     android:layout_height="wrap_content"
     android:orientation="vertical"
     android:gravity="center_vertical" 
-       android:paddingLeft="4dip"
+       android:paddingLeft="5dip"
+       android:layout_alignParentLeft="true"
        >
        
        
                <TextView
                android:id="@+id/checkout_record_title"
                style="@style/TitleSearchStyleList"
-               android:layout_width="wrap_content"
+               android:layout_width="fill_parent"
                android:layout_height="wrap_content"/>   
            
                <TextView
                android:id="@+id/checkout_record_author"
                style="@style/AuthorSearchStyleList"
-               android:layout_width="wrap_content"
-               android:layout_height="wrap_content"/>
-                   
-               <TextView
-               android:id="@+id/checkout_renewals_remaining"
-               style="@style/PubSearchStyleList"
-               android:layout_width="wrap_content"
+               android:layout_width="fill_parent"
                android:layout_height="wrap_content"/>
                
+               
                <TextView
                android:id="@+id/checkout_due_date"
                style="@style/PubSearchStyleList"
-               android:layout_width="wrap_content"
+               android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:text="due date"
                />
@@ -51,6 +47,7 @@
                 android:layout_height="wrap_content"
                 android:text="@string/renew_button" 
                 android:layout_gravity="right"  
+                android:layout_alignParentRight="true"
                    />
 
-</LinearLayout>
\ No newline at end of file
+</RelativeLayout>
\ No newline at end of file
index 1608ae1..822c67d 100644 (file)
@@ -800,7 +800,6 @@ public class AccountAccess {
        
                //get status
                holdObj.status = ((Map<String,Integer>)hold_status).get("status");
-               
                return hold_status;
        }
        
index 0e740c1..778f989 100644 (file)
@@ -175,9 +175,6 @@ public class ItemsCheckOutListView extends Activity{
                                //Get reference to TextView - record Publisher date+publisher
                                recordDueDate = (TextView) row.findViewById(R.id.checkout_due_date);
                    
-                               //Get remaining renewals
-                               recordRenewals = (TextView) row.findViewById(R.id.checkout_renewals_remaining);
-                               
                                renewButton = (TextView) row.findViewById(R.id.renew_button);
                                
                                renewButton.setText("renew : " + record.getRenewals());
@@ -249,14 +246,16 @@ public class ItemsCheckOutListView extends Activity{
                                                                                                }
                                                                                        }               
                                                                                        
-                                                                                       listAdapter.clear();
-                                                                                       for(int i=0;i<circRecords.size();i++){
-                                                                                               listAdapter.add(circRecords.get(i));
-                                                                                       }
+                                                                                       
                                                                                        runOnUiThread(new Runnable() {
-                                                                                               
+                                       
                                                                                                @Override
                                                                                                public void run() {
+                                                                                                       listAdapter.clear();
+                                                                                                       for(int i=0;i<circRecords.size();i++){
+                                                                                                               listAdapter.add(circRecords.get(i));
+                                                                                                       }
+                                                                                                       
                                                                                                        progressDialog.dismiss();
                                                                                                        listAdapter.notifyDataSetChanged();
                                                                                                }
@@ -273,7 +272,6 @@ public class ItemsCheckOutListView extends Activity{
                                recordTitle.setText(record.getTitle());
                                recordAuthor.setText(record.getAuthor());
                                recordDueDate.setText(record.getDueDate());
-                               recordRenewals.setText(record.getRenewals()+"");
                        }
                        
                        return row;
index c21d0de..f335448 100644 (file)
@@ -262,16 +262,17 @@ public class SearchCatalog {
                
                CopyInformation.availableOrgStatuses = new LinkedHashMap<String,String>();
                
-               for(int i=0;i<ccs_list.size();i++){
-                       OSRFObject ccs_obj = ccs_list.get(i);
-                       if(ccs_obj.getString("opac_visible").equals("t")){
-                               
-                               CopyInformation.availableOrgStatuses.put(ccs_obj.getInt("id")+"", ccs_obj.getString("name"));
-                               System.out.println("Add status " + ccs_obj.getString("name"));
-                               
+               if(ccs_list != null){
+                       for(int i=0;i<ccs_list.size();i++){
+                               OSRFObject ccs_obj = ccs_list.get(i);
+                               if(ccs_obj.getString("opac_visible").equals("t")){
+                                       
+                                       CopyInformation.availableOrgStatuses.put(ccs_obj.getInt("id")+"", ccs_obj.getString("name"));
+                                       System.out.println("Add status " + ccs_obj.getString("name"));
+                                       
+                               }
                        }
                }
-               
                return ccs_list;
        }