diff options
author | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2012-08-15 16:35:16 +0200 |
---|---|---|
committer | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2012-08-15 16:36:10 +0200 |
commit | 57ef2f63932b83da2fd3738712193b196101558d (patch) | |
tree | 36238906723594f95828ce4f812a4a0b739186af | |
parent | 6736ad3847a5667bbfbde7b891d324b97d7e331e (diff) |
Added About Dialog.
Change-Id: I8839c10e79f8f9ec864a33be7e182c8509d0b35e
-rw-r--r-- | android/sdremote/AndroidManifest.xml | 2 | ||||
-rw-r--r-- | android/sdremote/res/drawable/libreoffice_logo.png | bin | 0 -> 11628 bytes | |||
-rw-r--r-- | android/sdremote/res/layout/dialog_about.xml | 54 | ||||
-rw-r--r-- | android/sdremote/res/menu/actionbar_presentation.xml | 3 | ||||
-rw-r--r-- | android/sdremote/res/menu/activity_presentation.xml | 6 | ||||
-rw-r--r-- | android/sdremote/res/values/strings.xml | 6 | ||||
-rw-r--r-- | android/sdremote/src/org/libreoffice/impressremote/AboutDialogBuilder.java | 52 | ||||
-rw-r--r-- | android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java | 6 |
8 files changed, 121 insertions, 8 deletions
diff --git a/android/sdremote/AndroidManifest.xml b/android/sdremote/AndroidManifest.xml index 33d194fbe0b2..796cf81a1af3 100644 --- a/android/sdremote/AndroidManifest.xml +++ b/android/sdremote/AndroidManifest.xml @@ -2,7 +2,7 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.libreoffice.impressremote" android:versionCode="1" - android:versionName="1.0" > + android:versionName="0.1-Alpha" > <uses-permission android:name="android.permission.INTERNET" /> diff --git a/android/sdremote/res/drawable/libreoffice_logo.png b/android/sdremote/res/drawable/libreoffice_logo.png Binary files differnew file mode 100644 index 000000000000..f4f826b5c210 --- /dev/null +++ b/android/sdremote/res/drawable/libreoffice_logo.png diff --git a/android/sdremote/res/layout/dialog_about.xml b/android/sdremote/res/layout/dialog_about.xml new file mode 100644 index 000000000000..8ff6dd4ebb7e --- /dev/null +++ b/android/sdremote/res/layout/dialog_about.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/about_root" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" > + + <ImageView + android:id="@+id/imageView1" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/libreoffice_logo" /> + + <TextView + android:id="@+id/about_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_margin="10dip" + android:gravity="center_horizontal" + android:text="@string/app_name" + android:textAppearance="?android:attr/textAppearanceLarge" /> + + <TextView + android:id="@+id/about_version" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_margin="10dip" + android:gravity="center_horizontal" + android:text="@string/about_versionstring" /> + + <TextView + android:id="@+id/about_copyright" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_margin="10dip" + android:gravity="center_horizontal" + android:text="@string/about_copyright" /> + + <TextView + android:id="@+id/about_link" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_margin="10dip" + android:autoLink="web" + android:linksClickable="true" + android:text="www.libreoffice.org" + tools:ignore="HardcodedText" /> + +</LinearLayout>
\ No newline at end of file diff --git a/android/sdremote/res/menu/actionbar_presentation.xml b/android/sdremote/res/menu/actionbar_presentation.xml index cd88ddc3b5c0..59fe6fc5a34c 100644 --- a/android/sdremote/res/menu/actionbar_presentation.xml +++ b/android/sdremote/res/menu/actionbar_presentation.xml @@ -12,6 +12,9 @@ <item android:id="@+id/actionbar_presentation_submenu_options" android:title="@string/options"/> + <item + android:id="@+id/actionbar_presentation_submenu_about" + android:title="@string/about"/> </menu> </item> diff --git a/android/sdremote/res/menu/activity_presentation.xml b/android/sdremote/res/menu/activity_presentation.xml deleted file mode 100644 index cfc10fd52e83..000000000000 --- a/android/sdremote/res/menu/activity_presentation.xml +++ /dev/null @@ -1,6 +0,0 @@ -<menu xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:id="@+id/menu_settings" - android:title="@string/menu_settings" - android:orderInCategory="100" - android:showAsAction="never" /> -</menu> diff --git a/android/sdremote/res/values/strings.xml b/android/sdremote/res/values/strings.xml index 060652cdc2e6..6ede30d83423 100644 --- a/android/sdremote/res/values/strings.xml +++ b/android/sdremote/res/values/strings.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <string name="app_name">LibreOffice Remote</string> + <string name="app_name">Impress Remote</string> <string name="menu_settings">Settings</string> <string name="title_activity_presentation">PresentationActivity</string> <string name="presentation_ui_resizehandle">Handle to resize view.</string> @@ -28,5 +28,9 @@ <string name="pairing_instructions_3">Then input this PIN:</string> <string name="startpresentation_instruction">No presentation is currently running.</string> <string name="startpresentation_button">Start Presentation</string> + <string name="about">About</string> + <string name="about_close">Close</string> + <string name="about_versionstring">Version: {0} (Build ID: {1})</string> + <string name="about_copyright">Copyright \u00A9 2012 LibreOffice Contributors and/or their affiliates.</string> </resources>
\ No newline at end of file diff --git a/android/sdremote/src/org/libreoffice/impressremote/AboutDialogBuilder.java b/android/sdremote/src/org/libreoffice/impressremote/AboutDialogBuilder.java new file mode 100644 index 000000000000..4825e6e1066b --- /dev/null +++ b/android/sdremote/src/org/libreoffice/impressremote/AboutDialogBuilder.java @@ -0,0 +1,52 @@ +package org.libreoffice.impressremote; + +import java.text.MessageFormat; + +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager.NameNotFoundException; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.TextView; + +public class AboutDialogBuilder extends AlertDialog.Builder { + + private TextView mVersionLabel; + + public AboutDialogBuilder(Context aContext) { + super(aContext); + + LayoutInflater aInflater = (LayoutInflater) aContext + .getSystemService(Context.LAYOUT_INFLATER_SERVICE); + View aLayout = aInflater.inflate(R.layout.dialog_about, null); + + setView(aLayout); + // setContentView(R.layout.dialog_about); + + // setTitle(R.string.about); + setPositiveButton( + aContext.getResources().getString(R.string.about_close), + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + dialog.dismiss(); + } + }); + + mVersionLabel = (TextView) aLayout.findViewById(R.id.about_version); + + try { + PackageInfo aInfo = aContext.getPackageManager().getPackageInfo( + aContext.getPackageName(), 0); + String aVersionString = MessageFormat.format( + getContext().getResources().getString( + R.string.about_versionstring), + aInfo.versionName, aInfo.versionCode); + mVersionLabel.setText(aVersionString); + } catch (NameNotFoundException e) { + // Cannot logically happen + } + + } +} diff --git a/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java b/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java index bc4efa9709a8..c96235b1a8f6 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java +++ b/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java @@ -8,6 +8,7 @@ import org.libreoffice.impressremote.communication.CommunicationService; import org.libreoffice.impressremote.communication.SlideShow.Timer; import android.app.ActionBar; +import android.app.AlertDialog; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -157,6 +158,11 @@ public class PresentationActivity extends FragmentActivity { ft.commit(); } return true; + case R.id.actionbar_presentation_submenu_about: + AboutDialogBuilder aBuilder = new AboutDialogBuilder(this); + AlertDialog aDialog = aBuilder.create(); + aDialog.show(); + return true; default: return super.onOptionsItemSelected(item); } |