Cleanup of Search Details and Copy Information activities
authorkenstir <kenstir@gmail.com>
Sat, 5 Dec 2015 20:13:22 +0000 (15:13 -0500)
committerkenstir <kenstir@gmail.com>
Sat, 5 Dec 2015 20:13:22 +0000 (15:13 -0500)
* Do not show any copy info on Search Details; show it only on Copy Information
* Copy Information page cleaned up.  Not beautiful but at least readable now.
* Replaced "add to bookbag" button with "show copies" button.  I never used bookbags and they are not visible anywhere else in the app.  We'll see if there are any complaints.

25 files changed:
Open-ILS/src/Android/core/res/layout/copy_information.xml
Open-ILS/src/Android/core/res/layout/record_details_basic_fragment.xml
Open-ILS/src/Android/core/res/values/dimens.xml
Open-ILS/src/Android/core/res/values/strings.xml
Open-ILS/src/Android/core/res/values/styles.xml
Open-ILS/src/Android/core/src/org/evergreen_ils/accountAccess/bookbags/BookBagDetails.java
Open-ILS/src/Android/core/src/org/evergreen_ils/accountAccess/bookbags/BookbagsListView.java
Open-ILS/src/Android/core/src/org/evergreen_ils/accountAccess/checkout/ItemsCheckOutListView.java
Open-ILS/src/Android/core/src/org/evergreen_ils/accountAccess/holds/HoldDetails.java
Open-ILS/src/Android/core/src/org/evergreen_ils/accountAccess/holds/HoldsListView.java
Open-ILS/src/Android/core/src/org/evergreen_ils/accountAccess/holds/PlaceHold.java
Open-ILS/src/Android/core/src/org/evergreen_ils/auth/AccountAuthenticator.java
Open-ILS/src/Android/core/src/org/evergreen_ils/auth/AuthenticatorActivity.java
Open-ILS/src/Android/core/src/org/evergreen_ils/auth/TestAuthActivity.java
Open-ILS/src/Android/core/src/org/evergreen_ils/barcodescan/camera/AutoFocusCallback.java
Open-ILS/src/Android/core/src/org/evergreen_ils/globals/Utils.java
Open-ILS/src/Android/core/src/org/evergreen_ils/searchCatalog/AdvancedSearchActivity.java
Open-ILS/src/Android/core/src/org/evergreen_ils/searchCatalog/CopyCountInformation.java
Open-ILS/src/Android/core/src/org/evergreen_ils/searchCatalog/CopyInformation.java
Open-ILS/src/Android/core/src/org/evergreen_ils/searchCatalog/MoreCopyInformation.java
Open-ILS/src/Android/core/src/org/evergreen_ils/searchCatalog/RecordInfo.java
Open-ILS/src/Android/core/src/org/evergreen_ils/searchCatalog/SearchCatalogListView.java
Open-ILS/src/Android/core/src/org/evergreen_ils/services/NotificationReceiver.java
Open-ILS/src/Android/core/src/org/evergreen_ils/utils/ui/BasicDetailsFragment.java
Open-ILS/src/Android/core/src/org/evergreen_ils/views/splashscreen/LoadingTask.java

index 8ad6ea1..24e5916 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
+    android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:orientation="vertical" >
     
@@ -8,28 +8,39 @@
     <LinearLayout 
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
-        android:orientation="horizontal"
+        android:orientation="vertical"
         >
         
         <TextView 
             android:id="@+id/copy_information_library"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            />
-        
-        <TextView 
-            android:id="@+id/copy_information_call_number"
-            android:layout_width="wrap_content"
+            android:layout_width="fill_parent"
             android:layout_height="wrap_content"
+            android:text="Athol Public Library"
             />
-        
-        <TextView 
-            android:id="@+id/copy_information_copy_location"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            />
-        
-        
+
+        <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                android:paddingLeft="10dip">
+
+            <TextView
+                    android:id="@+id/copy_information_call_number"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:ellipsize="end"
+                    android:text="j 793.01 Martin PBK"
+                    android:layout_weight="1" android:singleLine="true"/>
+
+            <TextView
+                    android:id="@+id/copy_information_copy_location"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:ellipsize="end"
+                    android:text="First Floor Juvenile"
+                    android:layout_weight="1" android:singleLine="true"/>
+        </LinearLayout>
+
     </LinearLayout>
     
     
@@ -38,7 +49,7 @@
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:orientation="vertical"
-        android:paddingLeft="30dip"
+        android:layout_marginLeft="10dip"
         >
         
         
index a77501f..493f1db 100644 (file)
                     android:layout_weight="1"
                     android:orientation="vertical"
                 >
-                
-                       <TextView
-                       android:id="@+id/record_details_simple_title"
-                       style="@style/textLarge" 
-                       />
+
+                    <TextView
+                            android:id="@+id/record_details_simple_title"
+                            style="@style/textLarge"
+                    />
 
                     <TextView
                             android:id="@+id/record_details_format"
                             style="@style/textSmall"
-                            android:layout_marginTop="5dip"
+                            android:layout_marginTop="3dip"
                             />
 
                     <TextView
                             android:id="@+id/record_details_simple_author"
                             style="@style/textSmall"
-                            android:layout_marginTop="5dip"
+                            android:layout_marginTop="3dip"
                             />
 
-                       <TextView
-                       android:id="@+id/record_details_simple_publisher"
-                       style="@style/textSmall" 
-                       android:layout_marginTop="3dip"
-                       />
+                    <TextView
+                            android:id="@+id/record_details_simple_publisher"
+                            style="@style/textSmall"
+                            android:layout_marginTop="3dip"
+                    />
                 </LinearLayout>
                 
                 <com.android.volley.toolbox.NetworkImageView
                     android:layout_alignParentLeft="true"
                     android:text="@string/button_place_hold"    
                     />
-                
+
                 <Button
-                    android:id="@+id/simple_add_to_bookbag_button"
+                    android:id="@+id/show_copy_information_button"
                     style="@style/SearchDetailsActionButton"
                     android:layout_height="wrap_content"
                     android:layout_width="150dip"
                     android:layout_alignParentRight="true"
-                                       android:text="@string/button_add_to_bookbag"
+                    android:text="@string/show_more_text"
                     />
             </RelativeLayout>
 
                 android:layout_height="wrap_content"
                 android:layout_width="match_parent"
                 />
-
+            <!--
                        <LinearLayout
                            android:id="@+id/record_details_copy_information"
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:orientation="vertical"
-                           >    
+                           >
                        </LinearLayout>
-        
-               <LinearLayout
-               android:id="@+id/record_details_show_more"    
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center"
-               android:orientation="horizontal"
-        style="@style/SearchDetailsInfoSeparator"
-        >
+            <LinearLayout
+                    android:id="@+id/record_details_show_more"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:gravity="center"
+                    android:orientation="horizontal"
+                    style="@style/SearchDetailsInfoSeparator"
+            >
+
+                <ImageView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:src="@drawable/navigation_expand"
+                />
 
-               <ImageView 
-                   android:layout_width="wrap_content"
-                   android:layout_height="wrap_content"
-                   android:src="@drawable/navigation_expand"
-                   />    
-                   
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textColor="@color/blue"
-            android:text="@string/show_more_text"
-            android:textStyle="bold"
-            android:textSize="@dimen/search_details_rect_text_size"
-        />
-        
-       </LinearLayout>
-                       
-                       <TextView
+                <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="@string/show_more_text"
+                       android:textSize="@dimen/search_details_rect_text_size"
+                />
+
+            </LinearLayout>
+                       -->
+
+
+            <TextView
                 style="@style/textLarge"
-                android:text="SUBJECT" />
+                android:text="Subject" />
                
             <TextView
                 android:id="@+id/record_details_simple_subject"
 
             <TextView
                 style="@style/textLarge"
-                android:text="SERIES" />
+                android:text="Series" />
 
             <TextView
                 android:id="@+id/record_details_simple_series"
 
             <TextView
                 style="@style/textLarge"
-                android:text="SYNOPSIS" />
+                android:text="Synopsis" />
 
             <TextView
                 android:id="@+id/record_details_simple_synopsis"
index 82c0900..01086e1 100644 (file)
@@ -22,7 +22,7 @@
     <dimen name="text_size_medium">18sp</dimen>\r
     <dimen name="text_size_large">22sp</dimen>\r
     <dimen name="library_logo_text_size">16sp</dimen>\r
-    <dimen name="search_details_rect_text_size">12dip</dimen>\r
+    <dimen name="search_details_rect_text_size">14dip</dimen>\r
     <dimen name="activity_horizontal_margin">16dp</dimen>\r
     <dimen name="activity_vertical_margin">16dp</dimen>\r
     <dimen name="bigActionButton_marginVertical">18dp</dimen>\r
index 77121f0..bb28b1a 100644 (file)
@@ -51,7 +51,7 @@
     <string name="menu_button_advanced_search">Advanced search</string>
     <string name="menu_button_library_hours">Library hours</string>
     <string name="menu_button_application_preferences">Preferences</string>
-    <string name="copy_information"> Availability of the book :</string>
+    <string name="copy_information">Availability:</string>
     <string name="title_activity_startup">Welcome to Evergreen</string>
     <string name="title_search">Search</string>
     <string name="title_my_account">My Account</string>
     <string name="item_renewed">Item renewed</string>
     <string name="record_of">record %1$d of %2$d</string>
     <string name="displaying_n_of_m_results">displaying %1$d of %2$d results</string>
-    <string name="n_of_m_available">%1$d of %2$s available</string>
+    <string name="n_of_m_available">%1$d of %2$s available at %3$s</string>
 
     <!-- Search Details View -->
-    <string name="show_more_text">Show More</string>
+    <string name="show_more_text">Show Copies</string>
 
     <!-- Place Hold Activity View -->
 
index 26a12c2..909d837 100644 (file)
     <!-- Search Details -->
     <style name="SearchDetailsInfoSeparator">
         <item name="android:background">@drawable/shadow_rect</item>
-        <item name="android:padding">3dip</item>
-        <item name="android:layout_marginTop">3dip</item>
-        <item name="android:textColor">@color/dark</item>
+        <item name="android:textColor">@color/header_title</item>
+        <item name="android:padding">1dip</item>
+        <item name="android:layout_marginTop">1dip</item>
     </style>
 
     <style name="SearchDetailsActionButton">
index 1c8c22f..29316b1 100644 (file)
@@ -58,7 +58,7 @@ import android.widget.Toast;
 
 public class BookBagDetails extends ActionBarActivity {
 
-    private final String TAG = BookBagDetails.class.getName();
+    private final static String TAG = BookBagDetails.class.getName();
 
     public static final int RESULT_CODE_UPDATE = 1;
 
@@ -163,13 +163,10 @@ public class BookBagDetails extends ActionBarActivity {
             @Override
             public void onItemSelected(AdapterView<?> arg0, View arg1,
                     int arg2, long arg3) {
-
             }
 
             @Override
             public void onNothingSelected(AdapterView<?> arg0) {
-                // TODO Auto-generated method stub
-
             }
 
         });
index b7fcaad..0684c70 100644 (file)
@@ -53,7 +53,7 @@ import android.widget.Toast;
 
 public class BookbagsListView extends ActionBarActivity {
 
-    private final String TAG = BookbagsListView.class.getName();
+    private final static String TAG = BookbagsListView.class.getName();
 
     private AccountAccess accountAccess = null;
 
@@ -107,8 +107,6 @@ public class BookbagsListView extends ActionBarActivity {
 
             @Override
             public void onNothingSelected(AdapterView<?> arg0) {
-                // TODO Auto-generated method stub
-
             }
 
         });
@@ -209,17 +207,13 @@ public class BookbagsListView extends ActionBarActivity {
 
     @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
-        // TODO Auto-generated method stub
         super.onActivityResult(requestCode, resultCode, data);
 
         switch (resultCode) {
-
-        case BookBagDetails.RESULT_CODE_UPDATE: {
+        case BookBagDetails.RESULT_CODE_UPDATE:
             Thread getBookBags = new Thread(getBookbagsRunnable);
             getBookBags.start();
-        }
             break;
-
         }
     }
 
index c613b4f..e9a6542 100644 (file)
@@ -50,7 +50,7 @@ import org.w3c.dom.Text;
 
 public class ItemsCheckOutListView extends ActionBarActivity {
 
-    private final String TAG = ItemsCheckOutListView.class.getSimpleName();
+    private final static String TAG = ItemsCheckOutListView.class.getName();
 
     private AccountAccess accountAccess = null;
 
@@ -147,8 +147,6 @@ public class ItemsCheckOutListView extends ActionBarActivity {
     }
 
     class CheckOutArrayAdapter extends ArrayAdapter<CircRecord> {
-        private static final String tag = "CheckoutArrayAdapter";
-
         private TextView recordTitle;
         private TextView recordAuthor;
         private TextView recordFormat;
index 144664f..781bb43 100644 (file)
@@ -59,7 +59,7 @@ import android.widget.Toast;
 
 public class HoldDetails extends ActionBarActivity {
 
-    private final String TAG = HoldDetails.class.getSimpleName();
+    private final static String TAG = HoldDetails.class.getName();
 
     public static final int RESULT_CODE_DELETE_HOLD = 5;
 
index 18b8d97..c539564 100644 (file)
@@ -44,7 +44,7 @@ import java.util.List;
 
 public class HoldsListView extends ActionBarActivity {
 
-    private final String TAG = HoldsListView.class.getSimpleName();
+    private final static String TAG = HoldsListView.class.getName();
 
     private AccountAccess accountAccess = null;
 
@@ -177,7 +177,7 @@ public class HoldsListView extends ActionBarActivity {
     }
 
     class HoldsArrayAdapter extends ArrayAdapter<HoldRecord> {
-        private static final String tag = "CheckoutArrayAdapter";
+        private final String tag = HoldsArrayAdapter.class.getName();
 
         private TextView holdTitle;
         private TextView holdAuthor;
index e63f5a0..01038af 100644 (file)
@@ -59,7 +59,7 @@ import android.widget.Toast;
 
 public class PlaceHold extends ActionBarActivity {
 
-    private final String TAG = PlaceHold.class.getSimpleName();
+    private static final String TAG = PlaceHold.class.getName();
 
     private TextView title;
 
index 2cf9211..8c4ec45 100644 (file)
@@ -13,7 +13,7 @@ import android.util.Log;
 
 public class AccountAuthenticator extends AbstractAccountAuthenticator {
     
-    private final String TAG = AccountAuthenticator.class.getSimpleName();
+    private final static String TAG = AccountAuthenticator.class.getSimpleName();
     private Context context;
 
     public AccountAuthenticator(Context context) {
index 61d7de7..90c7b88 100644 (file)
@@ -38,7 +38,7 @@ import java.util.*;
 
 public class AuthenticatorActivity extends AccountAuthenticatorActivity {
 
-    private final String TAG = AuthenticatorActivity.class.getSimpleName();
+    private final static String TAG = AuthenticatorActivity.class.getSimpleName();
 
     public final static String ARG_ACCOUNT_TYPE = "ACCOUNT_TYPE";
     public final static String ARG_AUTH_TYPE = "AUTH_TYPE";
index 37c8369..2da48d5 100644 (file)
@@ -43,7 +43,7 @@ public class TestAuthActivity extends Activity {
        
        private static final String STATE_DIALOG = "state_dialog";
        private static final String STATE_INVALIDATE = "state_invalidate";
-    private static final String TAG = TestAuthActivity.class.getSimpleName();
+    private static final String TAG = TestAuthActivity.class.getName();
 
     private AccountManager mAccountManager;
     private String mAccountType;
index c19fd2d..e8bda12 100755 (executable)
@@ -23,7 +23,7 @@ import android.util.Log;
 
 final class AutoFocusCallback implements Camera.AutoFocusCallback {
 
-  private static final String TAG = AutoFocusCallback.class.getSimpleName();
+  private final static String TAG = AutoFocusCallback.class.getSimpleName();
 
   private static final long AUTOFOCUS_INTERVAL_MS = 1500L;
 
index d03349d..e0e797b 100644 (file)
@@ -40,7 +40,7 @@ import org.opensrf.net.http.HttpRequest;
 import android.util.Log;
 
 public class Utils {
-    private static final String TAG = "osrf";
+    private static final String TAG = Utils.class.getName();
 
     /**
      * Gets the net page content.
index 513aa63..306f8da 100644 (file)
@@ -42,7 +42,7 @@ import android.widget.TextView;
 
 public class AdvancedSearchActivity extends ActionBarActivity {
 
-    private final String TAG = AdvancedSearchActivity.class.getName();
+    private final static String TAG = AdvancedSearchActivity.class.getName();
 
     private ArrayList<String> searchTerms;
     private String advancedSearchFormattedText;
index 87ae779..2f73183 100644 (file)
@@ -26,7 +26,7 @@ import java.util.Map;
 
 public class CopyCountInformation implements Serializable {
 
-    private final String TAG = CopyCountInformation.class.getName();
+    private final static String TAG = CopyCountInformation.class.getName();
     private static final long serialVersionUID = 12343248767867L;
     public Integer org_id;
     public Integer count;
index 6561f18..67e0fa8 100644 (file)
@@ -33,7 +33,7 @@ public class CopyInformation implements Serializable {
 
     private static final long serialVersionUID = -7269334218707079463L;
 
-    private final String TAG = CopyInformation.class.getName();
+    private final static String TAG = CopyInformation.class.getName();
 
     public Integer org_id = -1;
     public String call_number_sufix;
index 491144b..d602184 100644 (file)
@@ -88,50 +88,34 @@ public class MoreCopyInformation extends ActionBarActivity {
 
         for (int i = 0; i < record.copyInformationList.size(); i++) {
 
-            View copy_info_view = inflater.inflate(R.layout.copy_information,
-                    null);
+            View copy_info_view = inflater.inflate(R.layout.copy_information, null);
 
             // fill in any details dynamically here
-            TextView library = (TextView) copy_info_view
-                    .findViewById(R.id.copy_information_library);
-            TextView call_number = (TextView) copy_info_view
-                    .findViewById(R.id.copy_information_call_number);
-            TextView copy_location = (TextView) copy_info_view
-                    .findViewById(R.id.copy_information_copy_location);
-
-            library.setText(globalConfigs.getOrganizationName(record.copyInformationList
-                    .get(i).org_id) + " ");
-            call_number
-                    .setText(record.copyInformationList.get(i).call_number_sufix);
-            copy_location
-                    .setText(record.copyInformationList.get(i).copy_location);
+            TextView library = (TextView) copy_info_view.findViewById(R.id.copy_information_library);
+            TextView call_number = (TextView) copy_info_view.findViewById(R.id.copy_information_call_number);
+            TextView copy_location = (TextView) copy_info_view.findViewById(R.id.copy_information_copy_location);
+
+            library.setText(globalConfigs.getOrganizationName(record.copyInformationList.get(i).org_id));
+            call_number.setText(record.copyInformationList.get(i).call_number_sufix);
+            copy_location.setText(record.copyInformationList.get(i).copy_location);
 
             // insert into main view
             insertPoint.addView(copy_info_view, new ViewGroup.LayoutParams(
                     LayoutParams.MATCH_PARENT,
                     ViewGroup.LayoutParams.WRAP_CONTENT));
 
-            LinearLayout copy_statuses = (LinearLayout) copy_info_view
-                    .findViewById(R.id.copy_information_statuses);
+            LinearLayout copy_statuses = (LinearLayout) copy_info_view.findViewById(R.id.copy_information_statuses);
 
             CopyInformation info = record.copyInformationList.get(i);
-
             Set<Entry<String, String>> set = info.statusInformation.entrySet();
-
             Iterator<Entry<String, String>> it = set.iterator();
-
             while (it.hasNext()) {
-
                 Entry<String, String> ent = it.next();
                 TextView statusName = new TextView(context);
-                statusName.setText(ent.getKey() + " : " + ent.getValue());
-
+                statusName.setText(ent.getKey() + ": " + ent.getValue());
                 copy_statuses.addView(statusName, new LayoutParams(
                         LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
-
             }
-
         }
-
     }
 }
index 47a0c12..9d697c0 100644 (file)
@@ -33,7 +33,7 @@ public class RecordInfo implements Serializable {
 
     private static final long serialVersionUID = 10123L;
 
-    private static final String TAG = RecordInfo.class.getSimpleName();
+    private static final String TAG = RecordInfo.class.getName();
 
     public String title = null;
     public String author = null;
index 00ee692..1b14104 100644 (file)
@@ -63,7 +63,7 @@ import android.widget.Toast;
 
 public class SearchCatalogListView extends ActionBarActivity {
 
-    private final String TAG = SearchCatalogListView.class.getSimpleName();
+    private static final String TAG = SearchCatalogListView.class.getName();
 
     private ArrayList<RecordInfo> recordList;
 
@@ -317,8 +317,6 @@ public class SearchCatalogListView extends ActionBarActivity {
 
             @Override
             public void onScrollStateChanged(AbsListView view, int scrollState) {
-                // TODO Auto-generated method stub
-
             }
 
             @Override
@@ -543,7 +541,6 @@ public class SearchCatalogListView extends ActionBarActivity {
 
                     @Override
                     public void onClick(View v) {
-                        // TODO Auto-generated method stub
                         Thread addtoBookbag = new Thread(new Runnable() {
                             @Override
                             public void run() {
@@ -552,8 +549,7 @@ public class SearchCatalogListView extends ActionBarActivity {
                                     ac.addRecordToBookBag(info.doc_id,
                                             bookBags.get(bookbag_selected).id);
                                 } catch (SessionNotFoundException e) {
-                                    // TODO Auto-generated catch block
-                                    e.printStackTrace();
+                                    Log.d(TAG, "session not found", e);
                                 }
 
                                 runOnUiThread(new Runnable() {
@@ -651,7 +647,7 @@ public class SearchCatalogListView extends ActionBarActivity {
 
     class SearchArrayAdapter extends ArrayAdapter<RecordInfo> {
 
-        private static final String tag = "SearchArrayAdapter";
+        private final String tag = SearchArrayAdapter.class.getName();
         private Context context;
         private NetworkImageView recordImage;
         private TextView recordTitle;
index 1904c2d..d1ca9d8 100644 (file)
@@ -32,7 +32,7 @@ import android.util.Log;
 
 public class NotificationReceiver extends BroadcastReceiver {
 
-    private final String TAG = NotificationReceiver.class.getName();
+    private static final String TAG = NotificationReceiver.class.getName();
     public static final int NOTIFICATION_ID = 1;
 
     @Override
index c97d331..43f5130 100644 (file)
@@ -58,7 +58,7 @@ import android.widget.Toast;
 
 public class BasicDetailsFragment extends Fragment {
 
-    private final String TAG = BasicDetailsFragment.class.getName();
+    private final static String TAG = BasicDetailsFragment.class.getName();
 
     private RecordInfo record;
     private Integer orgId;
@@ -80,25 +80,19 @@ public class BasicDetailsFragment extends Fragment {
     private TextView copyCountTextView;
 
     private Button placeHoldButton;
-    private Button addToBookbagButton;
-
-    private LinearLayout showMore;
 
     private GlobalConfigs globalConfigs;
 
+    /*
+    private Button addToBookbagButton;
     private ProgressDialog progressDialog;
-
     private Integer bookbag_selected;
-
     private Dialog dialog;
-
     private ArrayList<BookBag> bookBags;
-
-    private final ImageDownloader imageDownloader = new ImageDownloader();
+    private int list_size = 3;
+    */
 
     private NetworkImageView recordImage;
-    // max display info
-    private int list_size = 3;
 
     public static BasicDetailsFragment newInstance(RecordInfo record,
             Integer position, Integer total, Integer orgID) {
@@ -136,7 +130,7 @@ public class BasicDetailsFragment extends Fragment {
 
         record_header = (TextView) layout.findViewById(R.id.record_header_text);
         copyCountTextView = (TextView) layout.findViewById(R.id.record_details_simple_copy_count);
-        showMore = (LinearLayout) layout.findViewById(R.id.record_details_show_more);
+//        showMore = (LinearLayout) layout.findViewById(R.id.record_details_show_more);
         titleTextView = (TextView) layout.findViewById(R.id.record_details_simple_title);
         formatTextView = (TextView) layout.findViewById(R.id.record_details_format);
         authorTextView = (TextView) layout.findViewById(R.id.record_details_simple_author);
@@ -150,8 +144,7 @@ public class BasicDetailsFragment extends Fragment {
         recordImage = (NetworkImageView) layout.findViewById(R.id.record_details_simple_image);
 
         placeHoldButton = (Button) layout.findViewById(R.id.simple_place_hold_button);
-        addToBookbagButton = (Button) layout.findViewById(R.id.simple_add_to_bookbag_button);
-
+//        addToBookbagButton = (Button) layout.findViewById(R.id.simple_add_to_bookbag_button);
         placeHoldButton.setOnClickListener(new OnClickListener() {
 
             @Override
@@ -169,6 +162,8 @@ public class BasicDetailsFragment extends Fragment {
         recordImage.setImageUrl(imageHref, imageLoader);
 
         AccountAccess ac = AccountAccess.getAccountAccess();
+
+        /*
         bookBags = ac.getBookbags();
         String array_spinner[] = new String[bookBags.size()];
 
@@ -179,7 +174,6 @@ public class BasicDetailsFragment extends Fragment {
         dialog.setContentView(R.layout.bookbag_spinner);
         dialog.setTitle("Choose bookbag");
         Spinner s = (Spinner) dialog.findViewById(R.id.bookbag_spinner);
-
         Button add = (Button) dialog.findViewById(R.id.add_to_bookbag_button);
         ArrayAdapter adapter = new ArrayAdapter(getActivity()
                 .getApplicationContext(), android.R.layout.simple_spinner_item,
@@ -221,10 +215,8 @@ public class BasicDetailsFragment extends Fragment {
             }
         });
         s.setOnItemSelectedListener(new OnItemSelectedListener() {
-
             @Override
-            public void onItemSelected(AdapterView<?> arg0, View arg1,
-                    int position, long arg3) {
+            public void onItemSelected(AdapterView<?> arg0, View arg1, int position, long arg3) {
                 bookbag_selected = position;
             }
 
@@ -251,6 +243,7 @@ public class BasicDetailsFragment extends Fragment {
                 });
             }
         });
+        */
 
         record_header.setText(String.format(getString(R.string.record_of), position, total));
 
@@ -265,32 +258,29 @@ public class BasicDetailsFragment extends Fragment {
 
         isbnTextView.setText(record.isbn);
 
-        // todo this is not working because we are on the main thread
+        // todo loading copy count on demand is not working because we are on the main thread
         //SearchCatalog.ensureCopyCount(record, orgId);
 
-        Log.d(TAG, "Size " + record.copyCountListInfo.size());
+        Log.d(TAG, "xxx copyCountListInfo.size=" + record.copyCountListInfo.size() + " title:" + record.title);
+        int total = 0;
+        int available = 0;
         for (int i = 0; i < record.copyCountListInfo.size(); i++) {
-//            Log.d(TAG, orgId + " "
-//                    + record.copyCountListInfo.get(i).org_id + " "
-//                    + record.copyCountListInfo.get(i).count);
-            if (record.copyCountListInfo.get(i).org_id == orgId) {
-                int total = record.copyCountListInfo.get(i).count;
-                int available = record.copyCountListInfo.get(i).available;
-                String totalCopies = getResources().getQuantityString(R.plurals.number_of_copies, total, total);
-                copyCountTextView.setText(String.format(getString(R.string.n_of_m_available), available, totalCopies));
+            Log.d(TAG, "xxx orgId=" + orgId
+                    + " rec.org_id=" + record.copyCountListInfo.get(i).org_id
+                    + " rec.count=" + record.copyCountListInfo.get(i).count);
+            if (record.copyCountListInfo.get(i).org_id.equals(orgId)) {
+                total = record.copyCountListInfo.get(i).count;
+                available = record.copyCountListInfo.get(i).available;
                 break;
             }
         }
+        String totalCopies = getResources().getQuantityString(R.plurals.number_of_copies, total, total);
+        copyCountTextView.setText(String.format(getString(R.string.n_of_m_available),
+                available, totalCopies, globalConfigs.getOrganizationName(orgId)));
 
-        final LayoutInflater inf = inflater;
-        final LinearLayout lay = layout;
-
-        // add more details
-        showMore.setOnClickListener(new OnClickListener() {
-
+        ((Button)layout.findViewById(R.id.show_copy_information_button)).setOnClickListener(new OnClickListener() {
             @Override
             public void onClick(View v) {
-                // show more details
                 Intent intent = new Intent(getActivity().getApplicationContext(), MoreCopyInformation.class);
                 intent.putExtra("recordInfo", record);
                 intent.putExtra("orgId", orgId);
@@ -298,14 +288,6 @@ public class BasicDetailsFragment extends Fragment {
             }
         });
 
-        if (list_size > record.copyInformationList.size())
-            list_size = record.copyInformationList.size();
-
-        // insert into main view
-        LinearLayout insertPoint = (LinearLayout) layout
-                .findViewById(R.id.record_details_copy_information);
-        addCopyInfo(0, list_size, inflater, insertPoint);
-
         return layout;
     }
 
@@ -317,51 +299,4 @@ public class BasicDetailsFragment extends Fragment {
         outState.putInt("total", this.total);
         super.onSaveInstanceState(outState);
     }
-
-    public void addCopyInfo(int start, int stop, LayoutInflater inflater,
-            LinearLayout insertPoint) {
-
-        for (int i = start; i < stop; i++) {
-
-            View copy_info_view = inflater.inflate(R.layout.copy_information, null);
-
-            // fill in any details dynamically here
-            TextView library = (TextView) copy_info_view
-                    .findViewById(R.id.copy_information_library);
-            TextView call_number = (TextView) copy_info_view
-                    .findViewById(R.id.copy_information_call_number);
-            TextView copy_location = (TextView) copy_info_view
-                    .findViewById(R.id.copy_information_copy_location);
-
-            CopyInformation info = record.copyInformationList.get(i);
-            library.setText(globalConfigs.getOrganizationName(info.org_id));
-            call_number.setText(info.call_number_sufix);
-            copy_location.setText(info.copy_location);
-
-            // insert into main view
-            insertPoint.addView(copy_info_view, new ViewGroup.LayoutParams(
-                    LayoutParams.MATCH_PARENT,
-                    ViewGroup.LayoutParams.WRAP_CONTENT));
-
-            LinearLayout copy_statuses = (LinearLayout) copy_info_view
-                    .findViewById(R.id.copy_information_statuses);
-
-            Set<Entry<String, String>> set = info.statusInformation.entrySet();
-
-            Iterator<Entry<String, String>> it = set.iterator();
-
-            while (it.hasNext()) {
-
-                Entry<String, String> ent = it.next();
-                TextView statusName = new TextView(getActivity());
-                statusName.setText(ent.getKey() + " : " + ent.getValue());
-
-                copy_statuses.addView(statusName, new LayoutParams(
-                        LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
-
-            }
-
-        }
-
-    }
 }
index 39d8b1e..ccae612 100644 (file)
@@ -41,7 +41,7 @@ import org.evergreen_ils.globals.Library;
  *
  */
 public class LoadingTask {
-    private final String TAG = LoadingTask.class.getSimpleName();
+    private final static String TAG = LoadingTask.class.getName();
 
     public static final String TASK_OK = "OK";