Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Solved my problem, thanks to a little bit more debugging in the UrlImageViewHelper port. As I assumed, the problem was in the caching. The logic behind was to limit cached items to specific number (I don't know why, but it was hardcoded), and if the limit is reached, then need to remove first few items from cache. This is fine, but the implementation still have some bugs. For now, instead of debug more, and fix the implementation, I increased the limit to 5000 (originally it was set to 100), but this is only the temporary way to fix this. In future I'll probably will fix the code, so it will delete first items in cache collection. So here it is:</p> <h2><code>SoftReferenceHashTable&lt;TKey, TValue&gt;</code> class</h2> <p>Fixed this line: <code>LRUCache&lt;TKey, TValue&gt; cache = new LRUCache&lt;TKey, TValue&gt;(100);</code> <br> To this: <code>LRUCache&lt;TKey, TValue&gt; cache = new LRUCache&lt;TKey, TValue&gt;(5000);</code></p> <hr> <p>Additionally, thanks to <strong>@Y2i</strong>'s comment, I found that in <code>UrlImageViewHelper</code> class, in the <code>SetUrlDrawable</code> method the downloading was implemented without closing the internet connection. May be this wasn't so much a problem, but I prefer to fix that. So I changed this part of a code:</p> <pre><code>var client = new System.Net.WebClient(); var data = client.DownloadData(url); System.IO.File.WriteAllBytes(filename, data); return LoadDrawableFromFile(context, filename); </code></pre> <p>To this:</p> <pre><code>using (var client = new System.Net.WebClient()) { var data = client.DownloadData(url); System.IO.File.WriteAllBytes(filename, data); return LoadDrawableFromFile(context, filename); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload