[Android] Audio player: when sliding the playlist, a big cover of the current media is displayed
Adrien Maglo
git at videolan.org
Wed Dec 4 17:58:48 CET 2013
vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Wed Dec 4 17:58:41 2013 +0100| [b2809e5d3594bc826bb9fe3c648b2c7b224e32eb] | committer: Adrien Maglo
Audio player: when sliding the playlist, a big cover of the current media is displayed
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=b2809e5d3594bc826bb9fe3c648b2c7b224e32eb
---
vlc-android/res/layout/audio_player.xml | 23 +++++++++++++++-----
.../vlc/gui/audio/AudioPlayerFragment.java | 4 ++++
2 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/vlc-android/res/layout/audio_player.xml b/vlc-android/res/layout/audio_player.xml
index 15d0a74..7563224 100644
--- a/vlc-android/res/layout/audio_player.xml
+++ b/vlc-android/res/layout/audio_player.xml
@@ -57,12 +57,25 @@
android:src="@drawable/dots" />
</LinearLayout>
- <ListView
- android:id="@+id/songs_list"
+ <org.videolan.vlc.widget.FlingViewGroup
+ android:id="@+id/content"
android:layout_width="fill_parent"
- android:layout_height="200dp"
- android:layout_weight="1"
- android:background="?attr/background_menu" />
+ android:layout_height="fill_parent"
+ android:layout_weight="1" >
+
+ <ListView
+ android:id="@+id/songs_list"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:background="?attr/background_menu" />
+
+ <ImageView
+ android:id="@+id/big_cover"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:scaleType="centerCrop" />
+
+ </org.videolan.vlc.widget.FlingViewGroup>
<LinearLayout
android:layout_width="fill_parent"
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerFragment.java
index a8ce981..a7bd5e1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerFragment.java
@@ -57,6 +57,7 @@ public class AudioPlayerFragment extends SherlockFragment implements IAudioPlaye
public final static String TAG = "VLC/AudioPlayerFragment";
private ImageView mCover;
+ private ImageView mBigCover;
private TextView mTitle;
private TextView mArtist;
private TextView mTime;
@@ -98,6 +99,7 @@ public class AudioPlayerFragment extends SherlockFragment implements IAudioPlaye
View v = inflater.inflate(R.layout.audio_player, container, false);
mCover = (ImageView) v.findViewById(R.id.cover);
+ mBigCover = (ImageView) v.findViewById(R.id.big_cover);
mTitle = (TextView) v.findViewById(R.id.title);
mArtist = (TextView) v.findViewById(R.id.artist);
mTime = (TextView) v.findViewById(R.id.time);
@@ -269,8 +271,10 @@ public class AudioPlayerFragment extends SherlockFragment implements IAudioPlaye
if (cover != null) {
mCover.setVisibility(ImageView.VISIBLE);
mCover.setImageBitmap(cover);
+ mBigCover.setImageBitmap(cover);
} else {
mCover.setVisibility(ImageView.GONE);
+ mBigCover.setImageResource(R.drawable.cone);
}
}
lastTitle = title;
More information about the Android
mailing list