36 lines
1.3 KiB
C#
36 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Gallery.Util.Model;
|
|
using Xamarin.Forms;
|
|
|
|
namespace Gallery.Util.Interface
|
|
{
|
|
public interface IGallerySource
|
|
{
|
|
string Name { get; }
|
|
string Route { get; }
|
|
string FlyoutIconKey { get; }
|
|
string HomePage { get; }
|
|
bool IsScrollable { get; }
|
|
|
|
void SetCookie();
|
|
void InitDynamicResources(string family, ResourceDictionary light, ResourceDictionary dark);
|
|
Task<IEnumerable<GalleryItem>> GetRecentItemsAsync(int page);
|
|
Task<string> ResolveImageUrl(GalleryItem item);
|
|
}
|
|
|
|
public abstract class GallerySourceBase : IGallerySource
|
|
{
|
|
public abstract string Name { get; }
|
|
public abstract string Route { get; }
|
|
public abstract string FlyoutIconKey { get; }
|
|
public abstract string HomePage { get; }
|
|
public virtual bool IsScrollable => true;
|
|
|
|
public abstract void SetCookie();
|
|
public abstract void InitDynamicResources(string family, ResourceDictionary light, ResourceDictionary dark);
|
|
public abstract Task<IEnumerable<GalleryItem>> GetRecentItemsAsync(int page);
|
|
public virtual Task<string> ResolveImageUrl(GalleryItem item) => Task.FromResult(item.RawUrl);
|
|
}
|
|
}
|