Made upgrades load the What's New page, while new installs load the default help page. Also bumped the version to 3.21 beta 1.

git-svn-id: https://zxing.googlecode.com/svn/trunk@1242 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
dswitkin 2010-03-05 22:41:02 +00:00
parent ef3d37cc07
commit 30f916b3d6
4 changed files with 35 additions and 13 deletions

View file

@ -20,8 +20,8 @@ version to be published. The next versionCode will be 7, regardless of whether t
versionName is 2.31, 2.4, or 3.0. --> versionName is 2.31, 2.4, or 3.0. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.zxing.client.android" package="com.google.zxing.client.android"
android:versionName="3.2" android:versionName="3.21 beta 1"
android:versionCode="45"> android:versionCode="46">
<!-- We require Cupcake (Android 1.5) or later, but are really targeting Donut. --> <!-- We require Cupcake (Android 1.5) or later, but are really targeting Donut. -->
<uses-sdk android:minSdkVersion="3" <uses-sdk android:minSdkVersion="3"
android:targetSdkVersion="4"/> android:targetSdkVersion="4"/>

View file

@ -3,11 +3,15 @@
<body> <body>
<link rel="StyleSheet" href="style.css" type="text/css"> <link rel="StyleSheet" href="style.css" type="text/css">
<h3><center>What's new in this version</center></h3> <h3><center>What's new in this version</center></h3>
<p>New in version 3.21:</p>
<ul>
<li>Fixed a bug with detecting camera resolutions on some devices.</li>
</ul>
<p>New in version 3.2:</p> <p>New in version 3.2:</p>
<ul> <ul>
<li>Added a Google Shopper button when scanning products.</li>
<li>Allowed devices without autofocus to see Barcode Scanner in the Market.</li> <li>Allowed devices without autofocus to see Barcode Scanner in the Market.</li>
<li>New Finnish, Swedish, Dutch, and Czech translations.</li> <li>New Finnish, Swedish, Dutch, and Czech translations.</li>
<li>Added a Google Shopper button when scanning products.</li>
<li>Fixed a possible crash on unsupported hardware.</li> <li>Fixed a possible crash on unsupported hardware.</li>
<li>Better layouts on QVGA devices like the HTC Tattoo.</li> <li>Better layouts on QVGA devices like the HTC Tattoo.</li>
<li>Added the ability to email your scan history.</li> <li>Added the ability to email your scan history.</li>

View file

@ -561,9 +561,11 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
int lastVersion = prefs.getInt(PreferencesActivity.KEY_HELP_VERSION_SHOWN, 0); int lastVersion = prefs.getInt(PreferencesActivity.KEY_HELP_VERSION_SHOWN, 0);
if (currentVersion > lastVersion) { if (currentVersion > lastVersion) {
prefs.edit().putInt(PreferencesActivity.KEY_HELP_VERSION_SHOWN, currentVersion).commit(); prefs.edit().putInt(PreferencesActivity.KEY_HELP_VERSION_SHOWN, currentVersion).commit();
Intent intent = new Intent(Intent.ACTION_VIEW); Intent intent = new Intent(this, HelpActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.setClassName(this, HelpActivity.class.getName()); // Show the default page on a clean install, and the what's new page on an upgrade.
String page = (lastVersion == 0) ? HelpActivity.DEFAULT_PAGE : HelpActivity.WHATS_NEW_PAGE;
intent.putExtra(HelpActivity.REQUESTED_PAGE_KEY, page);
startActivity(intent); startActivity(intent);
return true; return true;
} }

View file

@ -40,8 +40,15 @@ public final class HelpActivity extends Activity {
private static final String TAG = HelpActivity.class.getName(); private static final String TAG = HelpActivity.class.getName();
private static final String[] BUGGY_MODEL_SUBSTRINGS = {"Behold II", "Pulse"}; private static final String[] BUGGY_MODEL_SUBSTRINGS = {"Behold II", "Pulse"};
private static final Uri BUGGY_URI = Uri.parse("http://code.google.com/p/zxing/wiki/FrequentlyAskedQuestions"); private static final Uri BUGGY_URI =
private static final String DEFAULT_URL = "file:///android_asset/html/index.html"; Uri.parse("http://code.google.com/p/zxing/wiki/FrequentlyAskedQuestions");
// Use this key and one of the values below when launching this activity via intent. If not
// present, the default page will be loaded.
public static final String REQUESTED_PAGE_KEY = "requested_page_key";
public static final String DEFAULT_PAGE = "index.html";
public static final String WHATS_NEW_PAGE = "whatsnew.html";
private static final String BASE_URL = "file:///android_asset/html/";
private WebView webView; private WebView webView;
private Button backButton; private Button backButton;
@ -58,7 +65,8 @@ public final class HelpActivity extends Activity {
} }
}; };
private final DialogInterface.OnClickListener groupsListener = new DialogInterface.OnClickListener() { private final DialogInterface.OnClickListener groupsListener =
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogInterface, int i) { public void onClick(DialogInterface dialogInterface, int i) {
Intent intent = new Intent(Intent.ACTION_VIEW, BUGGY_URI); Intent intent = new Intent(Intent.ACTION_VIEW, BUGGY_URI);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
@ -73,15 +81,23 @@ public final class HelpActivity extends Activity {
webView = (WebView)findViewById(R.id.help_contents); webView = (WebView)findViewById(R.id.help_contents);
webView.setWebViewClient(new HelpClient()); webView.setWebViewClient(new HelpClient());
Intent intent = getIntent();
if (icicle != null) { if (icicle != null) {
webView.restoreState(icicle); webView.restoreState(icicle);
} else if (intent != null) {
String page = intent.getStringExtra(REQUESTED_PAGE_KEY);
if (page != null && page.length() > 0) {
webView.loadUrl(BASE_URL + page);
} else { } else {
webView.loadUrl(DEFAULT_URL); webView.loadUrl(BASE_URL + DEFAULT_PAGE);
}
} else {
webView.loadUrl(BASE_URL + DEFAULT_PAGE);
} }
backButton = (Button)findViewById(R.id.back_button); backButton = (Button)findViewById(R.id.back_button);
backButton.setOnClickListener(backListener); backButton.setOnClickListener(backListener);
Button doneButton = (Button)findViewById(R.id.done_button); Button doneButton = (Button)findViewById(R.id.done_button);
doneButton.setOnClickListener(doneListener); doneButton.setOnClickListener(doneListener);
} }