Ejemplo n.º 1
0
		/// <summary>
		///   Requests an image to be loaded using the default image loader
		/// </summary>
		/// <param name="uri">
		/// The URI for the image to load
		/// </param>
		/// <param name="notify">
		/// A class implementing the IImageUpdated interface that will be invoked when the image has been loaded
		/// </param>
		/// <returns>
		/// If the image has already been downloaded, or is in the cache, this will return the image as a Drawable.
		/// </returns>
		public static Drawable /*UIImage*/ DefaultRequestImage(Uri uri, IImageUpdated notify)
		{
			var maxMemory = (int)(Java.Lang.Runtime.GetRuntime().MaxMemory() / 1024);
			// Use 1/8th of the available memory for this memory cache.
			int cacheSize = maxMemory /8;

			//_memoryCache = new MemoryLimitedLruCache(cacheSize);
			if (DefaultLoader == null) {
				Console.WriteLine ("cache size limieted" + cacheSize.ToString ());
				//DefaultLoader = new ImageLoader(5, 4 * 1024 * 1024);
				DefaultLoader = new ImageLoader(20, cacheSize);
			}
			return DefaultLoader.RequestImage(uri, notify);
		}