diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2014-01-30 12:22:58 +0100 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2014-01-30 12:41:52 +0100 |
commit | 9a9a8973f0b9e77036a2dfa46f252377145dcff7 (patch) | |
tree | 1d8f08a0cc8fab308aac353f8334e545726179e2 /android | |
parent | c885850e2e54da986bd85cfc00bc8a23c272704d (diff) |
sdremote: add about/license info
The activity tired to include a file that was not checked in at all
(probably due .gitignore ignoring assets), so replace that with a simple
linear layout.
Change-Id: I505855346f440712b7e170080b7db11b775c4172
Diffstat (limited to 'android')
-rw-r--r-- | android/sdremote/res/drawable/libreoffice_logo.png | bin | 0 -> 8065 bytes | |||
-rw-r--r-- | android/sdremote/res/layout/activity_licenses.xml | 46 | ||||
-rw-r--r-- | android/sdremote/src/org/libreoffice/impressremote/activity/LicensesActivity.java | 32 |
3 files changed, 54 insertions, 24 deletions
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..7ad11473e0b8 --- /dev/null +++ b/android/sdremote/res/drawable/libreoffice_logo.png diff --git a/android/sdremote/res/layout/activity_licenses.xml b/android/sdremote/res/layout/activity_licenses.xml index 6319f3f6735c..a69118b49b73 100644 --- a/android/sdremote/res/layout/activity_licenses.xml +++ b/android/sdremote/res/layout/activity_licenses.xml @@ -16,7 +16,45 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> -<WebView xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/view_licenses" - android:layout_width="match_parent" - android:layout_height="match_parent"/>
\ No newline at end of file +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/layout_license" + android:layout_width="match_parent" + android:layout_height="fill_parent" + android:layout_marginTop="0dp" + android:gravity="center_horizontal|top" + android:orientation="vertical" > + + <ImageView + android:id="@+id/imageView1" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:adjustViewBounds="true" + android:maxWidth="350dp" + android:padding="16dp" + android:src="@drawable/libreoffice_logo" /> + + <TextView + android:id="@+id/textView1" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/application_name" + android:textAppearance="@style/SectionHeader" + android:textSize="22sp" /> + + <TextView + android:id="@+id/version" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="8dp" + android:text="Version: %s (Build ID: %s)" /> + + <TextView + android:id="@+id/copyright" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="center_horizontal" + android:paddingLeft="16dp" + android:paddingRight="16dp" + android:text="Copyright © 2012-2014 LibreOffice contributors\nThis App is provided under the\nMozilla Public License, v. 2.0" /> + +</LinearLayout>
\ No newline at end of file diff --git a/android/sdremote/src/org/libreoffice/impressremote/activity/LicensesActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/LicensesActivity.java index 84d69819c37a..40b708b7a112 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/activity/LicensesActivity.java +++ b/android/sdremote/src/org/libreoffice/impressremote/activity/LicensesActivity.java @@ -9,41 +9,33 @@ package org.libreoffice.impressremote.activity; import android.content.ContentResolver; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager.NameNotFoundException; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.view.MenuItem; -import android.webkit.WebView; +import android.widget.TextView; import org.libreoffice.impressremote.R; public class LicensesActivity extends ActionBarActivity { - private static final String SCHEME = ContentResolver.SCHEME_FILE; - private static final String AUTHORITY = "android_asset"; - private static final String PATH = "licenses.html"; @Override protected void onCreate(Bundle aSavedInstanceState) { super.onCreate(aSavedInstanceState); setContentView(R.layout.activity_licenses); - setUpHomeButton(); - setUpContent(); - } - - private void setUpHomeButton() { getSupportActionBar().setHomeButtonEnabled(true); - } - - private void setUpContent() { - getLicensesView().loadUrl(buildLicensesUri()); - } - - private WebView getLicensesView() { - return (WebView) findViewById(R.id.view_licenses); - } - private String buildLicensesUri() { - return String.format("%s:///%s/%s", SCHEME, AUTHORITY, PATH); + try { + PackageInfo info = getPackageManager().getPackageInfo( + getPackageName(), 0); + ((TextView) findViewById(R.id.version)).setText( + "Version: " + info.versionName + + " (Build ID: "+info.versionCode +")"); + } catch (NameNotFoundException e) { + // ignore + } } @Override |