Commit dc14f863 authored by Adrien Maglo's avatar Adrien Maglo

Audio player: add a progress bar to the mini player

parent e8777a71
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@android:id/background">
<shape>
<solid android:color="#00000000" />
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<solid android:color="@color/darkorange" />
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
......@@ -5,6 +5,20 @@
android:background="?attr/background_player"
android:orientation="vertical" >
<ProgressBar
android:id="@+id/progressBar"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:focusable="false"
android:indeterminate="false"
android:maxHeight="2dip"
android:minHeight="2dip"
android:paddingLeft="0px"
android:paddingRight="0px"
android:progressDrawable="@drawable/progress_mini_player" />
<LinearLayout
android:id="@+id/header"
android:layout_width="fill_parent"
......
......@@ -49,6 +49,7 @@ import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.ViewSwitcher;
......@@ -58,6 +59,7 @@ import android.widget.SeekBar.OnSeekBarChangeListener;
public class AudioMiniPlayer extends Fragment implements IAudioPlayer {
public static final String TAG = "VLC/AudioMiniPlayer";
private ProgressBar mProgressBar;
private AudioMediaSwitcher mAudioMediaSwitcher;
private AnimatedCoverView mBigCover;
private TextView mTime;
......@@ -98,6 +100,8 @@ public class AudioMiniPlayer extends Fragment implements IAudioPlayer {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.audio_player, container, false);
mProgressBar = (ProgressBar) v.findViewById(R.id.progressBar);
mAudioMediaSwitcher = (AudioMediaSwitcher) v.findViewById(R.id.audio_media_switcher);
mAudioMediaSwitcher.setAudioMediaSwitcherListener(mAudioMediaSwitcherListener);
......@@ -298,6 +302,8 @@ public class AudioMiniPlayer extends Fragment implements IAudioPlayer {
mLength.setText(Util.millisToString(length));
mTimeline.setMax(length);
mTimeline.setProgress(time);
mProgressBar.setMax(length);
mProgressBar.setProgress(time);
}
private void updateList() {
......
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