mirror of
https://github.com/zoriya/Opus.git
synced 2025-12-06 06:26:15 +00:00
Adding queue autoplay outline. Adding repeat and fav buttons to the player.
This commit is contained in:
@@ -888,6 +888,15 @@
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\layout\HomePlaylist.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\Fav.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\Unfav.xml">
|
||||
<Generator>MSBuild:UpdateGeneratedFiles</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</AndroidResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
<Import Project="..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.targets')" />
|
||||
<Import Project="..\packages\Xamarin.Android.Support.v7.Preference.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.v7.Preference.targets" Condition="Exists('..\packages\Xamarin.Android.Support.v7.Preference.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.v7.Preference.targets')" />
|
||||
|
||||
@@ -57,6 +57,8 @@ namespace Opus
|
||||
view.FindViewById<ImageButton>(Resource.Id.playButton).Click += Play_Click;
|
||||
view.FindViewById<ImageButton>(Resource.Id.nextButton).Click += Next_Click;
|
||||
view.FindViewById<ImageButton>(Resource.Id.moreButton).Click += More;
|
||||
view.FindViewById<ImageButton>(Resource.Id.repeat).Click += Repeat;
|
||||
view.FindViewById<ImageButton>(Resource.Id.fav).Click += Fav;
|
||||
}
|
||||
|
||||
albumArt = view.FindViewById<ImageView>(Resource.Id.playerAlbum);
|
||||
@@ -364,6 +366,32 @@ namespace Opus
|
||||
MainActivity.instance.StartService(intent);
|
||||
}
|
||||
|
||||
private void Repeat(object sender, EventArgs e)
|
||||
{
|
||||
MusicPlayer.repeat = !MusicPlayer.repeat;
|
||||
|
||||
if (MusicPlayer.UseCastPlayer)
|
||||
MusicPlayer.RemotePlayer.QueueSetRepeatMode(MusicPlayer.repeat ? 1 : 0, null);
|
||||
|
||||
if (MusicPlayer.repeat)
|
||||
{
|
||||
MainActivity.instance.FindViewById<ImageButton>(Resource.Id.repeat).SetColorFilter(Color.Argb(255, 21, 183, 237), PorterDuff.Mode.Multiply);
|
||||
MusicPlayer.useAutoPlay = false;
|
||||
Queue.instance.NotifyItemChanged(MusicPlayer.queue.Count, "UseAutoplay");
|
||||
}
|
||||
else
|
||||
{
|
||||
MainActivity.instance.FindViewById<ImageButton>(Resource.Id.repeat).ClearColorFilter();
|
||||
MusicPlayer.useAutoPlay = true;
|
||||
Queue.instance.NotifyItemChanged(MusicPlayer.queue.Count, "UseAutoplay");
|
||||
}
|
||||
}
|
||||
|
||||
private void Fav(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private async void More(object s, EventArgs e)
|
||||
{
|
||||
Song item = await MusicPlayer.GetItem();
|
||||
|
||||
@@ -149,14 +149,9 @@ namespace Opus.Resources.Portable_Class
|
||||
if (MusicPlayer.useAutoPlay)
|
||||
{
|
||||
MusicPlayer.repeat = false;
|
||||
//Queue.instance.menu.FindItem(Resource.Id.repeat).Icon.ClearColorFilter();
|
||||
NotifyItemChanged(0);
|
||||
}
|
||||
};
|
||||
|
||||
//holder.MixButton.Click += async (sender, e) =>
|
||||
//{
|
||||
// YoutubeEngine.CreateMix(await MusicPlayer.GetItem());
|
||||
//};
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
969
Opus/Resources/Resource.Designer.cs
generated
969
Opus/Resources/Resource.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
13
Opus/Resources/drawable/Fav.xml
Normal file
13
Opus/Resources/drawable/Fav.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:pathData="M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"
|
||||
android:fillColor="#000000" />
|
||||
<path
|
||||
android:pathData="M0 0h24v24H0z" />
|
||||
</vector>
|
||||
13
Opus/Resources/drawable/Unfav.xml
Normal file
13
Opus/Resources/drawable/Unfav.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:pathData="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"
|
||||
android:fillColor="#ffffff" />
|
||||
<path
|
||||
android:pathData="M0 0h24v24H0z" />
|
||||
</vector>
|
||||
@@ -28,6 +28,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:textSize="20sp"
|
||||
android:shadowDx="1.5"
|
||||
android:shadowDy="1.3"
|
||||
android:shadowRadius="1.3"
|
||||
android:shadowColor="#000"
|
||||
android:text="@string/autoplay"/>
|
||||
<android.widget.Switch
|
||||
android:layout_width="wrap_content"
|
||||
@@ -41,20 +45,12 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:shadowDx="1.5"
|
||||
android:shadowDy="1.3"
|
||||
android:shadowRadius="1.6"
|
||||
android:shadowColor="#000"
|
||||
android:text="@string/autoplay_desc"/>
|
||||
</LinearLayout>
|
||||
<!--<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@android:color/darker_gray"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="5dp"/>
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/FlatButtonBorder"
|
||||
android:id="@+id/createMix"
|
||||
android:text="@string/create_mix" />-->
|
||||
</LinearLayout>
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="fill_parent"
|
||||
|
||||
@@ -74,6 +74,28 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="25dp">
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp" >
|
||||
<ImageButton
|
||||
android:id="@+id/repeat"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_margin="12dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:tint="#ffffff"
|
||||
android:background="@null"
|
||||
android:src="@drawable/repeat" />
|
||||
<ImageButton
|
||||
android:id="@+id/fav"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_margin="12dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:tint="#ffffff"
|
||||
android:background="@null"
|
||||
android:src="@drawable/Fav" />
|
||||
</RelativeLayout>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp" >
|
||||
|
||||
Reference in New Issue
Block a user