/// <summary> /// Called after the bitmap is loaded. /// </summary> /// <param name="result">Result of the DoInBackground function.</param> protected override void OnPostExecute(Java.Lang.Object result) { base.OnPostExecute(result); if (IsCancelled) { result = null; Log.Debug("TT", "OnPostExecute - Task Cancelled"); } else { using (Bitmap bmpResult = result as Bitmap) { if (_imageViewReference != null && bmpResult != null) { ImageView imageView = (ImageView)_imageViewReference.Get(); AsyncImageTask asyncImageTask = GetAsyncImageTask(imageView); if (this == asyncImageTask && imageView != null) { imageView.SetImageBitmap(bmpResult); // if (!pLRUCache.ContainsKey(path)) // pLRUCache.Add(path, bmpResult); } } } } }
/// <summary> /// Initializes a new instance of the <see cref="WF.Player.AsyncDrawable"/> class. /// </summary> /// <param name="res">Resources of the context.</param> /// <param name="bitmap">Bitmap to load.</param> /// <param name="asyncImageTask">AsyncImageTask, which belongs to this AsyncDrawable.</param> public AsyncDrawable(Resources res, Bitmap bitmap, AsyncImageTask asyncImageTask) : base(res, bitmap) { _asyncImageTaskReference = new WeakReference <AsyncImageTask>(asyncImageTask); }
/// <summary> /// Initializes a new instance of the <see cref="WF.Player.AsyncDrawable"/> class. /// </summary> /// <param name="res">Resources of the context.</param> /// <param name="bitmap">Bitmap to load.</param> /// <param name="asyncImageTask">AsyncImageTask, which belongs to this AsyncDrawable.</param> public AsyncDrawable(Resources res, Bitmap bitmap, AsyncImageTask asyncImageTask) : base(res, bitmap) { _asyncImageTaskReference = new WeakReference<AsyncImageTask>(asyncImageTask); }