From 31a248dfdc61a6977300239ae0f1125cb5784286 Mon Sep 17 00:00:00 2001 From: kenstir Date: Mon, 16 Dec 2013 22:21:26 -0500 Subject: [PATCH] Checked Out view: * checked out / overdue headers cleaner * fixed up one-sided rounded corner * only show "Renew" button if there are renewals left * show brief toast when renewal successful Fixed NPE due to lack of IDL for class 'bmp' --- .../Android/core/res/layout/activity_splash.xml | 4 +- .../src/Android/core/res/layout/checkout_list.xml | 80 ++++++++++++---------- .../Android/core/res/layout/simple_actionbar.xml | 2 +- Open-ILS/src/Android/core/res/values/strings.xml | 10 +-- .../android/accountAccess/AccountAccess.java | 4 +- .../checkout/ItemsCheckOutListView.java | 26 ++++--- Open-ILS/src/Android/cwmars_app/assets/fm_IDL.xml | 18 +++++ Open-ILS/src/Android/cwmars_app/fetch_idl.sh | 3 +- Open-ILS/src/Android/demo_app/fetch_idl.sh | 3 +- 9 files changed, 92 insertions(+), 58 deletions(-) diff --git a/Open-ILS/src/Android/core/res/layout/activity_splash.xml b/Open-ILS/src/Android/core/res/layout/activity_splash.xml index 1cb6263bab..4df99cb13e 100644 --- a/Open-ILS/src/Android/core/res/layout/activity_splash.xml +++ b/Open-ILS/src/Android/core/res/layout/activity_splash.xml @@ -32,7 +32,9 @@ android:layout_centerHorizontal="true" android:layout_marginTop="60dp" android:text="@string/retry_label" - android:visibility="gone" + android:paddingLeft="25sp" + android:paddingRight="25sp" + android:visibility="visible" /> - - - - - - - - - - + + + + + + + + + + diff --git a/Open-ILS/src/Android/core/res/layout/simple_actionbar.xml b/Open-ILS/src/Android/core/res/layout/simple_actionbar.xml index 8f27a7aa28..9e0880e449 100644 --- a/Open-ILS/src/Android/core/res/layout/simple_actionbar.xml +++ b/Open-ILS/src/Android/core/res/layout/simple_actionbar.xml @@ -10,7 +10,7 @@ android:id="@+id/header" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:background="@drawable/one_header_rounded_corner" + android:background="@drawable/header_rounded_corners" android:orientation="horizontal" android:paddingTop="3dip" android:paddingBottom="2dip" diff --git a/Open-ILS/src/Android/core/res/values/strings.xml b/Open-ILS/src/Android/core/res/values/strings.xml index 13b1ee4207..5df739810c 100644 --- a/Open-ILS/src/Android/core/res/values/strings.xml +++ b/Open-ILS/src/Android/core/res/values/strings.xml @@ -58,7 +58,8 @@ Holds Fines Bookbags - renew + Renew + Item renewed Record %1$d of %2$d @@ -90,8 +91,9 @@ Items on hold: - Total items out: - / Overdue items: + Total items checked out: + Overdue: + due Total Owned @@ -146,9 +148,7 @@ %d items - JunkActivity Settings - Hello world! Retry diff --git a/Open-ILS/src/Android/core/src/org/evergreen/android/accountAccess/AccountAccess.java b/Open-ILS/src/Android/core/src/org/evergreen/android/accountAccess/AccountAccess.java index b6e62983f2..a67a69e3a5 100644 --- a/Open-ILS/src/Android/core/src/org/evergreen/android/accountAccess/AccountAccess.java +++ b/Open-ILS/src/Android/core/src/org/evergreen/android/accountAccess/AccountAccess.java @@ -408,8 +408,7 @@ public class AccountAccess { } } - // TODO are we using this too? In the opac they are not used - /* + /* Other fields returned by the request; apparently not used in OPAC resp_map.get("claims_returned"); resp_map.get("long_overdue") resp_map.get("lost"); @@ -421,6 +420,7 @@ public class AccountAccess { return lhs.getDueDate().compareTo(rhs.getDueDate()); } }); + return circRecords; } diff --git a/Open-ILS/src/Android/core/src/org/evergreen/android/accountAccess/checkout/ItemsCheckOutListView.java b/Open-ILS/src/Android/core/src/org/evergreen/android/accountAccess/checkout/ItemsCheckOutListView.java index 8d6ce2f362..47f76a22d4 100644 --- a/Open-ILS/src/Android/core/src/org/evergreen/android/accountAccess/checkout/ItemsCheckOutListView.java +++ b/Open-ILS/src/Android/core/src/org/evergreen/android/accountAccess/checkout/ItemsCheckOutListView.java @@ -23,6 +23,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; +import android.opengl.Visibility; import org.evergreen.android.R; import org.evergreen.android.accountAccess.AccountAccess; import org.evergreen.android.accountAccess.MaxRenewalsException; @@ -249,24 +250,23 @@ public class ItemsCheckOutListView extends Activity { } // Get reference to TextView - title - recordTitle = (TextView) row - .findViewById(R.id.checkout_record_title); + recordTitle = (TextView) row.findViewById(R.id.checkout_record_title); // Get reference to TextView - author - recordAuthor = (TextView) row - .findViewById(R.id.checkout_record_author); + recordAuthor = (TextView) row.findViewById(R.id.checkout_record_author); // Get reference to TextView - record Publisher date+publisher - recordDueDate = (TextView) row - .findViewById(R.id.checkout_due_date); + recordDueDate = (TextView) row.findViewById(R.id.checkout_due_date); renewButton = (TextView) row.findViewById(R.id.renew_button); - - renewButton.setText("renew : " + record.getRenewals()); - + final boolean renewable = record.getRenewals() > 0; + renewButton.setVisibility(renewable ? View.VISIBLE : View.GONE); + renewButton.setEnabled(renewable); renewButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { + if (!renewable) + return; Thread renew = new Thread(new Runnable() { @Override @@ -321,6 +321,12 @@ public class ItemsCheckOutListView extends Activity { Log.d(TAG, "Exception in reauth", eauth); } } + runOnUiThread(new Runnable() { + @Override + public void run() { + Toast.makeText(context, getString(R.string.item_renewed), Toast.LENGTH_SHORT).show(); + } + }); if (refresh) { try { @@ -356,7 +362,7 @@ public class ItemsCheckOutListView extends Activity { // set text recordTitle.setText(record.getTitle()); recordAuthor.setText(record.getAuthor()); - recordDueDate.setText(record.getDueDate()); + recordDueDate.setText(getString(R.string.due) + ": " + record.getDueDate()); Log.d(TAG, "title: " + record.getTitle()); Log.d(TAG, "author: " + record.getAuthor()); Log.d(TAG, "due: " + record.getDueDate()); diff --git a/Open-ILS/src/Android/cwmars_app/assets/fm_IDL.xml b/Open-ILS/src/Android/cwmars_app/assets/fm_IDL.xml index 5f8585e813..6f6f5f2c40 100644 --- a/Open-ILS/src/Android/cwmars_app/assets/fm_IDL.xml +++ b/Open-ILS/src/Android/cwmars_app/assets/fm_IDL.xml @@ -109,6 +109,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/src/Android/cwmars_app/fetch_idl.sh b/Open-ILS/src/Android/cwmars_app/fetch_idl.sh index 2f7cd68180..ad7a5d4fa2 100644 --- a/Open-ILS/src/Android/cwmars_app/fetch_idl.sh +++ b/Open-ILS/src/Android/cwmars_app/fetch_idl.sh @@ -1,2 +1,3 @@ #!/bin/sh -curl -o assets/fm_IDL.xml 'http://bark.cwmars.org/reports/fm_IDL.xml?class=acn&class=acp&class=ahr&class=ahtc&class=au&class=cbreb&class=cbrebi&class=cbrebin&class=cbrebn&class=ccs&class=circ&class=ex&class=mbt&class=mbts&class=mous&class=mus&class=mvr&class=perm_ex' +root=http://bark.cwmars.org +curl -o assets/fm_IDL.xml "$root/reports/fm_IDL.xml?class=acn&class=acp&class=ahr&class=ahtc&class=au&class=bmp&class=cbreb&class=cbrebi&class=cbrebin&class=cbrebn&class=ccs&class=circ&class=ex&class=mbt&class=mbts&class=mous&class=mus&class=mvr&class=perm_ex" diff --git a/Open-ILS/src/Android/demo_app/fetch_idl.sh b/Open-ILS/src/Android/demo_app/fetch_idl.sh index 7f50727694..a671ee087d 100644 --- a/Open-ILS/src/Android/demo_app/fetch_idl.sh +++ b/Open-ILS/src/Android/demo_app/fetch_idl.sh @@ -1,2 +1,3 @@ #!/bin/sh -curl -o assets/fm_IDL.xml 'http://demo.evergreencatalog.com/reports/fm_IDL.xml?class=acn&class=acp&class=ahr&class=ahtc&class=au&class=cbreb&class=cbrebi&class=cbrebin&class=cbrebn&class=ccs&class=circ&class=ex&class=mbt&class=mbts&class=mous&class=mus&class=mvr&class=perm_ex' +root=http://demo.evergreencatalog.com +curl -o assets/fm_IDL.xml "$root/reports/fm_IDL.xml?class=acn&class=acp&class=ahr&class=ahtc&class=au&class=bmp&class=cbreb&class=cbrebi&class=cbrebin&class=cbrebn&class=ccs&class=circ&class=ex&class=mbt&class=mbts&class=mous&class=mus&class=mvr&class=perm_ex" -- 2.11.0