mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
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:
parent
ef3d37cc07
commit
30f916b3d6
|
@ -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. -->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.google.zxing.client.android"
|
||||
android:versionName="3.2"
|
||||
android:versionCode="45">
|
||||
android:versionName="3.21 beta 1"
|
||||
android:versionCode="46">
|
||||
<!-- We require Cupcake (Android 1.5) or later, but are really targeting Donut. -->
|
||||
<uses-sdk android:minSdkVersion="3"
|
||||
android:targetSdkVersion="4"/>
|
||||
|
@ -131,5 +131,5 @@ versionName is 2.31, 2.4, or 3.0. -->
|
|||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
|
||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||
<uses-permission android:name="android.permission.FLASHLIGHT"/>
|
||||
<uses-permission android:name="android.permission.FLASHLIGHT"/>
|
||||
</manifest>
|
||||
|
|
|
@ -3,11 +3,15 @@
|
|||
<body>
|
||||
<link rel="StyleSheet" href="style.css" type="text/css">
|
||||
<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>
|
||||
<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>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>Better layouts on QVGA devices like the HTC Tattoo.</li>
|
||||
<li>Added the ability to email your scan history.</li>
|
||||
|
|
|
@ -561,9 +561,11 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|||
int lastVersion = prefs.getInt(PreferencesActivity.KEY_HELP_VERSION_SHOWN, 0);
|
||||
if (currentVersion > lastVersion) {
|
||||
prefs.edit().putInt(PreferencesActivity.KEY_HELP_VERSION_SHOWN, currentVersion).commit();
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
|
||||
intent.setClassName(this, HelpActivity.class.getName());
|
||||
Intent intent = new Intent(this, HelpActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
|
||||
// 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);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -40,8 +40,15 @@ public final class HelpActivity extends Activity {
|
|||
private static final String TAG = HelpActivity.class.getName();
|
||||
|
||||
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 String DEFAULT_URL = "file:///android_asset/html/index.html";
|
||||
private static final Uri BUGGY_URI =
|
||||
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 Button backButton;
|
||||
|
@ -58,10 +65,11 @@ 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) {
|
||||
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);
|
||||
HelpActivity.this.startActivity(intent);
|
||||
}
|
||||
};
|
||||
|
@ -73,15 +81,23 @@ public final class HelpActivity extends Activity {
|
|||
|
||||
webView = (WebView)findViewById(R.id.help_contents);
|
||||
webView.setWebViewClient(new HelpClient());
|
||||
|
||||
Intent intent = getIntent();
|
||||
if (icicle != null) {
|
||||
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 {
|
||||
webView.loadUrl(BASE_URL + DEFAULT_PAGE);
|
||||
}
|
||||
} else {
|
||||
webView.loadUrl(DEFAULT_URL);
|
||||
webView.loadUrl(BASE_URL + DEFAULT_PAGE);
|
||||
}
|
||||
|
||||
backButton = (Button)findViewById(R.id.back_button);
|
||||
backButton.setOnClickListener(backListener);
|
||||
|
||||
Button doneButton = (Button)findViewById(R.id.done_button);
|
||||
doneButton.setOnClickListener(doneListener);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue