mirror of
https://github.com/zoriya/Opus.git
synced 2026-06-04 14:56:23 +00:00
Replaced small player
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
|
||||
// This file is used by Code Analysis to maintain SuppressMessage
|
||||
// attributes that are applied to this project.
|
||||
// Project-level suppressions either have no target or are given
|
||||
// a specific target and scoped to a namespace, type, member, etc.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>", Scope = "member", Target = "~P:MusicApp.MainActivity.paddingBot")]
|
||||
|
||||
@@ -22,6 +22,18 @@ namespace MusicApp
|
||||
public Android.Support.V7.Widget.Toolbar ToolBar;
|
||||
public IMenu menu;
|
||||
|
||||
public static int paddingBot
|
||||
{
|
||||
get
|
||||
{
|
||||
if (((FrameLayout)instance.FindViewById(Resource.Id.smallPlayer).Parent).Visibility == ViewStates.Gone)
|
||||
return instance.FindViewById<BottomNavigationView>(Resource.Id.bottomView).Height;
|
||||
else
|
||||
return instance.FindViewById<BottomNavigationView>(Resource.Id.bottomView).Height + ((FrameLayout)instance.FindViewById(Resource.Id.smallPlayer).Parent).Height;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
base.OnCreate(savedInstanceState);
|
||||
@@ -130,7 +142,7 @@ namespace MusicApp
|
||||
FolderTracks.instance.result = null;
|
||||
}
|
||||
|
||||
void HideSearch()
|
||||
public void HideSearch()
|
||||
{
|
||||
if (menu == null)
|
||||
return;
|
||||
|
||||
@@ -145,6 +145,7 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="MainActivity.cs" />
|
||||
<Compile Include="MainApplication.cs" />
|
||||
<Compile Include="Resources\Fragments\DownloadFragment.cs" />
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Android.Content;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using MusicApp.Resources.values;
|
||||
using Android.Graphics;
|
||||
using Android.Util;
|
||||
using System.IO;
|
||||
using Android.OS;
|
||||
using Android.App;
|
||||
using Square.Picasso;
|
||||
|
||||
@@ -55,7 +51,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
Picasso.With(Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Resize(400, 400).CenterCrop().Into(holder.AlbumArt);
|
||||
}
|
||||
|
||||
convertView.SetBackgroundColor(Color.White);
|
||||
//convertView.SetBackgroundColor(Color.White);
|
||||
return convertView;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,9 @@ using Android.Content.PM;
|
||||
using Android.Support.V4.App;
|
||||
using Android.Support.V7.App;
|
||||
|
||||
using EventArgs = System.EventArgs;
|
||||
using Square.Picasso;
|
||||
|
||||
namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
public class Browse : ListFragment
|
||||
@@ -37,12 +40,62 @@ namespace MusicApp.Resources.Portable_Class
|
||||
emptyView = LayoutInflater.Inflate(Resource.Layout.NoSong, null);
|
||||
ListView.EmptyView = emptyView;
|
||||
|
||||
if(ListView.Adapter == null)
|
||||
if (MusicPlayer.isRunning)
|
||||
{
|
||||
Song current = MusicPlayer.queue[MusicPlayer.CurrentID()];
|
||||
|
||||
RelativeLayout smallPlayer = Activity.FindViewById<RelativeLayout>(Resource.Id.smallPlayer);
|
||||
FrameLayout parent = (FrameLayout)smallPlayer.Parent;
|
||||
parent.Visibility = ViewStates.Visible;
|
||||
smallPlayer.Visibility = ViewStates.Visible;
|
||||
smallPlayer.FindViewById<TextView>(Resource.Id.spTitle).Text = current.GetName();
|
||||
smallPlayer.FindViewById<TextView>(Resource.Id.spArtist).Text = current.GetArtist();
|
||||
ImageView art = smallPlayer.FindViewById<ImageView>(Resource.Id.spArt);
|
||||
|
||||
var songCover = Android.Net.Uri.Parse("content://media/external/audio/albumart");
|
||||
var songAlbumArtUri = ContentUris.WithAppendedId(songCover, current.GetAlbumArt());
|
||||
|
||||
Picasso.With(Android.App.Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(art);
|
||||
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spLast).Click += Last_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spPlay).Click += Play_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spNext).Click += Next_Click;
|
||||
}
|
||||
|
||||
if (ListView.Adapter == null)
|
||||
GetStoragePermission();
|
||||
}
|
||||
|
||||
private void Last_Click(object sender, EventArgs e)
|
||||
{
|
||||
Intent intent = new Intent(Android.App.Application.Context, typeof(MusicPlayer));
|
||||
intent.SetAction("Previus");
|
||||
Activity.StartService(intent);
|
||||
}
|
||||
|
||||
private void Play_Click(object sender, EventArgs e)
|
||||
{
|
||||
Intent intent = new Intent(Android.App.Application.Context, typeof(MusicPlayer));
|
||||
intent.SetAction("Pause");
|
||||
Activity.StartService(intent);
|
||||
}
|
||||
|
||||
private void Next_Click(object sender, EventArgs e)
|
||||
{
|
||||
Intent intent = new Intent(Android.App.Application.Context, typeof(MusicPlayer));
|
||||
intent.SetAction("Next");
|
||||
Activity.StartService(intent);
|
||||
}
|
||||
|
||||
public override void OnDestroy()
|
||||
{
|
||||
RelativeLayout smallPlayer = Activity.FindViewById<RelativeLayout>(Resource.Id.smallPlayer);
|
||||
FrameLayout parent = (FrameLayout)smallPlayer.Parent;
|
||||
parent.Visibility = ViewStates.Gone;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spLast).Click -= Last_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spPlay).Click -= Play_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spNext).Click -= Next_Click;
|
||||
|
||||
if (isEmpty)
|
||||
{
|
||||
ViewGroup rootView = Activity.FindViewById<ViewGroup>(Android.Resource.Id.Content);
|
||||
@@ -58,7 +111,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
View view = base.OnCreateView(inflater, container, savedInstanceState);
|
||||
this.view = view;
|
||||
view.SetPadding(0, 0, 0, 100);
|
||||
view.SetPadding(0, 0, 0, MainActivity.paddingBot);
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -206,6 +259,9 @@ namespace MusicApp.Resources.Portable_Class
|
||||
Intent intent = new Intent(context, typeof(MusicPlayer));
|
||||
intent.PutExtra("file", item.GetPath());
|
||||
context.StartService(intent);
|
||||
MainActivity.instance.HideTabs();
|
||||
MainActivity.instance.HideSearch();
|
||||
MainActivity.instance.SupportFragmentManager.BeginTransaction().Replace(Resource.Id.contentView, Player.NewInstance()).Commit();
|
||||
}
|
||||
|
||||
public static void PlayNext(Song item)
|
||||
|
||||
@@ -11,6 +11,8 @@ using Android.Support.V7.Preferences;
|
||||
using YoutubeExtractor;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Square.Picasso;
|
||||
using System;
|
||||
|
||||
namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
@@ -32,10 +34,59 @@ namespace MusicApp.Resources.Portable_Class
|
||||
ListView.ItemLongClick += ListView_ItemLongClick; ;
|
||||
ListAdapter = null;
|
||||
Activity.AddContentView(emptyView, View.LayoutParameters);
|
||||
if (MusicPlayer.isRunning)
|
||||
{
|
||||
Song current = MusicPlayer.queue[MusicPlayer.CurrentID()];
|
||||
|
||||
RelativeLayout smallPlayer = Activity.FindViewById<RelativeLayout>(Resource.Id.smallPlayer);
|
||||
FrameLayout parent = (FrameLayout)smallPlayer.Parent;
|
||||
parent.Visibility = ViewStates.Visible;
|
||||
smallPlayer.Visibility = ViewStates.Visible;
|
||||
smallPlayer.FindViewById<TextView>(Resource.Id.spTitle).Text = current.GetName();
|
||||
smallPlayer.FindViewById<TextView>(Resource.Id.spArtist).Text = current.GetArtist();
|
||||
ImageView art = smallPlayer.FindViewById<ImageView>(Resource.Id.spArt);
|
||||
|
||||
var songCover = Android.Net.Uri.Parse("content://media/external/audio/albumart");
|
||||
var songAlbumArtUri = ContentUris.WithAppendedId(songCover, current.GetAlbumArt());
|
||||
|
||||
Picasso.With(Android.App.Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(art);
|
||||
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spLast).Click += Last_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spPlay).Click += Play_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spNext).Click += Next_Click;
|
||||
}
|
||||
}
|
||||
|
||||
private void Last_Click(object sender, EventArgs e)
|
||||
{
|
||||
Intent intent = new Intent(Android.App.Application.Context, typeof(MusicPlayer));
|
||||
intent.SetAction("Previus");
|
||||
Activity.StartService(intent);
|
||||
}
|
||||
|
||||
private void Play_Click(object sender, EventArgs e)
|
||||
{
|
||||
Intent intent = new Intent(Android.App.Application.Context, typeof(MusicPlayer));
|
||||
intent.SetAction("Pause");
|
||||
Activity.StartService(intent);
|
||||
}
|
||||
|
||||
private void Next_Click(object sender, EventArgs e)
|
||||
{
|
||||
Intent intent = new Intent(Android.App.Application.Context, typeof(MusicPlayer));
|
||||
intent.SetAction("Next");
|
||||
Activity.StartService(intent);
|
||||
}
|
||||
|
||||
public override void OnDestroy()
|
||||
{
|
||||
RelativeLayout smallPlayer = Activity.FindViewById<RelativeLayout>(Resource.Id.smallPlayer);
|
||||
FrameLayout parent = (FrameLayout)smallPlayer.Parent;
|
||||
parent.Visibility = ViewStates.Gone;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spLast).Click -= Last_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spPlay).Click -= Play_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spNext).Click -= Next_Click;
|
||||
|
||||
if (isEmpty)
|
||||
{
|
||||
ViewGroup rootView = Activity.FindViewById<ViewGroup>(Android.Resource.Id.Content);
|
||||
@@ -48,7 +99,10 @@ namespace MusicApp.Resources.Portable_Class
|
||||
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
||||
{
|
||||
View view = base.OnCreateView(inflater, container, savedInstanceState);
|
||||
view.SetPadding(0, 100, 0, 0);
|
||||
if (!MusicPlayer.isRunning)
|
||||
view.SetPadding(0, 100, 0, 0);
|
||||
else
|
||||
view.SetPadding(0, 360, 0, 0);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
View view = base.OnCreateView(inflater, container, savedInstanceState);
|
||||
this.view = view;
|
||||
view.SetPadding(0, 0, 0, 100);
|
||||
view.SetPadding(0, 0, 0, MainActivity.paddingBot);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
||||
{
|
||||
View view = base.OnCreateView(inflater, container, savedInstanceState);
|
||||
view.SetPadding(0, 100, 0, 100);
|
||||
view.SetPadding(0, 100, 0, MainActivity.paddingBot);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
@@ -237,6 +237,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
public void AddToQueue(string filePath)
|
||||
{
|
||||
GetTrackSong(filePath, out Song song);
|
||||
Console.WriteLine("AddToQueue path: " + song.GetPath() + " Before get track song: " + filePath);
|
||||
if (CurrentID() == -1)
|
||||
queue.Add(song);
|
||||
else
|
||||
@@ -263,7 +264,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
if (CurrentID() + 1 > queue.Count - 1)
|
||||
{
|
||||
Stop();
|
||||
Pause();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -274,12 +275,28 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
async void SwitchQueue(string filePath)
|
||||
{
|
||||
player.Reset();
|
||||
isRunning = true;
|
||||
|
||||
if(player != null)
|
||||
player.Reset();
|
||||
InitializePlayer();
|
||||
await player.SetDataSourceAsync(Application.Context, Uri.Parse(filePath));
|
||||
player.PrepareAsync();
|
||||
GetTrackSong(filePath, out Song song);
|
||||
CreateNotification(song.GetName(), song.GetArtist(), song.GetAlbumArt());
|
||||
|
||||
if (Player.instance != null)
|
||||
Player.instance.RefreshPlayer();
|
||||
|
||||
RelativeLayout smallPlayer = MainActivity.instance.FindViewById<RelativeLayout>(Resource.Id.smallPlayer);
|
||||
smallPlayer.FindViewById<TextView>(Resource.Id.spTitle).Text = song.GetName();
|
||||
smallPlayer.FindViewById<TextView>(Resource.Id.spArtist).Text = song.GetArtist();
|
||||
ImageView art = smallPlayer.FindViewById<ImageView>(Resource.Id.spArt);
|
||||
|
||||
var songCover = Uri.Parse("content://media/external/audio/albumart");
|
||||
var songAlbumArtUri = ContentUris.WithAppendedId(songCover, song.GetAlbumArt());
|
||||
|
||||
Picasso.With(Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(art);
|
||||
}
|
||||
|
||||
public static int CurrentID()
|
||||
@@ -353,12 +370,14 @@ namespace MusicApp.Resources.Portable_Class
|
||||
Artist = "Unknow Artist";
|
||||
if (Album == null)
|
||||
Album = "Unknow Album";
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (musicCursor.MoveToNext());
|
||||
musicCursor.Close();
|
||||
}
|
||||
song = new Song(Title, Artist, Album, AlbumArt, id, path);
|
||||
song = new Song(Title, Artist, Album, AlbumArt, id, filePath);
|
||||
}
|
||||
|
||||
async void CreateNotification(string title, string artist, long albumArt = 0, string imageURI = "")
|
||||
|
||||
@@ -58,8 +58,8 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
async void CreatePlayer()
|
||||
{
|
||||
if (MusicPlayer.CurrentID() == -1)
|
||||
await Task.Delay(500);
|
||||
while (MusicPlayer.CurrentID() == -1)
|
||||
await Task.Delay(100);
|
||||
|
||||
MainActivity.instance.ToolBar.Visibility = ViewStates.Gone;
|
||||
MainActivity.instance.FindViewById<BottomNavigationView>(Resource.Id.bottomView).Visibility = ViewStates.Gone;
|
||||
@@ -115,6 +115,48 @@ namespace MusicApp.Resources.Portable_Class
|
||||
}
|
||||
}
|
||||
|
||||
public async void RefreshPlayer()
|
||||
{
|
||||
while (MusicPlayer.CurrentID() == -1)
|
||||
await Task.Delay(100);
|
||||
|
||||
TextView title = playerView.FindViewById<TextView>(Resource.Id.playerTitle);
|
||||
TextView artist = playerView.FindViewById<TextView>(Resource.Id.playerArtist);
|
||||
imgView = playerView.FindViewById<ImageView>(Resource.Id.playerAlbum);
|
||||
|
||||
Song current = MusicPlayer.queue[MusicPlayer.CurrentID()];
|
||||
|
||||
title.Text = current.GetName();
|
||||
artist.Text = current.GetArtist();
|
||||
|
||||
var songCover = Android.Net.Uri.Parse("content://media/external/audio/albumart");
|
||||
var songAlbumArtUri = ContentUris.WithAppendedId(songCover, current.GetAlbumArt());
|
||||
|
||||
Picasso.With(Android.App.Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(imgView);
|
||||
|
||||
|
||||
bool asNext = MusicPlayer.queue.Count > MusicPlayer.CurrentID() + 1;
|
||||
if (asNext)
|
||||
{
|
||||
Song next = MusicPlayer.queue[MusicPlayer.CurrentID() + 1];
|
||||
playerView.FindViewById<TextView>(Resource.Id.nextTitle).Text = "Next music:";
|
||||
playerView.FindViewById<TextView>(Resource.Id.nextArtist).Text = next.GetName();
|
||||
|
||||
var nextAlbumArtUri = ContentUris.WithAppendedId(songCover, next.GetAlbumArt());
|
||||
|
||||
ImageView nextArt = playerView.FindViewById<ImageView>(Resource.Id.nextArt);
|
||||
Picasso.With(Android.App.Application.Context).Load(nextAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(nextArt);
|
||||
}
|
||||
else
|
||||
{
|
||||
playerView.FindViewById<TextView>(Resource.Id.nextTitle).Text = "Next music:";
|
||||
playerView.FindViewById<TextView>(Resource.Id.nextArtist).Text = "Nothing.";
|
||||
|
||||
ImageView nextArt = playerView.FindViewById<ImageView>(Resource.Id.nextArt);
|
||||
Picasso.With(Android.App.Application.Context).Load(Resource.Drawable.noAlbum).Placeholder(Resource.Drawable.MusicIcon).Into(nextArt);
|
||||
}
|
||||
}
|
||||
|
||||
private void AddToPlaylist_Click(object sender, EventArgs e)
|
||||
{
|
||||
Browse.act = Activity;
|
||||
|
||||
@@ -11,6 +11,10 @@ using Android.Content.PM;
|
||||
using Android.Support.Design.Widget;
|
||||
using Android;
|
||||
using Android.Net;
|
||||
using MusicApp.Resources.values;
|
||||
using Square.Picasso;
|
||||
|
||||
using EventArgs = System.EventArgs;
|
||||
|
||||
namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
@@ -35,10 +39,60 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
if(ListView.Adapter == null)
|
||||
GetStoragePermission();
|
||||
|
||||
if (MusicPlayer.isRunning)
|
||||
{
|
||||
Song current = MusicPlayer.queue[MusicPlayer.CurrentID()];
|
||||
|
||||
RelativeLayout smallPlayer = Activity.FindViewById<RelativeLayout>(Resource.Id.smallPlayer);
|
||||
FrameLayout parent = (FrameLayout)smallPlayer.Parent;
|
||||
parent.Visibility = ViewStates.Visible;
|
||||
smallPlayer.Visibility = ViewStates.Visible;
|
||||
smallPlayer.FindViewById<TextView>(Resource.Id.spTitle).Text = current.GetName();
|
||||
smallPlayer.FindViewById<TextView>(Resource.Id.spArtist).Text = current.GetArtist();
|
||||
ImageView art = smallPlayer.FindViewById<ImageView>(Resource.Id.spArt);
|
||||
|
||||
var songCover = Android.Net.Uri.Parse("content://media/external/audio/albumart");
|
||||
var songAlbumArtUri = ContentUris.WithAppendedId(songCover, current.GetAlbumArt());
|
||||
|
||||
Picasso.With(Android.App.Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(art);
|
||||
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spLast).Click += Last_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spPlay).Click += Play_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spNext).Click += Next_Click;
|
||||
}
|
||||
}
|
||||
|
||||
private void Last_Click(object sender, EventArgs e)
|
||||
{
|
||||
Intent intent = new Intent(Android.App.Application.Context, typeof(MusicPlayer));
|
||||
intent.SetAction("Previus");
|
||||
Activity.StartService(intent);
|
||||
}
|
||||
|
||||
private void Play_Click(object sender, EventArgs e)
|
||||
{
|
||||
Intent intent = new Intent(Android.App.Application.Context, typeof(MusicPlayer));
|
||||
intent.SetAction("Pause");
|
||||
Activity.StartService(intent);
|
||||
}
|
||||
|
||||
private void Next_Click(object sender, EventArgs e)
|
||||
{
|
||||
Intent intent = new Intent(Android.App.Application.Context, typeof(MusicPlayer));
|
||||
intent.SetAction("Next");
|
||||
Activity.StartService(intent);
|
||||
}
|
||||
|
||||
public override void OnDestroy()
|
||||
{
|
||||
RelativeLayout smallPlayer = Activity.FindViewById<RelativeLayout>(Resource.Id.smallPlayer);
|
||||
FrameLayout parent = (FrameLayout)smallPlayer.Parent;
|
||||
parent.Visibility = ViewStates.Gone;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spLast).Click -= Last_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spPlay).Click -= Play_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spNext).Click -= Next_Click;
|
||||
|
||||
if (isEmpty)
|
||||
{
|
||||
ViewGroup rootView = Activity.FindViewById<ViewGroup>(Android.Resource.Id.Content);
|
||||
@@ -51,7 +105,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
||||
{
|
||||
View view = base.OnCreateView(inflater, container, savedInstanceState);
|
||||
view.SetPadding(0, 100, 0, 0);
|
||||
view.SetPadding(0, 100, 0, MainActivity.paddingBot);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@ using Android;
|
||||
using Android.Net;
|
||||
using Android.Support.V7.App;
|
||||
|
||||
using EventArgs = System.EventArgs;
|
||||
using Square.Picasso;
|
||||
|
||||
namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
public class PlaylistTracks : ListFragment
|
||||
@@ -37,11 +40,61 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
PopulateList();
|
||||
MainActivity.instance.DisplaySearch(1);
|
||||
|
||||
if (MusicPlayer.isRunning)
|
||||
{
|
||||
Song current = MusicPlayer.queue[MusicPlayer.CurrentID()];
|
||||
|
||||
RelativeLayout smallPlayer = Activity.FindViewById<RelativeLayout>(Resource.Id.smallPlayer);
|
||||
FrameLayout parent = (FrameLayout)smallPlayer.Parent;
|
||||
parent.Visibility = ViewStates.Visible;
|
||||
smallPlayer.Visibility = ViewStates.Visible;
|
||||
smallPlayer.FindViewById<TextView>(Resource.Id.spTitle).Text = current.GetName();
|
||||
smallPlayer.FindViewById<TextView>(Resource.Id.spArtist).Text = current.GetArtist();
|
||||
ImageView art = smallPlayer.FindViewById<ImageView>(Resource.Id.spArt);
|
||||
|
||||
var songCover = Android.Net.Uri.Parse("content://media/external/audio/albumart");
|
||||
var songAlbumArtUri = ContentUris.WithAppendedId(songCover, current.GetAlbumArt());
|
||||
|
||||
Picasso.With(Android.App.Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Into(art);
|
||||
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spLast).Click += Last_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spPlay).Click += Play_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spNext).Click += Next_Click;
|
||||
}
|
||||
}
|
||||
|
||||
private void Last_Click(object sender, EventArgs e)
|
||||
{
|
||||
Intent intent = new Intent(Android.App.Application.Context, typeof(MusicPlayer));
|
||||
intent.SetAction("Previus");
|
||||
Activity.StartService(intent);
|
||||
}
|
||||
|
||||
private void Play_Click(object sender, EventArgs e)
|
||||
{
|
||||
Intent intent = new Intent(Android.App.Application.Context, typeof(MusicPlayer));
|
||||
intent.SetAction("Pause");
|
||||
Activity.StartService(intent);
|
||||
}
|
||||
|
||||
private void Next_Click(object sender, EventArgs e)
|
||||
{
|
||||
Intent intent = new Intent(Android.App.Application.Context, typeof(MusicPlayer));
|
||||
intent.SetAction("Next");
|
||||
Activity.StartService(intent);
|
||||
}
|
||||
|
||||
public override void OnDestroy()
|
||||
{
|
||||
if(isEmpty)
|
||||
RelativeLayout smallPlayer = Activity.FindViewById<RelativeLayout>(Resource.Id.smallPlayer);
|
||||
FrameLayout parent = (FrameLayout)smallPlayer.Parent;
|
||||
parent.Visibility = ViewStates.Gone;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spLast).Click -= Last_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spPlay).Click -= Play_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spNext).Click -= Next_Click;
|
||||
|
||||
if (isEmpty)
|
||||
{
|
||||
ViewGroup rootView = Activity.FindViewById<ViewGroup>(Android.Resource.Id.Content);
|
||||
rootView.RemoveView(emptyView);
|
||||
@@ -61,7 +114,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
||||
{
|
||||
View view = base.OnCreateView(inflater, container, savedInstanceState);
|
||||
view.SetPadding(0, 100, 0, 100);
|
||||
view.SetPadding(0, 100, 0, MainActivity.paddingBot);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@ namespace MusicApp.Resources.Portable_Class
|
||||
Song current = MusicPlayer.queue[MusicPlayer.CurrentID()];
|
||||
|
||||
RelativeLayout smallPlayer = Activity.FindViewById<RelativeLayout>(Resource.Id.smallPlayer);
|
||||
FrameLayout parent = (FrameLayout) smallPlayer.Parent;
|
||||
parent.Visibility = ViewStates.Visible;
|
||||
smallPlayer.Visibility = ViewStates.Visible;
|
||||
smallPlayer.FindViewById<TextView>(Resource.Id.spTitle).Text = current.GetName();
|
||||
smallPlayer.FindViewById<TextView>(Resource.Id.spArtist).Text = current.GetArtist();
|
||||
@@ -72,7 +74,12 @@ namespace MusicApp.Resources.Portable_Class
|
||||
public override void OnDestroy()
|
||||
{
|
||||
RelativeLayout smallPlayer = Activity.FindViewById<RelativeLayout>(Resource.Id.smallPlayer);
|
||||
smallPlayer.Visibility = ViewStates.Gone;
|
||||
FrameLayout parent = (FrameLayout)smallPlayer.Parent;
|
||||
parent.Visibility = ViewStates.Gone;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spLast).Click -= Last_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spPlay).Click -= Play_Click;
|
||||
smallPlayer.FindViewById<ImageButton>(Resource.Id.spNext).Click -= Next_Click;
|
||||
|
||||
if (isEmpty)
|
||||
{
|
||||
ViewGroup rootView = Activity.FindViewById<ViewGroup>(Android.Resource.Id.Content);
|
||||
@@ -86,7 +93,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
View view = base.OnCreateView(inflater, container, savedInstanceState);
|
||||
this.view = view;
|
||||
view.SetPadding(0, 100, 0, 100);
|
||||
view.SetPadding(0, 100, 0, MainActivity.paddingBot);
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -107,7 +114,6 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
if (adapter == null || adapter.Count == 0)
|
||||
{
|
||||
view.SetPadding(0, 100, 0, 0);
|
||||
isEmpty = true;
|
||||
Activity.AddContentView(emptyView, View.LayoutParameters);
|
||||
}
|
||||
|
||||
@@ -44,8 +44,6 @@ namespace MusicApp.Resources.Portable_Class
|
||||
Line1 = { Text = line1[position] },
|
||||
Line2 = { Text = line2[position].ToString() + ((line2[position] > 1) ? " elements" : " element") },
|
||||
};
|
||||
|
||||
convertView.SetBackgroundColor(Color.White);
|
||||
return convertView;
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+35
-32
@@ -2464,8 +2464,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f07001e
|
||||
public const int add = 2131165214;
|
||||
|
||||
// aapt resource value: 0x7f0700c2
|
||||
public const int albumArt = 2131165378;
|
||||
// aapt resource value: 0x7f0700c3
|
||||
public const int albumArt = 2131165379;
|
||||
|
||||
// aapt resource value: 0x7f070058
|
||||
public const int alertTitle = 2131165272;
|
||||
@@ -2476,8 +2476,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f070023
|
||||
public const int always = 2131165219;
|
||||
|
||||
// aapt resource value: 0x7f0700c3
|
||||
public const int artist = 2131165379;
|
||||
// aapt resource value: 0x7f0700c4
|
||||
public const int artist = 2131165380;
|
||||
|
||||
// aapt resource value: 0x7f07002f
|
||||
public const int auto = 2131165231;
|
||||
@@ -2488,11 +2488,11 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f070028
|
||||
public const int bottom = 2131165224;
|
||||
|
||||
// aapt resource value: 0x7f07008d
|
||||
public const int bottomView = 2131165325;
|
||||
// aapt resource value: 0x7f07008c
|
||||
public const int bottomView = 2131165324;
|
||||
|
||||
// aapt resource value: 0x7f0700c8
|
||||
public const int browseLayout = 2131165384;
|
||||
// aapt resource value: 0x7f0700c9
|
||||
public const int browseLayout = 2131165385;
|
||||
|
||||
// aapt resource value: 0x7f070073
|
||||
public const int browseList = 2131165299;
|
||||
@@ -2533,8 +2533,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f07004e
|
||||
public const int contentPanel = 2131165262;
|
||||
|
||||
// aapt resource value: 0x7f07008c
|
||||
public const int contentView = 2131165324;
|
||||
// aapt resource value: 0x7f07008b
|
||||
public const int contentView = 2131165323;
|
||||
|
||||
// aapt resource value: 0x7f070078
|
||||
public const int coordinator = 2131165304;
|
||||
@@ -2572,8 +2572,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0700b4
|
||||
public const int downFAB = 2131165364;
|
||||
|
||||
// aapt resource value: 0x7f0700c9
|
||||
public const int downloadLayout = 2131165385;
|
||||
// aapt resource value: 0x7f0700ca
|
||||
public const int downloadLayout = 2131165386;
|
||||
|
||||
// aapt resource value: 0x7f070066
|
||||
public const int edit_query = 2131165286;
|
||||
@@ -2665,8 +2665,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0700a1
|
||||
public const int line1 = 2131165345;
|
||||
|
||||
// aapt resource value: 0x7f0700c4
|
||||
public const int line2 = 2131165380;
|
||||
// aapt resource value: 0x7f0700c5
|
||||
public const int line2 = 2131165381;
|
||||
|
||||
// aapt resource value: 0x7f0700a3
|
||||
public const int line3 = 2131165347;
|
||||
@@ -2680,8 +2680,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f070048
|
||||
public const int list_item = 2131165256;
|
||||
|
||||
// aapt resource value: 0x7f0700c6
|
||||
public const int masked = 2131165382;
|
||||
// aapt resource value: 0x7f0700c7
|
||||
public const int masked = 2131165383;
|
||||
|
||||
// aapt resource value: 0x7f070095
|
||||
public const int media_actions = 2131165333;
|
||||
@@ -2695,8 +2695,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f070019
|
||||
public const int multiply = 2131165209;
|
||||
|
||||
// aapt resource value: 0x7f0700c7
|
||||
public const int musicLayout = 2131165383;
|
||||
// aapt resource value: 0x7f0700c8
|
||||
public const int musicLayout = 2131165384;
|
||||
|
||||
// aapt resource value: 0x7f07007d
|
||||
public const int navigation_header_container = 2131165309;
|
||||
@@ -2737,8 +2737,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f070097
|
||||
public const int notification_main_column_container = 2131165335;
|
||||
|
||||
// aapt resource value: 0x7f07008b
|
||||
public const int pager = 2131165323;
|
||||
// aapt resource value: 0x7f07008a
|
||||
public const int pager = 2131165322;
|
||||
|
||||
// aapt resource value: 0x7f070037
|
||||
public const int parallax = 2131165239;
|
||||
@@ -2767,8 +2767,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0700ad
|
||||
public const int playerTitle = 2131165357;
|
||||
|
||||
// aapt resource value: 0x7f0700ca
|
||||
public const int playlistLayout = 2131165386;
|
||||
// aapt resource value: 0x7f0700cb
|
||||
public const int playlistLayout = 2131165387;
|
||||
|
||||
// aapt resource value: 0x7f070074
|
||||
public const int playlistName = 2131165300;
|
||||
@@ -2851,8 +2851,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f070072
|
||||
public const int select_dialog_listview = 2131165298;
|
||||
|
||||
// aapt resource value: 0x7f0700cb
|
||||
public const int settings = 2131165387;
|
||||
// aapt resource value: 0x7f0700cc
|
||||
public const int settings = 2131165388;
|
||||
|
||||
// aapt resource value: 0x7f07005c
|
||||
public const int shortcut = 2131165276;
|
||||
@@ -2869,8 +2869,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f070075
|
||||
public const int smallLabel = 2131165301;
|
||||
|
||||
// aapt resource value: 0x7f07008a
|
||||
public const int smallPlayer = 2131165322;
|
||||
// aapt resource value: 0x7f07008d
|
||||
public const int smallPlayer = 2131165325;
|
||||
|
||||
// aapt resource value: 0x7f07007c
|
||||
public const int snackbar_action = 2131165308;
|
||||
@@ -2890,15 +2890,18 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0700be
|
||||
public const int spArtist = 2131165374;
|
||||
|
||||
// aapt resource value: 0x7f0700bf
|
||||
public const int spLast = 2131165375;
|
||||
|
||||
// aapt resource value: 0x7f0700c1
|
||||
public const int spNext = 2131165377;
|
||||
public const int spLast = 2131165377;
|
||||
|
||||
// aapt resource value: 0x7f0700bf
|
||||
public const int spNext = 2131165375;
|
||||
|
||||
// aapt resource value: 0x7f0700c0
|
||||
public const int spPlay = 2131165376;
|
||||
|
||||
// aapt resource value: 0x7f0700c2
|
||||
public const int spProgress = 2131165378;
|
||||
|
||||
// aapt resource value: 0x7f0700bd
|
||||
public const int spTitle = 2131165373;
|
||||
|
||||
@@ -3004,8 +3007,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f07000e
|
||||
public const int view_offset_helper = 2131165198;
|
||||
|
||||
// aapt resource value: 0x7f0700c5
|
||||
public const int visible = 2131165381;
|
||||
// aapt resource value: 0x7f0700c6
|
||||
public const int visible = 2131165382;
|
||||
|
||||
// aapt resource value: 0x7f070027
|
||||
public const int withText = 2131165223;
|
||||
|
||||
@@ -1,54 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="com.journaldev.tablayoutviewpager.MainActivity">
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="com.journaldev.tablayoutviewpager.MainActivity">
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:tabTextColor="@android:color/white"
|
||||
app:tabSelectedTextColor="@android:color/white"
|
||||
app:tabIndicatorColor="@android:color/white"
|
||||
app:tabGravity="fill"
|
||||
app:tabMode="fixed" />
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
<include
|
||||
layout="@layout/SmallPlayer"
|
||||
android:id="@+id/smallPlayer"
|
||||
android:visibility="gone"/>
|
||||
android:layout_height="wrap_content">
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:tabTextColor="@android:color/white"
|
||||
app:tabSelectedTextColor="@android:color/white"
|
||||
app:tabIndicatorColor="@android:color/white"
|
||||
app:tabGravity="fill"
|
||||
app:tabMode="fixed" />
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:id="@+id/pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<FrameLayout
|
||||
android:id="@+id/contentView"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent" />
|
||||
<RelativeLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@android:color/white"
|
||||
android:elevation="12dp"
|
||||
android:layout_alignParentBottom="true" >
|
||||
<android.support.design.widget.BottomNavigationView
|
||||
android:id="@+id/bottomView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<FrameLayout
|
||||
android:id="@+id/contentView"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent" />
|
||||
<android.support.design.widget.BottomNavigationView
|
||||
android:id="@+id/bottomView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_gravity="start"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@android:color/white"
|
||||
app:elevation="16dp"
|
||||
app:menu="@menu/bottom_items" />
|
||||
android:layout_height="56dp"
|
||||
app:menu="@menu/bottom_items" />
|
||||
<FrameLayout
|
||||
android:layout_height="70dp"
|
||||
android:layout_below="@id/bottomView"
|
||||
android:layout_width="match_parent" >
|
||||
<include
|
||||
layout="@layout/SmallPlayer"
|
||||
android:id="@+id/smallPlayer"/>
|
||||
</FrameLayout>
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
@@ -1,57 +1,75 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/smallPlayer"
|
||||
android:elevation="12dp" >
|
||||
<ImageView
|
||||
android:id="@+id/spArt"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:src="@drawable/MusicIcon"
|
||||
android:layout_alignParentLeft="true" />
|
||||
android:layout_height="70dp"
|
||||
android:background="#ffffff"
|
||||
android:id="@+id/smallPlayer" >
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="140dp">
|
||||
<TextView
|
||||
android:id="@+id/spTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#000"
|
||||
android:textSize="24dip"
|
||||
android:textStyle="bold" />
|
||||
<TextView
|
||||
android:id="@+id/spArtist"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18dip"
|
||||
android:textColor="#000" />
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
<ImageView
|
||||
android:id="@+id/spArt"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:src="@drawable/noAlbum"
|
||||
android:layout_gravity="left|center" />
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
<ImageButton
|
||||
android:id="@+id/spLast"
|
||||
android:background="@null"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:src="@drawable/ic_skip_previous_black_24dp"/>
|
||||
<ImageButton
|
||||
android:id="@+id/spPlay"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:background="@null"
|
||||
android:layout_marginRight="10dp"
|
||||
android:src="@drawable/ic_pause_black_24dp"/>
|
||||
<ImageButton
|
||||
android:id="@+id/spNext"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="@null"
|
||||
android:src="@drawable/ic_skip_next_black_24dp"/>
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/spTitle"
|
||||
android:text="Title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textColor="#000"
|
||||
android:textSize="18dip" />
|
||||
<TextView
|
||||
android:id="@+id/spArtist"
|
||||
android:text="Artist"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textSize="14dip"
|
||||
android:textColor="#4f5b62" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<ImageButton
|
||||
android:id="@+id/spNext"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="@null"
|
||||
android:layout_alignParentRight="true"
|
||||
android:src="@drawable/ic_skip_next_black_24dp"/>
|
||||
<ImageButton
|
||||
android:id="@+id/spPlay"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:layout_toLeftOf="@id/spNext"
|
||||
android:background="@null"
|
||||
android:layout_marginRight="3dp"
|
||||
android:src="@drawable/ic_pause_black_24dp"/>
|
||||
<ImageButton
|
||||
android:id="@+id/spLast"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@null"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_toLeftOf="@id/spPlay"
|
||||
android:src="@drawable/ic_skip_previous_black_24dp"/>
|
||||
<ProgressBar
|
||||
android:id="@+id/spProgress"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="3dp"
|
||||
android:layout_gravity="top"
|
||||
android:layout_toRightOf="@id/spArt"
|
||||
android:progress="25"/>
|
||||
</RelativeLayout >
|
||||
@@ -1,8 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFDAFF7F"
|
||||
android:layout_height="fill_parent"
|
||||
android:padding="8dp">
|
||||
<ImageView
|
||||
android:id="@+id/albumArt"
|
||||
@@ -17,17 +16,17 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="100dp">
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#000"
|
||||
android:textSize="16dip"
|
||||
android:textStyle="bold" />
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#000"
|
||||
android:textSize="16dip"
|
||||
android:textStyle="bold" />
|
||||
<TextView
|
||||
android:id="@+id/artist"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14dip"
|
||||
android:textColor="#000" />
|
||||
android:id="@+id/artist"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14dip"
|
||||
android:textColor="#000" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout >
|
||||
Reference in New Issue
Block a user