private async Task LoadThumbIntoImageList(string imagePath, Activity context) { Bitmap thumb = await ThumbnailUtils.CreateVideoThumbnailAsync(imagePath, ThumbnailKind.MiniKind); ImageViewAsync newImage = new ImageViewAsync(context); newImage.SetPadding(10, 10, 10, 10); ItemList.AddView(newImage); newImage.SetImageBitmap(thumb); newImage.Click += Item_Click; }
public override void ShowResults(IEnumerable<string> files, Activity context) { ClearResults(); if (files == null) { return; } for (int i = 0; i < files.Count(); i++) { Button openButton = new Button(context); openButton.SetPadding(10, 10, 10, 10); openButton.Text = string.Format(context.Resources.GetString(Resource.String.openAudioBtn), i + 1); openButton.Click += Item_Click; ItemList.AddView(openButton); } }
/// <summary> /// Populates the empty LinearLayout with images loaded from the given paths /// </summary> /// <param name="files">Collection of image paths</param> /// <param name="context">Activity context for image loading</param> public virtual void ShowResults(IEnumerable<string> files, Activity context) { ClearResults(); if (files == null) { return; } foreach (string imagePath in files) { ImageViewAsync newImage = new ImageViewAsync(context); newImage.SetPadding(10, 10, 10, 10); ItemList.AddView(newImage); ImageService.Instance.LoadFile(imagePath) .DownSampleInDip(width: 150) .Into(newImage); newImage.Click += Item_Click; } }