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

Makes FFImageLoading linker-safe #1378

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
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
2 changes: 0 additions & 2 deletions FFImageLoading.MvvmCross/MvxCachedImageView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ namespace FFImageLoading.Cross
{

#if __IOS__
[Preserve(AllMembers = true)]
[Register("MvxCachedImageView")]
#elif __ANDROID__
[Preserve(AllMembers = true)]
[Register("ffimageloading.cross.MvxCachedImageView")]
#endif
/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions FFImageLoading.MvvmCross/MvxSvgCachedImageView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
namespace FFImageLoading.Cross
{
#if __IOS__
[Preserve(AllMembers = true)]
[Register("MvxSvgCachedImageView")]
#elif __ANDROID__
[Preserve(AllMembers = true)]
[Register("ffimageloading.cross.MvxSvgCachedImageView")]
#endif
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace FFImageLoading.Args
{
[Preserve(AllMembers = true)]
public class DownloadProgressEventArgs : EventArgs
{
public DownloadProgressEventArgs(DownloadProgress downloadProgress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace FFImageLoading.Args
{
[Preserve(AllMembers = true)]
public class DownloadStartedEventArgs : EventArgs
{
public DownloadStartedEventArgs(DownloadInformation downloadInformation)
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Common/Args/ErrorEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace FFImageLoading.Args
{
[Preserve(AllMembers = true)]
public class ErrorEventArgs : EventArgs
{
public ErrorEventArgs(Exception exception)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace FFImageLoading.Args
{
[Preserve(AllMembers = true)]
public class FileWriteFinishedEventArgs : EventArgs
{
public FileWriteFinishedEventArgs(FileWriteInfo fileWriteInfo)
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Common/Args/FinishEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace FFImageLoading.Args
{
[Preserve(AllMembers = true)]
public class FinishEventArgs : EventArgs
{
public FinishEventArgs(IScheduledWork scheduledWork)
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Common/Args/SuccessEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace FFImageLoading.Args
{
[Preserve(AllMembers = true)]
public class SuccessEventArgs : EventArgs
{
public SuccessEventArgs(ImageInformation imageInformation, LoadingResult loadingResult)
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Common/Cache/CacheResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace FFImageLoading.Cache
{
[Preserve(AllMembers = true)]
public enum CacheResult
{
Found,
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Common/Cache/CacheStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace FFImageLoading.Cache
{
[Preserve(AllMembers = true)]
public class CacheStream
{
public CacheStream(Stream stream, bool retrievedFromDiskCache, string filePath)
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Common/Cache/CacheType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace FFImageLoading.Cache
{
[Preserve(AllMembers = true)]
public enum CacheType
{
Memory,
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Common/Cache/DownloadCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace FFImageLoading.Cache
{
[Preserve(AllMembers = true)]
public class DownloadCache : IDownloadCache
{
public DownloadCache(Configuration configuration)
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Common/Cache/IDiskCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace FFImageLoading.Cache
{
[Preserve(AllMembers = true)]
public interface IDiskCache
{
/// <summary>
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Common/Cache/IDownloadCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

namespace FFImageLoading.Cache
{
[Preserve(AllMembers = true)]
public interface IDownloadCache
{
Task<CacheStream> DownloadAndCacheIfNeededAsync (string url, TaskParameter parameters, Configuration configuration, CancellationToken token);
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Common/Cache/IMemoryCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace FFImageLoading.Cache
{
[Preserve(AllMembers = true)]
public interface IMemoryCache<TImageContainer>
{
ImageInformation GetInfo(string key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace FFImageLoading.Exceptions
{
[Preserve(AllMembers = true)]
public class DownloadAggregateException : AggregateException
{
public DownloadAggregateException()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
namespace FFImageLoading.Exceptions
{
[Preserve(AllMembers = true)]
public class DownloadException : Exception
{
public DownloadException(string message) : base(message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace FFImageLoading.Exceptions
{
[Preserve(AllMembers = true)]
public class DownloadHeadersTimeoutException : Exception
{
public DownloadHeadersTimeoutException() : base("Headers timeout")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace FFImageLoading.Exceptions
{
[Preserve(AllMembers = true)]
public class DownloadHttpStatusCodeException : Exception
{
public DownloadHttpStatusCodeException(HttpStatusCode httpStatusCode, string content = null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
namespace FFImageLoading.Exceptions
{
[Preserve(AllMembers = true)]
public class DownloadReadTimeoutException : Exception
{
public DownloadReadTimeoutException() : base("Read timeout")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace FFImageLoading
{
[Preserve(AllMembers = true)]
public static class AssemblyExtensions
{
public static string GetTypeAssemblyFullName(this Type type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace FFImageLoading
{
[Preserve(AllMembers = true)]
public static class StringExtensions
{
public static string ToSanitizedKey(this string key)
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Common/Helpers/IMD5Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace FFImageLoading.Helpers
{
[Preserve(AllMembers = true)]
public interface IMD5Helper
{
string MD5(string input);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace FFImageLoading.Helpers
{
[Preserve(AllMembers = true)]
public interface IMainThreadDispatcher
{
// void Post(Action action);
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Common/Helpers/IMiniLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace FFImageLoading.Helpers
{
[Preserve(AllMembers = true)]
public interface IMiniLogger
{
void Debug(string message);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
namespace FFImageLoading
{
[Preserve(AllMembers = true)]
public interface IPlatformPerformance
{
int GetCurrentManagedThreadId();
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Common/Helpers/MiniLoggerWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using FFImageLoading.Helpers;
namespace FFImageLoading
{
[Preserve(AllMembers = true)]
internal class MiniLoggerWrapper : IMiniLogger
{
IMiniLogger _logger;
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Common/Helpers/Retry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

namespace FFImageLoading
{
[Preserve(AllMembers = true)]
public static class Retry
{
public static async Task<T> DoAsync<T>(Func<Task<T>> action, TimeSpan retryInterval, int retryCount, Action onRetry = null)
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Common/Work/IImageLoaderTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

namespace FFImageLoading.Work
{
[Preserve(AllMembers = true)]
public interface IImageLoaderTask : IScheduledWork, IDisposable
{
Task Init();
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Common/Work/IImageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace FFImageLoading
/// <summary>
/// FFImageLoading by Daniel Luberda
/// </summary>
[Preserve(AllMembers = true)]
public interface IImageService
{
/// <summary>
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Droid/ImageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace FFImageLoading
/// <summary>
/// FFImageLoading by Daniel Luberda
/// </summary>
[Preserve(AllMembers = true)]
public class ImageService : ImageServiceBase<SelfDisposingBitmapDrawable>
{
readonly Android.Util.DisplayMetrics _metrics = Android.Content.Res.Resources.System.DisplayMetrics;
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Droid/Views/ImageViewAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

namespace FFImageLoading.Views
{
[Preserve(AllMembers = true)]
[Register("ffimageloading.views.ImageViewAsync")]
[Obsolete("You can now use Android's ImageView")]
public class ImageViewAsync : ImageView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace FFImageLoading.Forms.Platform
/// <summary>
/// CachedImage Implementation
/// </summary>
[Preserve(AllMembers = true)]
public class CachedImageFastRenderer : CachedImageView, IVisualElementRenderer
{
internal static readonly Type ElementRendererType = typeof(ImageRenderer).Assembly.GetType("Xamarin.Forms.Platform.Android.FastRenderers.VisualElementRenderer");
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Forms.Droid/CachedImageRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ namespace FFImageLoading.Forms.Platform
/// <summary>
/// CachedImage Implementation
/// </summary>
[Preserve(AllMembers=true)]
public class CachedImageRenderer : ViewRenderer<CachedImage, CachedImageView>
{
[RenderWith(typeof(CachedImageRenderer))]
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Forms.Droid/CachedImageView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace FFImageLoading.Forms.Platform
{
[Preserve(AllMembers = true)]
public class CachedImageView : ImageView
{
bool _skipInvalidate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

namespace FFImageLoading.Forms.Platform
{
[Preserve(AllMembers = true)]
public class FFImageLoadingImageViewHandler : HandlerBase<ImageView>, IImageViewHandler
{
public Task LoadImageAsync(Xamarin.Forms.ImageSource imageSource, ImageView imageView, CancellationToken cancellationToken = default)
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Forms.Droid/ImageSourceBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace FFImageLoading.Forms.Platform
{
[Preserve(AllMembers = true)]
internal class ImageSourceBinding : IImageSourceBinding
{
public ImageSourceBinding(FFImageLoading.Work.ImageSource imageSource, string path)
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Forms.Tizen/ImageSourceBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

namespace FFImageLoading.Forms.Platform
{
[Preserve(AllMembers = true)]
internal class ImageSourceBinding : IImageSourceBinding
{
public ImageSourceBinding(FFImageLoading.Work.ImageSource imageSource, string path)
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Forms.Touch/CachedImageRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ namespace FFImageLoading.Forms.Platform
/// <summary>
/// CachedImage Implementation
/// </summary>
[Preserve(AllMembers = true)]
public class CachedImageRenderer : ViewRenderer<CachedImage, PImageView>
{
[RenderWith(typeof(CachedImageRenderer))]
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Forms.Touch/ImageSourceBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace FFImageLoading.Forms.Platform
{
[Preserve(AllMembers= true)]
internal class ImageSourceBinding : IImageSourceBinding
{
public ImageSourceBinding(FFImageLoading.Work.ImageSource imageSource, string path)
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Forms.WinUWP/CachedImageRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ namespace FFImageLoading.Forms.Platform
/// <summary>
/// CachedImage Implementation
/// </summary>
[Preserve(AllMembers = true)]
public class CachedImageRenderer : ViewRenderer<CachedImage, Windows.UI.Xaml.Controls.Image>
{
[RenderWith(typeof(CachedImageRenderer))]
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Forms.Wpf/CachedImageRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ namespace FFImageLoading.Forms.Platform
/// <summary>
/// CachedImage Implementation
/// </summary>
[Preserve(AllMembers = true)]
public class CachedImageRenderer : ViewRenderer<CachedImage, Image>
{
[RenderWith(typeof(CachedImageRenderer))]
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Forms/CachedImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace FFImageLoading.Forms
{
[Preserve(AllMembers = true)]
[RenderWith(typeof(Platform.CachedImageRenderer._CachedImageRenderer))]
/// <summary>
/// CachedImage by Daniel Luberda
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Forms/DataUrlImageSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace FFImageLoading.Forms
{
[Preserve(AllMembers = true)]
public class DataUrlImageSource : ImageSource
{
public DataUrlImageSource(string dataUrl)
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Forms/EmbeddedResourceImageSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace FFImageLoading.Forms
/// eg. resource://YourProject.Resource.Resource.png
/// eg. resource://YourProject.Resource.Resource.png?assembly=[FULL_ASSEMBLY_NAME]
/// </summary>
[Preserve(AllMembers = true)]
public class EmbeddedResourceImageSource : ImageSource
{
static string _cachedMainAssembly;
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Forms/ICacheKeyFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace FFImageLoading.Forms
{
[Preserve(AllMembers = true)]
public interface ICacheKeyFactory
{
string GetKey(ImageSource imageSource, object bindingContext);
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Forms/IImageSourceBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

namespace FFImageLoading.Forms
{
[Preserve(AllMembers = true)]
public interface IImageSourceBinding
{
ImageSource ImageSource { get; }
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Forms/IVectorImageSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace FFImageLoading.Forms
{
[Preserve(AllMembers = true)]
public interface IVectorImageSource
{
IVectorDataResolver GetVectorDataResolver();
Expand Down
1 change: 0 additions & 1 deletion source/FFImageLoading.Forms/ImageSourceConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace FFImageLoading.Forms
{
[Preserve(AllMembers = true)]
public class ImageSourceConverter : TypeConverter, IValueConverter
{
public override bool CanConvertFrom(Type sourceType)
Expand Down
Loading