added more results list element at the end of the search result list
authordrizea <danielrizea27@gmail.com>
Fri, 15 Jun 2012 13:34:32 +0000 (16:34 +0300)
committerdrizea <danielrizea27@gmail.com>
Fri, 15 Jun 2012 13:34:32 +0000 (16:34 +0300)
29 files changed:
Open-ILS/src/Android/bin/EvergreenApp.apk
Open-ILS/src/Android/bin/classes.dex
Open-ILS/src/Android/bin/classes/org/evergreen/android/R$color.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/R$dimen.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/R$drawable.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/R$id.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/R$layout.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/R$string.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/R$style.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordInfo.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalog.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$1.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$2$1$1.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$2$1.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$2.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$3.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$SearchArrayAdapter.class
Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView.class
Open-ILS/src/Android/bin/resources.ap_
Open-ILS/src/Android/gen/org/evergreen/android/R.java
Open-ILS/src/Android/res/drawable/expander_ic_maximized.9.png [new file with mode: 0644]
Open-ILS/src/Android/res/layout/search_result_footer_view.xml [new file with mode: 0644]
Open-ILS/src/Android/res/layout/search_result_list.xml
Open-ILS/src/Android/res/values/colors.xml
Open-ILS/src/Android/res/values/strings.xml
Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/ImageDownloader.java
Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/RecordInfo.java
Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/SearchCatalog.java
Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/SearchCatalogListView.java

index 10a2b57..5b44202 100644 (file)
Binary files a/Open-ILS/src/Android/bin/EvergreenApp.apk and b/Open-ILS/src/Android/bin/EvergreenApp.apk differ
index ed50844..ea7cfd4 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes.dex and b/Open-ILS/src/Android/bin/classes.dex differ
index 3ddd095..c610bae 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$color.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$color.class differ
index 4d3bc74..ecb6dd8 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$dimen.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$dimen.class differ
index e8b77ce..44cfa68 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$drawable.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$drawable.class differ
index eaff07c..ec62a43 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$id.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$id.class differ
index 893b9cd..6902809 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$layout.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$layout.class differ
index eec2622..a89ce8d 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$string.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$string.class differ
index e228baf..691ff58 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$style.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$style.class differ
index 9913f32..36e6726 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordInfo.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordInfo.class differ
index 1b435ad..fb9a24f 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalog.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalog.class differ
index c051e00..aa91e96 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$1.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$1.class differ
index 92f7605..34d8355 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$2$1$1.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$2$1$1.class differ
index b4d3952..91b42c0 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$2$1.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$2$1.class differ
index 4cec04e..bb07e89 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$2.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$2.class differ
index 7ff95af..8e0f6a8 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$3.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$3.class differ
index c52884d..573efb3 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$SearchArrayAdapter.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$SearchArrayAdapter.class differ
index 7693512..239ff5a 100644 (file)
Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView.class differ
index d9de5e2..c076396 100644 (file)
Binary files a/Open-ILS/src/Android/bin/resources.ap_ and b/Open-ILS/src/Android/bin/resources.ap_ differ
index 89fde60..dd086d2 100644 (file)
@@ -15,6 +15,7 @@ public final class R {
         public static final int background2=0x7f050006;
         public static final int background3=0x7f050007;
         public static final int bg_gray=0x7f05000b;
+        public static final int blue=0x7f05000d;
         public static final int emphasis=0x7f05000a;
         public static final int foreground1=0x7f050003;
         public static final int foreground2=0x7f050004;
@@ -39,18 +40,19 @@ public final class R {
         public static final int address_book=0x7f020002;
         public static final int book_bag=0x7f020003;
         public static final int check_out=0x7f020004;
-        public static final int find_96=0x7f020005;
-        public static final int fines=0x7f020006;
-        public static final int holds=0x7f020007;
-        public static final int ic_launcher=0x7f020008;
-        public static final int settings=0x7f020009;
+        public static final int expander_ic_maximized=0x7f020005;
+        public static final int find_96=0x7f020006;
+        public static final int fines=0x7f020007;
+        public static final int holds=0x7f020008;
+        public static final int ic_launcher=0x7f020009;
+        public static final int settings=0x7f02000a;
     }
     public static final class id {
         public static final int account_btn_book_bags=0x7f090003;
         public static final int account_btn_check_out=0x7f090000;
         public static final int account_btn_fines=0x7f090002;
         public static final int account_btn_holds=0x7f090001;
-        public static final int chose_organisation=0x7f090018;
+        public static final int chose_organisation=0x7f09001a;
         public static final int main_btn_account=0x7f090005;
         public static final int main_btn_app_settings=0x7f090006;
         public static final int main_btn_search=0x7f090004;
@@ -64,13 +66,15 @@ public final class R {
         public static final int record_details_simple_subject=0x7f09000d;
         public static final int record_details_simple_synopsis=0x7f09000f;
         public static final int record_details_simple_title=0x7f09000a;
-        public static final int searchButton=0x7f090016;
-        public static final int searchText=0x7f090015;
-        public static final int search_record_author=0x7f090013;
-        public static final int search_record_img=0x7f090011;
-        public static final int search_record_publishing=0x7f090014;
-        public static final int search_record_title=0x7f090012;
-        public static final int search_results_list=0x7f090017;
+        public static final int searchButton=0x7f090017;
+        public static final int searchText=0x7f090016;
+        public static final int search_more_items_button=0x7f090011;
+        public static final int search_record_author=0x7f090014;
+        public static final int search_record_img=0x7f090012;
+        public static final int search_record_publishing=0x7f090015;
+        public static final int search_record_title=0x7f090013;
+        public static final int search_result_number=0x7f090018;
+        public static final int search_results_list=0x7f090019;
     }
     public static final class layout {
         public static final int dashbord_account=0x7f030000;
@@ -78,12 +82,14 @@ public final class R {
         public static final int main=0x7f030002;
         public static final int record_details_info=0x7f030003;
         public static final int record_details_simple=0x7f030004;
-        public static final int search_result_item=0x7f030005;
-        public static final int search_result_list=0x7f030006;
+        public static final int search_result_footer_view=0x7f030005;
+        public static final int search_result_item=0x7f030006;
+        public static final int search_result_list=0x7f030007;
     }
     public static final class string {
         public static final int app_name=0x7f070001;
         public static final int hello=0x7f070000;
+        public static final int search_result_text=0x7f070009;
         public static final int title_application_settings=0x7f070004;
         public static final int title_book_bags=0x7f070008;
         public static final int title_check_out=0x7f070005;
diff --git a/Open-ILS/src/Android/res/drawable/expander_ic_maximized.9.png b/Open-ILS/src/Android/res/drawable/expander_ic_maximized.9.png
new file mode 100644 (file)
index 0000000..bad4b82
Binary files /dev/null and b/Open-ILS/src/Android/res/drawable/expander_ic_maximized.9.png differ
diff --git a/Open-ILS/src/Android/res/layout/search_result_footer_view.xml b/Open-ILS/src/Android/res/layout/search_result_footer_view.xml
new file mode 100644 (file)
index 0000000..0ed6c77
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content"
+    android:gravity="center"
+    android:background="@color/blue"
+     >
+
+    <ImageView
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"  
+        android:padding="20dip"     
+               android:gravity="center"
+               android:src="@drawable/expander_ic_maximized"
+               android:id="@+id/search_more_items_button"
+        />
+       
+</LinearLayout>
\ No newline at end of file
index 2c1e759..c8969f1 100644 (file)
         </LinearLayout>
     
     
+     <LinearLayout android:layout_width="fill_parent"
+         android:layout_height="wrap_content">
+         <TextView 
+             android:layout_width="wrap_content"
+             android:layout_height="wrap_content"
+             android:text="@string/search_result_text"
+             />
+         
+         <TextView 
+             android:id="@+id/search_result_number"
+             android:layout_width="wrap_content"
+             android:layout_height="wrap_content"
+             android:textStyle="bold"
+             />
+         
+     </LinearLayout>
        <ListView 
          android:id="@+id/search_results_list"
          android:layout_width="fill_parent"
@@ -46,7 +62,7 @@
        
        <Spinner 
         android:id="@+id/chose_organisation"   
-        android:layout_width="wrap_content"
+        android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:layout_gravity="center_horizontal"
            />
index 5f326a2..9f562e4 100644 (file)
@@ -33,4 +33,5 @@
     <color name="bg_gray">#cecbce</color>
        
     <color name="white">#ffffff</color>
+    <color name="blue">#1e90ff</color>
 </resources>
index 9ea23bd..e60cab9 100644 (file)
@@ -11,5 +11,5 @@
     <string name="title_holds">Holds</string>
     <string name="title_fines">Fines</string>
     <string name="title_book_bags">Book bags</string>
-    
+    <string name="search_result_text"> Search result :</string>
 </resources>
\ No newline at end of file
index 66ea35c..48b4f1e 100644 (file)
@@ -42,7 +42,7 @@ public class ImageDownloader {
     public enum Mode { NO_ASYNC_TASK, NO_DOWNLOADED_DRAWABLE, CORRECT }
     private Mode mode = Mode.CORRECT;
    
-    private int MIN_IMG_HEIGHT = 100;
+    private int MIN_IMG_HEIGHT = 75;
     
     /**
      * Download the specified image from the Internet and binds it to the provided ImageView. The
@@ -151,8 +151,17 @@ public class ImageDownloader {
         // AndroidHttpClient is not allowed to be used from the main thread
         final HttpClient client = (mode == Mode.NO_ASYNC_TASK) ? new DefaultHttpClient() :
             AndroidHttpClient.newInstance("Android");
-        final HttpGet getRequest = new HttpGet(url);
-
+       
+        HttpGet getRequest = null;
+        try{
+               getRequest = new HttpGet(url);
+        }catch(Exception e){
+            if ((client instanceof AndroidHttpClient)) {
+                ((AndroidHttpClient) client).close();
+            }
+               return null;
+        }
+       
         try {
             HttpResponse response = client.execute(getRequest);
             final int statusCode = response.getStatusLine().getStatusCode();
@@ -251,7 +260,9 @@ public class ImageDownloader {
             }
 
             addBitmapToCache(url, bitmap);
+            
 
+            
             if (imageViewReference != null) {
                 ImageView imageView = imageViewReference.get();
                 BitmapDownloaderTask bitmapDownloaderTask = getBitmapDownloaderTask(imageView);
@@ -259,10 +270,14 @@ public class ImageDownloader {
                 // Or if we don't use any bitmap to task association (NO_DOWNLOADED_DRAWABLE mode)
                 if ((this == bitmapDownloaderTask) || (mode != Mode.CORRECT)) {
                     imageView.setImageBitmap(bitmap);
+                }   
+
+                if(bitmap == null){
+                       if(imageView != null)
+                               imageView.setImageResource(R.drawable.address_book);
                 }
-                else
-                       imageView.setImageResource(R.drawable.address_book);
             }
+
         }
     }
 
@@ -302,7 +317,7 @@ public class ImageDownloader {
      * Garbage Collector.
      */
    
-    private static final int HARD_CACHE_CAPACITY = 10;
+    private static final int HARD_CACHE_CAPACITY = 20;
     private static final int DELAY_BEFORE_PURGE = 10 * 1000; // in milliseconds
 
     // Hard cache, with a fixed maximum capacity and a life duration
index f18c1e6..4ebbdd0 100644 (file)
@@ -42,11 +42,20 @@ public class RecordInfo implements Serializable{
        //tcn field
        public String image = null;
        
+       public boolean dummy = false;
+       
+       public RecordInfo(){
+               this.title = "Test title";
+               this.author = "Test author";
+               this.pubdate = "Publication date";
+               
+               //marks the fact that this is a record made from no info
+               this.dummy = true;
+       }
        public RecordInfo(OSRFObject info){
                
                try{
-                       
-                       
+
                        this.title = info.getString("title");
                        this.author = info.getString("author");
                        this.pubdate = info.getString("pubdate");
index 5fd6c74..ea490a3 100644 (file)
@@ -46,6 +46,13 @@ public class SearchCatalog {
        private Organisation selectedOrganization = null;
        
        private Context context;
+       
+       public Integer offset;
+       
+       public Integer visible;
+       
+       public Integer searchLimit = 10;
+       
        /**
         * Instantiates a new search catalog.
         *
@@ -72,11 +79,11 @@ public class SearchCatalog {
 
        /**
         * Gets the search results
-        *
+        * 
         * @param searchWords the search words
         * @return the search results
         */
-       public ArrayList<RecordInfo> getSearchResults(String searchWords){
+       public ArrayList<RecordInfo> getSearchResults(String searchWords, Integer offset){
                
                
                ArrayList<RecordInfo> resultsRecordInfo = new ArrayList<RecordInfo>();
@@ -94,7 +101,9 @@ public class SearchCatalog {
                                        complexParm.put("depth", this.selectedOrganization.level-1);
                        }
                        //TODO change here, multiple result per page
-                       complexParm.put("limit", 50);
+                       complexParm.put("limit", searchLimit);
+                       
+                       complexParm.put("offset",offset);
                        
                        /*
                        complexParm.put("offset",0);
@@ -112,6 +121,7 @@ public class SearchCatalog {
                method.addParam(searchWords);
                method.addParam(1);
                
+               
                // sync test
                HttpRequest req = new GatewayRequest(conn, SERVICE, method).send();
                Object resp;
@@ -120,6 +130,7 @@ public class SearchCatalog {
                
                ArrayList<String> ids = new ArrayList<String>();
                
                while ( (resp = req.recv()) != null){
                    System.out.println("Sync Response: " + resp);
                    
@@ -128,6 +139,8 @@ public class SearchCatalog {
                    System.out.println(" ids : " + response.get("ids") + " " );
                    
                    List<List<String>> result_ids = (List) response.get("ids");
+
+                   visible =Integer.parseInt((String)response.get("count"));
                    
                    for(int i=0;i<result_ids.size();i++){
                        ids.add(result_ids.get(i).get(0));
index 71fd3d0..3c431ea 100644 (file)
@@ -6,6 +6,8 @@ import java.util.List;
 import org.evergreen.android.R;
 import org.evergreen.android.globals.GlobalConfigs;
 
+import com.google.android.maps.ItemizedOverlay;
+
 import android.app.Activity;
 import android.app.ProgressDialog;
 import android.content.Context;
@@ -24,6 +26,7 @@ import android.widget.AdapterView;
 import android.widget.AdapterView.OnItemClickListener;
 import android.widget.AdapterView.OnItemSelectedListener;
 import android.widget.ArrayAdapter;
+import android.widget.Button;
 import android.widget.EditText;
 import android.widget.ImageButton;
 import android.widget.ImageView;
@@ -61,6 +64,8 @@ public class SearchCatalogListView extends Activity{
        
        private static final int DETAILS = 1;
 
+       private TextView searchResultsNumber;
+       
        private final ImageDownloader imageDownloader = new ImageDownloader();
        
     @Override
@@ -79,15 +84,32 @@ public class SearchCatalogListView extends Activity{
         // Create a customized ArrayAdapter
         adapter = new SearchArrayAdapter(
                                getApplicationContext(), R.layout.search_result_item, recordList);
-               
+       
+        searchResultsNumber = (TextView) findViewById(R.id.search_result_number);
+        
        // Get reference to ListView holder
        lv = (ListView) this.findViewById(R.id.search_results_list);
        
+        
+       // Creating a button - Load More
+       Button btnLoadMore = new Button(this);
+       btnLoadMore.setText("Load More");
+       
+       // Adding button to listview at footer
+       //lv.addFooterView(btnLoadMore);
+       
+       View footerView = findViewById(R.layout.search_result_footer_view);
+       //call before set adapter
+       //lv.addFooterView(footerView);
+       
        //System.out.println("Here it is "  + lv);
+       
+               progressDialog = new ProgressDialog(context);
+               
+               progressDialog.setMessage("Fetching data");
        // Set the ListView adapter
        lv.setAdapter(adapter);
-       
-       
+
        
        registerForContextMenu(lv);
        
@@ -99,13 +121,65 @@ public class SearchCatalogListView extends Activity{
                        
                
                        RecordInfo info = (RecordInfo)lv.getItemAtPosition(position);
-                       //start activity with book details
-                       
-                       Intent intent = new Intent(getBaseContext(),RecordDetails_Simple.class);
-                       //serialize object and pass it to next activity
-                       intent.putExtra("recordInfo", info);
                        
-                       startActivity(intent);
+                       if(info.dummy == true){
+                               progressDialog = new ProgressDialog(context);
+                               
+                               progressDialog.setMessage("Fetching data");
+                               progressDialog.show();
+                               final String text = searchText.getText().toString();
+                               
+                               Thread searchThreadwithOffset = new Thread(new Runnable() {
+                                               
+                                               @Override
+                                               public void run() {
+                                                       searchResults = search.getSearchResults(text,recordList.size()-1);
+                                                       
+                                                       runOnUiThread(new Runnable() {
+                                                               
+                                                               @Override
+                                                               public void run() {
+
+                                                                       //don't clear record list
+                                                                       //recordList.clear();
+                                                                       if(searchResults.size()>0){
+                                                                               
+                                                                               //remove previous more button
+                                                                               recordList.remove(recordList.size()-1);
+                                                                               
+                                                                               for(int j=0;j<searchResults.size();j++)
+                                                                                       recordList.add(searchResults.get(j));
+                                                                               
+                                                                       //add extra record to display more option button
+                                                                       if(search.visible > recordList.size()){
+                                                                                       recordList.add(new RecordInfo());
+                                                                                       searchResultsNumber.setText(adapter.getCount()-1 +" out of "+search.visible);
+                                                                               }
+                                                                       else
+                                                                               searchResultsNumber.setText(adapter.getCount() +" out of "+search.visible);
+                                                                       }
+                                                                       else{
+                                                                               searchResultsNumber.setText(adapter.getCount() +" out of "+search.visible);
+                                                                       }
+                                                                       adapter.notifyDataSetChanged();
+                                                                       progressDialog.dismiss();
+                                                               }
+                                                       });
+                                                       
+                                               }
+                                       });
+                                       
+                                       searchThreadwithOffset.start();
+                       }
+                       else{
+                               //start activity with book details
+                               
+                               Intent intent = new Intent(getBaseContext(),RecordDetails_Simple.class);
+                               //serialize object and pass it to next activity
+                               intent.putExtra("recordInfo", info);
+                               
+                               startActivity(intent);
+                       }
                }
                });
         
@@ -133,7 +207,7 @@ public class SearchCatalogListView extends Activity{
                                                
                                                @Override
                                                public void run() {
-                                                       searchResults = search.getSearchResults(text);
+                                                       searchResults = search.getSearchResults(text,0);
                                                        
                                                        runOnUiThread(new Runnable() {
                                                                
@@ -145,10 +219,22 @@ public class SearchCatalogListView extends Activity{
                                                                                
                                                                                for(int j=0;j<searchResults.size();j++)
                                                                                        recordList.add(searchResults.get(j));
+                                                                               
+                                                                       //add extra record to display more option button
+                                                                       if(search.visible > recordList.size()){
+                                                                               recordList.add(new RecordInfo());
+                                                                               searchResultsNumber.setText(recordList.size()-1 +" out of "+search.visible);
+                                                                               }
+                                                                       else
+                                                                               searchResultsNumber.setText(recordList.size() +" out of "+search.visible);
                                                                        }
+                                                                       else
+                                                                               searchResultsNumber.setText(recordList.size() +" out of "+search.visible);
+                                                                       
                                                                        adapter.notifyDataSetChanged();
                                                                        progressDialog.dismiss();
                                                                        
+                                                                       
                                                                }
                                                        });
                                                        
@@ -264,21 +350,38 @@ public class SearchCatalogListView extends Activity{
 
        public View getView(int position, View convertView, ViewGroup parent) {
                View row = convertView;
-               if (row == null) {
-                       // ROW INFLATION
-                       Log.d(tag, "Starting XML Row Inflation ... ");
+               
+               // Get item
+               RecordInfo record = getItem(position);
+               
+               if(record.dummy == true)
+               {
+                               Log.d(tag, "Starting XML view more infaltion ... ");
                        LayoutInflater inflater = (LayoutInflater) this.getContext()
                                        .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-                       row = inflater.inflate(R.layout.search_result_item, parent, false);
-                       Log.d(tag, "Successfully completed XML Row Inflation!");
-               }
+                       row = inflater.inflate(R.layout.search_result_footer_view, parent, false);
+                       Log.d(tag, "Successfully completed XML view more Inflation!");
 
-               // Get item
-               RecordInfo record = getItem(position);
+                       
+                       }
+               else{
                
+                       //if it is the right type of view
+                               if (row == null || row.findViewById(R.id.search_record_title) == null) {
+       
+                                               Log.d(tag, "Starting XML Row Inflation ... ");
+                                               LayoutInflater inflater = (LayoutInflater) this.getContext()
+                                                               .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+                                               row = inflater.inflate(R.layout.search_result_item, parent, false);
+                                               Log.d(tag, "Successfully completed XML Row Inflation!");
+       
+                               }
+               
+                   
+
+               Log.d(TAG, "reord image value " + recordImage);
                // Get reference to ImageView 
                recordImage = (ImageView) row.findViewById(R.id.search_record_img);
-               
                //TODO fix bugs + features
                String imageHref= GlobalConfigs.httpAddress + "/opac/extras/ac/jacket/small/"+record.isbn;
                //start async download of image 
@@ -297,7 +400,8 @@ public class SearchCatalogListView extends Activity{
                recordTitle.setText(record.title);
                recordAuthor.setText(record.author);
                recordPublisher.setText(record.pubdate + " " + record.publisher);
-
+               }
+               
                return row;
        }
     }