--- /dev/null
+/* \r
+ * Copyright (C) 2007-2011 OpenIntents.org\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+package org.openintents.filemanager;\r
+\r
+import org.openintents.intents.AboutMiniIntents;\r
+import org.openintents.util.IntentUtils;\r
+import org.openintents.util.VersionUtils;\r
+\r
+import android.app.Activity;\r
+import android.content.Context;\r
+import android.content.Intent;\r
+\r
+/**\r
+ * About dialog\r
+ *\r
+ * @version 2009-02-04\r
+ * @author Peli\r
+ *\r
+ */\r
+public class AboutDialog extends DownloadAppDialog {\r
+ private static final String TAG = "About";\r
+ private static final boolean DEBUG_NO_OI_ABOUT = false;\r
+ \r
+ public AboutDialog(Context context) {\r
+ super(context,\r
+ R.string.oi_distribution_aboutapp_not_available,\r
+ R.string.oi_distribution_aboutapp,\r
+ R.string.oi_distribution_aboutapp_package,\r
+ R.string.oi_distribution_aboutapp_website);\r
+\r
+ String version = VersionUtils.getVersionNumber(mContext);\r
+ String appname = VersionUtils.getApplicationName(mContext);\r
+ String appnameversion = mContext.getString(R.string.oi_distribution_name_and_version, appname, version);\r
+ \r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append(appnameversion);\r
+ sb.append("\n\n");\r
+ sb.append(mMessageText);\r
+ setMessage(sb.toString());\r
+ }\r
+ \r
+ public static void showDialogOrStartActivity(Activity activity, int dialogId) {\r
+ Intent intent = new Intent(AboutMiniIntents.ACTION_SHOW_ABOUT_DIALOG);\r
+ intent.putExtra(AboutMiniIntents.EXTRA_PACKAGE_NAME, activity.getPackageName());\r
+ \r
+ if (IntentUtils.isIntentAvailable(activity, intent)) {\r
+ activity.startActivity(intent);\r
+ } else {\r
+ activity.showDialog(dialogId);\r
+ }\r
+ }\r
+\r
+}\r