Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #96

Merged
merged 4 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions DdfGuide.Android/AudioDramaListAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Android.Views;
using Android.Widget;
using DdfGuide.Core;
using FFImageLoading.Views;

namespace DdfGuide.Android
{
Expand Down Expand Up @@ -44,9 +43,9 @@ public override View GetView(int position, View convertView, ViewGroup parent)
var view = convertView ?? _context.LayoutInflater.Inflate(Resource.Layout.audiodramalistitem, null);

var titleView = view.FindViewById<TextView>(Resource.Id.titleview);
titleView.Text = audioDrama.AudioDramaDto.ToString();
var imageView = view.FindViewById<ImageViewAsync>(Resource.Id.coverview);
titleView.Text = audioDrama.AudioDramaDto.ToString();
var imageView = view.FindViewById<ImageView>(Resource.Id.coverview);
_imageViewFiller.FillImageViewFromUrl(imageView, audioDrama.AudioDramaDto.CoverUrl);

var heardView = view.FindViewById<CheckBox>(Resource.Id.listcheckboxheard);
Expand Down
12 changes: 10 additions & 2 deletions DdfGuide.Android/AudioDramaListView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

namespace DdfGuide.Android
{
[Obsolete]
public class AudioDramaListView : Fragment, IAudioDramaListView
{
private readonly IImageViewFiller _imageViewFiller;
Expand All @@ -26,16 +27,18 @@ public class AudioDramaListView : Fragment, IAudioDramaListView
private AudioDramaListAdapter _listViewAdapter;
private ListView _listView;
private TabLayout _tabLayout;
private SwipeActionListener _swipeActionListener;

private SwipeActionListener _swipeActionListener;
/// <summary>
/// Fragments need a default constructor. Needed for old android versions.
/// </summary>
[Obsolete]
public AudioDramaListView()
{
_imageViewFiller = new ImageViewFiller();
}

[Obsolete]
public AudioDramaListView(IImageViewFiller imageViewFiller, IReleaseDateService releaseDateService,
IUserNotifier userNotifier)
{
Expand All @@ -44,6 +47,7 @@ public AudioDramaListView(IImageViewFiller imageViewFiller, IReleaseDateService
_userNotifier = userNotifier;
}

[Obsolete]
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
_view = inflater.Inflate(Resource.Layout.audiodramalistlayout, container, false);
Expand All @@ -55,6 +59,7 @@ public override View OnCreateView(LayoutInflater inflater, ViewGroup container,
return _view;
}

[Obsolete]
private void SetupFloatingRandomButton()
{
var fab = _view.FindViewById<FloatingActionButton>(Resource.Id.floatingActionButtonRandom);
Expand All @@ -65,6 +70,7 @@ private void SetupFloatingRandomButton()
fab.Click += (sender, args) => { RandomClicked?.Invoke(this, EventArgs.Empty); };
}

[Obsolete]
private void SetupListView()
{
_listView = _view.FindViewById<ListView>(Resource.Id.listViewAudioDramas);
Expand Down Expand Up @@ -121,6 +127,7 @@ private void SetupListView()
swipeActionAdapter.SetSwipeActionListener(_swipeActionListener);
}

[Obsolete]
private void SetupToolbar()
{
_toolbar = _view.FindViewById<Toolbar>(Resource.Id.toolbar);
Expand All @@ -144,6 +151,7 @@ private void SetupSearchView()
_searchView.QueryTextChange += (sender, args) => { SearchTextChanged?.Invoke(this, EventArgs.Empty); };
}

[Obsolete]
private void SetupTabs()
{
_tabLayout = _view.FindViewById<TabLayout>(Resource.Id.tabLayout);
Expand Down
12 changes: 10 additions & 2 deletions DdfGuide.Android/AudioDramaView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

namespace DdfGuide.Android
{
[Obsolete]
public class UpdatingView : Fragment, IUpdatingView
{
private View _view;

[Obsolete]
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
_view = inflater.Inflate(Resource.Layout.updatinglayout, container, false);
Expand All @@ -23,24 +25,28 @@ public override View OnCreateView(LayoutInflater inflater, ViewGroup container,
}
}

[Obsolete]
public class AudioDramaView : Fragment, IAudioDramaView
{
private readonly IImageViewFiller _imageViewFiller;
private View _view;

private View _view;
/// <summary>
/// Fragments need a default constructor. Needed for old android versions.
/// </summary>
[Obsolete]
public AudioDramaView()
{
_imageViewFiller = new ImageViewFiller();
}

[Obsolete]
public AudioDramaView(IImageViewFiller imageViewFiller)
{
_imageViewFiller = imageViewFiller;
}

[Obsolete]
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
_view = inflater.Inflate(Resource.Layout.audiodramalayout, container, false);
Expand Down Expand Up @@ -82,6 +88,7 @@ private void SetupHeardCheckbox()
};
}

[Obsolete]
private void SetupToolbar()
{
var toolbar = _view.FindViewById<Toolbar>(Resource.Id.toolbarsingleview);
Expand All @@ -91,6 +98,7 @@ private void SetupToolbar()
toolbar.NavigationOnClick += (sender, args) => BackClicked?.Invoke(this, EventArgs.Empty);
}

[Obsolete]
public void SetAudioDrama(AudioDrama audioDrama)
{
var interpreterView = _view.FindViewById<TextView>(Resource.Id.textviewinterpreter);
Expand Down
5 changes: 3 additions & 2 deletions DdfGuide.Android/DdfGuide.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<AndroidResgenClass>Resource</AndroidResgenClass>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v13.0</TargetFrameworkVersion>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
Expand Down Expand Up @@ -64,7 +64,8 @@
<EnableLLVM>false</EnableLLVM>
<BundleAssemblies>false</BundleAssemblies>
<AndroidSupportedAbis>armeabi-v7a;arm64-v8a</AndroidSupportedAbis>
<AndroidSigningKeyStore>C:\Users\marce\Downloads\keystore.jks</AndroidSigningKeyStore>
<AndroidSigningKeyStore>C:\Users\neummarc\Downloads\keystore.jks</AndroidSigningKeyStore>
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
4 changes: 2 additions & 2 deletions DdfGuide.Android/IImageViewFiller.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using FFImageLoading.Views;
using Android.Widget;

namespace DdfGuide.Android
{
public interface IImageViewFiller
{
void FillImageViewFromUrl(ImageViewAsync imageView, string url);
void FillImageViewFromUrl(ImageView imageView, string url);
}
}
53 changes: 27 additions & 26 deletions DdfGuide.Android/ImageViewFiller.cs
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
using FFImageLoading;
using FFImageLoading.Views;
using FFImageLoading.Work;

namespace DdfGuide.Android
{
public class ImageViewFiller : IImageViewFiller
{
public void FillImageViewFromUrl(ImageViewAsync imageView, string url)
{
if (string.IsNullOrWhiteSpace(url))
{
ImageService.Instance
.LoadCompiledResource("ic_launcher")
.IntoAsync(imageView);
}
else
{
ImageService.Instance
.LoadUrl(url)
.LoadingPlaceholder("ic_launcher", ImageSource.CompiledResource)
.ErrorPlaceholder("ic_launcher", ImageSource.CompiledResource)
.IntoAsync(imageView);
}
}
}
using Android.Widget;
using FFImageLoading;
using FFImageLoading.Work;

namespace DdfGuide.Android
{
public class ImageViewFiller : IImageViewFiller
{
[System.Obsolete]
public void FillImageViewFromUrl(ImageView imageView, string url)
{
if (string.IsNullOrWhiteSpace(url))
{
ImageService.Instance
.LoadCompiledResource("ic_launcher")
.IntoAsync(imageView);
}
else
{
ImageService.Instance
.LoadUrl(url)
.LoadingPlaceholder("ic_launcher", ImageSource.CompiledResource)
.ErrorPlaceholder("ic_launcher", ImageSource.CompiledResource)
.IntoAsync(imageView);
}
}
}
}
Loading
Loading