[Android] fix removed NativeSizeChanged (#4395)

This commit is contained in:
Shane Neuville 2018-11-13 12:22:49 -07:00 коммит произвёл GitHub
Родитель 26d8b1fc08
Коммит 41e5358169
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 56 добавлений и 36 удалений

Просмотреть файл

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
@ -8,16 +9,16 @@ namespace Xamarin.Forms.Controls
{
public class ImageGallery : ContentPage
{
public ImageGallery ()
public ImageGallery()
{
Padding = new Thickness (20);
Padding = new Thickness(20);
var normal = new Image { Source = ImageSource.FromFile ("cover1.jpg") };
var disabled = new Image { Source = ImageSource.FromFile ("cover1.jpg") };
var rotate = new Image { Source = ImageSource.FromFile ("cover1.jpg") };
var transparent = new Image { Source = ImageSource.FromFile ("cover1.jpg") };
var embedded = new Image { Source = ImageSource.FromResource ("Xamarin.Forms.Controls.ControlGalleryPages.crimson.jpg", typeof (ImageGallery)) };
var normal = new Image { Source = ImageSource.FromFile("cover1.jpg") };
var disabled = new Image { Source = ImageSource.FromFile("cover1.jpg") };
var rotate = new Image { Source = ImageSource.FromFile("cover1.jpg") };
var transparent = new Image { Source = ImageSource.FromFile("cover1.jpg") };
var embedded = new Image { Source = ImageSource.FromResource("Xamarin.Forms.Controls.GalleryPages.crimson.jpg", typeof(ImageGallery).GetTypeInfo().Assembly) };
// let the stack shrink the images
normal.MinimumHeightRequest = normal.MinimumHeightRequest = 10;
@ -27,45 +28,63 @@ namespace Xamarin.Forms.Controls
embedded.MinimumHeightRequest = 10;
disabled.IsEnabled = false;
rotate.GestureRecognizers.Add (new TapGestureRecognizer { Command = new Command (o => rotate.RelRotateTo (180))});
rotate.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(o => rotate.RelRotateTo(180)) });
transparent.Opacity = .5;
Content = new StackLayout {
Orientation = StackOrientation.Horizontal,
Children = {
new StackLayout {
//MinimumWidthRequest = 20,
HorizontalOptions = LayoutOptions.FillAndExpand,
Children = {
normal,
disabled,
transparent,
rotate,
embedded,
new StackLayout {
HeightRequest = 30,
Orientation = StackOrientation.Horizontal,
Children = {
Content =
new ScrollView()
{
Content = new StackLayout
{
Orientation = StackOrientation.Horizontal,
Children =
{
new StackLayout
{
//MinimumWidthRequest = 20,
HorizontalOptions = LayoutOptions.FillAndExpand,
Children =
{
new Label(){ Text = "Normal"},
normal,
new Label(){ Text = "Disabled"},
disabled,
new Label(){ Text = "Transparent"},
transparent,
new Label(){ Text = "Rotate"},
rotate,
new Label(){ Text = "Embedded"},
embedded,
new Label(){ Text = "Horizontal"},
new StackLayout
{
HeightRequest = 30,
Orientation = StackOrientation.Horizontal,
Children =
{
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"}
}
}
}
},
new StackLayout
{
WidthRequest = 30,
Children =
{
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"}
}
}
}
},
new StackLayout {
WidthRequest = 30,
Children = {
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"}
}
}
}
};
};
}
}
}

Просмотреть файл

@ -80,6 +80,7 @@ namespace Xamarin.Forms.Platform.Android
bitmap?.Dispose();
imageController?.SetIsLoading(false);
imageController?.NativeSizeChanged();
}
}
}