Commit fb8c3fd9 authored by Edward Wang's avatar Edward Wang Committed by Jean-Baptiste Kempf

Update Android code to support SDK 7

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent ef03b7ee
...@@ -2,12 +2,11 @@ ...@@ -2,12 +2,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1" android:versionCode="1"
android:versionName="0.0-alpha" android:versionName="0.0-alpha"
package="org.videolan.vlc.android" package="org.videolan.vlc.android">
android:installLocation="auto"> <uses-sdk android:minSdkVersion="7" />
<uses-sdk android:minSdkVersion="8" />
<application <application
android:icon="@drawable/icon" android:icon="@drawable/icon"
android:label="@string/app_name"> android:label="@string/app_name" android:debuggable="true">
<activity <activity
android:label="@string/app_name" android:label="@string/app_name"
android:icon="@drawable/icon" android:icon="@drawable/icon"
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project name="VLC" default="default"> <project name="VLC" default="help">
<!-- The local.properties file is created and updated by the 'android' <!-- The local.properties file is created and updated by the 'android' tool.
tool. It contains the path to the SDK. It should *NOT* be checked into
It contains the path to the SDK. It should *NOT* be checked into Version Control Systems. -->
Version Control Systems. --> <loadproperties srcFile="local.properties" />
<property file="local.properties" />
<!-- The build.properties file can be created by you and is never touched <!-- The ant.properties file can be created by you. It is only edited by the
by the 'android' tool. This is the place to change some of the 'android' tool to add properties to it.
default property values used by the Ant rules. This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update: Here are some properties you may want to change/update:
source.dir source.dir
...@@ -17,6 +16,9 @@ ...@@ -17,6 +16,9 @@
out.dir out.dir
The name of the output directory. Default is 'bin'. The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action. be updated using the 'android' tool with the 'update' action.
...@@ -24,28 +26,25 @@ ...@@ -24,28 +26,25 @@
application and should be checked into Version Control Systems. application and should be checked into Version Control Systems.
--> -->
<property file="build.properties" /> <property file="ant.properties" />
<!-- The default.properties file is created and updated by the 'android' <!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT. tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your This file is an integral part of the build system for your
application and should be checked into Version Control Systems. --> application and should be checked into Version Control Systems. -->
<property file="project.properties" /> <loadproperties srcFile="project.properties" />
<!-- Custom Android task to deal with the project target, and import the
proper rules.
This requires ant 1.6.0 or above. -->
<path id="android.antlibs">
<pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
<pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
<pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
</path>
<taskdef name="setup" <!-- quick check on sdk.dir -->
classname="com.android.ant.SetupTask" <fail
classpathref="android.antlibs" /> message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
unless="sdk.dir"
/>
<target name="default" />
<!-- extension targets. Uncomment the ones where you want to do custom work <!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets --> in between standard targets -->
...@@ -55,32 +54,32 @@ ...@@ -55,32 +54,32 @@
<target name="-pre-compile"> <target name="-pre-compile">
</target> </target>
[This is typically used for code obfuscation. /* This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir} Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir}] If this is not done in place, override ${out.dex.input.absolute.dir} */
<target name="-post-compile"> <target name="-post-compile">
</target> </target>
--> -->
<!-- Import the actual build file.
<!-- Execute the Android Setup task that will setup some properties
specific to the target, and import the build rules files.
The rules file is imported from
<SDK>/platforms/<target_platform>/ant/ant_rules_r#.xml
To customize existing targets, there are two options: To customize existing targets, there are two options:
- Customize only one target: - Customize only one target:
- copy/paste the target into this file, *before* the - copy/paste the target into this file, *before* the
<setup> task. <import> task.
- customize it to your needs. - customize it to your needs.
- Customize the whole script. - Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node) - copy/paste the content of the rules files (minus the top node)
into this file, *after* the <setup> task into this file, replacing the <import> task.
- disable the import of the rules by changing the setup task
below to <setup import="false" />.
- customize to your needs. - customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
--> -->
<setup /> <!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project> </project>
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
# project structure. # project structure.
# Project target. # Project target.
target=android-8 target=android-7
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:orientation="vertical"> android:orientation="vertical">
<HorizontalScrollView <HorizontalScrollView
android:id="@+id/header" android:id="@+id/header"
android:scrollbars="none" android:scrollbars="none"
android:fadingEdge="none" android:fadingEdge="none"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_with_shadow"> android:background="@drawable/bg_with_shadow">
<LinearLayout <LinearLayout
...@@ -59,36 +59,36 @@ ...@@ -59,36 +59,36 @@
</LinearLayout> </LinearLayout>
</HorizontalScrollView> </HorizontalScrollView>
<View <View
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="1dip" android:layout_height="1dip"
android:background="#f0f0f0" /> android:background="#f0f0f0" />
<org.videolan.vlc.android.widget.FlingViewGroup <org.videolan.vlc.android.widget.FlingViewGroup
android:id="@+id/content" android:id="@+id/content"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="match_parent"> android:layout_height="fill_parent">
<ListView <ListView
android:id="@+id/songs_list" android:id="@+id/songs_list"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:fastScrollEnabled="true" /> android:fastScrollEnabled="true" />
<ListView <ListView
android:id="@+id/artists_list" android:id="@+id/artists_list"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:fastScrollEnabled="true" /> android:fastScrollEnabled="true" />
<ListView <ListView
android:id="@+id/albums_list" android:id="@+id/albums_list"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" /> android:layout_height="fill_parent" />
<ListView <ListView
android:id="@+id/genres_list" android:id="@+id/genres_list"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:fastScrollEnabled="true" /> android:fastScrollEnabled="true" />
<ListView <ListView
android:id="@+id/playklists_list" android:id="@+id/playklists_list"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:fastScrollEnabled="true" /> android:fastScrollEnabled="true" />
</org.videolan.vlc.android.widget.FlingViewGroup> </org.videolan.vlc.android.widget.FlingViewGroup>
</LinearLayout> </LinearLayout>
...@@ -2,26 +2,26 @@ ...@@ -2,26 +2,26 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:background="@drawable/bg_with_shadow"> android:background="@drawable/bg_with_shadow">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="48dip" android:layout_height="48dip"
android:orientation="horizontal" android:orientation="horizontal"
android:background="@drawable/header"> android:background="@drawable/header">
<ImageView <ImageView
android:src="@drawable/header_logo" android:src="@drawable/header_logo"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:scaleType="centerInside" /> android:scaleType="centerInside" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="0dip" android:layout_height="0dip"
android:layout_weight="1"> android:layout_weight="1">
<ImageView <ImageView
android:layout_height="match_parent" android:layout_height="fill_parent"
android:layout_width="0dip" android:layout_width="0dip"
android:layout_weight="1" android:layout_weight="1"
android:background="#00ffffff" android:background="#00ffffff"
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
android:id="@+id/cover" /> android:id="@+id/cover" />
<LinearLayout <LinearLayout
android:layout_width="90dip" android:layout_width="90dip"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:gravity="bottom" android:gravity="bottom"
android:paddingLeft="15dip" android:paddingLeft="15dip"
android:orientation="vertical"> android:orientation="vertical">
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<LinearLayout <LinearLayout
android:orientation="horizontal" android:orientation="horizontal"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_marginLeft="15dip" android:layout_marginLeft="15dip"
android:layout_marginTop="10dip" android:layout_marginTop="10dip"
android:layout_marginRight="15dip"> android:layout_marginRight="15dip">
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
android:id="@+id/length" /> android:id="@+id/length" />
</LinearLayout> </LinearLayout>
<SeekBar <SeekBar
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="4dip" android:minHeight="4dip"
android:maxHeight="4dip" android:maxHeight="4dip"
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
android:paddingRight="15dip" android:paddingRight="15dip"
android:id="@+id/timeline" /> android:id="@+id/timeline" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/title" android:text="@string/title"
android:textColor="#ffffff" android:textColor="#ffffff"
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
android:layout_marginBottom="4dip" android:layout_marginBottom="4dip"
android:id="@+id/title" /> android:id="@+id/title" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/artist" android:text="@string/artist"
android:textColor="#888888" android:textColor="#888888"
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
android:layout_marginBottom="4dip" android:layout_marginBottom="4dip"
android:id="@+id/artist" /> android:id="@+id/artist" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/album" android:text="@string/album"
android:textColor="#888888" android:textColor="#888888"
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
android:ellipsize="marquee" android:ellipsize="marquee"
android:id="@+id/album" /> android:id="@+id/album" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center" android:gravity="center"
......
...@@ -2,20 +2,20 @@ ...@@ -2,20 +2,20 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_with_shadow"> android:background="@drawable/bg_with_shadow">
<SeekBar <SeekBar
android:id="@+id/timeline" android:id="@+id/timeline"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:minHeight="2dip" android:minHeight="2dip"
android:maxHeight="2dip" android:maxHeight="2dip"
android:progressDrawable="@drawable/po_seekbar" android:progressDrawable="@drawable/po_seekbar"
android:thumb="@drawable/spacer" /> android:thumb="@drawable/spacer" />
<LinearLayout <LinearLayout
android:id="@+id/mini_player" android:id="@+id/mini_player"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="60dip" android:layout_height="60dip"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_vertical"> android:gravity="center_vertical">
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical"> android:orientation="vertical">
<ListView android:id="@id/android:list" <ListView android:id="@id/android:list"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" android:layout_height="fill_parent"
/> />
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:paddingLeft="5dip" android:paddingLeft="5dip"
android:paddingTop="5dip" android:paddingTop="5dip"
android:paddingBottom="5dip"> android:paddingBottom="5dip">
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:weightSum="1"> android:weightSum="1">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="#444444" android:background="#444444"
android:gravity="center_vertical" android:gravity="center_vertical"
...@@ -25,17 +25,17 @@ ...@@ -25,17 +25,17 @@
android:text="@string/info_title" /> android:text="@string/info_title" />
</LinearLayout> </LinearLayout>
<TextView <TextView
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/beta_warning" android:text="@string/beta_warning"
android:padding="10dip" /> android:padding="10dip" />
<View <View
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="0dip" android:layout_height="0dip"
android:layout_weight="1" /> android:layout_weight="1" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_vertical" android:gravity="center_vertical"
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
android:text="@string/not_show_again" /> android:text="@string/not_show_again" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_horizontal" android:gravity="center_horizontal"
......
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:background="@drawable/bg_with_shadow"> android:background="@drawable/bg_with_shadow">
<TextView <TextView
android:id="@+id/text" android:id="@+id/text"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_marginLeft="18dip" android:layout_marginLeft="18dip"
android:textSize="16dip" android:textSize="16dip"
android:textColor="#ffffff" /> android:textColor="#ffffff" />
<View <View
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="1dip" android:layout_height="1dip"
android:background="#f0f0f0" /> android:background="#f0f0f0" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -5,14 +5,14 @@ ...@@ -5,14 +5,14 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent"> android:layout_height="fill_parent">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="48dip" android:layout_height="48dip"
android:orientation="horizontal" android:orientation="horizontal"
android:background="@drawable/header"> android:background="@drawable/header">
<ImageView <ImageView
android:src="@drawable/header_logo" android:src="@drawable/header_logo"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:scaleType="centerInside" /> android:scaleType="centerInside" />
<View <View
android:layout_width="0dip" android:layout_width="0dip"
...@@ -70,6 +70,6 @@ ...@@ -70,6 +70,6 @@
<org.videolan.vlc.android.widget.AudioMiniPlayer <org.videolan.vlc.android.widget.AudioMiniPlayer
android:id="@+id/audio_mini_player" android:id="@+id/audio_mini_player"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:visibility="gone" /> android:visibility="gone" />
</LinearLayout> </LinearLayout>
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
android:scrollbars="none"> android:scrollbars="none">
<FrameLayout <FrameLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="match_parent"> android:layout_height="fill_parent">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:paddingTop="60dip"> android:paddingTop="60dip">
<ProgressBar <ProgressBar
...@@ -20,18 +20,18 @@ ...@@ -20,18 +20,18 @@
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="230dip" android:layout_height="230dip"
android:id="@+id/image" android:id="@+id/image"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:visibility="invisible" /> android:visibility="invisible" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="fill_parent"