--- /dev/null
+<?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
--- /dev/null
+<?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
--- /dev/null
+<?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
<?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" >
<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>
--- /dev/null
+<?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
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"
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"
<!-- 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>
<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>
<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>
</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>
--- /dev/null
+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);
+ }
+
+
+}
public boolean dummy = false;
+ public ArrayList<CopyCountInformation> copyCountListInfo = null;
+
public List<CopyInformation> copyInformationList = null;
public RecordInfo(){
import android.widget.ListView;
public class SampleUnderlinesNoFade extends BaseSampleActivity {
-
-
- private RecordInfo record;
-
+
private List<RecordInfo> records;
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());
*/
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;
return searchCatalogSingleton;
}
+
+ public static SearchCatalog getInstance(){
+
+ return searchCatalogSingleton;
+ }
+
/**
* Instantiates a new search catalog.
*
//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);
*/
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;
+ }
}
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;
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);
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);
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);
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);
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);
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);
copy_statuses.addView(statusName, new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
}
-
-
-
- }
-
-
-
- return layout;
- }
-
- @Override
- public void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
+ }
+
}
}