Skip to content

Commit b1ffb2d

Browse files
Finish v1.3.1
2 parents 29bf5c9 + 380fbb7 commit b1ffb2d

4 files changed

Lines changed: 122 additions & 5 deletions

File tree

.github/copilot-instructions.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Copilot Instructions for FFImageLoading.Cross
2+
3+
## Project Overview
4+
5+
FFImageLoading.Cross is a .NET image loading, caching, and transforming library for .NET Android, .NET iOS, and MvvmCross. It provides configurable disk/memory caching, deduplication of download requests, placeholder support, downsampling, SVG/WebP/GIF support, fade-in animations, and built-in image transformations.
6+
7+
## Repository Structure
8+
9+
- `source/FFImageLoading/` — Cross-platform core library (`Cross.FFImageLoading.Core` NuGet package), targeting `net9.0;net10.0`
10+
- `source/FFImageLoading.Droid/` — Android platform implementation (`Cross.FFImageLoading.Android` NuGet package), targeting `net9.0-android;net10.0-android`
11+
- `source/FFImageLoading.Ios/` — iOS platform implementation (`Cross.FFImageLoading.Ios` NuGet package), targeting `net9.0-ios;net10.0-ios`
12+
- `samples/SampleApp.Droid/` — Sample Android application demonstrating library usage
13+
- `Directory.Build.props` — Shared MSBuild properties, multi-target framework versions (`NetVersion`, `NetVersionAndroid`, `NetVersionIos`), and NuGet package metadata
14+
15+
## Build & Development Setup
16+
17+
### Prerequisites
18+
19+
- .NET 9 and .NET 10 SDKs
20+
- Android and iOS workloads: `dotnet workload install android ios`
21+
22+
### Build Commands
23+
24+
```bash
25+
dotnet restore
26+
dotnet build -c Release
27+
```
28+
29+
### CI/CD
30+
31+
- **CI** (`.github/workflows/ci.yml`): Runs on `macos-latest` on push/PR to `master`. Installs android + ios workloads, restores, and builds.
32+
- **Publish** (`.github/workflows/publish.yml`): Triggers on GitHub release. Uses NuGet Trusted Publishing via `nuget/login@v1` with OIDC to push packages.
33+
34+
## Code Style & Conventions
35+
36+
### General
37+
38+
- Follow the `.editorconfig` at the repo root for all formatting rules.
39+
- C# files use **tabs** for indentation (size 4), with `utf-8-bom` encoding.
40+
- XML/JSON files use **spaces** (indent size 2).
41+
- Nullable reference types are enabled globally (`<Nullable>enable</Nullable>`).
42+
- Implicit usings are enabled globally (`<ImplicitUsings>enable</ImplicitUsings>`).
43+
44+
### Naming Conventions
45+
46+
- **PascalCase** for constants, methods, properties, classes, interfaces, enums, structs, delegates, and events.
47+
- **camelCase** for parameters and local variables.
48+
- **_camelCase** (underscore prefix) for private fields (e.g., `_initialized`, `_config`, `_disposed`).
49+
- Avoid `this.` qualification unless necessary.
50+
- Use language keywords over framework types (e.g., `string` not `String`).
51+
52+
### Code Style Preferences
53+
54+
- Methods, constructors, and operators: prefer **block bodies**.
55+
- Properties, indexers, and accessors: prefer **expression bodies**.
56+
- Use pattern matching over `is`/`as` with casts.
57+
- Use inline variable declarations.
58+
- Use null-coalescing (`??`) and null-propagation (`?.`) operators.
59+
- Allman brace style — opening braces on a new line.
60+
61+
## Architecture & Key Patterns
62+
63+
### Namespaces
64+
65+
- Core types: `FFImageLoading`, `FFImageLoading.Work`, `FFImageLoading.Cache`, `FFImageLoading.Config`, `FFImageLoading.Helpers`
66+
- Android-specific: `FFImageLoading.Droid`, `FFImageLoading.Droid.*`
67+
- iOS-specific: `FFImageLoading.Ios`, `FFImageLoading.Ios.*`
68+
- Shared public view: `FFImageLoading.Cross` (contains `MvxCachedImageView` on both platforms)
69+
70+
### Key Types
71+
72+
- `ImageServiceBase<TImageContainer>` — Abstract base providing the core image service logic. Platform implementations override abstract methods for platform-specific behavior.
73+
- `ImageService` — Platform-specific singleton (in `FFImageLoading.Droid` / `FFImageLoading.Ios`). Access via `ImageService.Instance`. Call `Initialize()` before use.
74+
- `TaskParameter` — Fluent API for configuring image loading tasks (via `FromFile`, `FromUrl`, `FromEmbeddedResource`, etc.).
75+
- `MvxCachedImageView` — The primary image view for both Android (`Android.Widget.ImageView` subclass) and iOS (`UIImageView` subclass), registered as `ffimageloading.cross.MvxCachedImageView` on Android.
76+
- `Configuration` — Centralized configuration (caching, timeouts, logging, animations, etc.).
77+
- `ITransformation` — Interface for image transformations (blur, circle, crop, grayscale, etc.).
78+
79+
### Data Resolver Pattern
80+
81+
- `DataResolverResult` supports dual paths: **Stream** (for standard bitmap decoding) or **Decoded** (pre-decoded image, bypasses decoder). XML/vector drawables on Android must use the Decoded path.
82+
- Platform-specific resolvers: `ResourceDataResolver`, `BundleDataResolver`, `UrlDataResolver`, etc.
83+
84+
## Multi-Targeting
85+
86+
- Target framework versions are centralized in `Directory.Build.props` via properties:
87+
- `NetVersion` = `net9.0;net10.0`
88+
- `NetVersionAndroid` = `net9.0-android;net10.0-android`
89+
- `NetVersionIos` = `net9.0-ios;net10.0-ios`
90+
- Android uses conditional `TargetPlatformVersion`: 35 for net9.0, 36.1 for net10.0.
91+
92+
## NuGet Packages
93+
94+
The repo produces three packages (with `GeneratePackageOnBuild=true`):
95+
96+
| Package | Project |
97+
|---|---|
98+
| `Cross.FFImageLoading.Core` | `source/FFImageLoading/` |
99+
| `Cross.FFImageLoading.Android` | `source/FFImageLoading.Droid/` |
100+
| `Cross.FFImageLoading.Ios` | `source/FFImageLoading.Ios/` |
101+
102+
## Adding Transformations
103+
104+
Transformations follow a consistent pattern:
105+
1. Create a platform-agnostic class in `source/FFImageLoading/Transformations/` inheriting common logic.
106+
2. Create platform-specific implementations in `source/FFImageLoading.Droid/Transformations/` and `source/FFImageLoading.Ios/Transformations/`, typically extending `TransformationBase`.
107+
3. Implement the `ITransformation` interface with a `Key` property and `Transform` method.

Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
<Nullable>enable</Nullable>
88
<ImplicitUsings>enable</ImplicitUsings>
99
<IsTrimmable>true</IsTrimmable>
10-
<AssemblyVersion>1.3.0.0</AssemblyVersion>
11-
<FileVersion>1.3.0.0</FileVersion>
10+
<AssemblyVersion>1.3.1.0</AssemblyVersion>
11+
<FileVersion>1.3.1.0</FileVersion>
1212
</PropertyGroup>
1313

1414
<PropertyGroup>
15-
<PackageVersion>1.3.0</PackageVersion>
15+
<PackageVersion>1.3.1</PackageVersion>
1616
<PackageProjectUrl>https://github.com/AlexeyBuryanov/FFImageLoading.Cross</PackageProjectUrl>
1717
<RepositoryUrl>https://github.com/AlexeyBuryanov/FFImageLoading.Cross</RepositoryUrl>
1818
<Description>Image loading, caching and transforming library for .NET Android, .NET iOS.</Description>

FFImageLoading.Cross.sln

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 17
4-
VisualStudioVersion = 17.9.34728.123
3+
# Visual Studio Version 18
4+
VisualStudioVersion = 18.3.11505.172 d18.3
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FFImageLoading", "source\FFImageLoading\FFImageLoading.csproj", "{8DD10A2B-92D6-4636-B9B6-461BFCAE65B7}"
77
EndProject
@@ -14,12 +14,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "!Solution Items", "!Solutio
1414
.editorconfig = .editorconfig
1515
.gitattributes = .gitattributes
1616
.gitignore = .gitignore
17+
.github\workflows\ci.yml = .github\workflows\ci.yml
1718
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
1819
CONTRIBUTING.md = CONTRIBUTING.md
1920
Directory.Build.props = Directory.Build.props
2021
icon.png = icon.png
2122
ISSUE_TEMPLATE.md = ISSUE_TEMPLATE.md
2223
LICENSE.md = LICENSE.md
24+
.github\workflows\publish.yml = .github\workflows\publish.yml
2325
README.md = README.md
2426
EndProjectSection
2527
EndProject

source/FFImageLoading.Ios/FFImageLoading.Ios.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
<PackageId>Cross.FFImageLoading.Ios</PackageId>
1010
</PropertyGroup>
1111

12+
<PropertyGroup Condition="'$(TargetFramework)' != '' And $(TargetFramework.StartsWith('net10.0'))">
13+
<TargetPlatformVersion>26.2</TargetPlatformVersion>
14+
</PropertyGroup>
15+
16+
<PropertyGroup Condition="'$(TargetFramework)' != '' And $(TargetFramework.StartsWith('net9.0'))">
17+
<TargetPlatformVersion>18.5</TargetPlatformVersion>
18+
</PropertyGroup>
19+
1220
<ItemGroup>
1321
<ProjectReference Include="..\FFImageLoading\FFImageLoading.csproj" />
1422
</ItemGroup>

0 commit comments

Comments
 (0)