Commit cf6d5036 authored by Adrien Maglo's avatar Adrien Maglo
Browse files

Audio player: add shadows to the top and the bottom of the playlist

parent 86dc884e
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:angle="90"
android:endColor="#00000000"
android:startColor="#a0a0a0" />
<size
android:height="5dp"
android:width="30dp" />
</shape>
\ No newline at end of file
......@@ -25,6 +25,7 @@ import org.videolan.vlc.R;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.MotionEvent;
......@@ -134,6 +135,28 @@ public class AudioPlaylistView extends ListView {
}
}
@Override
public void draw(Canvas c) {
super.draw(c);
// Draw the top and bottom list shadows.
Drawable mShadowDrawable = getResources().getDrawable(R.drawable.audio_playlist_shadow);
final int shadowHeight = mShadowDrawable.getIntrinsicHeight();
final int right = getRight();
final int left = getLeft();
final int bottom = getBottom();
final int top = bottom - shadowHeight;
mShadowDrawable.setBounds(left, top, right, bottom);
mShadowDrawable.draw(c);
c.rotate(180, c.getWidth() / 2, c.getHeight() / 2);
mShadowDrawable.setBounds(left, top, right, bottom);
mShadowDrawable.draw(c);
}
public void startDrag(int positionDragStart, String title, String artist) {
mPositionDragStart = positionDragStart;
if (mDragShadow != null) {
......
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