mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Added a specific message for unsearchable books, and changed the Exit button in the help to Done to be a little clearer.
git-svn-id: https://zxing.googlecode.com/svn/trunk@766 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
c3564411fb
commit
7f5c93a71d
|
@ -39,10 +39,10 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:text="@string/button_back"/>
|
||||
|
||||
<Button android:id="@+id/exit_button"
|
||||
<Button android:id="@+id/done_button"
|
||||
android:layout_width="100px"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/button_exit"/>
|
||||
android:text="@string/button_done"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
<string name="button_cancel">Cancel</string>
|
||||
<string name="button_clipboard_empty">Clipboard empty</string>
|
||||
<string name="button_dial">Dial number</string>
|
||||
<string name="button_done">Done</string>
|
||||
<string name="button_email">Send email</string>
|
||||
<string name="button_exit">Exit</string>
|
||||
<string name="button_get_directions">Get directions</string>
|
||||
<string name="button_mms">Send MMS</string>
|
||||
<string name="button_ok">OK</string>
|
||||
|
@ -65,6 +65,7 @@
|
|||
<string name="msg_encode_contents_failed">Could not encode a barcode from the data provided.
|
||||
</string>
|
||||
<string name="msg_encode_in_progress">Generating a barcode\u2026</string>
|
||||
<string name="msg_sbc_book_not_searchable">Sorry, this book is not searchable.</string>
|
||||
<string name="msg_sbc_failed">Sorry, the search encountered a problem.</string>
|
||||
<string name="msg_sbc_no_page_returned">No page returned</string>
|
||||
<string name="msg_sbc_page">Page</string>
|
||||
|
|
|
@ -50,8 +50,8 @@ public final class HelpActivity extends Activity {
|
|||
mBackButton = (Button)findViewById(R.id.back_button);
|
||||
mBackButton.setOnClickListener(mBackListener);
|
||||
|
||||
Button exitButton = (Button)findViewById(R.id.exit_button);
|
||||
exitButton.setOnClickListener(mExitListener);
|
||||
Button doneButton = (Button)findViewById(R.id.done_button);
|
||||
doneButton.setOnClickListener(mDoneListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -81,7 +81,7 @@ public final class HelpActivity extends Activity {
|
|||
}
|
||||
};
|
||||
|
||||
private final Button.OnClickListener mExitListener = new Button.OnClickListener() {
|
||||
private final Button.OnClickListener mDoneListener = new Button.OnClickListener() {
|
||||
public void onClick(View view) {
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -179,6 +179,10 @@ public final class SearchBookContentsActivity extends Activity {
|
|||
}
|
||||
mResultListView.setAdapter(new SearchBookContentsAdapter(this, items));
|
||||
} else {
|
||||
String searchable = json.optString("searchable");
|
||||
if (searchable != null && searchable.equals("false")) {
|
||||
mHeaderView.setText(R.string.msg_sbc_book_not_searchable);
|
||||
}
|
||||
mResultListView.setAdapter(null);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
|
@ -237,9 +241,10 @@ public final class SearchBookContentsActivity extends Activity {
|
|||
AndroidHttpClient client = null;
|
||||
try {
|
||||
// These return a JSON result which describes if and where the query was found. This API may
|
||||
// break or disappear at any time in the future. Since this is an API call rather than a website,
|
||||
// we don't use LocaleManager to change the TLD.
|
||||
URI uri = new URI("http", null, "www.google.com", -1, "/books", "vid=isbn" + mISBN + "&jscmd=SearchWithinVolume2&q=" + mQuery, null);
|
||||
// break or disappear at any time in the future. Since this is an API call rather than a
|
||||
// website, we don't use LocaleManager to change the TLD.
|
||||
URI uri = new URI("http", null, "www.google.com", -1, "/books", "vid=isbn" + mISBN +
|
||||
"&jscmd=SearchWithinVolume2&q=" + mQuery, null);
|
||||
HttpUriRequest get = new HttpGet(uri);
|
||||
get.setHeader("cookie", getCookie(uri.toString()));
|
||||
client = AndroidHttpClient.newInstance(mUserAgent);
|
||||
|
|
Loading…
Reference in a new issue