Added new version of Picasso (#866)
|
@ -0,0 +1,216 @@
|
|||
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
|
||||
Do not translate or localize
|
||||
|
||||
Xamarin Components for Square Picasso
|
||||
third party material from the projects listed below. The original copyright
|
||||
notice and the license under which Microsoft received such third party
|
||||
material are set forth below. Microsoft reserves all other rights not
|
||||
expressly granted, whether by implication, estoppel or otherwise.
|
||||
|
||||
########################################
|
||||
# Square Picasso
|
||||
# https://github.com/square/picasso
|
||||
########################################
|
||||
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
|
@ -0,0 +1,17 @@
|
|||
**Xamarin is not responsible for, nor does it grant any licenses to, third-party packages. Some packages may require or install dependencies which are governed by additional licenses.**
|
||||
|
||||
Note: This component depends on [Square Picasso](https://github.com/square/picasso), which is subject to the [Apache 2.0](https://github.com/square/picasso/blob/master/LICENSE.txt)
|
||||
|
||||
### Xamarin Component for Square Picasso for Xamarin.Android
|
||||
|
||||
**The MIT License (MIT)**
|
||||
|
||||
Copyright (c) .NET Foundation Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
20190503
|
|
@ -0,0 +1,62 @@
|
|||
var TARGET = Argument ("t", Argument ("target", "ci"));
|
||||
|
||||
var NUGET_VERSION = "2.71828.0";
|
||||
|
||||
var AAR_VERSION = "2.71828";
|
||||
var AAR_URL = $"https://repo1.maven.org/maven2/com/squareup/picasso/picasso/{AAR_VERSION}/picasso-{AAR_VERSION}.aar";
|
||||
|
||||
Task ("externals")
|
||||
.Does (() =>
|
||||
{
|
||||
EnsureDirectoryExists ("./externals");
|
||||
|
||||
DownloadFile(AAR_URL, "./externals/picasso.aar");
|
||||
|
||||
// Update .csproj nuget versions
|
||||
XmlPoke("./source/Square.Picasso/Square.Picasso.csproj", "/Project/PropertyGroup/PackageVersion", NUGET_VERSION);
|
||||
});
|
||||
|
||||
Task("nuget")
|
||||
.IsDependentOn("externals")
|
||||
.Does(() =>
|
||||
{
|
||||
MSBuild ("./source/Square.Picasso.sln", c => {
|
||||
c.Configuration = "Release";
|
||||
c.Restore = true;
|
||||
c.MaxCpuCount = 0;
|
||||
c.Targets.Clear();
|
||||
c.Targets.Add("Pack");
|
||||
c.Properties.Add("PackageOutputPath", new [] { MakeAbsolute(new FilePath("./output")).FullPath });
|
||||
c.Properties.Add("PackageRequireLicenseAcceptance", new [] { "true" });
|
||||
c.Properties.Add("DesignTimeBuild", new [] { "false" });
|
||||
});
|
||||
});
|
||||
|
||||
Task("samples")
|
||||
.IsDependentOn("nuget")
|
||||
.Does(() =>
|
||||
{
|
||||
MSBuild ("./samples/PicassoSample.sln", c => {
|
||||
c.Configuration = "Release";
|
||||
c.Restore = true;
|
||||
c.MaxCpuCount = 0;
|
||||
c.Properties.Add("DesignTimeBuild", new [] { "false" });
|
||||
});
|
||||
});
|
||||
|
||||
Task("ci")
|
||||
.IsDependentOn("externals")
|
||||
.IsDependentOn("nuget")
|
||||
.IsDependentOn("samples");
|
||||
|
||||
Task ("clean")
|
||||
.Does (() =>
|
||||
{
|
||||
if (DirectoryExists ("./externals/"))
|
||||
DeleteDirectory ("./externals", new DeleteDirectorySettings {
|
||||
Recursive = true,
|
||||
Force = true
|
||||
});
|
||||
});
|
||||
|
||||
RunTarget (TARGET);
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"Registrations": [
|
||||
{
|
||||
"Component": {
|
||||
"Type": "Maven",
|
||||
"Maven": {
|
||||
"ArtifactId": "picasso",
|
||||
"GroupId": "com.squareup.picasso",
|
||||
"Version": "2.71828",
|
||||
"NuGetId": "Square.Picasso"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"Version": 1
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30113.216
|
||||
MinimumVisualStudioVersion = 15.0.26124.0
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Square.Picasso", "..\source\Square.Picasso\Square.Picasso.csproj", "{1D016F0F-7FA0-4784-9735-3EDA73D48265}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PicassoSample", "PicassoSample\PicassoSample.csproj", "{44383013-1CBC-48AC-982B-B73ACED887C3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1D016F0F-7FA0-4784-9735-3EDA73D48265}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1D016F0F-7FA0-4784-9735-3EDA73D48265}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1D016F0F-7FA0-4784-9735-3EDA73D48265}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1D016F0F-7FA0-4784-9735-3EDA73D48265}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{44383013-1CBC-48AC-982B-B73ACED887C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{44383013-1CBC-48AC-982B-B73ACED887C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{44383013-1CBC-48AC-982B-B73ACED887C3}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{44383013-1CBC-48AC-982B-B73ACED887C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{44383013-1CBC-48AC-982B-B73ACED887C3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{44383013-1CBC-48AC-982B-B73ACED887C3}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {40F5FC21-6696-44DB-8CBA-83EDEBA24737}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,42 @@
|
|||
namespace PicassoSample
|
||||
{
|
||||
public static class Data
|
||||
{
|
||||
public static readonly string[] Urls = new string[] {
|
||||
"http://i.imgur.com/CqmBjo5.jpg",
|
||||
"http://i.imgur.com/zkaAooq.jpg",
|
||||
"http://i.imgur.com/0gqnEaY.jpg",
|
||||
"http://i.imgur.com/9gbQ7YR.jpg",
|
||||
"http://i.imgur.com/aFhEEby.jpg",
|
||||
"http://i.imgur.com/0E2tgV7.jpg",
|
||||
"http://i.imgur.com/P5JLfjk.jpg",
|
||||
"http://i.imgur.com/nz67a4F.jpg",
|
||||
"http://i.imgur.com/dFH34N5.jpg",
|
||||
"http://i.imgur.com/FI49ftb.jpg",
|
||||
"http://i.imgur.com/DvpvklR.jpg",
|
||||
"http://i.imgur.com/DNKnbG8.jpg",
|
||||
"http://i.imgur.com/yAdbrLp.jpg",
|
||||
"http://i.imgur.com/55w5Km7.jpg",
|
||||
"http://i.imgur.com/NIwNTMR.jpg",
|
||||
"http://i.imgur.com/DAl0KB8.jpg",
|
||||
"http://i.imgur.com/xZLIYFV.jpg",
|
||||
"http://i.imgur.com/HvTyeh3.jpg",
|
||||
"http://i.imgur.com/Ig9oHCM.jpg",
|
||||
"http://i.imgur.com/7GUv9qa.jpg",
|
||||
"http://i.imgur.com/i5vXmXp.jpg",
|
||||
"http://i.imgur.com/glyvuXg.jpg",
|
||||
"http://i.imgur.com/u6JF6JZ.jpg",
|
||||
"http://i.imgur.com/ExwR7ap.jpg",
|
||||
"http://i.imgur.com/Q54zMKT.jpg",
|
||||
"http://i.imgur.com/9t6hLbm.jpg",
|
||||
"http://i.imgur.com/F8n3Ic6.jpg",
|
||||
"http://i.imgur.com/P5ZRSvT.jpg",
|
||||
"http://i.imgur.com/jbemFzr.jpg",
|
||||
"http://i.imgur.com/8B7haIK.jpg",
|
||||
"http://i.imgur.com/aSeTYQr.jpg",
|
||||
"http://i.imgur.com/OKvWoTh.jpg",
|
||||
"http://i.imgur.com/zD3gT4Z.jpg",
|
||||
"http://i.imgur.com/z77CaIt.jpg"
|
||||
};
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using Android.Graphics;
|
||||
using Square.Picasso;
|
||||
|
||||
namespace PicassoSample
|
||||
{
|
||||
public class GrayscaleTransformation : Java.Lang.Object, ITransformation
|
||||
{
|
||||
private readonly Picasso picasso;
|
||||
|
||||
public GrayscaleTransformation(Picasso picasso)
|
||||
{
|
||||
this.picasso = picasso;
|
||||
}
|
||||
|
||||
public Bitmap Transform(Bitmap source)
|
||||
{
|
||||
Bitmap result = Bitmap.CreateBitmap(source.Width, source.Height, source.GetConfig());
|
||||
Bitmap noise;
|
||||
try
|
||||
{
|
||||
noise = picasso.Load(Resource.Drawable.noise).Get();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw new Exception("Failed to apply transformation! Missing resource.");
|
||||
}
|
||||
|
||||
BitmapShader shader = new BitmapShader(noise, Shader.TileMode.Repeat, Shader.TileMode.Repeat);
|
||||
|
||||
ColorMatrix colorMatrix = new ColorMatrix();
|
||||
colorMatrix.SetSaturation(0);
|
||||
ColorMatrixColorFilter filter = new ColorMatrixColorFilter(colorMatrix);
|
||||
|
||||
Paint paint = new Paint(PaintFlags.AntiAlias);
|
||||
paint.SetColorFilter(filter);
|
||||
|
||||
Canvas canvas = new Canvas(result);
|
||||
canvas.DrawBitmap(source, 0, 0, paint);
|
||||
|
||||
paint.SetColorFilter(null);
|
||||
paint.SetShader(shader);
|
||||
paint.SetXfermode(new PorterDuffXfermode(PorterDuff.Mode.Multiply));
|
||||
|
||||
canvas.DrawRect(0, 0, canvas.Width, canvas.Height, paint);
|
||||
|
||||
source.Recycle();
|
||||
noise.Recycle();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public string Key
|
||||
{
|
||||
get { return "grayscaleTransformation()"; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,139 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{44383013-1CBC-48AC-982B-B73ACED887C3}</ProjectGuid>
|
||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>PicassoSample</RootNamespace>
|
||||
<AssemblyName>PicassoSample</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AndroidApplication>true</AndroidApplication>
|
||||
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
<TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
<AndroidSupportedAbis>armeabi-v7a;x86;arm64-v8a;x86_64</AndroidSupportedAbis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
|
||||
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
|
||||
<AndroidLinkMode>Full</AndroidLinkMode>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Mono.Android" />
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.3" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\source\Square.Picasso\Square.Picasso.csproj">
|
||||
<Project>{BC45EFFF-5CEE-4C2D-BBE8-542DBE8E7940}</Project>
|
||||
<Name>Square.Picasso</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Data.cs" />
|
||||
<Compile Include="GrayscaleTransformation.cs" />
|
||||
<Compile Include="PicassoSampleActivity.cs" />
|
||||
<Compile Include="PicassoSampleAdapter.cs" />
|
||||
<Compile Include="Resources\Resource.Designer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SampleGalleryActivity.cs" />
|
||||
<Compile Include="SampleGridViewActivity.cs" />
|
||||
<Compile Include="SampleGridViewAdapter.cs" />
|
||||
<Compile Include="SampleListDetailActivity.cs" />
|
||||
<Compile Include="SampleListDetailAdapter.cs" />
|
||||
<Compile Include="SampleWidgetProvider.cs" />
|
||||
<Compile Include="SquaredImageView.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Properties\AndroidManifest.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\button_selector.xml" />
|
||||
<AndroidResource Include="Resources\values\Strings.xml" />
|
||||
<AndroidResource Include="Resources\drawable\error.jpg" />
|
||||
<AndroidResource Include="Resources\drawable\list_selector.xml" />
|
||||
<AndroidResource Include="Resources\drawable\overlay_selector.xml" />
|
||||
<AndroidResource Include="Resources\drawable\placeholder.jpg" />
|
||||
<AndroidResource Include="Resources\drawable-hdpi\button_disabled.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-hdpi\button_disabled_focused.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-hdpi\button_focused.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-hdpi\button_normal.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-hdpi\button_pressed.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-hdpi\contact_picture_placeholder.png" />
|
||||
<AndroidResource Include="Resources\drawable-hdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\drawable-hdpi\list_focused.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-hdpi\list_pressed.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-hdpi\list_selector_disabled.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-mdpi\button_disabled.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-mdpi\button_disabled_focused.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-mdpi\button_focused.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-mdpi\button_normal.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-mdpi\button_pressed.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-mdpi\contact_picture_placeholder.png" />
|
||||
<AndroidResource Include="Resources\drawable-mdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\drawable-mdpi\list_focused.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-mdpi\list_pressed.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-mdpi\list_selector_disabled.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-nodpi\noise.png" />
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\button_disabled.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\button_disabled_focused.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\button_focused.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\button_normal.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\button_pressed.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\contact_picture_placeholder.png" />
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\list_focused.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\list_pressed.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\list_selector_disabled.9.png" />
|
||||
<AndroidResource Include="Resources\drawable-xxhdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\drawable-xxxhdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\layout\notification_view.xml" />
|
||||
<AndroidResource Include="Resources\layout\picasso_sample_activity.xml" />
|
||||
<AndroidResource Include="Resources\layout\picasso_sample_activity_item.xml" />
|
||||
<AndroidResource Include="Resources\layout\sample_gallery_activity.xml" />
|
||||
<AndroidResource Include="Resources\layout\sample_gridview_activity.xml" />
|
||||
<AndroidResource Include="Resources\layout\sample_list_detail_detail.xml" />
|
||||
<AndroidResource Include="Resources\layout\sample_list_detail_item.xml" />
|
||||
<AndroidResource Include="Resources\layout\sample_list_detail_list.xml" />
|
||||
<AndroidResource Include="Resources\layout\sample_widget.xml" />
|
||||
<AndroidResource Include="Resources\values\colors.xml" />
|
||||
<AndroidResource Include="Resources\values\dimens.xml" />
|
||||
<AndroidResource Include="Resources\values\integers.xml" />
|
||||
<AndroidResource Include="Resources\values\styles.xml" />
|
||||
<AndroidResource Include="Resources\values\themes.xml" />
|
||||
<AndroidResource Include="Resources\values-land\dimens.xml" />
|
||||
<AndroidResource Include="Resources\values-w500dp\integers.xml" />
|
||||
<AndroidResource Include="Resources\values-w600dp\dimens.xml" />
|
||||
<AndroidResource Include="Resources\values-w600dp\integers.xml" />
|
||||
<AndroidResource Include="Resources\values-w700dp\integers.xml" />
|
||||
<AndroidResource Include="Resources\xml\sample_widget_info.xml" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.31101.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.Picasso", "..\..\binding\Square.Picasso\Square.Picasso.csproj", "{BC45EFFF-5CEE-4C2D-BBE8-542DBE8E7940}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PicassoSample", "PicassoSample.csproj", "{44383013-1CBC-48AC-982B-B73ACED887C3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{BC45EFFF-5CEE-4C2D-BBE8-542DBE8E7940}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BC45EFFF-5CEE-4C2D-BBE8-542DBE8E7940}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BC45EFFF-5CEE-4C2D-BBE8-542DBE8E7940}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BC45EFFF-5CEE-4C2D-BBE8-542DBE8E7940}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{44383013-1CBC-48AC-982B-B73ACED887C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{44383013-1CBC-48AC-982B-B73ACED887C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{44383013-1CBC-48AC-982B-B73ACED887C3}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{44383013-1CBC-48AC-982B-B73ACED887C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{44383013-1CBC-48AC-982B-B73ACED887C3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{44383013-1CBC-48AC-982B-B73ACED887C3}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,71 @@
|
|||
using Android.OS;
|
||||
using Android.Support.V7.App;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
|
||||
using Square.Picasso;
|
||||
|
||||
namespace PicassoSample
|
||||
{
|
||||
public abstract class PicassoSampleActivity : AppCompatActivity
|
||||
{
|
||||
private ToggleButton showHide;
|
||||
private FrameLayout sampleContent;
|
||||
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
base.OnCreate(savedInstanceState);
|
||||
|
||||
base.SetContentView(Resource.Layout.picasso_sample_activity);
|
||||
sampleContent = FindViewById<FrameLayout>(Resource.Id.sample_content);
|
||||
|
||||
ListView activityList = FindViewById<ListView>(Resource.Id.activity_list);
|
||||
PicassoSampleAdapter adapter = new PicassoSampleAdapter(this);
|
||||
activityList.Adapter = adapter;
|
||||
activityList.ItemClick += (sender, e) =>
|
||||
{
|
||||
adapter[e.Position].Launch(this);
|
||||
};
|
||||
|
||||
showHide = FindViewById<ToggleButton>(Resource.Id.faux_action_bar_control);
|
||||
showHide.CheckedChange += (sender, e) =>
|
||||
{
|
||||
activityList.Visibility = e.IsChecked ? ViewStates.Visible : ViewStates.Gone;
|
||||
};
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
|
||||
Picasso.Get().CancelTag(this);
|
||||
}
|
||||
|
||||
public override void OnBackPressed()
|
||||
{
|
||||
if (showHide.Checked)
|
||||
{
|
||||
showHide.Checked = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
base.OnBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetContentView(int layoutResID)
|
||||
{
|
||||
LayoutInflater.Inflate(layoutResID, sampleContent);
|
||||
}
|
||||
|
||||
public override void SetContentView(View view)
|
||||
{
|
||||
sampleContent.AddView(view);
|
||||
}
|
||||
|
||||
public override void SetContentView(View view, ViewGroup.LayoutParams @params)
|
||||
{
|
||||
sampleContent.AddView(view, @params);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,124 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.OS;
|
||||
using Android.Support.V4.App;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
|
||||
using Square.Picasso;
|
||||
|
||||
namespace PicassoSample
|
||||
{
|
||||
public class PicassoSampleAdapter : BaseAdapter<PicassoSampleAdapter.Sample>
|
||||
{
|
||||
private const int NotificationId = 666;
|
||||
|
||||
private readonly LayoutInflater inflater;
|
||||
|
||||
public PicassoSampleAdapter(Context context)
|
||||
{
|
||||
inflater = LayoutInflater.From(context);
|
||||
}
|
||||
|
||||
public override int Count
|
||||
{
|
||||
get { return Sample.Values.Length; }
|
||||
}
|
||||
|
||||
public override Sample this[int position]
|
||||
{
|
||||
get { return Sample.Values[position]; }
|
||||
}
|
||||
|
||||
public override long GetItemId(int position)
|
||||
{
|
||||
return position;
|
||||
}
|
||||
|
||||
public override View GetView(int position, View convertView, ViewGroup parent)
|
||||
{
|
||||
TextView view = (TextView)convertView;
|
||||
if (view == null)
|
||||
{
|
||||
view = (TextView)inflater.Inflate(Resource.Layout.picasso_sample_activity_item, parent, false);
|
||||
}
|
||||
|
||||
view.Text = this[position].Name;
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
public class Sample
|
||||
{
|
||||
static Sample()
|
||||
{
|
||||
Values = new[]
|
||||
{
|
||||
new Sample("Image Grid View", typeof(SampleGridViewActivity)),
|
||||
new Sample("Load from Gallery", typeof(SampleGalleryActivity)),
|
||||
new Sample("List / Detail View", typeof(SampleListDetailActivity)),
|
||||
new Sample("Sample Notification", activity =>
|
||||
{
|
||||
RemoteViews remoteViews = new RemoteViews(activity.PackageName, Resource.Layout.notification_view);
|
||||
Intent intent = new Intent(activity, typeof(SampleGridViewActivity));
|
||||
Notification notification = new NotificationCompat.Builder(activity)
|
||||
.SetSmallIcon(Resource.Drawable.icon)
|
||||
.SetContentIntent(PendingIntent.GetActivity(activity, -1, intent, 0))
|
||||
.SetContent(remoteViews)
|
||||
.Build();
|
||||
|
||||
// Bug in NotificationCompat that does not set the content.
|
||||
if ((int)Build.VERSION.SdkInt <= (int)BuildVersionCodes.GingerbreadMr1)
|
||||
{
|
||||
notification.ContentView = remoteViews;
|
||||
}
|
||||
|
||||
NotificationManager notificationManager = NotificationManager.FromContext(activity);
|
||||
notificationManager.Notify(NotificationId, notification);
|
||||
|
||||
// Now load an image for this notification.
|
||||
Picasso.Get()
|
||||
.Load(Data.Urls[(new Random()).Next(Data.Urls.Length)])
|
||||
.ResizeDimen(
|
||||
Resource.Dimension.notification_icon_width_height,
|
||||
Resource.Dimension.notification_icon_width_height)
|
||||
.Into(remoteViews, Resource.Id.photo, NotificationId, notification);
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
public static readonly Sample[] Values;
|
||||
|
||||
private readonly Type activityClass;
|
||||
private readonly Action<Activity> onLaunch;
|
||||
|
||||
private Sample(string name, Type activityClass)
|
||||
{
|
||||
this.Name = name;
|
||||
this.activityClass = activityClass;
|
||||
}
|
||||
|
||||
private Sample(string name, Action<Activity> onLaunch)
|
||||
{
|
||||
this.Name = name;
|
||||
this.onLaunch = onLaunch;
|
||||
}
|
||||
public string Name { get; private set; }
|
||||
|
||||
public void Launch(Activity activity)
|
||||
{
|
||||
if (onLaunch == null)
|
||||
{
|
||||
activity.StartActivity(new Intent(activity, activityClass));
|
||||
activity.Finish();
|
||||
}
|
||||
else
|
||||
{
|
||||
onLaunch(activity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.yourcompany.picassosample" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
|
||||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="29" />
|
||||
<application android:label="@string/app_name" android:icon="@drawable/icon" android:theme="@style/Theme.PicassoSample"></application>
|
||||
</manifest>
|
|
@ -0,0 +1,39 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using Android.App;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("PicassoSample")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("PicassoSample")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
// This is required for Picasso to work
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
|
||||
|
||||
// The following permissions are OPTIONAL
|
||||
// Used to adjust the work load depending on the type of network the device is using
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.AccessNetworkState)]
|
||||
// Used to load images from the gallery content provider
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.ReadExternalStorage)]
|
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-hdpi/button_disabled.9.png
Normal file
После Ширина: | Высота: | Размер: 393 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-hdpi/button_disabled_focused.9.png
Normal file
После Ширина: | Высота: | Размер: 294 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-hdpi/button_focused.9.png
Normal file
После Ширина: | Высота: | Размер: 326 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-hdpi/button_normal.9.png
Normal file
После Ширина: | Высота: | Размер: 385 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-hdpi/button_pressed.9.png
Normal file
После Ширина: | Высота: | Размер: 539 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-hdpi/contact_picture_placeholder.png
Normal file
После Ширина: | Высота: | Размер: 944 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-hdpi/icon.png
Normal file
После Ширина: | Высота: | Размер: 6.4 KiB |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-hdpi/list_focused.9.png
Normal file
После Ширина: | Высота: | Размер: 139 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-hdpi/list_pressed.9.png
Normal file
После Ширина: | Высота: | Размер: 115 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-hdpi/list_selector_disabled.9.png
Normal file
После Ширина: | Высота: | Размер: 189 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-mdpi/button_disabled.9.png
Normal file
После Ширина: | Высота: | Размер: 289 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-mdpi/button_disabled_focused.9.png
Normal file
После Ширина: | Высота: | Размер: 202 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-mdpi/button_focused.9.png
Normal file
После Ширина: | Высота: | Размер: 229 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-mdpi/button_normal.9.png
Normal file
После Ширина: | Высота: | Размер: 257 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-mdpi/button_pressed.9.png
Normal file
После Ширина: | Высота: | Размер: 391 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-mdpi/contact_picture_placeholder.png
Normal file
После Ширина: | Высота: | Размер: 686 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-mdpi/icon.png
Normal file
После Ширина: | Высота: | Размер: 3.3 KiB |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-mdpi/list_focused.9.png
Normal file
После Ширина: | Высота: | Размер: 117 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-mdpi/list_pressed.9.png
Normal file
После Ширина: | Высота: | Размер: 110 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-mdpi/list_selector_disabled.9.png
Normal file
После Ширина: | Высота: | Размер: 171 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-nodpi/noise.png
Normal file
После Ширина: | Высота: | Размер: 6.6 KiB |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-xhdpi/button_disabled.9.png
Normal file
После Ширина: | Высота: | Размер: 499 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-xhdpi/button_disabled_focused.9.png
Normal file
После Ширина: | Высота: | Размер: 353 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-xhdpi/button_focused.9.png
Normal file
После Ширина: | Высота: | Размер: 398 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-xhdpi/button_normal.9.png
Normal file
После Ширина: | Высота: | Размер: 491 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-xhdpi/button_pressed.9.png
Normal file
После Ширина: | Высота: | Размер: 720 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-xhdpi/contact_picture_placeholder.png
Normal file
После Ширина: | Высота: | Размер: 1.3 KiB |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-xhdpi/icon.png
Normal file
После Ширина: | Высота: | Размер: 10 KiB |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-xhdpi/list_focused.9.png
Normal file
После Ширина: | Высота: | Размер: 154 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-xhdpi/list_pressed.9.png
Normal file
После Ширина: | Высота: | Размер: 121 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-xhdpi/list_selector_disabled.9.png
Normal file
После Ширина: | Высота: | Размер: 188 B |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-xxhdpi/icon.png
Normal file
После Ширина: | Высота: | Размер: 22 KiB |
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable-xxxhdpi/icon.png
Normal file
После Ширина: | Высота: | Размер: 37 KiB |
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_window_focused="false" android:state_enabled="true"
|
||||
android:drawable="@drawable/button_normal"/>
|
||||
<item android:state_window_focused="false" android:state_enabled="false"
|
||||
android:drawable="@drawable/button_disabled"/>
|
||||
<item android:state_pressed="true"
|
||||
android:drawable="@drawable/button_pressed"/>
|
||||
<item android:state_focused="true" android:state_enabled="true"
|
||||
android:drawable="@drawable/button_focused"/>
|
||||
<item android:state_enabled="true"
|
||||
android:drawable="@drawable/button_normal"/>
|
||||
<item android:state_focused="true"
|
||||
android:drawable="@drawable/button_disabled_focused"/>
|
||||
<item
|
||||
android:drawable="@drawable/button_disabled"/>
|
||||
</selector>
|
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable/error.jpg
Normal file
После Ширина: | Высота: | Размер: 32 KiB |
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_window_focused="false" android:drawable="@android:color/transparent"/>
|
||||
|
||||
<!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
|
||||
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true"
|
||||
android:drawable="@drawable/list_selector_disabled"/>
|
||||
<item android:state_focused="true" android:state_enabled="false"
|
||||
android:drawable="@drawable/list_selector_disabled"/>
|
||||
<item android:state_focused="true" android:state_pressed="true"
|
||||
android:drawable="@drawable/list_pressed"/>
|
||||
<item android:state_focused="false" android:state_pressed="true"
|
||||
android:drawable="@drawable/list_pressed"/>
|
||||
<item android:state_focused="true" android:drawable="@drawable/list_focused"/>
|
||||
</selector>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true" android:drawable="@color/overlay_selector_pressed"/>
|
||||
<item android:drawable="@android:color/transparent"/>
|
||||
</selector>
|
Двоичные данные
Android/SquarePicasso/samples/PicassoSample/Resources/drawable/placeholder.jpg
Normal file
После Ширина: | Высота: | Размер: 5.8 KiB |
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/photo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/sample_notification"
|
||||
/>
|
||||
</LinearLayout>
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
<FrameLayout
|
||||
android:id="@+id/sample_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
<ListView
|
||||
android:id="@+id/activity_list"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="@dimen/faux_action_bar_size"
|
||||
android:listSelector="@drawable/overlay_selector"
|
||||
android:divider="@null"
|
||||
android:visibility="gone"
|
||||
style="@style/Widget.PicassoSample.Overlay"
|
||||
/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/faux_action_bar_size"
|
||||
android:orientation="horizontal"
|
||||
style="@style/Widget.PicassoSample.Overlay">
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/app_name"
|
||||
style="@style/Widget.PicassoSample.ActionBarTitle"
|
||||
/>
|
||||
<ToggleButton
|
||||
android:id="@+id/faux_action_bar_control"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:textOff="@string/more"
|
||||
android:textOn="@string/hide"
|
||||
style="@style/Widget.PicassoSample.ActionBarButton"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
style="@style/Widget.PicassoSample.ListItem"/>
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ViewAnimator
|
||||
android:id="@+id/animator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#ffc0c0c0"
|
||||
android:animateFirstView="false"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
<ProgressBar
|
||||
android:id="@+id/progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
/>
|
||||
</ViewAnimator>
|
||||
|
||||
<Button
|
||||
android:id="@+id/go"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:text="@string/select_picture"
|
||||
/>
|
||||
</FrameLayout>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/grid_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:numColumns="@integer/column_count"
|
||||
android:scrollbarStyle="insideOverlay"
|
||||
android:scrollbars="none"
|
||||
android:listSelector="@null"
|
||||
/>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="@dimen/faux_action_bar_size">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/url"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="center"
|
||||
style="@style/Widget.PicassoSample.DescriptionUrl"
|
||||
/>
|
||||
<PicassoSample.SquaredImageView
|
||||
android:id="@+id/photo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/disk_cache_description"
|
||||
style="@style/Widget.PicassoSample.DescriptionText"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
<ImageView
|
||||
android:id="@+id/photo"
|
||||
android:layout_width="@dimen/list_detail_image_size"
|
||||
android:layout_height="@dimen/list_detail_image_size"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/url"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
/>
|
||||
</LinearLayout>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="@dimen/faux_action_bar_size"
|
||||
android:clipToPadding="false"/>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/sample_widget"
|
||||
/>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="faux_action_bar_size">40dp</dimen>
|
||||
</resources>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<integer name="column_count">3</integer>
|
||||
</resources>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="faux_action_bar_size">56dp</dimen>
|
||||
</resources>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<integer name="column_count">4</integer>
|
||||
</resources>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<integer name="column_count">5</integer>
|
||||
</resources>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="overlay_selector_pressed">#40000000</color>
|
||||
<color name="window_background">#ff202020</color>
|
||||
<color name="list_divider">#ff555555</color>
|
||||
</resources>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="faux_action_bar_size">48dp</dimen>
|
||||
<dimen name="list_detail_image_size">60dp</dimen>
|
||||
<dimen name="widget_min_width">110dp</dimen>
|
||||
<dimen name="widget_min_height">110dp</dimen>
|
||||
<dimen name="notification_icon_width_height">64dp</dimen>
|
||||
</resources>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<integer name="column_count">2</integer>
|
||||
</resources>
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Picasso Samples</string>
|
||||
<string name="hide">HIDE</string>
|
||||
<string name="more">MORE</string>
|
||||
<string name="sample_widget">Picasso Sample Widget</string>
|
||||
<string name="sample_notification">Picasso Sample Notification</string>
|
||||
<string name="select_picture">Select Picture</string>
|
||||
<string name="disk_cache_description">On Ice Cream Sandwich and above, a disk cache is
|
||||
automatically used so that subsequent requests for the same URL do not re-download the
|
||||
image.\n\nTo enable this functionality on pre-ICS use a standalone HTTP client with caching such
|
||||
as OkHttp.
|
||||
</string>
|
||||
</resources>
|
|
@ -0,0 +1,57 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="Widget.PicassoSample.Button" parent="android:Widget.Button">
|
||||
<item name="android:background">@drawable/button_selector</item>
|
||||
<item name="android:minHeight">48dip</item>
|
||||
<item name="android:minWidth">64dip</item>
|
||||
<item name="android:textColor">#000000</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.PicassoSample.Overlay" parent="android:Widget">
|
||||
<item name="android:background">#90000000</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.PicassoSample.ActionBarTitle" parent="android:Widget.TextView">
|
||||
<item name="android:paddingLeft">8dp</item>
|
||||
<item name="android:paddingRight">8dp</item>
|
||||
<!-- Use 'dp' so that the user's font preference doesn't affect the action bar. -->
|
||||
<item name="android:textSize">19dp</item>
|
||||
<item name="android:textColor">#ffffffff</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:singleLine">true</item>
|
||||
<item name="android:ellipsize">end</item>
|
||||
<item name="android:fontFamily">sans-serif-light</item>
|
||||
<item name="android:textStyle">italic</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.PicassoSample.ActionBarButton" parent="android:Widget.Button">
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:paddingLeft">16dp</item>
|
||||
<item name="android:paddingRight">16dp</item>
|
||||
<item name="android:textColor">#ffffffff</item>
|
||||
<!-- Use 'dp' so that the user's font preference doesn't affect the action bar. -->
|
||||
<item name="android:textSize">13dp</item>
|
||||
<item name="android:background">@drawable/overlay_selector</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.PicassoSample.ListView" parent="android:Widget.ListView">
|
||||
<item name="android:listSelector">@drawable/list_selector</item>
|
||||
<item name="android:divider">@color/list_divider</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.PicassoSample.ListItem" parent="android:Widget.TextView">
|
||||
<item name="android:minHeight">50dp</item>
|
||||
<item name="android:padding">12dp</item>
|
||||
<item name="android:gravity">left|center_vertical</item>
|
||||
<item name="android:textSize">16sp</item>
|
||||
<item name="android:textColor">#ffffffff</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.PicassoSample.DescriptionUrl" parent="android:Widget.TextView">
|
||||
<item name="android:textSize">15sp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.PicassoSample.DescriptionText" parent="android:Widget.TextView">
|
||||
<item name="android:textSize">12sp</item>
|
||||
</style>
|
||||
</resources>
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<resources>
|
||||
<style name="Theme.PicassoSample" parent="android:Theme.NoTitleBar">
|
||||
<item name="android:windowBackground">@color/window_background</item>
|
||||
<item name="android:buttonStyle">@style/Widget.PicassoSample.Button</item>
|
||||
<item name="android:listViewStyle">@style/Widget.PicassoSample.ListView</item>
|
||||
<item name="android:textColor">#ffe0e0e0</item>
|
||||
</style>
|
||||
</resources>
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:minWidth="@dimen/widget_min_width"
|
||||
android:minHeight="@dimen/widget_min_height"
|
||||
android:updatePeriodMillis="86400000"
|
||||
android:initialLayout="@layout/sample_widget"
|
||||
android:widgetCategory="home_screen"
|
||||
/>
|
|
@ -0,0 +1,89 @@
|
|||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.OS;
|
||||
using Android.Provider;
|
||||
using Android.Widget;
|
||||
using Square.Picasso;
|
||||
|
||||
namespace PicassoSample
|
||||
{
|
||||
[Activity(Theme = "@style/Theme.AppCompat")]
|
||||
public class SampleGalleryActivity : PicassoSampleActivity
|
||||
{
|
||||
private const int GalleryRequest = 9391;
|
||||
private const string ImageKey = "PicassoSample:image";
|
||||
|
||||
private ImageView imageView;
|
||||
private ViewAnimator animator;
|
||||
private string image;
|
||||
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
base.OnCreate(savedInstanceState);
|
||||
|
||||
SetContentView(Resource.Layout.sample_gallery_activity);
|
||||
|
||||
animator = FindViewById<ViewAnimator>(Resource.Id.animator);
|
||||
imageView = FindViewById<ImageView>(Resource.Id.image);
|
||||
|
||||
FindViewById(Resource.Id.go).Click += delegate
|
||||
{
|
||||
Intent gallery = new Intent(Intent.ActionPick, MediaStore.Images.Media.ExternalContentUri);
|
||||
StartActivityForResult(gallery, GalleryRequest);
|
||||
};
|
||||
|
||||
if (savedInstanceState != null)
|
||||
{
|
||||
image = savedInstanceState.GetString(ImageKey);
|
||||
if (image != null)
|
||||
{
|
||||
LoadImage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnPause()
|
||||
{
|
||||
base.OnPause();
|
||||
|
||||
if (IsFinishing)
|
||||
{
|
||||
// Always cancel the request here, this is safe to call even if the image has been loaded.
|
||||
// This ensures that the anonymous callback we have does not prevent the activity from
|
||||
// being garbage collected. It also prevents our callback from getting invoked even after the
|
||||
// activity has finished.
|
||||
Picasso.Get().CancelRequest(imageView);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnSaveInstanceState(Bundle outState)
|
||||
{
|
||||
base.OnSaveInstanceState(outState);
|
||||
|
||||
outState.PutString(ImageKey, image);
|
||||
}
|
||||
|
||||
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
|
||||
{
|
||||
if (requestCode == GalleryRequest && resultCode == Result.Ok && data != null)
|
||||
{
|
||||
image = data.Data.ToString();
|
||||
LoadImage();
|
||||
}
|
||||
else
|
||||
{
|
||||
base.OnActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadImage()
|
||||
{
|
||||
// Index 1 is the progress bar. Show it while we're loading the image.
|
||||
animator.DisplayedChild = 1;
|
||||
|
||||
Picasso.Get()
|
||||
.Load(image)
|
||||
.Into(imageView, delegate { animator.DisplayedChild = 0; }, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
using Android.App;
|
||||
using Android.OS;
|
||||
using Android.Widget;
|
||||
|
||||
using Square.Picasso;
|
||||
|
||||
namespace PicassoSample
|
||||
{
|
||||
[Activity(Label = "@string/app_name", MainLauncher = true, Theme = "@style/Theme.AppCompat")]
|
||||
public class SampleGridViewActivity : PicassoSampleActivity
|
||||
{
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
base.OnCreate(savedInstanceState);
|
||||
|
||||
SetContentView(Resource.Layout.sample_gridview_activity);
|
||||
|
||||
GridView gv = FindViewById<GridView>(Resource.Id.grid_view);
|
||||
gv.Adapter = new SampleGridViewAdapter(this);
|
||||
gv.ScrollStateChanged += (sender, e) =>
|
||||
{
|
||||
Picasso picasso = Picasso.Get();
|
||||
if (e.ScrollState == ScrollState.Idle || e.ScrollState == ScrollState.TouchScroll)
|
||||
{
|
||||
picasso.ResumeTag(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
picasso.PauseTag(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Android.Content;
|
||||
using Android.Widget;
|
||||
|
||||
using Square.Picasso;
|
||||
using Android.Views;
|
||||
|
||||
namespace PicassoSample
|
||||
{
|
||||
public class SampleGridViewAdapter : BaseAdapter<string>
|
||||
{
|
||||
private readonly Context context;
|
||||
private readonly List<string> urls = new List<string>();
|
||||
|
||||
public SampleGridViewAdapter(Context context)
|
||||
{
|
||||
this.context = context;
|
||||
|
||||
// Ensure we get a different ordering of images on each run.
|
||||
var copy = Data.Urls.ToList();
|
||||
Shuffle(copy);
|
||||
|
||||
// Triple up the list.
|
||||
urls.AddRange(copy);
|
||||
urls.AddRange(copy);
|
||||
urls.AddRange(copy);
|
||||
}
|
||||
|
||||
public override View GetView(int position, View convertView, ViewGroup parent)
|
||||
{
|
||||
SquaredImageView view = convertView as SquaredImageView;
|
||||
if (view == null)
|
||||
{
|
||||
view = new SquaredImageView(context);
|
||||
view.SetScaleType(ImageView.ScaleType.CenterCrop);
|
||||
}
|
||||
|
||||
// Get the image URL for the current position.
|
||||
string url = this[position];
|
||||
|
||||
// Trigger the download of the URL asynchronously into the image view.
|
||||
Picasso.Get()
|
||||
.Load(url)
|
||||
.Placeholder(Resource.Drawable.placeholder)
|
||||
.Error(Resource.Drawable.error)
|
||||
.Fit()
|
||||
.Tag(context)
|
||||
.Into(view);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
public override int Count
|
||||
{
|
||||
get { return urls.Count; }
|
||||
}
|
||||
|
||||
public override string this[int position]
|
||||
{
|
||||
get { return urls[position]; }
|
||||
}
|
||||
|
||||
public override long GetItemId(int position)
|
||||
{
|
||||
return position;
|
||||
}
|
||||
|
||||
private static void Shuffle<T>(IList<T> list)
|
||||
{
|
||||
Random rng = new Random();
|
||||
int n = list.Count;
|
||||
while (n > 1)
|
||||
{
|
||||
n--;
|
||||
int k = rng.Next(n + 1);
|
||||
T value = list[k];
|
||||
list[k] = list[n];
|
||||
list[n] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
using Android.App;
|
||||
using Android.OS;
|
||||
using Android.Support.V4.App;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
|
||||
using Fragment = Android.Support.V4.App.Fragment;
|
||||
|
||||
using Square.Picasso;
|
||||
|
||||
namespace PicassoSample
|
||||
{
|
||||
[Activity(Theme = "@style/Theme.AppCompat")]
|
||||
public class SampleListDetailActivity : PicassoSampleActivity
|
||||
{
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
base.OnCreate(savedInstanceState);
|
||||
|
||||
if (savedInstanceState == null)
|
||||
{
|
||||
SupportFragmentManager.BeginTransaction()
|
||||
.Add(Resource.Id.sample_content, ListFragment.NewInstance())
|
||||
.Commit();
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void ShowDetails(string url)
|
||||
{
|
||||
SupportFragmentManager.BeginTransaction()
|
||||
.Replace(Resource.Id.sample_content, DetailFragment.NewInstance(url))
|
||||
.AddToBackStack(null)
|
||||
.Commit();
|
||||
}
|
||||
|
||||
public class ListFragment : Fragment
|
||||
{
|
||||
public static ListFragment NewInstance()
|
||||
{
|
||||
return new ListFragment();
|
||||
}
|
||||
|
||||
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
||||
{
|
||||
SampleListDetailActivity activity = (SampleListDetailActivity)Activity;
|
||||
SampleListDetailAdapter adapter = new SampleListDetailAdapter(activity);
|
||||
|
||||
ListView listView = (ListView)LayoutInflater.From(activity).Inflate(Resource.Layout.sample_list_detail_list, container, false);
|
||||
listView.Adapter = adapter;
|
||||
listView.ScrollStateChanged += (sender, e) =>
|
||||
{
|
||||
Picasso picasso = Picasso.Get();
|
||||
if (e.ScrollState == ScrollState.Idle || e.ScrollState == ScrollState.TouchScroll)
|
||||
{
|
||||
picasso.ResumeTag(activity);
|
||||
}
|
||||
else
|
||||
{
|
||||
picasso.PauseTag(activity);
|
||||
}
|
||||
};
|
||||
listView.ItemClick += (sender, e) =>
|
||||
{
|
||||
string url = adapter[e.Position];
|
||||
activity.ShowDetails(url);
|
||||
};
|
||||
return listView;
|
||||
}
|
||||
}
|
||||
|
||||
public class DetailFragment : Fragment
|
||||
{
|
||||
private const string UrlKey = "picasso:url";
|
||||
|
||||
public static DetailFragment NewInstance(string url)
|
||||
{
|
||||
Bundle arguments = new Bundle();
|
||||
arguments.PutString(UrlKey, url);
|
||||
|
||||
DetailFragment fragment = new DetailFragment();
|
||||
fragment.Arguments = arguments;
|
||||
return fragment;
|
||||
}
|
||||
|
||||
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
||||
{
|
||||
Activity activity = Activity;
|
||||
|
||||
View view = LayoutInflater.From(activity).Inflate(Resource.Layout.sample_list_detail_detail, container, false);
|
||||
|
||||
TextView urlView = view.FindViewById<TextView>(Resource.Id.url);
|
||||
ImageView imageView = view.FindViewById<ImageView>(Resource.Id.photo);
|
||||
|
||||
string url = Arguments.GetString(UrlKey);
|
||||
|
||||
urlView.Text = url;
|
||||
Picasso.Get()
|
||||
.Load(url)
|
||||
.Fit()
|
||||
.Tag(activity)
|
||||
.Into(imageView);
|
||||
|
||||
return view;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
using System.Collections.Generic;
|
||||
using Android.Widget;
|
||||
using Android.Content;
|
||||
using Android.Views;
|
||||
|
||||
using Square.Picasso;
|
||||
|
||||
namespace PicassoSample
|
||||
{
|
||||
public class SampleListDetailAdapter : BaseAdapter<string>
|
||||
{
|
||||
private readonly Context context;
|
||||
private readonly List<string> urls = new List<string>();
|
||||
|
||||
public SampleListDetailAdapter(Context context)
|
||||
{
|
||||
this.context = context;
|
||||
|
||||
urls.AddRange(Data.Urls);
|
||||
}
|
||||
|
||||
public override View GetView(int position, View view, ViewGroup parent)
|
||||
{
|
||||
ViewHolder holder;
|
||||
if (view == null)
|
||||
{
|
||||
view = LayoutInflater.From(context).Inflate(Resource.Layout.sample_list_detail_item, parent, false);
|
||||
holder = new ViewHolder
|
||||
{
|
||||
image = view.FindViewById<ImageView>(Resource.Id.photo),
|
||||
text = view.FindViewById<TextView>(Resource.Id.url)
|
||||
};
|
||||
view.Tag = holder;
|
||||
}
|
||||
else
|
||||
{
|
||||
holder = (ViewHolder)view.Tag;
|
||||
}
|
||||
|
||||
// Get the image URL for the current position.
|
||||
string url = this[position];
|
||||
|
||||
holder.text.Text = url;
|
||||
|
||||
// Trigger the download of the URL asynchronously into the image view.
|
||||
Picasso.Get()
|
||||
.Load(url)
|
||||
.Placeholder(Resource.Drawable.placeholder)
|
||||
.Error(Resource.Drawable.error)
|
||||
.ResizeDimen(Resource.Dimension.list_detail_image_size, Resource.Dimension.list_detail_image_size)
|
||||
.CenterInside()
|
||||
.Tag(context)
|
||||
.Into(holder.image);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
public override int Count
|
||||
{
|
||||
get { return urls.Count; }
|
||||
}
|
||||
|
||||
public override string this[int position]
|
||||
{
|
||||
get { return urls[position]; }
|
||||
}
|
||||
|
||||
public override long GetItemId(int position)
|
||||
{
|
||||
return position;
|
||||
}
|
||||
|
||||
private class ViewHolder : Java.Lang.Object
|
||||
{
|
||||
internal ImageView image;
|
||||
internal TextView text;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using Android.Appwidget;
|
||||
using Android.Content;
|
||||
using Android.Widget;
|
||||
using Square.Picasso;
|
||||
using Android.App;
|
||||
|
||||
namespace PicassoSample
|
||||
{
|
||||
[BroadcastReceiver]
|
||||
[IntentFilter(new[] { "android.appwidget.action.APPWIDGET_UPDATE" })]
|
||||
[MetaData("android.appwidget.provider", Resource = "@xml/sample_widget_info")]
|
||||
public class SampleWidgetProvider : AppWidgetProvider
|
||||
{
|
||||
public override void OnUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds)
|
||||
{
|
||||
RemoteViews updateViews = new RemoteViews(context.PackageName, Resource.Layout.sample_widget);
|
||||
|
||||
// Load image for all appWidgetIds.
|
||||
Picasso picasso = Picasso.Get();
|
||||
picasso.Load(Data.Urls[(new Random()).Next(Data.Urls.Length)])
|
||||
.Placeholder(Resource.Drawable.placeholder)
|
||||
.Error(Resource.Drawable.error)
|
||||
.Transform(new GrayscaleTransformation(picasso))
|
||||
.Into(updateViews, Resource.Id.image, appWidgetIds);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
using Android.Content;
|
||||
using Android.Util;
|
||||
using Android.Widget;
|
||||
|
||||
namespace PicassoSample
|
||||
{
|
||||
/// <summary>
|
||||
/// An image view which always remains square with respect to its width.
|
||||
/// </summary>
|
||||
public class SquaredImageView : ImageView
|
||||
{
|
||||
public SquaredImageView(Context context)
|
||||
: base(context)
|
||||
{
|
||||
}
|
||||
|
||||
public SquaredImageView(Context context, IAttributeSet attrs)
|
||||
: base(context, attrs)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
|
||||
{
|
||||
base.OnMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
|
||||
SetMeasuredDimension(MeasuredWidth, MeasuredWidth);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26124.0
|
||||
MinimumVisualStudioVersion = 15.0.26124.0
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.Picasso", "Square.Picasso\Square.Picasso.csproj", "{1D016F0F-7FA0-4784-9735-3EDA73D48265}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1D016F0F-7FA0-4784-9735-3EDA73D48265}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1D016F0F-7FA0-4784-9735-3EDA73D48265}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1D016F0F-7FA0-4784-9735-3EDA73D48265}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1D016F0F-7FA0-4784-9735-3EDA73D48265}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,11 @@
|
|||
using Android.Content;
|
||||
using System;
|
||||
|
||||
namespace Square.Picasso
|
||||
{
|
||||
partial class Picasso
|
||||
{
|
||||
[Obsolete("Use Get() instead.")]
|
||||
public static Picasso With(Context context) => Get();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
using Android.Widget;
|
||||
using System;
|
||||
|
||||
namespace Square.Picasso
|
||||
{
|
||||
partial class RequestCreator
|
||||
{
|
||||
public virtual void Into(ImageView imageView, Action onSuccess, Action<Java.Lang.Exception> onError)
|
||||
{
|
||||
Into(imageView, new ActionCallback(onSuccess, onError));
|
||||
}
|
||||
|
||||
private class ActionCallback : Java.Lang.Object, ICallback
|
||||
{
|
||||
private readonly Action onSuccess;
|
||||
private readonly Action<Java.Lang.Exception> onError;
|
||||
|
||||
public ActionCallback(Action onSuccess, Action<Java.Lang.Exception> onError)
|
||||
{
|
||||
this.onSuccess = onSuccess;
|
||||
this.onError = onError;
|
||||
}
|
||||
|
||||
public void OnSuccess() =>
|
||||
onSuccess?.Invoke();
|
||||
|
||||
public void OnError(Java.Lang.Exception exc) =>
|
||||
onError?.Invoke(exc);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
<Project Sdk="MSBuild.Sdk.Extras/2.0.54">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>monoandroid9.0</TargetFrameworks>
|
||||
<IsBindingProject>true</IsBindingProject>
|
||||
<AssemblyName>Square.Picasso</AssemblyName>
|
||||
<RootNamespace>Square.Picasso</RootNamespace>
|
||||
<AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk>
|
||||
<AndroidUseIntermediateDesignerFile>True</AndroidUseIntermediateDesignerFile>
|
||||
<AndroidClassParser>class-parse</AndroidClassParser>
|
||||
<AndroidCodegenTarget>XAJavaInterop1</AndroidCodegenTarget>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<PackageId>Square.Picasso</PackageId>
|
||||
<Title>Picasso bindings for Xamarin.Android</Title>
|
||||
<Summary>A powerful image downloading and caching library for Android.</Summary>
|
||||
<Description>A powerful image downloading and caching library for Android.</Description>
|
||||
<Authors>Microsoft</Authors>
|
||||
<Owners>Microsoft</Owners>
|
||||
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
|
||||
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
|
||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||
<PackageTags>picasso images xamarin android monodroid</PackageTags>
|
||||
<PackageProjectUrl>https://go.microsoft.com/fwlink/?linkid=2130312</PackageProjectUrl>
|
||||
<PackageVersion>2.71828.0</PackageVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Mono.Android" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Transforms\*.xml" />
|
||||
<TransformFile Include="Transforms\*.xml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<LibraryProjectZip Include="..\..\externals\picasso.aar" Link="Jars\picasso.aar" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="..\..\License.md" Pack="true" PackagePath="LICENSE.md" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Square.OkHttp3" Version="3.11.0" />
|
||||
<PackageReference Include="Xamarin.Android.Support.Annotations" Version="28.0.0.3" />
|
||||
<PackageReference Include="Xamarin.Android.Support.Exif" Version="28.0.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,14 @@
|
|||
<enum-field-mappings>
|
||||
<!--
|
||||
This example converts the constants Fragment_id, Fragment_name,
|
||||
and Fragment_tag from android.support.v4.app.FragmentActivity.FragmentTag
|
||||
to an enum called Android.Support.V4.App.FragmentTagType with values
|
||||
Id, Name, and Tag.
|
||||
|
||||
<mapping jni-class="android/support/v4/app/FragmentActivity$FragmentTag" clr-enum-type="Android.Support.V4.App.FragmentTagType">
|
||||
<field jni-name="Fragment_name" clr-name="Name" value="0" />
|
||||
<field jni-name="Fragment_id" clr-name="Id" value="1" />
|
||||
<field jni-name="Fragment_tag" clr-name="Tag" value="2" />
|
||||
</mapping>
|
||||
-->
|
||||
</enum-field-mappings>
|
|
@ -0,0 +1,13 @@
|
|||
<enum-method-mappings>
|
||||
<!--
|
||||
This example changes the Java method:
|
||||
android.support.v4.app.Fragment.SavedState.writeToParcel (int flags)
|
||||
to be:
|
||||
android.support.v4.app.Fragment.SavedState.writeToParcel (Android.OS.ParcelableWriteFlags flags)
|
||||
when bound in C#.
|
||||
|
||||
<mapping jni-class="android/support/v4/app/Fragment.SavedState">
|
||||
<method jni-name="writeToParcel" parameter="flags" clr-enum-type="Android.OS.ParcelableWriteFlags" />
|
||||
</mapping>
|
||||
-->
|
||||
</enum-method-mappings>
|
|
@ -0,0 +1,44 @@
|
|||
<metadata>
|
||||
<!--
|
||||
This sample removes the class: android.support.v4.content.AsyncTaskLoader.LoadTask:
|
||||
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='AsyncTaskLoader.LoadTask']" />
|
||||
|
||||
This sample removes the method: android.support.v4.content.CursorLoader.loadInBackground:
|
||||
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='CursorLoader']/method[@name='loadInBackground']" />
|
||||
-->
|
||||
|
||||
<attr path="/api/package[@name='com.squareup.picasso']" name="managedName">Square.Picasso</attr>
|
||||
|
||||
<!-- deprecated -->
|
||||
<remove-node path="/api/package/class[@visibility='']" />
|
||||
<remove-node path="/api/package/class/method[@deprecated='deprecated']" />
|
||||
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/interface[@name='Cache']/method[@name='clearKeyUri']/parameter[1]" name="managedName">key</attr>
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/interface[@name='Cache']/method[@name='get']/parameter[1]" name="managedName">keyPrefix</attr>
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/interface[@name='Cache']/method[@name='set']/parameter[1]" name="managedName">key</attr>
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/interface[@name='Cache']/method[@name='set']/parameter[2]" name="managedName">bitmap</attr>
|
||||
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/interface[@name='Downloader']/method[@name='load']/parameter[1]" name="managedName">uri</attr>
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/interface[@name='Downloader']/method[@name='load']/parameter[2]" name="managedName">networkPolicy</attr>
|
||||
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/interface[@name='Target']/method[@name='onBitmapFailed']/parameter[1]" name="managedName">errorDrawable</attr>
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/interface[@name='Target']/method[@name='onBitmapLoaded']/parameter[1]" name="managedName">bitmap</attr>
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/interface[@name='Target']/method[@name='onBitmapLoaded']/parameter[2]" name="managedName">loadedFrom</attr>
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/interface[@name='Target']/method[@name='onPrepareLoad']/parameter[1]" name="managedName">placeHolderDrawable</attr>
|
||||
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/interface[@name='Transformation']/method[@name='transform']/parameter[1]" name="managedName">source</attr>
|
||||
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/interface[@name='Picasso.RequestTransformer']/method[@name='transformRequest']/parameter[1]" name="managedName">request</attr>
|
||||
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/class[@name='RequestHandler']/method[@name='canHandleRequest']/parameter[1]" name="managedName">data</attr>
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/class[@name='RequestHandler']/method[@name='load']/parameter[1]" name="managedName">uri</attr>
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/class[@name='RequestHandler']/method[@name='load']/parameter[2]" name="managedName">networkPolicy</attr>
|
||||
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/interface[@name='Picasso.Listener']/method[@name='onImageLoadFailed']/parameter[1]" name="managedName">picasso</attr>
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/interface[@name='Picasso.Listener']/method[@name='onImageLoadFailed']/parameter[2]" name="managedName">uri</attr>
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/interface[@name='Picasso.Listener']/method[@name='onImageLoadFailed']/parameter[3]" name="managedName">exception</attr>
|
||||
|
||||
<!-- property names -->
|
||||
<attr path="/api/package[@name='com.squareup.picasso']/interface[@name='Transformation']/method[@name='key']" name="managedName">GetKey</attr>
|
||||
|
||||
</metadata>
|
|
@ -34,6 +34,7 @@ jobs:
|
|||
- Masonry
|
||||
- GoogleGson
|
||||
- AndroidEasingFunctions
|
||||
- Square
|
||||
tools:
|
||||
- 'Xamarin.AndroidBinderator.Tool': '0.4.2'
|
||||
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
|
||||
|
|
|
@ -245,6 +245,10 @@
|
|||
BuildScript: ./Android/GoogleBillingClient/build.cake
|
||||
TriggerPaths: [ Android/GoogleBillingClient ]
|
||||
MacBuildTargets: [ libs, nuget]
|
||||
- Name: SquarePicasso
|
||||
BuildScript: ./Android/SquarePicasso/build.cake
|
||||
TriggerPaths: [ Android/SquarePicasso ]
|
||||
MacBuildTargets: [ ci ]
|
||||
|
||||
# will be XPlat in the future
|
||||
- Name: TensorFlow.Lite
|
||||
|
|