Rework library controls layout
Use two rows of text and show all controls below text
This commit is contained in:
parent
724e3cfe23
commit
a6c4c6c90f
@ -20,7 +20,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
-->
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/controls"
|
||||
android:background="@drawable/music_bottom_playback_bg"
|
||||
@ -29,75 +29,73 @@ THE SOFTWARE.
|
||||
<ImageView
|
||||
android:id="@+id/cover"
|
||||
android:scaleType="fitCenter"
|
||||
android:maxWidth="80dip"
|
||||
android:layout_width="80dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_gravity="center" />
|
||||
<LinearLayout
|
||||
android:id="@+id/state_buttons"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_alignParentRight="true">
|
||||
<ImageButton
|
||||
android:id="@+id/shuffle"
|
||||
android:layout_height="0px"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/shuffle_inactive" />
|
||||
<ImageButton
|
||||
android:id="@+id/end_action"
|
||||
android:layout_height="0px"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/repeat_inactive" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/status_text"
|
||||
android:text="@string/none"
|
||||
android:textSize="16sp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:gravity="center"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/cover"
|
||||
android:layout_toLeftOf="@id/state_buttons" />
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/status_text"
|
||||
android:layout_toRightOf="@id/cover"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_toLeftOf="@id/state_buttons" >
|
||||
<ImageButton
|
||||
android:id="@+id/previous"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0px"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/previous" />
|
||||
<ImageButton
|
||||
android:id="@+id/play_pause"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0px"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/play" />
|
||||
<ImageButton
|
||||
android:id="@+id/next"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0px"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/next" />
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:textSize="14sp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:gravity="center"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:id="@+id/artist"
|
||||
android:textSize="12sp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:gravity="center"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
<ImageButton
|
||||
android:id="@+id/shuffle"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="0px"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/shuffle_inactive" />
|
||||
<ImageButton
|
||||
android:id="@+id/previous"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="0px"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/previous" />
|
||||
<ImageButton
|
||||
android:id="@+id/play_pause"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="0px"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/play" />
|
||||
<ImageButton
|
||||
android:id="@+id/next"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="0px"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/next" />
|
||||
<ImageButton
|
||||
android:id="@+id/end_action"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="0px"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/repeat_inactive" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
@ -76,7 +76,6 @@ THE SOFTWARE.
|
||||
|
||||
<string name="none">Ingen</string>
|
||||
<string name="unknown">Ukjent</string>
|
||||
<string name="title_by_artist">%1$s etter %2$s</string>
|
||||
<string name="play_all">Soill Alt</string>
|
||||
<string name="enqueue_all">Kø Alt</string>
|
||||
<string name="all_songs">Alle Låter</string>
|
||||
|
@ -80,7 +80,6 @@ THE SOFTWARE.
|
||||
|
||||
<string name="none">Nič</string>
|
||||
<string name="unknown">Neznáme</string>
|
||||
<string name="title_by_artist">%1$s od %2$s</string>
|
||||
<string name="play_all">Prehrať všetko</string>
|
||||
<string name="enqueue_all">Pridať do zoznamu všetko</string>
|
||||
<string name="all_songs">Všetky skladby</string>
|
||||
|
@ -84,7 +84,6 @@ THE SOFTWARE.
|
||||
|
||||
<string name="none">None</string>
|
||||
<string name="unknown">Unknown</string>
|
||||
<string name="title_by_artist">%1$s by %2$s</string>
|
||||
<string name="play_all">Play All</string>
|
||||
<string name="enqueue_all">Enqueue All</string>
|
||||
<string name="all_songs">All Songs</string>
|
||||
|
@ -83,7 +83,8 @@ public class LibraryActivity
|
||||
private View mClearButton;
|
||||
|
||||
private View mControls;
|
||||
private TextView mStatusText;
|
||||
private TextView mTitle;
|
||||
private TextView mArtist;
|
||||
private ImageView mCover;
|
||||
|
||||
private ViewGroup mLimiterViews;
|
||||
@ -124,7 +125,8 @@ public class LibraryActivity
|
||||
|
||||
mControls = findViewById(R.id.controls);
|
||||
|
||||
mStatusText = (TextView)mControls.findViewById(R.id.status_text);
|
||||
mTitle = (TextView)mControls.findViewById(R.id.title);
|
||||
mArtist = (TextView)mControls.findViewById(R.id.artist);
|
||||
mCover = (ImageView)mControls.findViewById(R.id.cover);
|
||||
View previous = mControls.findViewById(R.id.previous);
|
||||
mPlayPauseButton = (ImageButton)mControls.findViewById(R.id.play_pause);
|
||||
@ -873,16 +875,18 @@ public class LibraryActivity
|
||||
{
|
||||
super.onSongChange(song);
|
||||
|
||||
if (mStatusText != null) {
|
||||
if (mTitle != null) {
|
||||
Uri cover = null;
|
||||
|
||||
if (song == null) {
|
||||
mStatusText.setText(R.string.none);
|
||||
mTitle.setText(R.string.none);
|
||||
mArtist.setText(null);
|
||||
} else {
|
||||
Resources res = getResources();
|
||||
String title = song.title == null ? res.getString(R.string.unknown) : song.title;
|
||||
String artist = song.artist == null ? res.getString(R.string.unknown) : song.artist;
|
||||
mStatusText.setText(res.getString(R.string.title_by_artist, title, artist));
|
||||
mTitle.setText(title);
|
||||
mArtist.setText(artist);
|
||||
cover = song.hasCover(this) ? song.getCoverUri() : null;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user