Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
Solving bugs, updating packages and releasing v3.4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
zoriya committed Jul 4, 2019
1 parent 0f12b76 commit d86f78f
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 30 deletions.
6 changes: 3 additions & 3 deletions Opus.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Global
{35E54AD4-5E2B-4DCD-9C20-F715D682A22B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35E54AD4-5E2B-4DCD-9C20-F715D682A22B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35E54AD4-5E2B-4DCD-9C20-F715D682A22B}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{35E54AD4-5E2B-4DCD-9C20-F715D682A22B}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{35E54AD4-5E2B-4DCD-9C20-F715D682A22B}.Release|Any CPU.Build.0 = Debug|Any CPU
{35E54AD4-5E2B-4DCD-9C20-F715D682A22B}.Release|Any CPU.Deploy.0 = Debug|Any CPU
{35E54AD4-5E2B-4DCD-9C20-F715D682A22B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35E54AD4-5E2B-4DCD-9C20-F715D682A22B}.Release|Any CPU.Build.0 = Release|Any CPU
{35E54AD4-5E2B-4DCD-9C20-F715D682A22B}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 2 additions & 2 deletions Opus/Assets/Version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 3.4.6
Version: 3.4.9
Beta: False
Link: https://github.com/AnonymusRaccoon/Opus/releases/download/3.4.6/Opus.v3.4.6.apk
Link: https://github.com/AnonymusRaccoon/Opus/releases/download/3.4.9/Opus.v3.4.9.apk
16 changes: 8 additions & 8 deletions Opus/Code/UI/Adapter/SectionAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int po

if(items[position].channelContent != null)
{
holder.recycler.SetAdapter(new SmallListAdapter(items[position].channelContent.GetRange(0, items[position].channelContent.Count > 4 ? 4 : items[position].channelContent.Count), holder.recycler));
holder.recycler.SetAdapter(new VerticalSectionAdapter(items[position].channelContent.GetRange(0, items[position].channelContent.Count > 4 ? 4 : items[position].channelContent.Count), holder.recycler));

if (items[position].channelContent.Count > 4)
{
holder.more.Visibility = ViewStates.Visible;
((GradientDrawable)holder.more.Background).SetStroke(5, Android.Content.Res.ColorStateList.ValueOf(Color.Argb(255, 21, 183, 237)));
holder.more.SetTextColor(Color.Argb(255, 21, 183, 237));
holder.more.Text = ((SmallListAdapter)holder.recycler.GetAdapter()).channels.Count > 4 ? MainActivity.instance.GetString(Resource.String.view_less) : MainActivity.instance.GetString(Resource.String.view_more);
holder.more.Text = ((VerticalSectionAdapter)holder.recycler.GetAdapter()).channels.Count > 4 ? MainActivity.instance.GetString(Resource.String.view_less) : MainActivity.instance.GetString(Resource.String.view_more);
holder.more.Click += (sender, e) =>
{
SmallListAdapter adapter = (SmallListAdapter)holder.recycler.GetAdapter();
VerticalSectionAdapter adapter = (VerticalSectionAdapter)holder.recycler.GetAdapter();
if (adapter.ItemCount == 4)
{
adapter.channels.AddRange(items[position].channelContent.GetRange(4, items[position].channelContent.Count - 4));
Expand All @@ -143,7 +143,7 @@ public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int po
}
else
{
holder.recycler.SetAdapter(new SmallListAdapter(false, holder.recycler));
holder.recycler.SetAdapter(new VerticalSectionAdapter(false, holder.recycler));
}

}
Expand All @@ -155,7 +155,7 @@ public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int po
holder.recycler.SetLayoutManager(new LinearLayoutManager(MainActivity.instance, LinearLayoutManager.Vertical, false));
if (items[position].playlistContent != null)
{
holder.recycler.SetAdapter(new SmallListAdapter(items[position].playlistContent.GetRange(0, items[position].playlistContent.Count > 4 ? 4 : items[position].playlistContent.Count), holder.recycler));
holder.recycler.SetAdapter(new VerticalSectionAdapter(items[position].playlistContent.GetRange(0, items[position].playlistContent.Count > 4 ? 4 : items[position].playlistContent.Count), holder.recycler));

if (ChannelDetails.instance != null)
{
Expand All @@ -164,10 +164,10 @@ public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int po
holder.more.Visibility = ViewStates.Visible;
((GradientDrawable)holder.more.Background).SetStroke(5, Android.Content.Res.ColorStateList.ValueOf(Color.Argb(255, 21, 183, 237)));
holder.more.SetTextColor(Color.Argb(255, 21, 183, 237));
holder.more.Text = ((SmallListAdapter)holder.recycler.GetAdapter()).playlists.Count > 4 ? MainActivity.instance.GetString(Resource.String.view_less) : MainActivity.instance.GetString(Resource.String.view_more);
holder.more.Text = ((VerticalSectionAdapter)holder.recycler.GetAdapter()).playlists.Count > 4 ? MainActivity.instance.GetString(Resource.String.view_less) : MainActivity.instance.GetString(Resource.String.view_more);
holder.more.Click += (sender, e) =>
{
SmallListAdapter adapter = (SmallListAdapter)holder.recycler.GetAdapter();
VerticalSectionAdapter adapter = (VerticalSectionAdapter)holder.recycler.GetAdapter();
if (adapter.ItemCount == 4)
{
adapter.playlists.AddRange(items[position].playlistContent.GetRange(4, items[position].playlistContent.Count - 4));
Expand All @@ -194,7 +194,7 @@ public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int po
}
else
{
holder.recycler.SetAdapter(new SmallListAdapter(true, holder.recycler));
holder.recycler.SetAdapter(new VerticalSectionAdapter(true, holder.recycler));
holder.more.Visibility = ViewStates.Gone;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Opus.Adapter
{
public class SmallListAdapter : RecyclerView.Adapter
public class VerticalSectionAdapter : RecyclerView.Adapter
{
public RecyclerView recycler;
public List<Channel> channels;
Expand All @@ -33,21 +33,21 @@ public override int ItemCount
}
}

public SmallListAdapter(List<Channel> channels, RecyclerView recycler)
public VerticalSectionAdapter(List<Channel> channels, RecyclerView recycler)
{
this.recycler = recycler;
this.channels = channels;
UseChannel = true;
}

public SmallListAdapter(List<PlaylistItem> playlists, RecyclerView recycler)
public VerticalSectionAdapter(List<PlaylistItem> playlists, RecyclerView recycler)
{
this.recycler = recycler;
this.playlists = playlists;
UseChannel = false;
}

public SmallListAdapter(bool UseChannel, RecyclerView recycler)
public VerticalSectionAdapter(bool UseChannel, RecyclerView recycler)
{
this.recycler = recycler;
this.UseChannel = UseChannel;
Expand All @@ -74,10 +74,9 @@ public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int po
else
{
holder.Title.Text = playlists[position].Name;
Picasso.With(Application.Context).Load(playlists[position].ImageURL).Placeholder(Resource.Color.background_material_dark).Resize(400, 400).CenterCrop().Into(holder.AlbumArt);
Picasso.With(Application.Context).Load(playlists[position].ImageURL).Placeholder(Resource.Color.background_material_dark).Transform(new RemoveBlackBorder(true)).Into(holder.AlbumArt);
if (!holder.RightButtons.FindViewById<ImageButton>(Resource.Id.play).HasOnClickListeners)
{
//Only support local playlists for now.
holder.RightButtons.FindViewById<ImageButton>(Resource.Id.play).Click += (sender, e) => { PlaylistManager.PlayInOrder(playlists[position]); };
holder.RightButtons.FindViewById<ImageButton>(Resource.Id.shuffle).Click += (sender, e) => { PlaylistManager.Shuffle(playlists[position]); };
}
Expand Down
12 changes: 10 additions & 2 deletions Opus/Code/UI/Fragments/OpenSourceViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,21 @@ public class OpenSourceViewer : ListFragment
{
public static OpenSourceViewer instance;
private bool isPaused = false;
/// <summary>
/// To update this dictionary, run the "Get-Package | Select-Object Id,LicenseUrl" command on the package manager console.
/// Then copy the output to a notepad and remove every spaces. Then replace http to: '", "http'
/// Then replace every \n to '{ "'
/// Then in extended mode (of notepad ++), replace $ to '" },'.
/// Finaly, past the result below (replace the initialized dictionary and solve the few errors that may be here.
/// </summary>
private readonly ReadOnlyDictionary<string, string> libraries = new ReadOnlyDictionary<string, string>(new Dictionary<string, string>
{
{ "AngleSharp", "https://github.com/AngleSharp/AngleSharp/blob/master/LICENSE" },
{ "Google.Apis", "https://aka.ms/deprecateLicenseUrl" },
{ "Google.Apis.Auth", "https://aka.ms/deprecateLicenseUrl" },
{ "Google.Apis.Core", "https://aka.ms/deprecateLicenseUrl" },
{ "Google.Apis.YouTube.v3", "https://aka.ms/deprecateLicenseUrl" },
{ "Karamunting.Android.AnderWeb.DiscreteSeekBar", "https://github.com/AnderWeb/discreteSeekBar/blob/master/LICENSE" },
{ "LtGt", "https://licenses.nuget.org/MIT" },
{ "Microsoft.CSharp", "https://github.com/dotnet/corefx/blob/master/LICENSE.TXT" },
{ "Microsoft.NETCore.Platforms", "https://github.com/dotnet/corefx/blob/master/LICENSE.TXT" },
{ "NETStandard.Library", "https://github.com/dotnet/standard/blob/master/LICENSE.TXT" },
Expand All @@ -33,6 +40,7 @@ public class OpenSourceViewer : ListFragment
{ "PInvoke.Kernel32", "https://raw.githubusercontent.com/AArnott/pinvoke/cf0176c42b/LICENSE" },
{ "PInvoke.NCrypt", "https://raw.githubusercontent.com/AArnott/pinvoke/cf0176c42b/LICENSE" },
{ "PInvoke.Windows.Core", "https://raw.githubusercontent.com/AArnott/pinvoke/cf0176c42b/LICENSE" },
{ "Sprache", "https://github.com/sprache/Sprache/blob/master/licence.txt" },
{ "sqlite-net-pcl", "https://raw.githubusercontent.com/praeclarum/sqlite-net/master/LICENSE.md" },
{ "SQLitePCLRaw.bundle_green", "https://licenses.nuget.org/Apache-2.0" },
{ "SQLitePCLRaw.core", "https://licenses.nuget.org/Apache-2.0" },
Expand All @@ -46,6 +54,7 @@ public class OpenSourceViewer : ListFragment
{ "System.ComponentModel.TypeConverter", "http://go.microsoft.com/fwlink/?LinkId=329770" },
{ "System.Console", "http://go.microsoft.com/fwlink/?LinkId=329770" },
{ "System.Diagnostics.Process", "http://go.microsoft.com/fwlink/?LinkId=329770" },
{ "System.Globalization", "http://go.microsoft.com/fwlink/?LinkId=329770" },
{ "System.IO", "http://go.microsoft.com/fwlink/?LinkId=329770" },
{ "System.IO.Compression", "http://go.microsoft.com/fwlink/?LinkId=329770" },
{ "System.IO.Compression.ZipFile", "http://go.microsoft.com/fwlink/?LinkId=329770" },
Expand Down Expand Up @@ -142,7 +151,6 @@ public class OpenSourceViewer : ListFragment
{ "Xamarin.GooglePlayServices.Cast", "https://go.microsoft.com/fwlink/?linkid=865373" },
{ "Xamarin.GooglePlayServices.Cast.Framework", "https://go.microsoft.com/fwlink/?linkid=865373" },
{ "Xamarin.GooglePlayServices.Flags", "https://go.microsoft.com/fwlink/?linkid=865373" },
{ "Xamarin.GooglePlayServices.Oss.Licenses", "https://go.microsoft.com/fwlink/?linkid=865373" },
{ "Xamarin.GooglePlayServices.Tasks", "https://go.microsoft.com/fwlink/?linkid=865373" },
{ "YoutubeExplode", "https://licenses.nuget.org/LGPL-3.0-only" }
});
Expand Down
15 changes: 9 additions & 6 deletions Opus/Opus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@
<AndroidDexTool>d8</AndroidDexTool>
</PropertyGroup>
<ItemGroup>
<Reference Include="AngleSharp, Version=0.9.9.0, Culture=neutral, PublicKeyToken=e83494dcdc6d31ea, processorArchitecture=MSIL">
<HintPath>..\packages\AngleSharp.0.9.11\lib\portable-windows8+net45+windowsphone8+wpa+monoandroid+monotouch\AngleSharp.dll</HintPath>
</Reference>
<Reference Include="DiscreteSeekBar, Version=1.0.1.1, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Karamunting.Android.AnderWeb.DiscreteSeekBar.1.0.1.1\lib\monoandroid81\DiscreteSeekBar.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -112,6 +109,9 @@
<HintPath>..\packages\Google.Apis.YouTube.v3.1.40.2.1593\lib\netstandard2.0\Google.Apis.YouTube.v3.dll</HintPath>
</Reference>
<Reference Include="Java.Interop" />
<Reference Include="LtGt, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\LtGt.1.0.0\lib\netstandard2.0\LtGt.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\netstandard2.0\Newtonsoft.Json.dll</HintPath>
Expand All @@ -131,6 +131,9 @@
<Reference Include="PInvoke.Windows.Core, Version=0.5.0.0, Culture=neutral, PublicKeyToken=9e300f9f87f04a7a, processorArchitecture=MSIL">
<HintPath>..\packages\PInvoke.Windows.Core.0.5.184\lib\netstandard2.0\PInvoke.Windows.Core.dll</HintPath>
</Reference>
<Reference Include="Sprache, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sprache.2.2.0\lib\netstandard2.0\Sprache.dll</HintPath>
</Reference>
<Reference Include="SQLite-net, Version=1.5.231.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\sqlite-net-pcl.1.5.231\lib\netstandard1.1\SQLite-net.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -319,8 +322,8 @@
<Reference Include="Xamarin.GooglePlayServices.Tasks, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.GooglePlayServices.Tasks.71.1601.0-preview9\lib\monoandroid90\Xamarin.GooglePlayServices.Tasks.dll</HintPath>
</Reference>
<Reference Include="YoutubeExplode, Version=4.7.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\YoutubeExplode.4.7.4\lib\netstandard2.0\YoutubeExplode.dll</HintPath>
<Reference Include="YoutubeExplode, Version=4.7.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\YoutubeExplode.4.7.5\lib\netstandard2.0\YoutubeExplode.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -370,7 +373,7 @@
<Compile Include="Code\Others\HeadphonesActions.cs" />
<Compile Include="Code\UI\Fragments\Home.cs" />
<Compile Include="Code\UI\Adapter\SectionAdapter.cs" />
<Compile Include="Code\UI\Adapter\HomeListAdapter.cs" />
<Compile Include="Code\UI\Adapter\VerticalSectionAdapter.cs" />
<Compile Include="Code\DataStructure\HomeHolder.cs" />
<Compile Include="Code\Others\ItemTouchCallback.cs" />
<Compile Include="Code\UI\Adapter\LineAdapter.cs" />
Expand Down
2 changes: 1 addition & 1 deletion Opus/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.sdg.opus" android:installLocation="preferExternal" android:versionName="3.4.6" android:versionCode="51">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.sdg.opus" android:installLocation="preferExternal" android:versionName="3.4.9" android:versionCode="54">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Expand Down
6 changes: 4 additions & 2 deletions Opus/packages.config
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AngleSharp" version="0.9.11" targetFramework="monoandroid90" />
<package id="Google.Apis" version="1.40.2" targetFramework="monoandroid90" />
<package id="Google.Apis.Auth" version="1.40.2" targetFramework="monoandroid90" />
<package id="Google.Apis.Core" version="1.40.2" targetFramework="monoandroid90" />
<package id="Google.Apis.YouTube.v3" version="1.40.2.1593" targetFramework="monoandroid90" />
<package id="Karamunting.Android.AnderWeb.DiscreteSeekBar" version="1.0.1.1" targetFramework="monoandroid81" />
<package id="LtGt" version="1.0.0" targetFramework="monoandroid90" />
<package id="Microsoft.CSharp" version="4.5.0" targetFramework="monoandroid81" />
<package id="Microsoft.NETCore.Platforms" version="2.2.1" targetFramework="monoandroid90" />
<package id="NETStandard.Library" version="2.0.3" targetFramework="monoandroid81" />
Expand All @@ -15,6 +15,7 @@
<package id="PInvoke.Kernel32" version="0.5.184" targetFramework="monoandroid90" />
<package id="PInvoke.NCrypt" version="0.5.184" targetFramework="monoandroid90" />
<package id="PInvoke.Windows.Core" version="0.5.184" targetFramework="monoandroid90" />
<package id="Sprache" version="2.2.0" targetFramework="monoandroid90" />
<package id="sqlite-net-pcl" version="1.5.231" targetFramework="monoandroid81" />
<package id="SQLitePCLRaw.bundle_green" version="1.1.14" targetFramework="monoandroid90" />
<package id="SQLitePCLRaw.core" version="1.1.14" targetFramework="monoandroid90" />
Expand All @@ -28,6 +29,7 @@
<package id="System.ComponentModel.TypeConverter" version="4.3.0" targetFramework="monoandroid81" />
<package id="System.Console" version="4.3.1" targetFramework="monoandroid81" />
<package id="System.Diagnostics.Process" version="4.3.0" targetFramework="monoandroid81" />
<package id="System.Globalization" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.IO" version="4.3.0" targetFramework="monoandroid81" />
<package id="System.IO.Compression" version="4.3.0" targetFramework="monoandroid81" />
<package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="monoandroid81" />
Expand Down Expand Up @@ -125,5 +127,5 @@
<package id="Xamarin.GooglePlayServices.Cast.Framework" version="71.1602.0-preview9" targetFramework="monoandroid90" />
<package id="Xamarin.GooglePlayServices.Flags" version="71.1601.0-preview9" targetFramework="monoandroid90" />
<package id="Xamarin.GooglePlayServices.Tasks" version="71.1601.0-preview9" targetFramework="monoandroid90" />
<package id="YoutubeExplode" version="4.7.4" targetFramework="monoandroid90" />
<package id="YoutubeExplode" version="4.7.5" targetFramework="monoandroid90" />
</packages>

0 comments on commit d86f78f

Please sign in to comment.