changed ui for search details view
authordrizea <danielrizea27@gmail.com>
Tue, 24 Jul 2012 11:33:11 +0000 (14:33 +0300)
committerdrizea <danielrizea27@gmail.com>
Tue, 24 Jul 2012 11:33:11 +0000 (14:33 +0300)
must enable image download + activate more copy information button

25 files changed:
Open-ILS/src/Android/res/drawable-hdpi/navigation_collapse.png [new file with mode: 0644]
Open-ILS/src/Android/res/drawable-hdpi/navigation_expand.png [new file with mode: 0644]
Open-ILS/src/Android/res/drawable-hdpi/navigation_next_item.png [new file with mode: 0644]
Open-ILS/src/Android/res/drawable-hdpi/navigation_previous_item.png [new file with mode: 0644]
Open-ILS/src/Android/res/drawable-mdpi/navigation_collapse.png [new file with mode: 0644]
Open-ILS/src/Android/res/drawable-mdpi/navigation_expand.png [new file with mode: 0644]
Open-ILS/src/Android/res/drawable-mdpi/navigation_next_item.png [new file with mode: 0644]
Open-ILS/src/Android/res/drawable-mdpi/navigation_previous_item.png [new file with mode: 0644]
Open-ILS/src/Android/res/drawable/details_rounded_corners.xml [new file with mode: 0644]
Open-ILS/src/Android/res/drawable/no_image.png [new file with mode: 0644]
Open-ILS/src/Android/res/drawable/rounded_bottom_corners.xml [new file with mode: 0644]
Open-ILS/src/Android/res/drawable/shadow_rect.xml [new file with mode: 0644]
Open-ILS/src/Android/res/layout/copy_information.xml
Open-ILS/src/Android/res/layout/record_details_basic_fragment.xml
Open-ILS/src/Android/res/layout/simple_actionbar.xml [new file with mode: 0644]
Open-ILS/src/Android/res/layout/simple_underlines.xml
Open-ILS/src/Android/res/values/colors.xml
Open-ILS/src/Android/res/values/dimens.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/searchCatalog/CopyCountInformation.java [new file with mode: 0644]
Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/RecordInfo.java
Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/SampleUnderlinesNoFade.java
Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/SearchCatalog.java
Open-ILS/src/Android/src/org/evergreen/android/utils/ui/BasicDetailsFragment.java

diff --git a/Open-ILS/src/Android/res/drawable-hdpi/navigation_collapse.png b/Open-ILS/src/Android/res/drawable-hdpi/navigation_collapse.png
new file mode 100644 (file)
index 0000000..bd405ba
Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-hdpi/navigation_collapse.png differ
diff --git a/Open-ILS/src/Android/res/drawable-hdpi/navigation_expand.png b/Open-ILS/src/Android/res/drawable-hdpi/navigation_expand.png
new file mode 100644 (file)
index 0000000..8225e74
Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-hdpi/navigation_expand.png differ
diff --git a/Open-ILS/src/Android/res/drawable-hdpi/navigation_next_item.png b/Open-ILS/src/Android/res/drawable-hdpi/navigation_next_item.png
new file mode 100644 (file)
index 0000000..e6495b2
Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-hdpi/navigation_next_item.png differ
diff --git a/Open-ILS/src/Android/res/drawable-hdpi/navigation_previous_item.png b/Open-ILS/src/Android/res/drawable-hdpi/navigation_previous_item.png
new file mode 100644 (file)
index 0000000..23778ae
Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-hdpi/navigation_previous_item.png differ
diff --git a/Open-ILS/src/Android/res/drawable-mdpi/navigation_collapse.png b/Open-ILS/src/Android/res/drawable-mdpi/navigation_collapse.png
new file mode 100644 (file)
index 0000000..6673c7a
Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-mdpi/navigation_collapse.png differ
diff --git a/Open-ILS/src/Android/res/drawable-mdpi/navigation_expand.png b/Open-ILS/src/Android/res/drawable-mdpi/navigation_expand.png
new file mode 100644 (file)
index 0000000..7810786
Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-mdpi/navigation_expand.png differ
diff --git a/Open-ILS/src/Android/res/drawable-mdpi/navigation_next_item.png b/Open-ILS/src/Android/res/drawable-mdpi/navigation_next_item.png
new file mode 100644 (file)
index 0000000..88029a8
Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-mdpi/navigation_next_item.png differ
diff --git a/Open-ILS/src/Android/res/drawable-mdpi/navigation_previous_item.png b/Open-ILS/src/Android/res/drawable-mdpi/navigation_previous_item.png
new file mode 100644 (file)
index 0000000..8d19e39
Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-mdpi/navigation_previous_item.png differ
diff --git a/Open-ILS/src/Android/res/drawable/details_rounded_corners.xml b/Open-ILS/src/Android/res/drawable/details_rounded_corners.xml
new file mode 100644 (file)
index 0000000..d21dedf
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?> 
+<shape xmlns:android="http://schemas.android.com/apk/res/android" 
+     android:shape="rectangle"> 
+    <gradient android:startColor="#000" android:endColor="#000"/> 
+
+    <corners android:topRightRadius="8dip" android:topLeftRadius="8dip" /> 
+</shape> 
\ No newline at end of file
diff --git a/Open-ILS/src/Android/res/drawable/no_image.png b/Open-ILS/src/Android/res/drawable/no_image.png
new file mode 100644 (file)
index 0000000..633cf5b
Binary files /dev/null and b/Open-ILS/src/Android/res/drawable/no_image.png differ
diff --git a/Open-ILS/src/Android/res/drawable/rounded_bottom_corners.xml b/Open-ILS/src/Android/res/drawable/rounded_bottom_corners.xml
new file mode 100644 (file)
index 0000000..51486a1
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?> 
+<shape xmlns:android="http://schemas.android.com/apk/res/android" 
+     android:shape="rectangle"> 
+    <gradient android:startColor="#000" android:endColor="#000"/> 
+    <corners android:radius="14dip" /> 
+</shape> 
\ No newline at end of file
diff --git a/Open-ILS/src/Android/res/drawable/shadow_rect.xml b/Open-ILS/src/Android/res/drawable/shadow_rect.xml
new file mode 100644 (file)
index 0000000..24d1d5c
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+    <!-- Bottom 2dp Shadow -->
+    <item>
+        <shape android:shape="rectangle">
+            <solid android:color="#d8d8d8" />
+        </shape>
+    </item>
+    <!-- White Top color -->
+    <item android:bottom="3px">
+        <shape android:shape="rectangle">
+        <solid android:color="#FFFFFF" />
+        </shape>
+    </item>
+</layer-list>
\ No newline at end of file
index 2b6abf0..8ad6ea1 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
     android:orientation="vertical" >
     
 
index 15b47b1..040b94e 100644 (file)
 
     <LinearLayout
         android:layout_width="fill_parent"
-        android:layout_height="30dip"
-        android:background="@color/blue"
-        android:layout_marginTop="10dip"
+        android:layout_height="wrap_content"
+               style="@style/SearchDetailsInfoSeparator"
          >
 
         <TextView
             android:id="@+id/record_header_text"
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
-            android:textSize="20sp" 
-            android:textColor="@color/white"
+            android:textColor="@color/blue"
+            android:gravity="center"
+            android:textSize="@dimen/search_details_rect_text_size"
+            android:textStyle="bold"
             />
+        
     </LinearLayout>
 
     <ScrollView
         android:layout_width="fill_parent"
-        android:layout_height="fill_parent" >
-
+        android:layout_height="fill_parent"
+        android:layout_marginTop="5dip">
+        
+        
         <LinearLayout
             android:id="@+id/content_layout"
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:orientation="vertical" >
+            
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                >
+                <LinearLayout 
+                    android:layout_width="0dip"
+                    android:layout_height="wrap_content"
+                    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_author"
+                       style="@style/textSmall" 
+                       android:layout_marginTop="5dip"
+                       />
+                       
+                       <TextView
+                       android:id="@+id/record_details_simple_publisher"
+                       style="@style/textSmall" 
+                       android:layout_marginTop="3dip"
+                       />
+                </LinearLayout>
+                
+                <ImageView 
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:src="@drawable/no_image"
+                    android:layout_marginRight="5dip"
+                    android:layout_marginBottom="5dip"
+                    />
+                
+            </LinearLayout>
+
+
+
+            <TextView
+                android:id="@+id/record_details_simple_copy_count"
+                style="@style/SeparatorInformation"
+               
+            />
 
-            <TextView
-                xmlns:android="http://schemas.android.com/apk/res/android"
-                style="@style/sectionHeader"
-                android:text="Basic Information" />
-
-            <TextView
-                style="@style/textLarge"
-                android:text="TITLE" />
-
-            <TextView
-                android:id="@+id/record_details_simple_title"
-                style="@style/textSmall" />
-
-            <TextView
-                style="@style/textLarge"
-                android:text="AUTHOR" />
-
-            <TextView
-                android:id="@+id/record_details_simple_author"
-                style="@style/textSmall" />
-
-            <TextView
-                style="@style/textLarge"
-                android:text="PUBLISHER" />
-
-            <TextView
-                android:id="@+id/record_details_simple_publisher"
-                style="@style/textSmall" />
-
-            <TextView
-                xmlns:android="http://schemas.android.com/apk/res/android"
-                style="@style/sectionHeader"
-                android:text="Content" />
+                       <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"
+               style="@style/SearchDetailsInfoSeparator"
+               android:orientation="horizontal"
+         >
 
-            <TextView
+                   
+               <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:textSize="@dimen/search_details_rect_text_size"
+            android:textStyle="bold"
+        />
+        
+       </LinearLayout>
+                       
+                       <TextView
                 style="@style/textLarge"
                 android:text="SUBJECT" />
-
+               
             <TextView
                 android:id="@+id/record_details_simple_subject"
                 style="@style/textSmall" />
                 style="@style/textSmall" />
 
             <TextView
-                xmlns:android="http://schemas.android.com/apk/res/android"
-                style="@style/sectionHeader"
-                android:text="Other" />
-
-            <TextView
                 style="@style/textLarge"
                 android:text="ISBN" />
 
             <TextView
                 android:id="@+id/record_details_simple_isbn"
                 style="@style/textSmall" />
-            
-            <TextView
-                xmlns:android="http://schemas.android.com/apk/res/android"
-                style="@style/sectionHeader"
-                android:text="Copy information" />
+
             
         </LinearLayout>
     </ScrollView>
diff --git a/Open-ILS/src/Android/res/layout/simple_actionbar.xml b/Open-ILS/src/Android/res/layout/simple_actionbar.xml
new file mode 100644 (file)
index 0000000..4c9b5bb
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout
+       xmlns:android="http://schemas.android.com/apk/res/android"
+        android:id="@+id/header"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:background="@drawable/header_rounded_corners"
+        android:paddingTop="3dip"
+        android:paddingBottom="3dip"
+        >
+        
+        <Button 
+            android:id="@+id/library_logo"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/library_text_logo"
+            style="@style/LibraryLogoText"
+            android:layout_alignParentLeft="true"
+            android:padding="10dip"
+            />
+
+        <Button
+            android:id="@+id/my_acount_button"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/my_account_button_text"
+            android:layout_alignParentRight="true"
+            android:padding="10dip"
+            />
+
+    </RelativeLayout>
\ No newline at end of file
index e73e186..740a5fd 100644 (file)
     android:orientation="vertical"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
-    android:background="@color/white"
     >
 
-    <RelativeLayout
-        android:id="@+id/header"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:orientation="horizontal"
-        android:background="@drawable/header_rounded_corners"
-        android:paddingTop="3dip"
-        >
-        
-        <Button 
-            android:id="@+id/library_logo"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/library_text_logo"
-            style="@style/LibraryLogoText"
-            android:layout_alignParentLeft="true"
-            android:padding="10dip"
-            />
-
-        <Button
-            android:id="@+id/my_acount_button"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/my_account_button_text"
-            android:layout_alignParentRight="true"
-            android:padding="10dip"
-            />
+       <include android:id="@+id/header_actionbar" layout="@layout/simple_actionbar"/>
 
-    </RelativeLayout>
-    
-    
-    
     <android.support.v4.view.ViewPager
         android:id="@+id/pager"
         android:layout_width="fill_parent"
@@ -62,7 +31,6 @@
         android:layout_marginTop="5dip"
         android:layout_marginLeft="4dip"
         android:layout_marginRight="4dip"
-        android:background="@drawable/details_rounded_corners"
         />
     <org.evergreen.android.utils.ui.UnderlinePageIndicator
         android:id="@+id/indicator"
index 7068f13..f10abcc 100644 (file)
@@ -51,6 +51,9 @@
        <!-- Header portion -->
     <color name="header_gradient_start">#a10000</color>
     <color name="header_gradient_stop">#aA0000</color>
-    <color name="library_logo_text_coor">#ffffff</color>
+    <color name="library_logo_text_coor">#000</color>
     
+    
+    <!-- Search Details -->
+    <color name="dark">#000</color>
 </resources>
index 75bdd5d..b4919ed 100644 (file)
@@ -21,5 +21,6 @@
     <dimen name="text_size_large">22sp</dimen>
 
     
-    <dimen name="library_logo_text_size">18sp</dimen>
+    <dimen name="library_logo_text_size">16sp</dimen>
+    <dimen name="search_details_rect_text_size">16dip</dimen>
 </resources>
index b467ac8..9ff7a61 100644 (file)
@@ -29,6 +29,9 @@
     <string name="search_result_text"> Search result :</string>
     <string name="renew_button">renew</string>
     
+    <!-- Search Details View -->
+    <string name="show_more_text">Show More...</string>
+    
     <!-- Place Hold Activity View -->
     
     <string name="recipient">Recipient</string>
index 63ed6f8..64a9758 100644 (file)
     </style>
     
     
+    <!--  Search Details -->
+   <style name="SearchDetailsInfoSeparator">
+               <item name="android:background">@drawable/shadow_rect</item>
+        <item name="android:padding">5dip</item>
+        <item name="android:layout_marginTop">10dip</item>
+        <item name="android:textColor">@color/dark</item>
+   </style>
+    
+   <style name="SeparatorInformation">
+        <item name="android:layout_width">fill_parent</item>
+        <item name="android:layout_height">wrap_content</item>
+               <item name="android:background">@drawable/shadow_rect</item>
+        <item name="android:padding">5dip</item>
+        <item name="android:layout_marginTop">10dip</item>
+        <item name="android:textColor">@color/dark</item>
+        <item name="android:gravity">center</item>
+        <item name="android:textStyle">bold</item>
+   </style>
+   
+    
     <!--  Menu List Buttons -->
    <style name="MenuListButton">
                <item name="android:background">@drawable/menu_button</item>
diff --git a/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/CopyCountInformation.java b/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/CopyCountInformation.java
new file mode 100644 (file)
index 0000000..479a825
--- /dev/null
@@ -0,0 +1,31 @@
+package org.evergreen.android.searchCatalog;
+
+import java.io.Serializable;
+import java.util.Map;
+
+public class CopyCountInformation implements Serializable{
+
+       
+       /**
+        * 
+        */
+       private static final long serialVersionUID = 12343248767867L;
+       public Integer org_id;
+       public Integer count;
+       public Integer available;
+       public Integer depth;
+       public Integer unshadow;
+       
+       public CopyCountInformation(Object map){
+               
+               this.org_id = ((Map<String,Integer>)map).get("org_unit");
+               this.count = ((Map<String,Integer>)map).get("count");
+               this.available = ((Map<String,Integer>)map).get("available");
+               this.depth = ((Map<String,Integer>)map).get("depth");
+               this.unshadow = ((Map<String,Integer>)map).get("unshadow");
+               
+               System.out.println(org_id + " " + available + " " + count);
+       }
+       
+       
+}
index 0169ba9..b964c25 100644 (file)
@@ -47,6 +47,8 @@ public class RecordInfo implements Serializable{
        
        public boolean dummy = false;
        
+       public ArrayList<CopyCountInformation> copyCountListInfo = null;
+       
        public List<CopyInformation> copyInformationList = null;
        
        public RecordInfo(){
index e4a0e36..e717763 100644 (file)
@@ -15,10 +15,7 @@ import android.support.v4.view.ViewPager;
 import android.widget.ListView;
 
 public class SampleUnderlinesNoFade extends BaseSampleActivity {
-    
-       
-       private RecordInfo record;
-       
+
        private List<RecordInfo> records;
        
        
@@ -26,13 +23,9 @@ public class SampleUnderlinesNoFade extends BaseSampleActivity {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.simple_underlines);
-
-        
-        
+   
         records = (List<RecordInfo>)getIntent().getSerializableExtra("recordList");
-        
-        record = (RecordInfo) getIntent().getSerializableExtra("recordInfo");
-        
+
         int record_position = getIntent().getIntExtra("recordPosition", 0);
         mAdapter = new SearchFragmentAdapter(getSupportFragmentManager());
 
index d8c6da1..e692974 100644 (file)
@@ -56,6 +56,16 @@ public class SearchCatalog {
         */
        public static String METHOD_GET_COPY_STATUSES = "open-ils.search.config.copy_status.retrieve.all";
        
+       /**
+        *  Get copy count information
+        *  @param :   org_unit_id, record_id, "" ?
+        *  @returns: objects [{"transcendant":null,"count":35,"org_unit":1,"depth":0,"unshadow":35,"available":35},
+        *  {"transcendant":null,"count":14,"org_unit":2,"depth":1,"unshadow":14,"available":14},{"transcendant":null,"count":7,"org_unit":4,"depth":2,"unshadow":7,"available":7}]
+        */
+       public static String METHOD_GET_COPY_COUNT = "open-ils.search.biblio.record.copy_count";
+       
+       
+       
        public static SearchCatalog searchCatalogSingleton = null;
        /** The conn. */
        public HttpConnection conn;
@@ -86,6 +96,12 @@ public class SearchCatalog {
                
                return searchCatalogSingleton;
        }
+       
+       public static SearchCatalog getInstance(){
+       
+               return searchCatalogSingleton;
+       }
+       
        /**
         * Instantiates a new search catalog.
         *
@@ -182,6 +198,8 @@ public class SearchCatalog {
                        //get copy information
                        resultsRecordInfo.add(record);
                        
+                       record.copyCountListInfo = getCopyCount(Integer.parseInt(ids.get(i)), this.selectedOrganization.id);
+                       
                        //get copy count 
                        List<List<Object>> list= (List<List<Object>>)getLocationCount(Integer.parseInt(ids.get(i)), this.selectedOrganization.id, this.selectedOrganization.level-1);
                        
@@ -303,12 +321,27 @@ public class SearchCatalog {
         */
        public void selectOrganisation(Organisation org){
                
-               
                Log.d(TAG,"Select search organisation " + (org.level-1) + " " + org.id ); 
                this.selectedOrganization = org;
                
-               
        }
        
+       public ArrayList<CopyCountInformation> getCopyCount(Integer recordID, Integer orgID) throws NoNetworkAccessException, NoAccessToServer{
+               
+               List<?> list = (List<?>)Utils.doRequest(conn, SERVICE, METHOD_GET_COPY_COUNT, cm, new Object[]{orgID, recordID, ""});
+               
+               ArrayList<CopyCountInformation> copyInfoList = new ArrayList<CopyCountInformation>();
+               
+               if(list == null)
+                       return copyInfoList;
+
+               for(int i=0;i<list.size();i++){
+                       
+                       CopyCountInformation copyInfo = new CopyCountInformation(list.get(i));
+                       copyInfoList.add(copyInfo);
+               }
+               
+               return copyInfoList;
+       }
 
 }
index 6ba151d..157010a 100644 (file)
@@ -3,16 +3,19 @@ package org.evergreen.android.utils.ui;
 import java.util.Iterator;
 import java.util.Map.Entry;
 import java.util.Set;
+import java.util.zip.Inflater;
 
 import org.evergreen.android.R;
 import org.evergreen.android.globals.GlobalConfigs;
 import org.evergreen.android.searchCatalog.CopyInformation;
 import org.evergreen.android.searchCatalog.RecordInfo;
+import org.evergreen.android.searchCatalog.SearchCatalog;
 
 import android.os.Bundle;
 import android.support.v4.app.Fragment;
 import android.view.LayoutInflater;
 import android.view.View;
+import android.view.View.OnClickListener;
 import android.view.ViewGroup;
 import android.view.ViewGroup.LayoutParams;
 import android.widget.LinearLayout;
@@ -36,7 +39,16 @@ public class BasicDetailsFragment extends Fragment{
        private TextView synopsisTextView;
        private TextView isbnTextView;
        
+       private TextView copyCountTestView;
        
+       private LinearLayout showMore;
+       
+       private SearchCatalog search = null;
+       
+       private GlobalConfigs gl;
+
+       //max display info
+       private int list_size = 3;
        
            public static BasicDetailsFragment newInstance(RecordInfo record, Integer position, Integer total) {
                BasicDetailsFragment fragment = new BasicDetailsFragment(record,position,total);
@@ -49,9 +61,16 @@ public class BasicDetailsFragment extends Fragment{
                this.record = record;
                this.position = position;
                this.total = total;
-               
+
+               search = SearchCatalog.getInstance();
            }
 
+           public BasicDetailsFragment(){
+
+               search = SearchCatalog.getInstance();
+           }
+           
+           
            @Override
            public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
@@ -62,12 +81,13 @@ public class BasicDetailsFragment extends Fragment{
            public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
            
                
-               GlobalConfigs gl = GlobalConfigs.getGlobalConfigs(getActivity());
+               gl = GlobalConfigs.getGlobalConfigs(getActivity());
                
                LinearLayout layout = (LinearLayout) inflater.inflate(R.layout.record_details_basic_fragment, null);
 
                record_header = (TextView) layout.findViewById(R.id.record_header_text);
-               
+               copyCountTestView = (TextView) layout.findViewById(R.id.record_details_simple_copy_count);
+               showMore = (LinearLayout) layout.findViewById(R.id.record_details_show_more);
                titleTextView = (TextView) layout.findViewById(R.id.record_details_simple_title);
                        authorTextView = (TextView) layout.findViewById(R.id.record_details_simple_author);
                        publisherTextView = (TextView) layout.findViewById(R.id.record_details_simple_publisher);
@@ -77,7 +97,7 @@ public class BasicDetailsFragment extends Fragment{
                        synopsisTextView = (TextView) layout.findViewById(R.id.record_details_simple_synopsis);
                        isbnTextView = (TextView) layout.findViewById(R.id.record_details_simple_isbn);
                        
-                       record_header.setText("Record :" + position + " out of " + total  );
+                       record_header.setText("Record " + position + "of " + total  );
                        
                        titleTextView.setText(record.title);
                        authorTextView.setText(record.author);
@@ -89,9 +109,62 @@ public class BasicDetailsFragment extends Fragment{
                        
                        isbnTextView.setText(record.isbn);
                        
+                       int current_org = 0;
+                       if(search != null)
+                        current_org = search.selectedOrganization.id;
+                       
+                       System.out.println("Size " + record.copyCountListInfo.size());
+                       for(int i=0;i<record.copyCountListInfo.size();i++){
+                               //TODO
+                               System.out.println(current_org + " " + record.copyCountListInfo.get(i).org_id + " " + record.copyCountListInfo.get(i).count);
+                               if(record.copyCountListInfo.get(i).org_id == current_org){
+                                       int total = record.copyCountListInfo.get(i).count;
+                                       int available = record.copyCountListInfo.get(i).available;
+                                       copyCountTestView.setText(available + " / " + total);
+                                       break;
+                               }
+                       }
+
+                       final LayoutInflater inf = inflater;
+                       final LinearLayout lay = layout;
                        
+                       //add more details
+                       showMore.setOnClickListener(new OnClickListener() {
+                               
+                               @Override
+                               public void onClick(View v) {
+                                       // TODO Auto-generated method stub
+                                       
+                               
+                                       
+                                       System.out.println("Show more tabed");
+                                       // insert into main view
+                                       LinearLayout insertPoint = (LinearLayout) lay.findViewById(R.id.record_details_copy_information);
+                                       addCopyInfo(list_size, record.copyCountListInfo.size(), inf, insertPoint);
+                                       
+                               }
+                       });
+
+                       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);
                        
-                       for(int i=0;i<record.copyInformationList.size();i++){
+
+               return layout;
+           }
+
+           @Override
+           public void onSaveInstanceState(Bundle outState) {
+               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);
        
@@ -107,7 +180,6 @@ public class BasicDetailsFragment extends Fragment{
                                copy_location.setText(record.copyInformationList.get(i).copy_location);
                                
                                // insert into main view
-                               LinearLayout insertPoint = (LinearLayout) layout.findViewById(R.id.content_layout);
                                insertPoint.addView(copy_info_view, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
 
                                LinearLayout copy_statuses = (LinearLayout) copy_info_view.findViewById(R.id.copy_information_statuses);
@@ -128,19 +200,8 @@ public class BasicDetailsFragment extends Fragment{
                                        copy_statuses.addView(statusName, new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
                                        
                                }
-
-
-                               
-                       }
-                       
-                       
                        
-                       
-               return layout;
-           }
-
-           @Override
-           public void onSaveInstanceState(Bundle outState) {
-               super.onSaveInstanceState(outState);
+                       }
+               
            }
 }