Commit e89ad430 authored by Alexandre Perraud's avatar Alexandre Perraud Committed by Jean-Baptiste Kempf
Browse files

Cute About whith version number


Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 1cef3171
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:gravity="center" android:gravity="center|fill_vertical"
android:orientation="vertical" android:orientation="vertical"
android:weightSum="1"> android:weightSum="1" >
<RelativeLayout <RelativeLayout
android:layout_width="fill_parent" android:layout_width="fill_parent"
...@@ -30,14 +30,12 @@ ...@@ -30,14 +30,12 @@
android:src="@drawable/header_logo" /> android:src="@drawable/header_logo" />
<TextView <TextView
android:id="@+id/textView1" android:id="@+id/textViewVersion"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:gravity="center" android:gravity="center"/>
android:text="@string/about_version" />
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
......
...@@ -73,7 +73,6 @@ ...@@ -73,7 +73,6 @@
<string name="surface_fill">Fill</string> <string name="surface_fill">Fill</string>
<string name="surface_original">Center</string> <string name="surface_original">Center</string>
<string name="about_text">\nVLC media player\n\nVLC authors and VideoLAN\n\nLicensed under the GPLv3\n</string> <string name="about_text">\nVLC media player\n\nVLC authors and VideoLAN\n\nLicensed under the GPLv3\n</string>
<string name="about_version">version xxx</string>
<string name="thumbnail">Thumbnail</string> <string name="thumbnail">Thumbnail</string>
<string name="main_prefs_category">Main</string> <string name="main_prefs_category">Main</string>
<string name="advanced_prefs_category">Advanced</string> <string name="advanced_prefs_category">Advanced</string>
......
...@@ -23,7 +23,10 @@ package org.videolan.vlc.gui; ...@@ -23,7 +23,10 @@ package org.videolan.vlc.gui;
import org.videolan.vlc.R; import org.videolan.vlc.R;
import android.app.Activity; import android.app.Activity;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle; import android.os.Bundle;
import android.widget.TextView;
public class AboutActivity extends Activity { public class AboutActivity extends Activity {
...@@ -32,7 +35,21 @@ public class AboutActivity extends Activity { ...@@ -32,7 +35,21 @@ public class AboutActivity extends Activity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.about); setContentView(R.layout.about);
displayVersionName();
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
} }
private void displayVersionName() {
String versionName = "";
PackageInfo packageInfo;
try {
packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
versionName = "v " + packageInfo.versionName;
} catch (NameNotFoundException e) {
e.printStackTrace();
}
TextView tv = (TextView) findViewById(R.id.textViewVersion);
tv.setText(versionName);
}
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment