<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[AndroidPub - Medium]]></title>
        <description><![CDATA[The (retired) Pub(lication) for Android &amp; Tech, focused on Development - Medium]]></description>
        <link>https://medium.com/android-news?source=rss----8fca399d4de---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>AndroidPub - Medium</title>
            <link>https://medium.com/android-news?source=rss----8fca399d4de---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 02:54:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/android-news" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Introducing Vectordrawable-Seekable]]></title>
            <link>https://medium.com/android-news/introducing-vectordrawable-seekable-b96ef57ffe36?source=rss----8fca399d4de---4</link>
            <guid isPermaLink="false">https://medium.com/p/b96ef57ffe36</guid>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[material-design]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[animation]]></category>
            <dc:creator><![CDATA[Alistair Sykes]]></dc:creator>
            <pubDate>Mon, 11 May 2020 13:35:28 GMT</pubDate>
            <atom:updated>2020-05-11T13:35:28.363Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Febnyxzk7cXlTWgRoYpUYQ.jpeg" /></figure><h4><em>Using the new and improved AnimatedVectorDrawable to pause and seek your animations.</em></h4><h3>AnimatedVectorDrawable</h3><p>Android SDK 21 introduced both the VectorDrawable and the AnimatedVectorDrawable. This allowed you to use vector assets within your app, and even animate them.</p><p>They’ve iterated on these since then, but AnimatedVectorDrawable was still missing something. You couldn’t manipulate and control the animation. There was no pause or seek functionality.</p><h3>Core-Animation</h3><p>The Android team has been hard at work backporting the framework Animator APIs. They have created a separate unbundled AndroidX library called Core-Animation.</p><p>The Animator APIs have been around for some time. But they didn’t provide the capabilities needed for this pause and seek functionality. So they needed to be unbundled and then iterated on.</p><h3>Vectordrawable-Seekable</h3><p>Once Core-Animation was available the Android team could create the Vectordrawable-Seekable library. This library revolves around the class SeekableAnimatedVectorDrawable.</p><p>Under the hood, this class uses the AnimatorSet and subsequently Animator from Core-Animation. These provide the pause and seek functionality.</p><h3>How to</h3><h4>Create the vector</h4><p>Firstly, you need a vector asset of the image you wish to animate. This works best if it is simple and optimised.</p><p>See these resources for information on optimising assets:</p><p>- <a href="https://www.brightec.co.uk/blog/creating-vector-drawables-android">https://www.brightec.co.uk/blog/creating-vector-drawables-android</a></p><p>- <a href="https://arturdryomov.dev/posts/optimizing-android-vector-images/">https://arturdryomov.dev/posts/optimizing-android-vector-images/</a></p><p>For this example I am going to use an Android:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c1f49ee65961374471c7019479d595cf/href">https://medium.com/media/c1f49ee65961374471c7019479d595cf/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/0*So5ZkO11SRkrkvWH.png" /></figure><p>This XML file should be placed in your res/drawable directory.</p><p>Notice the group names, as these allow us to reference each part of the image later. Notice also the pivot points defined. These define the pivot around which rotation would happen.</p><h4>Create the animation</h4><p>To define the animation itself you can create another XML file. This defines an ObjectAnimator.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/51350379510a257647e0a635938370a3/href">https://medium.com/media/51350379510a257647e0a635938370a3/href</a></iframe><p>This file goes into your res/anim directory.</p><p>You can see from the attributes that this is a rotation animation. It will repeat infinitely by going forward and then reversing and going backwards. It will rotate from 180° to 220° over 600 milliseconds each repeat.</p><h4>Create AnimatedVectorDrawable</h4><p>We can combine these two into an animated-vector. This can again be defined within an XML file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0fb6305ca150a51e7ed1901cdcceff5e/href">https://medium.com/media/0fb6305ca150a51e7ed1901cdcceff5e/href</a></iframe><p>This XML file should be placed in your res/drawable directory.</p><p>This file connects the image and animation. The drawable is defined near the top. The animation rotation is targeting the arm-left.</p><h4>Using AnimatedVectorDrawable</h4><p>You can now use this animated-vector to display your animation on the screen.</p><p>Either set it on your ImageView via:</p><pre>app:srcCompat=&quot;@drawable/img_android_animated&quot;</pre><p>Or you can define it programmatically:</p><pre>val drawable = AnimatedVectorDrawableCompat.create(<br>    this, R.drawable.img_android_animated<br>)<br>imageView.setImageDrawable(drawable)<br>drawable.start()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Rum8AFs1qaNsEC-O.gif" /></figure><h4>Converting to SeekableAnimatedVectorDrawable</h4><p>Instead of creating an AnimatedVectorDrawable from your XML, create a SeekableAnimatedVectorDrawable:</p><pre>val drawable = SeekableAnimatedVectorDrawable.create(<br>    this, R.drawable.img_android_animated<br>)<br>imageView.setImageDrawable(drawable)<br>drawable.start()</pre><p>Now you have access to pause seek functionality.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F415890449%3Fapp_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F415890449&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F889531205_960.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="970" height="2048" frameborder="0" scrolling="no"><a href="https://medium.com/media/ccaec0591db3af0e80def8e14b37e5fe/href">https://medium.com/media/ccaec0591db3af0e80def8e14b37e5fe/href</a></iframe><p><strong>Play/Pause</strong></p><pre>drawable.pause()<br>drawable.play()</pre><p><strong>Duration</strong></p><pre>drawable.totalDuration</pre><p>Note for infinite animations this will return -1.</p><p><strong>Current Time</strong></p><pre>drawable.currentPlayTime</pre><p>This can be both gotten and set. If you set this value, the animation will be set to that time and continued if it was already running.</p><h3>Conclusion</h3><p>These new API’s provide some interesting functionality. It unlocks some very cool and delighting animations.</p><p>Both Core-Animation and Vectordrawable-Seekable are in alpha at the time of writing. It is worth noting that Core-Animation is mostly a backport of the existing framework API’s. So arguably it should be more stable than a usual alpha release.</p><p><a href="https://developer.android.com/jetpack/androidx/releases/vectordrawable">https://developer.android.com/jetpack/androidx/releases/vectordrawable</a> <a href="https://developer.android.com/jetpack/androidx/releases/core">https://developer.android.com/jetpack/androidx/releases/core</a></p><p>Now you can pause and seek to your heart’s content.</p><p><em>Previous Post</em></p><p><a href="https://android.jlelse.eu/education-through-motion-b500a77a3b5">Education through motion</a></p><p><em>Originally published at </em><a href="https://www.brightec.co.uk/blog/introducing-vectordrawable-seekable"><em>https://www.brightec.co.uk</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b96ef57ffe36" width="1" height="1" alt=""><hr><p><a href="https://medium.com/android-news/introducing-vectordrawable-seekable-b96ef57ffe36">Introducing Vectordrawable-Seekable</a> was originally published in <a href="https://medium.com/android-news">AndroidPub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crack Top Android Development Company Interview]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/android-news/crack-top-android-development-company-interview-f106756f045e?source=rss----8fca399d4de---4"><img src="https://cdn-images-1.medium.com/max/1280/0*yXPrTKP-Pt_6CfNl" width="1280"></a></p><p class="medium-feed-snippet">The interviewer in interviews asked these questions with top-tier Internet companies. Familiarity with the knowledge points listed in this&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/android-news/crack-top-android-development-company-interview-f106756f045e?source=rss----8fca399d4de---4">Continue reading on AndroidPub »</a></p></div>]]></description>
            <link>https://medium.com/android-news/crack-top-android-development-company-interview-f106756f045e?source=rss----8fca399d4de---4</link>
            <guid isPermaLink="false">https://medium.com/p/f106756f045e</guid>
            <category><![CDATA[crack]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[tips]]></category>
            <dc:creator><![CDATA[Budhdi Sharma]]></dc:creator>
            <pubDate>Fri, 08 May 2020 20:48:42 GMT</pubDate>
            <atom:updated>2024-10-18T17:04:25.639Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Deep Dive into Activity Results API — No More onActivityResult()]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/android-news/activity-results-api-69be5a225e86?source=rss----8fca399d4de---4"><img src="https://cdn-images-1.medium.com/max/1280/1*5qS8vUrb65fUUoANF5vXew.png" width="1280"></a></p><p class="medium-feed-snippet">Learn New ActivityResultContracts by Examples</p><p class="medium-feed-link"><a href="https://medium.com/android-news/activity-results-api-69be5a225e86?source=rss----8fca399d4de---4">Continue reading on AndroidPub »</a></p></div>]]></description>
            <link>https://medium.com/android-news/activity-results-api-69be5a225e86?source=rss----8fca399d4de---4</link>
            <guid isPermaLink="false">https://medium.com/p/69be5a225e86</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Wajahat Karim]]></dc:creator>
            <pubDate>Sun, 03 May 2020 00:11:01 GMT</pubDate>
            <atom:updated>2020-05-03T00:11:01.377Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[GitFlow with GitHub]]></title>
            <link>https://medium.com/android-news/gitflow-with-github-c675aa4f606a?source=rss----8fca399d4de---4</link>
            <guid isPermaLink="false">https://medium.com/p/c675aa4f606a</guid>
            <category><![CDATA[gitflow]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Maciej Najbar]]></dc:creator>
            <pubDate>Mon, 27 Apr 2020 17:43:02 GMT</pubDate>
            <atom:updated>2020-04-27T17:43:02.336Z</atom:updated>
            <content:encoded><![CDATA[<p>Why we have to choose between safety and tidiness?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tUlhQJzYu4b5rXjj.png" /><figcaption><a href="https://nvie.com/posts/a-successful-git-branching-model/">https://nvie.com/posts/a-successful-git-branching-model/</a></figcaption></figure><p>Quick note before I begin. GitFlow, was first published by Vincent Driessen in 2010. He suggests a simpler workflow — <a href="https://guides.github.com/introduction/flow/">GitHub Flow</a> — for the teams that do not have to support multiple versions at the same time. For further reading see the <a href="https://nvie.com/posts/a-successful-git-branching-model/">post from the author himself</a>.</p><p>Most of the teams around the world have worked, work or will work with GitFlow. A good understanding of branch management and conflicts resolution can save a lot of trouble. The latter is the topic that I will focus the most in this article.</p><h3>tl;dr</h3><h4>Long living branches</h4><ul><li><strong>master</strong> — this is where stable production ready code lands. No direct commits are allowed. If you want to configure Continuous Delivery for your project, master branch is exactly the place (read how to <a href="https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks">hook on commits</a>). Each change on this branch must be tagged with version number.</li><li><strong>develop</strong> — this is a construction area. All new features are merged to it. This branch should be buildable all the time. If it doesn’t (for any reasons), fix it asap.</li></ul><h4>Special branches</h4><p><strong>Feature branch</strong><br>- branches off from <strong>develop</strong><br>- merges to <strong>develop</strong><br>- naming: anything but <strong>master</strong>, <strong>develop</strong>, <strong>release</strong> or <strong>hotfix</strong>; most commonly <strong>devName/JiraTicketNo</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*x1ZWfxBYKqmaziwdHj2TUg.png" /><figcaption>Feature branch</figcaption></figure><p><strong>Release branch</strong><br>- branches off from <strong>develop<br></strong>- merges to <strong>master</strong> and <strong>develop</strong><br>- naming: <strong>release</strong>, <strong>rc</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*nmpsEaFVbJGw46TQcPcYdA.png" /><figcaption>Release branch</figcaption></figure><p><strong>Hotfix branch</strong><br>- branches off from <strong>master</strong><br>- merges to <strong>master</strong> and <strong>develop</strong> or <strong>release</strong> (if exists)<br>- naming: <strong>hotfix</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ua7iUtqW0fx0R8JzETHC9Q.png" /><figcaption>Hotfix branch</figcaption></figure><h3>Conflicts</h3><p>This is the most important topic to cover. They will occur eventually — even in one-man projects; that’s right, I work with a great developer who did do just that 🙂 Anyway, I want to focus mostly on it because it’s a very marshy ground and can bring tragic effects to the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*04GjisZVs986ZMIYzxeuIA.png" /><figcaption>Perfect flow? Never happen!</figcaption></figure><p>I know the feature branch may look like it doesn’t follow GitFlow rules, but let me explain it.</p><blockquote>Plans are useless, but planning is indispensable. — Dwight Eisenhower</blockquote><p>Sometimes you take a bug ticket into a sprint and this bug turns out to be a big refactoring that lasts for couple of sprints. When refactoring gets big enough, this branch becomes a stand-alone version and is not included in any future sprints. It must pass all regression testing and is considered as a hotfix.</p><p>We all desire a harmony and… Let me stop you right there. Projects that run in teams are messy. Tools that we have can be a pain in ass too. Privileges, configurations, … There are just too many things that can go bad or make us workaround.</p><h3>Merging</h3><p>Even simple decision as which variant of merge to choose when working with GitFlow can be a bone of contention. Which one do you prefer?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J1fhvgyU9Xg-E_7eO0YOLA.png" /><figcaption>Merge no fast-forward / merge (fast-forward) / merge and squash</figcaption></figure><p>Each decision has its effects. Let’s discuss what they are.</p><h4><strong>Merge (default)</strong></h4><p>Simple fast-forward merge is the most messy. Depending on situation on merging branch it can look like below. Probably that is why there’s no such option on GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hVI3DLw2G8y4ekFbGv3zbQ.png" /><figcaption>Left: no fast-forward; Right fast-forward</figcaption></figure><p>On the right we have a take over of other branch’s history. Merge is quick, requires no other action. Whereas merging is effortless, searching for feature in commits that introduced it is exhausting.</p><h4><strong>Merge no fast-forward</strong></h4><p>This one always requires us to create a merge commit. No fast-forward option is set by default when working with GitHub and in long run, causes the least pain. This is preferred by Vincent in his GitFlow workflow. It displays entire history of merges. There’s one caveat though which I’ll explain in section GitFlow with GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*kYY0L3NxupMQxRA-v6HuOw.png" /><figcaption>backporting develop to release</figcaption></figure><h4><strong>Merge squash</strong></h4><p>A project history given by squashing is tempting to be used as a default option. It’s just a straight line with commit dots — fantastic! But when something looks nice, it must be bitter. One merge squash can create a conflict where we expect none.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3i-g11voVaj9n9CSR0gZoQ.png" /><figcaption>Conflict on merge to master; accept changes from release branch</figcaption></figure><h4>GitFlow with GitHub</h4><p>GitHub gives us great options like e.g. protecting branches from direct commits. It’s a good practice, in my opinion, to protect two main branches <strong>master</strong> and <strong>develop</strong>. But let’s remember it’s a double-edged sword — it requires other peers to review the code — apart from blind approves 😉 — but prevents us from having a clean history.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*2uDyy33npbJ8obmCmk0M4A.png" /><figcaption>GitFlow expected result</figcaption></figure><p><strong>Clean GitFlow </strong>— expected result is as as presented. All the branches get updated by merge with no fast-forward method. The history is clean. No extra merging required. Conflicts are resolved within this merge. Unfortunately, having protected branches prevents us from such operation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*4Ps5EpssLgIqj9m_fJO7iA.png" /><figcaption>GitHub PR backporting to release (the way GitHub allows)</figcaption></figure><p><strong>Merge no fast-forward</strong> — besides visual representation in a git history, this method turns out to be safe. As developers working with someone else’s businesses I suggest we stick to things that are safe rather than pretty. With this method we can very thoroughly walk through the history and study what was happening on each step.</p><p><strong>Merge squash</strong> — It’s safe to use this method for merging feature branches to develop. It makes develop branch look clean — like really clean.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7i0NKL0F0YgH-5cHRy109Q.png" /><figcaption>Develop branch with squashed feature branches</figcaption></figure><p>Unfortunately I cannot think of any other usage for merge squash when using GitHub’s Pull Request system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*Q2pSl_8NcGQB7eGXQ5y4Pg.png" /><figcaption>GitHub PR backporting to release (wishful thinking)</figcaption></figure><p>It would be very helpful to have merge options on GitHub PRs. Defining merge strategy would solve the issue with ugly graph when backporting (image on the left). After we updated release branch with changes from hotfix we pulled changes from develop by using merge squash (develop -&gt; release). This way we resolved the conflicts on our release branch and we should be able to merge it back to develop without any problems — in theory. It fact, commits on develop branch still cause conflicts — which shouldn’t matter anymore and we should just override changes on develop with changes from release branch. We could do it with a command below, but protected branches won’t let us push these changes to a remote.</p><pre>git checkout develop<br>git merge -s recursive -X theirs release</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*qL4pbZBRnqMIwBUVjcD2gA.png" /><figcaption>Merge with fast-forward</figcaption></figure><p><strong>Merge fast-forward</strong> — if GitHub allowed fast-forward option we would be able to get a situation like this one. Fast Forward in this case “swaps” branch develop with release. The merge commit message is “Merging from develop into release” and that stays in the history, but there’s a saying:</p><blockquote>One picture is worth more than a thousand words.</blockquote><p>Clean GitFlow with GitHub is either unsafe or impossible — which affects history graphs. We should be aware of strengths and weaknesses of tools (and libraries) we use. Work out with your team a preferred solution and make sure everyone follows the same rules.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c675aa4f606a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/android-news/gitflow-with-github-c675aa4f606a">GitFlow with GitHub</a> was originally published in <a href="https://medium.com/android-news">AndroidPub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Handling Media Files With MediaFacer Library For Android]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/android-news/handling-media-files-with-mediafacer-library-for-android-cd9d2ca0dc68?source=rss----8fca399d4de---4"><img src="https://cdn-images-1.medium.com/max/777/1*HQEFkLd93rU5IjEL-SjHbg.jpeg" width="777"></a></p><p class="medium-feed-snippet">Querying media content on android with ease using the MediaFacer class library</p><p class="medium-feed-link"><a href="https://medium.com/android-news/handling-media-files-with-mediafacer-library-for-android-cd9d2ca0dc68?source=rss----8fca399d4de---4">Continue reading on AndroidPub »</a></p></div>]]></description>
            <link>https://medium.com/android-news/handling-media-files-with-mediafacer-library-for-android-cd9d2ca0dc68?source=rss----8fca399d4de---4</link>
            <guid isPermaLink="false">https://medium.com/p/cd9d2ca0dc68</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[M.N Emmanuel]]></dc:creator>
            <pubDate>Mon, 27 Apr 2020 07:45:41 GMT</pubDate>
            <atom:updated>2021-03-19T08:11:06.216Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Jetpack Compose: Twitter UI]]></title>
            <link>https://medium.com/android-news/jetpack-compose-twitter-ui-96f76577143a?source=rss----8fca399d4de---4</link>
            <guid isPermaLink="false">https://medium.com/p/96f76577143a</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[jetpack]]></category>
            <dc:creator><![CDATA[Ahmed Rizwan]]></dc:creator>
            <pubDate>Sat, 25 Apr 2020 23:46:18 GMT</pubDate>
            <atom:updated>2020-05-26T15:08:47.291Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6t3FHu_d8T2Q6QldaglFHA.png" /></figure><p>I decided to test out Jetpack Compose by making a simple Twitter UI clone after I came across this tweet by <a href="https://twitter.com/geekmz">Mariano Zorrilla</a>:</p><h3>Mariano Zorrilla 💙 on Twitter</h3><p>Wait... did I just copied Twitter using #Flutter and share it over @CodePen?! 🥰 Such an amazing tool! Took me 1 day of work and 1500 lines of code. Link: https://t.co/zI90oTPYDd cc @timsneath @redbrogdon @ZoeyFan723 @kevmoo @MartinAguinis @nlycskn @Nash0x7E2 https://t.co/OqzBNWET0y</p><p>He used <a href="https://flutter.dev/">Flutter</a> (which is an amazing tool btw for building cross platform apps) — with just one day of work, 1500 lines of code. That’s beyond impressive (specially the fact that Flutter can be hosted on CodePen as well).</p><p>So with similar constraints, I wanted to try out Jetpack Compose. I followed the CodePen example (as closely as I could) and this is the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*-N0mLwZLb4xSrRFtLc6JKg.gif" /></figure><p>Complete source code:</p><p><a href="https://github.com/ahmedrizwan/JetpackComposeTwitter">ahmedrizwan/JetpackComposeTwitter</a></p><h3>The App</h3><p>There are three screens in this app</p><blockquote>Home Screen</blockquote><blockquote>Profile Screen</blockquote><blockquote>Compose Screen</blockquote><h4>App State</h4><p>Before we get to the screens — take a look at app state model, which will be used for navigation and theming. I also added some helpers for navigating to individual screens &amp; for checking theme.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hqRhLo32dyJCjfGTIjwdmg.png" /></figure><h4>Models</h4><p>There are two models — both data classes. The <em>Tweet</em> model is annotated with <em>@Model </em>as we update this model from our composed functions to update view state. User stays the same, hence it’s not annotated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BtnvSwEmvpqRsyL09VT86Q.png" /></figure><h3>Home Screen</h3><p>Home screen is a <strong>Scaffold</strong> — with drawer, bottom app bar, fab and content components. The scaffoldState is for managing the navigation drawer state. Initially the drawer is closed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ueu4HVsaEP_OiQhBHMaFzA.png" /></figure><h4>Content</h4><p>The content consists of a custom top bar &amp; list of tweets. I used <strong>VerticalScroller </strong>(with column inside)<strong> </strong>for the list instead of an <strong>AdapterList, </strong>as for some reason it wasn’t as smooth when scrolling (this will change as Jetpack Compose matures). Ideally we would opt for <strong>AdapterList </strong>instead — but for now, I’m using the scroller.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tQGQDJr99uz5zVzA2mqkuw.png" /></figure><h4>Top Bar</h4><p>As it’s a custom top bar — I used a Surface with some elevation. Inside it’s a simple row with three image resources, all arranged in a <strong>SpaceBetween </strong>pattern.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IC6a7x0z7UYbtE1jqs7Qyg.png" /></figure><h4>Tweet Layout</h4><p>The tweet layout is also basically composed up of Rows &amp; Columns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5iPOvwScblGpV2SEqgu-0Q.png" /></figure><h3>Profile Screen</h3><p>For profile screen, I used <strong>ConstraintLayout</strong> within a <strong>VerticalScroller </strong>— the reason for using this layout is how simple it is to place profile image on top banner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XcjgZzykuefooOOp8LPaww.png" /></figure><h4>Constraints</h4><p>Here’s an example of setting constraints inside the <strong>ConstraintSet</strong>. This is how I placed the image at the center of Banner’s bottom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jwm9Rx0dTvoOQYV5x1bVuA.png" /></figure><p>For other constraints — you can view the complete <a href="https://github.com/ahmedrizwan/JetpackComposeTwitter">source code</a>.</p><h3>Compose Screen</h3><p>Compose screen is also built using columns and rows. Additionally it includes <strong>TextField</strong> for input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VSKgf2hsd_X1eKdgSWunrA.png" /></figure><h3>Theming</h3><p>There are three themes <strong>light</strong>, <strong>dark</strong> and <strong>darker</strong>. Compose library gives us light and dark color palettes where we set primary, accent, background colors etc. These are considered “themes”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*YRjJ1CSWtr-ol4AZaJqNbw.png" /></figure><p>And here’s how I switch the theme from a dialog:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZUoND39M-Itq96PPv71mig.png" /></figure><p>ThemeOption is a custom compose layout with a Radio Button &amp; Text — I pass in on click event which triggers the theme switch.</p><h3>Limitations</h3><p>While implementing the layout — there were some limitations, as Compose is in pre-release dev stage.</p><ol><li>Something like <strong>CoordinatorLayout</strong> is not available yet (which allows us to do custom app bar animations). Hence I wasn’t able to add that in Profile screen.</li><li><strong>TextField</strong> doesn’t have placeholder/hint. So I had to implement one myself.</li><li>There’s currently no <strong>pull to refresh</strong> functionality available in lists.</li></ol><p>Next up — check out Compose implementation of Android 10’s Calculator UI</p><p><a href="https://link.medium.com/kNeuoINNN6">Jetpack Compose: Calculator UI</a></p><p>Previously I also covered other composable layouts:</p><ul><li><a href="https://levelup.gitconnected.com/jetpack-compose-lists-3599d3ee5970">Jetpack Compose: Lists</a></li><li><a href="https://levelup.gitconnected.com/jetpack-compose-columns-and-rows-d8ef19a0cef">Jetpack Compose: Columns and Rows</a></li><li><a href="https://levelup.gitconnected.com/jetpack-compose-container-layout-183e655518f2">Jetpack Compose: Container Layout</a></li></ul><blockquote><em>Disclaimer: As the Jetpack Compose is in development phase — any of these APIs can change at any time. So as the source of truth, please always refer to the official </em><a href="https://developer.android.com/jetpack/compose"><em>documentation</em></a><em>.</em></blockquote><p>That’s it for now, thank you for reading! 🙂</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96f76577143a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/android-news/jetpack-compose-twitter-ui-96f76577143a">Jetpack Compose: Twitter UI</a> was originally published in <a href="https://medium.com/android-news">AndroidPub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Realtime Database vs Firestore: 9 Major Differences]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/android-news/realtime-database-vs-firestore-447b2d990599?source=rss----8fca399d4de---4"><img src="https://cdn-images-1.medium.com/max/1280/1*AdcNwj3-u4O7XqdtwC1CIA.png" width="1280"></a></p><p class="medium-feed-snippet">Firestore is much better than the Realtime Database like the black trainer. Period.</p><p class="medium-feed-link"><a href="https://medium.com/android-news/realtime-database-vs-firestore-447b2d990599?source=rss----8fca399d4de---4">Continue reading on AndroidPub »</a></p></div>]]></description>
            <link>https://medium.com/android-news/realtime-database-vs-firestore-447b2d990599?source=rss----8fca399d4de---4</link>
            <guid isPermaLink="false">https://medium.com/p/447b2d990599</guid>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[firestore]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Wajahat Karim]]></dc:creator>
            <pubDate>Fri, 17 Apr 2020 20:00:38 GMT</pubDate>
            <atom:updated>2020-04-17T20:00:38.040Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to migrate GitLab/Bitbucket to GitHub in a simple way]]></title>
            <link>https://medium.com/android-news/how-to-migrate-gitlab-bitbucket-to-github-in-a-simple-way-e38bc60b1547?source=rss----8fca399d4de---4</link>
            <guid isPermaLink="false">https://medium.com/p/e38bc60b1547</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[bitbucket]]></category>
            <category><![CDATA[gitlab]]></category>
            <dc:creator><![CDATA[Quang Nguyen]]></dc:creator>
            <pubDate>Wed, 15 Apr 2020 12:55:23 GMT</pubDate>
            <atom:updated>2021-07-02T06:46:47.097Z</atom:updated>
            <cc:license>https://creativecommons.org/publicdomain/mark/1.0/</cc:license>
            <content:encoded><![CDATA[<blockquote><a href="https://tinido.com/">Checkout my latest app: Tinido.</a></blockquote><p>GitHub has just announced <a href="https://github.blog/2020-04-14-github-is-now-free-for-teams/">a happy news</a> today for us, developers.<br>“<strong>Teams on GitHub can create unlimited private repositories for free.”</strong></p><p>So, here are their newest updates on the free package.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*YNksnhX0n3i652-yIemt-w.png" /><figcaption>Screenshot was taken on April 15th, 2020. Source (<a href="https://github.com/pricing">https://github.com/pricing</a>)</figcaption></figure><p>These changes are so competitive to other code hosting services like Bitbucket or GitLab. Many teams are going to relocate their projects to GitHub as I think.</p><p>If you share the same idea and look for a simple way to migrate a repo from Bitbucket or GitLab, the followings are several simple steps to accomplish this.</p><ol><li>Inside your GitHub team page, create an empty private repo with the same name of Bitbucket/GitLab repo that you want to transfer.</li><li>Copy your newly created repo link, either in HTTPS or SSH. For example, git@github.com:team-name/repo-name.git (SSH type)</li><li>Inside your local project folder, change the remote URL under.git/config ‘s file to your copied GitHub&#39;s one. The content looks similar as follows. [remote &quot;origin&quot;]<br> url = git@github.com:team-name/repo-name.git<br> fetch = +refs/heads/*:refs/remotes/origin/*</li><li>Do a git push: git push --all . It will push all codes and commit history on your newly GitHub repository.</li><li>Done. After that, when we push new commits, it will push to GitHub only.</li><li>The Bitbucket/GitLab repo now can be archived to ‘Read-only’ mode.</li></ol><p>Please get in touch with me via <a href="https://github.com/quangctkm9207">Github</a>. Happy coding and have a good time!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e38bc60b1547" width="1" height="1" alt=""><hr><p><a href="https://medium.com/android-news/how-to-migrate-gitlab-bitbucket-to-github-in-a-simple-way-e38bc60b1547">How to migrate GitLab/Bitbucket to GitHub in a simple way</a> was originally published in <a href="https://medium.com/android-news">AndroidPub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Happened to Chat Bubbles / Heads in Android?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/android-news/what-happened-to-chat-bubbles-heads-in-android-a30597f36115?source=rss----8fca399d4de---4"><img src="https://cdn-images-1.medium.com/max/1080/0*AqopT-mvNCzht-Sb.jpeg" width="1080"></a></p><p class="medium-feed-snippet">How the SYSTEM_ALERT_WINDOW permission has been abused over the years by malware creators &amp; hackers?</p><p class="medium-feed-link"><a href="https://medium.com/android-news/what-happened-to-chat-bubbles-heads-in-android-a30597f36115?source=rss----8fca399d4de---4">Continue reading on AndroidPub »</a></p></div>]]></description>
            <link>https://medium.com/android-news/what-happened-to-chat-bubbles-heads-in-android-a30597f36115?source=rss----8fca399d4de---4</link>
            <guid isPermaLink="false">https://medium.com/p/a30597f36115</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[chat]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Wajahat Karim]]></dc:creator>
            <pubDate>Fri, 10 Apr 2020 18:49:54 GMT</pubDate>
            <atom:updated>2020-04-10T18:49:54.496Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Education through motion]]></title>
            <link>https://medium.com/android-news/education-through-motion-b500a77a3b5?source=rss----8fca399d4de---4</link>
            <guid isPermaLink="false">https://medium.com/p/b500a77a3b5</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[material-design]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Alistair Sykes]]></dc:creator>
            <pubDate>Thu, 09 Apr 2020 14:46:24 GMT</pubDate>
            <atom:updated>2020-04-09T14:46:24.349Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QZCFzVhUO4jzcgJr19XwDA.jpeg" /></figure><h4><em>Educating Android users can be subtle by using motion</em></h4><h3>Material Design</h3><p>The material design system will be familiar to most, as one of the most widely used design systems. It’s a visual language that represents good design principles whilst allowing expressive branding.</p><p>Foundationally, it is based on the physics of the world. This makes it natural and familiar to users. It models the way objects move and how they interact with each other.</p><h3>Motion</h3><p>Motion can celebrate the completion of a task, delight the user, or help to drive the user through a flow. The way objects move and interact can bring a touch of class and express your brand.</p><p>You can also use motion to help teach the user how to interact with an element. Often subtle bounces, shakes, and elevations can improve user experience and understanding.</p><h3>Animations</h3><p>On Android, animation API’s have been re-written and changed over time. Currently, there are two main ways. The Animation API’s are the older API’s, but they allow you to use the anim resource files. The Animator API’s are the newer API’s which typically are a little easier to work with. Animator’s change the properties of an object/view. Whilst Animation’s only change the visual representation of them.</p><h3>Examples</h3><p>I have created some examples which give a flavour of what is achievable using motion on Android. There are many ways of creating the same animations, so I have tried to showcase a variety. Hopefully, these examples will inspire you to experiment with motion in your apps.</p><h4>Clickable</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JoOMmrUqzeFop0bg.gif" /></figure><p>Some elements may not appear clickable to some users. For example the items within a list. Although changing the static visual may help, using motion can be more powerful.</p><p>Lists commonly will utilize a RecyclerView with an accompanying adapter. If a list item is clickable, you may want to set a background of selectableItemBackground. This provides a ripple effect upon user click, giving visual confirmation of a click.</p><p>You can also trigger this effect manually, thus giving a visual clue to the user.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc9fa1075ae2775284954e34f72fc2ff/href">https://medium.com/media/dc9fa1075ae2775284954e34f72fc2ff/href</a></iframe><p>Firstly, I ensure that the background is a RippleDrawable as a safety measure.</p><p>Then I post a runnable on the animation queue of the itemView. I delay it to ensure it’s after the screen has loaded and so visible to the user.</p><p>Then I set the hotspot. This is the epicenter of the ripple effect. For the goal of educating a user, this should be in a natural place where the user would interact with the element.</p><p>Then to trigger the ripple I set the state of the drawable to pressed and enabled.</p><p>To clean up after the effect has finished, we set the state back to an empty array.</p><h4>Swipe up to unlock</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F405796815%3Fapp_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F405796815&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F876086450_640.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="720" height="1280" frameborder="0" scrolling="no"><a href="https://medium.com/media/5540c3bab9b000119a8b44768f105fd4/href">https://medium.com/media/5540c3bab9b000119a8b44768f105fd4/href</a></iframe><p>This motion might be familiar to you. With this bouncing motion, Android is trying to show the user that you can swipe up to unlock the screen.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6bb4f0c2ca2ad9b1d5377e6f5150825f/href">https://medium.com/media/6bb4f0c2ca2ad9b1d5377e6f5150825f/href</a></iframe><p>I define two ObjectAnimator’s. One for the motion upwards and one for downwards. I create an AnimatorSet to control their behaviour together.</p><p>The key to this motion is the Interpolator’s. The upwards motion has a linear speed. The downwards motion uses the BounceInterpolator. This simulates the dropping of an object and it bouncing on the ground.</p><h4>Shake</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*n7c0zP-_HX9dN4Xt.gif" /></figure><p>A shaking motion can help draw the immediate attention of the user. You can use it to inform the user of an error or that a button needs to be urgently clicked.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cd32c9fbc0f5a7f3c085290fcb288cbe/href">https://medium.com/media/cd32c9fbc0f5a7f3c085290fcb288cbe/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/36028812e156efb7d8410d9e0cb49df8/href">https://medium.com/media/36028812e156efb7d8410d9e0cb49df8/href</a></iframe><p>I create an anim resource that represents the shake. I start this anim by calling startAnimation() on the TextView.</p><p>Then I fade the TextView to an alpha of 0, after a short delay, to hide the error.</p><h3>Summary</h3><p>Experiment with simple motion. It can have a huge impact on the usability of your app. It can delight users and give a sense of polish and quality.</p><h3>Sources</h3><ul><li><a href="https://material.io/design/introduction/">https://material.io/design/introduction/</a></li><li><a href="https://material.io/design/motion/understanding-motion.html">https://material.io/design/motion/understanding-motion.html</a></li></ul><p><em>Previous Post</em></p><p><a href="https://levelup.gitconnected.com/kotlin-multiplatform-ios-certificate-pinning-fd1abba5ca8f">Kotlin Multiplatform iOS: Certificate Pinning</a></p><p><em>Originally published at </em><a href="https://www.brightec.co.uk/blog/education-through-motion"><em>https://www.brightec.co.uk</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b500a77a3b5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/android-news/education-through-motion-b500a77a3b5">Education through motion</a> was originally published in <a href="https://medium.com/android-news">AndroidPub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>