<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: crypticminds</title>
    <description>The latest articles on Forem by crypticminds (@crypticminds).</description>
    <link>https://forem.com/crypticminds</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F319452%2F75547c24-ae5d-4414-ba8d-e914e645e7fd.png</url>
      <title>Forem: crypticminds</title>
      <link>https://forem.com/crypticminds</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/crypticminds"/>
    <language>en</language>
    <item>
      <title>Load and cache an image from a URL directly into an ImageView using one annotation.</title>
      <dc:creator>crypticminds</dc:creator>
      <pubDate>Mon, 03 Feb 2020 12:46:15 +0000</pubDate>
      <link>https://forem.com/crypticminds/load-and-cache-an-image-from-a-url-directly-into-an-imageview-using-one-annotation-1af8</link>
      <guid>https://forem.com/crypticminds/load-and-cache-an-image-from-a-url-directly-into-an-imageview-using-one-annotation-1af8</guid>
      <description>&lt;p&gt;Images are one of the most cached items in any application. ColdStorage library provides a very easy way to load an image and cache it directly into an ImageView.&lt;/p&gt;

&lt;p&gt;Usage :-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight kotlin"&gt;&lt;code&gt;
 &lt;span class="nd"&gt;@LoadImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nc"&gt;R&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;image_1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s"&gt;"https://images.unsplash.com/photo-1549740425-5e9ed4d8cd34?ixlib=rb-1.2.1&amp;amp;w=1000&amp;amp;q=80"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;placeHolder&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;R&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;drawable&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;enableLoadingAnimation&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;lateinit&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="py"&gt;imageWithAnimation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;ImageView&lt;/span&gt;

 &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;onCreate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;savedInstanceState&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Bundle&lt;/span&gt;&lt;span class="p"&gt;?)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onCreate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;savedInstanceState&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;setContentView&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;R&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;layout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;load_image_example&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nc"&gt;Cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The image view will bind the variable with its resource id and take care of loading the image after downloading it from the URL into it.&lt;/p&gt;

&lt;p&gt;Additionally, it can also show a placeholder image and loading animation until the image is downloaded.&lt;/p&gt;

&lt;p&gt;Check out the repository for more detailed usage:- &lt;a href="https://github.com/crypticminds/ColdStorage"&gt;https://github.com/crypticminds/ColdStorage&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kotlin</category>
      <category>android</category>
      <category>opensource</category>
      <category>github</category>
    </item>
    <item>
      <title>Convert a class to a cache layer using just one annotation</title>
      <dc:creator>crypticminds</dc:creator>
      <pubDate>Thu, 30 Jan 2020 20:17:49 +0000</pubDate>
      <link>https://forem.com/crypticminds/convert-a-class-to-a-cache-layer-using-just-one-annotation-4h8d</link>
      <guid>https://forem.com/crypticminds/convert-a-class-to-a-cache-layer-using-just-one-annotation-4h8d</guid>
      <description>&lt;p&gt;Read more about generating a cache layer with annotation here :-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/@crypticmindscom_5258/caching-made-easy-on-android-with-kotlin-part-3-3d4cfcb57df0"&gt;https://medium.com/@crypticmindscom_5258/caching-made-easy-on-android-with-kotlin-part-3-3d4cfcb57df0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check out the repository here:-&lt;br&gt;
&lt;a href="https://github.com/crypticminds/ColdStorage"&gt;https://github.com/crypticminds/ColdStorage&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>kotlin</category>
      <category>opensource</category>
      <category>android</category>
    </item>
    <item>
      <title>Caching made easy in android (with annotations)</title>
      <dc:creator>crypticminds</dc:creator>
      <pubDate>Sat, 18 Jan 2020 06:27:45 +0000</pubDate>
      <link>https://forem.com/crypticminds/caching-made-easy-in-android-with-annotations-3jpm</link>
      <guid>https://forem.com/crypticminds/caching-made-easy-in-android-with-annotations-3jpm</guid>
      <description>&lt;p&gt;ColdStorage (&lt;a href="https://github.com/crypticminds/ColdStorage"&gt;https://github.com/crypticminds/ColdStorage&lt;/a&gt;) library will allow you to create a caching layer in your android application with simple annotations.&lt;/p&gt;

&lt;p&gt;Check out the indepth tutorial here :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/@crypticmindscom_5258/caching-made-easy-in-android-with-kotlin-part-2-61bb476063b4"&gt;https://medium.com/@crypticmindscom_5258/caching-made-easy-in-android-with-kotlin-part-2-61bb476063b4&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you like the library leave a star :) &lt;/p&gt;

&lt;p&gt;Contributions are welcome.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YjHMmAZ1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ok719cgnvx1ku6mi6a2q.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YjHMmAZ1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ok719cgnvx1ku6mi6a2q.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>android</category>
      <category>kotlin</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
