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

Add QVGA specific layout

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 0093418a
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg_with_shadow">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="48dip"
android:orientation="horizontal"
android:background="@drawable/header">
<ImageView
android:src="@drawable/header_logo"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:scaleType="centerInside" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1">
<ImageView
android:layout_height="fill_parent"
android:layout_width="0dip"
android:layout_weight="1"
android:background="#00ffffff"
android:layout_marginLeft="15dip"
android:layout_marginTop="15dip"
android:id="@+id/cover" />
<LinearLayout
android:layout_width="90dip"
android:layout_height="fill_parent"
android:gravity="bottom"
android:paddingLeft="15dip"
android:orientation="vertical">
<ImageButton
android:src="@drawable/ic_shuffle"
android:background="#00000000"
android:scaleType="fitXY"
android:padding="5dip"
android:layout_height="50dip"
android:layout_width="50dip"
android:layout_marginBottom="-5dip"
android:id="@+id/shuffle"
android:onClick="onShuffleClick" />
<ImageButton
android:src="@drawable/ic_repeat"
android:background="#00000000"
android:scaleType="fitXY"
android:padding="5dip"
android:layout_height="50dip"
android:layout_width="50dip"
android:id="@+id/repeat"
android:onClick="onRepeatClick" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_marginLeft="15dip"
android:layout_marginTop="10dip"
android:layout_marginRight="15dip">
<TextView
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18dip"
android:text="@string/time_0"
android:textColor="#ffffff"
android:id="@+id/time" />
<TextView
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18dip"
android:text="@string/time_0"
android:gravity="right"
android:textColor="#ffffff"
android:id="@+id/length" />
</LinearLayout>
<SeekBar
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="4dip"
android:maxHeight="4dip"
android:progressDrawable="@drawable/po_seekbar"
android:thumb="@drawable/ic_seekbar_thumb"
android:paddingTop="5dip"
android:paddingBottom="10dip"
android:paddingLeft="15dip"
android:paddingRight="15dip"
android:id="@+id/timeline" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/title"
android:textColor="#ffffff"
android:textSize="20dip"
android:paddingLeft="20dip"
android:paddingRight="20dip"
android:singleLine="true"
android:ellipsize="marquee"
android:layout_marginBottom="4dip"
android:id="@+id/title" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/artist"
android:textColor="#888888"
android:textSize="18dip"
android:paddingLeft="20dip"
android:paddingRight="20dip"
android:singleLine="true"
android:ellipsize="marquee"
android:layout_marginBottom="4dip"
android:id="@+id/artist" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/album"
android:textColor="#888888"
android:textSize="18dip"
android:paddingLeft="20dip"
android:paddingRight="20dip"
android:singleLine="true"
android:ellipsize="marquee"
android:id="@+id/album" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:layout_margin="10dip">
<ImageButton
android:background="@drawable/ic_backward"
android:layout_height="70dip"
android:layout_width="70dip"
android:id="@+id/previous"
android:onClick="onPreviousClick" />
<ImageButton
android:background="@drawable/ic_pause"
android:layout_width="70dip"
android:layout_height="70dip"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:id="@+id/play_pause"
android:onClick="onPlayPauseClick" />
<ImageButton
android:id="@+id/stop"
android:layout_width="70dip"
android:layout_height="70dip"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:background="@drawable/ic_stop"
android:onClick="onStopClick" />
<ImageButton
android:background="@drawable/ic_forward"
android:layout_height="70dip"
android:layout_width="70dip"
android:id="@+id/next"
android:onClick="onNextClick" />
</LinearLayout>
</LinearLayout>
......@@ -4,6 +4,7 @@ import android.app.Activity;
import android.graphics.Bitmap;
import android.media.AudioManager;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ImageButton;
......@@ -36,7 +37,14 @@ public class AudioPlayerActivity extends Activity implements AudioPlayer {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.audio_player);
android.view.Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
Log.v(TAG, "width = " + width + " : height = " + height);
if(width == 240 && height == 320) /* QVGA 2.7in */
setContentView(R.layout.audio_player_qvga);
else
setContentView(R.layout.audio_player);
mCover = (ImageView) findViewById(R.id.cover);
mTitle = (TextView) findViewById(R.id.title);
......
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