diff --git a/assets/about.html b/assets/about.html index 23cbfbc..e0f4caa 100644 --- a/assets/about.html +++ b/assets/about.html @@ -2,10 +2,11 @@ -


Markers __VERSION__

+ +
+

by Daniel Sandler

Open Source License

+
-
__LICENSE__
+
+

Copyright © 2012 The Android Open Source Project

+

+Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +

+
+http://www.apache.org/licenses/LICENSE-2.0 +
+

+Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +

+
- + \ No newline at end of file diff --git a/assets/large_launcher_icon.png b/assets/large_launcher_icon.png deleted file mode 100644 index dfea408..0000000 Binary files a/assets/large_launcher_icon.png and /dev/null differ diff --git a/res/drawable-mdpi/qr.png b/res/drawable-mdpi/qr.png index ff05a99..e71f946 100644 Binary files a/res/drawable-mdpi/qr.png and b/res/drawable-mdpi/qr.png differ diff --git a/res/layout/about_box.xml b/res/layout/about_box.xml index ec01d28..20ae556 100644 --- a/res/layout/about_box.xml +++ b/res/layout/about_box.xml @@ -1,7 +1,9 @@ + android:layout_height="match_parent" + android:padding="16dp" + > + /> - + + \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index 2d95e5a..f63c658 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -18,4 +18,7 @@ Markers About Markers QR Code for Markers + + + diff --git a/res/values/styles.xml b/res/values/styles.xml index ca88839..b05b00d 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -55,5 +55,5 @@ + diff --git a/src/com/google/android/apps/markers/About.java b/src/com/google/android/apps/markers/About.java index 060e3b4..f64c269 100644 --- a/src/com/google/android/apps/markers/About.java +++ b/src/com/google/android/apps/markers/About.java @@ -16,6 +16,7 @@ package com.google.android.apps.markers; +import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -42,9 +43,11 @@ class About { static String loadFileText(Context context, String filename) { try { StringBuffer fileData = new StringBuffer(); - InputStreamReader reader = new InputStreamReader(context.getAssets().open(filename)); - while ( reader.read(buf) > 0 ) { - fileData.append(buf); + final BufferedReader reader = new BufferedReader( + new InputStreamReader(context.getAssets().open(filename))); + String line; + while ( (line = reader.readLine()) != null ) { + fileData.append(line); } return fileData.toString(); } catch (IOException e) { @@ -65,32 +68,6 @@ static String getVersionString(final Activity activity) { return version; } - static void showHtml(final MarkersActivity activity) { - final AlertDialog.Builder builder = new AlertDialog.Builder(activity); - builder.setTitle(null); - builder.setCancelable(true); -// builder.setPositiveButton(R.string.about_dismiss_button, -// new DialogInterface.OnClickListener() { -// public void onClick(DialogInterface dialog, int which) { -// } -// }); -// builder.setMessage(R.string.about_body); - - String htmlString = loadFileText(activity, "about.html"); - if (htmlString != null) { - String licenseString = loadFileText(activity, "license.html"); - String version = getVersionString(activity); - htmlString = htmlString.replaceAll("__VERSION__", version); - htmlString = htmlString.replaceAll("__LICENSE__", licenseString); - - WebView webview = new WebView(activity); - webview.loadDataWithBaseURL("file:///android_asset/", htmlString, "text/html", "utf-8", null); - builder.setView(webview); - } else { - builder.setMessage("Markers"); - } - } - static void show(final MarkersActivity activity) { final AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setTitle(null); @@ -104,14 +81,24 @@ static void show(final MarkersActivity activity) { title.setTypeface(light); title.setText(activity.getString(R.string.app_name) + " " + getVersionString(activity)); + WebView webview = (WebView) layout.findViewById(R.id.html); + webview.loadDataWithBaseURL("file:///android_asset/", + loadFileText(activity, "about.html"), "text/html", "utf-8", null); + builder.setView(layout); - builder.setNegativeButton("Rate/Share on Google Play", new OnClickListener() { + builder.setNegativeButton("Website", new OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + activity.clickSiteLink(null); + }}); + builder.setNeutralButton("on Play Store", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); activity.clickMarketLink(null); }}); - builder.setNeutralButton("Share via QR code", new OnClickListener() { + builder.setPositiveButton("QR code", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); diff --git a/src/com/google/android/apps/markers/MarkersActivity.java b/src/com/google/android/apps/markers/MarkersActivity.java index 126c784..38e33a5 100644 --- a/src/com/google/android/apps/markers/MarkersActivity.java +++ b/src/com/google/android/apps/markers/MarkersActivity.java @@ -631,6 +631,13 @@ public void clickMarketLink(View unused) { startActivity(urlIntent); } + public void clickSiteLink(View unused) { + hideOverflow(); + Intent urlIntent = new Intent(Intent.ACTION_VIEW, + Uri.parse("http://dsandler.org/markers?from=app")); + startActivity(urlIntent); + } + private void showOverflow() { mMenuDialog.show(); }