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
This commit is contained in:
Christian Lohmaier
2014-01-30 12:22:58 +01:00
parent c885850e2e
commit 9a9a8973f0
3 changed files with 54 additions and 24 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

@@ -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"/>
<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>

View File

@@ -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