[Libreoffice-commits] .: android/sdremote
Andrzej J.R. Hunt
ajrhunt at kemper.freedesktop.org
Wed Aug 15 07:36:25 PDT 2012
android/sdremote/AndroidManifest.xml | 2
android/sdremote/res/drawable/libreoffice_logo.png |binary
android/sdremote/res/layout/dialog_about.xml | 54 ++++++++++
android/sdremote/res/menu/actionbar_presentation.xml | 3
android/sdremote/res/menu/activity_presentation.xml | 6 -
android/sdremote/res/values/strings.xml | 6 -
android/sdremote/src/org/libreoffice/impressremote/AboutDialogBuilder.java | 52 +++++++++
android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java | 6 +
8 files changed, 121 insertions(+), 8 deletions(-)
New commits:
commit 57ef2f63932b83da2fd3738712193b196101558d
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date: Wed Aug 15 16:35:16 2012 +0200
Added About Dialog.
Change-Id: I8839c10e79f8f9ec864a33be7e182c8509d0b35e
diff --git a/android/sdremote/AndroidManifest.xml b/android/sdremote/AndroidManifest.xml
index 33d194f..796cf81 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
new file mode 100644
index 0000000..f4f826b
Binary files /dev/null and b/android/sdremote/res/drawable/libreoffice_logo.png differ
diff --git a/android/sdremote/res/layout/dialog_about.xml b/android/sdremote/res/layout/dialog_about.xml
new file mode 100644
index 0000000..8ff6dd4
--- /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 cd88ddc..59fe6fc 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 cfc10fd..0000000
--- 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 060652c..6ede30d 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 0000000..4825e6e
--- /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 bc4efa9..c96235b 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);
}
More information about the Libreoffice-commits
mailing list