summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-10-09 20:49:36 +0200
committerJan Holesovsky <kendy@collabora.com>2014-10-09 20:57:06 +0200
commit2b85db8b6b7cbdef8e8a8645c33d122ef987a27d (patch)
treea947ee352941400d250fcc7d8abb6ad4755a5268 /android
parent05e5da6ad085091f8c392502cd230273e6688aea (diff)
android: Simplify the About dialog creation.
Change-Id: I40fb007e8f672e1c5ff4e6e23c043b7305e726a9
Diffstat (limited to 'android')
-rw-r--r--android/experimental/LOAndroid3/res/layout/about.xml22
-rw-r--r--android/experimental/LOAndroid3/res/values/strings.xml5
-rw-r--r--android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java10
3 files changed, 9 insertions, 28 deletions
diff --git a/android/experimental/LOAndroid3/res/layout/about.xml b/android/experimental/LOAndroid3/res/layout/about.xml
index ec014a0e89f8..06c5bfe74ef7 100644
--- a/android/experimental/LOAndroid3/res/layout/about.xml
+++ b/android/experimental/LOAndroid3/res/layout/about.xml
@@ -25,24 +25,4 @@
android:textColor="@android:color/secondary_text_light"
android:textSize="18dip"/>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
-
- <Button
- android:id="@+id/about_license_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="12dp"
- android:text="License"/>
-
- <Button
- android:id="@+id/about_notice_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="12dp"
- android:text="Notice"/>
- </LinearLayout>
-
-</LinearLayout> \ No newline at end of file
+</LinearLayout>
diff --git a/android/experimental/LOAndroid3/res/values/strings.xml b/android/experimental/LOAndroid3/res/values/strings.xml
index f913e5e030d3..c98c0cde5f22 100644
--- a/android/experimental/LOAndroid3/res/values/strings.xml
+++ b/android/experimental/LOAndroid3/res/values/strings.xml
@@ -4,9 +4,12 @@
<string name="app_name">LibreOffice Viewer</string>
<string name="app_about_name"><b>LibreOffice Viewer \'Beta\'</b></string>
- <string name="app_description">LibreOffice Viewer is a document viewer based on LibreOffice</string>
+ <string name="app_description">LibreOffice Viewer is a document viewer based on LibreOffice.</string>
<string name="app_credits">http://www.libreoffice.org</string>
+ <string name="about_license">License</string>
+ <string name="about_notice">Notice</string>
+
<string name="browser_app_name">LibreOffice Browser</string>
<string name="menu_search">Search</string>
<string name="list_view">List</string>
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
index 1df149aba467..1778e3597f88 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -196,11 +196,8 @@ public class LibreOfficeMainActivity extends Activity {
builder.setIcon(R.drawable.lo_icon);
builder.setTitle(R.string.app_name);
builder.setView(messageView);
- builder.create();
- builder.show();
- Button licenseButton = (Button) messageView.findViewById(R.id.about_license_button);
- licenseButton.setOnClickListener(new View.OnClickListener() {
+ builder.setNegativeButton(R.string.about_license, new DialogInterface.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(view.getContext(), LibreOfficeMainActivity.class);
@@ -210,8 +207,7 @@ public class LibreOfficeMainActivity extends Activity {
}
});
- Button noticeButton = (Button) messageView.findViewById(R.id.about_notice_button);
- noticeButton.setOnClickListener(new View.OnClickListener() {
+ builder.setPositiveButton(R.string.about_notice, new DialogInterface.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(view.getContext(), LibreOfficeMainActivity.class);
@@ -221,6 +217,8 @@ public class LibreOfficeMainActivity extends Activity {
}
});
+ AlertDialog dialog = builder.create();
+ dialog.show();
}
public void showProgressSpinner() {