summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRay Chen <raychen@google.com>2012-04-16 16:18:47 +0800
committerRay Chen <raychen@google.com>2012-04-17 17:25:06 +0800
commite7d1767e30d01270bf67714b1902a316960952c0 (patch)
treefe707b06dab1458da1daae8ce4c701a9aae605d4 /src
parent2ca50f8b4d102471f7fa2f0163d6fef131abdd19 (diff)
downloadandroid_packages_apps_Gallery2-e7d1767e30d01270bf67714b1902a316960952c0.tar.gz
android_packages_apps_Gallery2-e7d1767e30d01270bf67714b1902a316960952c0.tar.bz2
android_packages_apps_Gallery2-e7d1767e30d01270bf67714b1902a316960952c0.zip
Fix b/6213053 Add Help entry point to Gallery (targeted for J release)
b:6213053 Change-Id: Ib9d9c5e69f09d6c2fffb4e6ecb09b2c3ae700365
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/app/AlbumSetPage.java5
-rw-r--r--src/com/android/gallery3d/util/GalleryUtils.java14
2 files changed, 19 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/app/AlbumSetPage.java b/src/com/android/gallery3d/app/AlbumSetPage.java
index 60de019de..c66f538b2 100644
--- a/src/com/android/gallery3d/app/AlbumSetPage.java
+++ b/src/com/android/gallery3d/app/AlbumSetPage.java
@@ -477,6 +477,11 @@ public class AlbumSetPage extends ActivityState implements
activity.startActivity(new Intent(activity, GallerySettings.class));
return true;
}
+ case R.id.action_general_help: {
+ activity.startActivity(
+ GalleryUtils.getHelpIntent(R.string.general_help_link, activity));
+ return true;
+ }
default:
return false;
}
diff --git a/src/com/android/gallery3d/util/GalleryUtils.java b/src/com/android/gallery3d/util/GalleryUtils.java
index fa9c97c75..13e08f9ee 100644
--- a/src/com/android/gallery3d/util/GalleryUtils.java
+++ b/src/com/android/gallery3d/util/GalleryUtils.java
@@ -24,6 +24,7 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
+import android.content.res.Resources;
import android.net.Uri;
import android.os.ConditionVariable;
import android.os.Environment;
@@ -330,4 +331,17 @@ public class GalleryUtils {
int h = item.getHeight();
return (h > 0 && w / h >= 2);
}
+
+ public static Intent getHelpIntent(int helpUrlResId, Context context) {
+ Resources res = context.getResources();
+ String url = res.getString(helpUrlResId)
+ + "&hl=" + res.getConfiguration().locale.getLanguage();
+
+ Intent i = new Intent(Intent.ACTION_VIEW);
+ i.setData(Uri.parse(url));
+ i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
+ i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
+ return i;
+ }
}