<?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[Stories by Atri Tripathi on Medium]]></title>
        <description><![CDATA[Stories by Atri Tripathi on Medium]]></description>
        <link>https://medium.com/@atritripathi?source=rss-5367763e2e09------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bBfPLJfFNv7xkqpaU6BK3Q.jpeg</url>
            <title>Stories by Atri Tripathi on Medium</title>
            <link>https://medium.com/@atritripathi?source=rss-5367763e2e09------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 20:13:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@atritripathi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Jetpack Compose and the conundrum of selecting a suitable architecture.]]></title>
            <link>https://medium.com/supershare-blog/jetpack-compose-and-the-conundrum-of-selecting-a-suitable-architecture-e9156900f380?source=rss-5367763e2e09------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9156900f380</guid>
            <category><![CDATA[mvvm]]></category>
            <category><![CDATA[mvi]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <dc:creator><![CDATA[Atri Tripathi]]></dc:creator>
            <pubDate>Mon, 08 Aug 2022 04:41:25 GMT</pubDate>
            <atom:updated>2022-08-08T04:41:25.857Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*OT4J6X5y_vrm5_5xpCUDKw.png" /></figure><p>Jetpack Compose is a modern and declarative UI framework developed by Google for Android to effectually replace the older View-based imperative UI system, which demands an excessive amount of ceremonial setup to render even simple UI elements on the screen.</p><p>The promise of Jetpack Compose lies in its ability to simplify UI development by allowing us to define, more or less, <em>“what”</em> rather than <em>“how”</em> it is to be rendered — declarative over imperative.</p><p>At <a href="https://ssup.co/">SuperShare</a>, we’re rewriting our Android app natively from scratch using the latest tech, libraries, design patterns, feature sets and frameworks that Google offers. And one of the primary decisions we had to take at the onset was selecting a suitable mobile software architecture — MVVM or MVI.</p><blockquote>The other famous architectures like MVC, MVP and Mobius (close contender) had other blatant and severe shortcomings, which we were already aware of; hence they weren’t in our consideration from the beginning.</blockquote><p>We were aware that our decision would have an impact on the application for its entire lifetime, which also, in a way, justified our predicament. We had to tread carefully with this decision and thoroughly weigh our biases on one or the other architecture.</p><p>Moreover, our UI layer had to be written entirely using Jetpack Compose, and the tricky thing with it is that, unlike the View system, Jetpack Compose is built and works using the concept of <em>State-Machine. </em>It operates and relies on a delicate and measured dance between the <em>State</em> changes and the <em>Events</em> that trigger them.</p><p>In simpler words, we had to rethink, adjust and accommodate our way of writing UI code from a mutation-friendly, less contractual and more flexible world to a more purist’s immutability, pure functions, and <em>“state-flows-down, events-flow-up” </em>way of seeing the world.</p><p>The following sections delineate our precise observation of the characteristic strengths and weaknesses of both the architectures and then our final verdict.</p><h3>MVVM</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*9toLHWBZgRrUKv56TrdIkA.png" /></figure><ul><li>MVVM stands for <em>Model-View-ViewModel </em>architecture.</li><li>It was adopted by Google as the standard architecture for developing Android apps several years ago, and they still stand by it.</li><li>It’s a development on the MVP pattern, where it replaces the Interface and its modifications between the View and Presenter with a Pub-Sub/Observer pattern between the View and ViewModel.</li><li>Its strongest suit offering is the lifecycle-aware ViewModel and the ability to have granular control over each UI component using Compose friendly state-holder variables, preferably in the ViewModels, that is decoupled from the screen’s state.</li></ul><h3>MVI</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*bWqpooOt_Xbx9oqfcLSOFg.png" /></figure><ul><li>MVI stands for Model-View-Intent architecture.</li><li>It is a reactive architecture that was developed in public and had strong backing from the developer community.</li><li>It was developed as an alternative for Android taking inspiration from <em>Redux, </em>a state-machined-based JavaScript library for the Web.</li><li>Its strongest suit is that it abides by purist’s principles of writing code, wherein entities and objects are immutable, and therefore they become good representatives of State, and any Event/Intent that wants to change the State does so, not by directly changing the value, but by creating a copy of the object using special functions called <em>Reducers</em>. This keeps the code resilient, thread-safe and testable.</li></ul><h3>Verdict</h3><p>We chose MVVM.</p><p>Now, I agree that on the envelope, reading the above bullet points, it may seem quite evident that MVI should be a clear yes and the way to go, given the fact that it clearly mimics Jetpack Compose in its <em>state-machine-based </em>operational behaviour. And to be honest, we were very split and closely considering this point too.</p><p>But what made MVVM win the bid had to do with two points:</p><ol><li>MVVM still has and probably in the near future will continue to have a strong backing as the standard architecture for Android app development from Google.</li><li>The fact that MVI was developed for Android as inspiration from Redux for JavaScript seemed an overkill, in lieu of the fact that although it might’ve made sense in JavaScript to have proper state management by funnelling your state changes through central <em>Reducer</em> functions because the language itself suffers from a lack of strict typing system, it didn’t really make sense for us with Java/Kotlin, because they do have strict typing system, and therefore a centralised funnelling may or may not have been good to have, but it was never really a necessity.</li></ol><p>The last thing to be mentioned here is that some developers have tried using a mix of both the architectures — where the central structural scaffolding is provided by MVVM, and only the cosmetic layer between the ViewModel and the View with Jetpack Compose is taken care of by a simplified and neutered down version of MVI’s extensive rigmarole.</p><p>Only time will tell how it all really plays out as Jetpack Compose matures.</p><p>Thank you for your precious time.<br>If you liked what you read, please hit the <em>Clap</em> button to your heart’s content, and <em>Follow</em> if you’d like to stay in the loop.</p><p>Best<br>Atri</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9156900f380" width="1" height="1" alt=""><hr><p><a href="https://medium.com/supershare-blog/jetpack-compose-and-the-conundrum-of-selecting-a-suitable-architecture-e9156900f380">Jetpack Compose and the conundrum of selecting a suitable architecture.</a> was originally published in <a href="https://medium.com/supershare-blog">SuperShare</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The fascinating dance of Lottie Android with ViewPager2 and then some.]]></title>
            <link>https://medium.com/supershare-blog/the-fascinating-dance-of-lottie-android-with-viewpager2-and-then-some-d5ce9b6be518?source=rss-5367763e2e09------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5ce9b6be518</guid>
            <category><![CDATA[onboarding]]></category>
            <category><![CDATA[viewpager2]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[lottie]]></category>
            <dc:creator><![CDATA[Atri Tripathi]]></dc:creator>
            <pubDate>Sat, 09 Apr 2022 19:51:02 GMT</pubDate>
            <atom:updated>2022-04-09T19:51:02.923Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*GoZAN_yopeouKEPVoWZAxQ.png" /></figure><p>Lottie is one of those perplexing tools in a developer’s toolbox which defy the age-old notion that animations are hard to build, maintain and execute. It is a library for Android, iOS, Web, and Windows that parses Adobe After Effects animations exported as JSON with Bodymovin, renders them natively and makes it easy to work with complex animations.</p><p>ViewPager2, on the other hand, is an improved version of the ViewPager library that offers enhanced functionality and allows transitions between one entire screen to another and are regularly found in UIs like setup wizards or slideshows.</p><p>This article deals with an anecdotal case study of how we had set about to create a User OnBoarding flow, which uses Lottie Animations coupled with ViewPager2’s ability to provide granular control over screen transitions, and allowed us to create a rich and delightful onboarding experience for the user.</p><h3>First things first</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*Qcc-mfZdBrRqL5kx093Etw.gif" /><figcaption>SuperShare User Onboarding Flow</figcaption></figure><p>As you can see from the design above, this is the current user onboarding flow built by the Android team at SuperShare, using just Lottie Animations, ViewPager2, some clever maths, and lots of coffee. It’s pretty clear that the GIF is only for representation, and its frame rate isn’t indicative of the actual performance of the app.</p><blockquote>On a real device, this animation plays at a sweet full-frame 60fps.</blockquote><p>For the sake of brevity and to keep things as simple and to the point, we won’t cover the boilerplate-y, housekeeping, and regular stuff such as adding library dependencies, setting up ViewPager2, adding Lottie Animations Views to some Layout XML, etc. We’ll skip directly to the meaty, exciting and fun parts.</p><h3>Without further ado, let’s dive in.</h3><p>From the design above, you can see that the onboarding flow revolves around three major pieces,</p><ol><li>Lottie animation playback, looping and frame control at a granular level</li><li>Background colour transitions between black, white and yellow</li><li>Synchronisation of UI elements like navbar and screen indicator with the scroll movement</li></ol><p>Let’s go through them one at a time.</p><h3>Lottie animation playback.</h3><p>The Lottie animation you see on each screen is two separate Lotties, conveniently named Primary and Secondary Lotties. The Primary Lottie is the large text that appears first in the background. The Secondary Lottie is the dynamic window that slides or fades in at the lower half of the screen after a certain period.</p><p>One of the challenges to implementing this behaviour was that the Secondary Lottie has two parts to it, and when it enters the canvas, say we split its frames into sections A -&gt; B -&gt; C, the Lottie has to playback the frames A -&gt; B once, and then immediately switch to an infinite loop between the frames B -&gt; C.</p><p>Another minor challenge was to synchronise the playback of Secondary Lottie animation, from a pre-specified frame of the ParentLottie, and reset this logic on every transition to a new page.</p><p>The data structure that we use to represent the Lottie based onboarding data:</p><pre>data class LottieOnBoarding(<br>    val versionNumber: Long,<br>    val parentLottie: ParentLottie,<br>    val childLotties: List&lt;ChildLottie&gt;,<br>    val windowColors: List&lt;ColorTuple&gt;,<br>    val proceedTexts: List&lt;String&gt;,<br>) {<br>    var totalPages = windowColors.size<br>    var lottieFormat: LottieFormat = LottieFormat.JSON<br><br>    data class ParentLottie(<br>        val url: String,<br>        val entry: FrameTuple,<br>        val pages: List&lt;FrameTuple&gt;,<br>        val exit: FrameTuple,<br>    )<br><br>    data class ChildLottie(<br>        val url: String,<br>        val entry: FrameTuple,<br>        val loop: FrameTuple<br>    )<br><br>    data class FrameTuple(<br>        val startFrame: Int,<br>        val endFrame: Int<br>    )<br>       <br>    data class ColorTuple(<br>        val background: String,<br>        val accent: String<br>    )<br><br>    enum class LottieFormat {<br>        JSON, DOT_LOTTIE<br>    }<br>}</pre><p>We begin by setting up the logic to handle screen or page scroll transitions by registering an OnPageChangeCallabacklistener and implementing its methods on the instance of our ViewPager.</p><pre>private fun setupPageScrollTransitions(<br>    totalTransitions: Int,<br>    colors: List&lt;ColorTuple&gt;,<br>    lottieFormat: LottieFormat<br>) {<br>    onBoardingViewPager.registerOnPageChangeCallback(object : OnPageChangeCallback() {<br>        override fun onPageScrolled(<br>            position: Int,<br>            positionOffset: Float,<br>            positionOffsetPixels: Int<br>        ) {<br>            handleBackgroundColorTransitions(<br>                colors = colors,<br>                position = position,<br>                positionOffset = positionOffset,<br>                totalTransitions = totalTransitions<br>            )</pre><pre>            handleParentLottieTransitions(<br>                position = position,<br>                positionOffset = positionOffset,<br>                totalTransitions = totalTransitions<br>            )</pre><pre>            handleChildLottieTransitions(<br>                positionOffset = positionOffset<br>            )</pre><pre>            handleNavBarTransitions(<br>                colors = colors,<br>                position = position,<br>                positionOffset = positionOffset,<br>                totalTransitions = totalTransitions<br>            )<br>        }</pre><pre>        override fun onPageSelected(position: Int) {<br>            setupClickListeners(position, totalTransitions)<br>            if (isEntryAnimationPlayed) {<br>                playChildLottie(<br>                    onBoardingData.childLotties[position],<br>                    lottieFormat<br>                )<br>            }<br>            showBottomNavBar()<br>        }</pre><pre>        override fun onPageScrollStateChanged(state: Int) {<br>            if (state == ViewPager2.SCROLL_STATE_IDLE) {<br>                binding.viewpagerIndicator.visibility = View.VISIBLE<br>                binding.textViewProceed.visibility = View.VISIBLE<br>                binding.proceedButton.visibility = View.VISIBLE<br>            }<br>        }<br>    })<br>}</pre><p>This OnPageChangeCallback listener is at the core of our logic to synchronise the horizontal finger based scroll movement with the progression or regression of our individual Lottie frames.</p><p>It provides us with three useful methods to override:</p><ol><li>onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) This method is called every time there is a scroll event on the screen. Out of the three parameters available here, position and possitionOffset are most useful in our case. The position parameter varies from the 0 → (n - 1) where n is the number of pages initialised in the ViewPager and holds the current page that is entirely visible, whereas the positionOffset parameter varies within the floating range 0.0 → 1.0 and holds the current fractional offset value from the left edge of the device as the user scrolls on the screen. This value varies from 0.0 → 1.0 as the user scrolls from Right → Left, and 1.0 → 0.0 otherwise.</li><li>onPageSelected(position: Int) This method is called when the screen or page has completed its scroll, and subsequently the position parameter holds the page number which varies from the 0 → (n - 1) where n is the number of pages initialised in the ViewPager. We personally used it to setup click listeners for the navbar elements, and also to control their visibility.</li><li>onPageScrollStateChanged(state: Int) This method is called whenever the scrolling state for the page undergoes a change. The three possible states are SCROLL_STATE_IDLE, SCROLL_STATE_DRAGGING and SCROLL_STATE_SETTLING. Again, we’ve used this to uniquely control the visibility of the navbar elements.</li></ol><p>This is how we control Parent Lottie transitions relative to the degree of page scroll.</p><pre>private fun handleParentLottieTransitions(<br>    position: Int,<br>    positionOffset: Float,<br>    totalTransitions: Int<br>) {<br>    if (position in 0 until totalTransitions <br>        &amp;&amp; isEntryAnimationPlayed) {<br>        binding.lottieParent.frame = lerp(<br>            onBoardingData.parentLottie<br>                          .pages[position]<br>                          .startFrame<br>                          .toFloat(),<br>            onBoardingData.parentLottie<br>                          .pages[position]<br>                          .endFrame<br>                          .toFloat()<br>                          .minus(1),<br>            positionOffset<br>       ).apply(::floor).toInt()<br>    }<br>}</pre><p>The handleParentLottieTransitions() method is called on every scroll event with the current position and positionOffset values as parameters. Here, we also check if the current page position is between 0 and the total pages defined in ViewPager, and the initial bit of the entry animation has played. If this is true, we update the frame property of the parent’s LottieView using a lerp() function, as given below:</p><pre>fun lerp(firstValue: Float, secondValue: Float, amount: Float): Float {<br>    return (secondValue - firstValue) * amount + firstValue<br>}</pre><p>The lerp() function essentially performs a <strong>Linear Interpolation</strong> between two values, using a third value to specify the amount to interpolate between these two values. An amount nearer to 0.1 would mean that the final value is nearer to the firstValue, and nearer to 0.9 means that the value is nearer to the secondValue.</p><p>Subsequently, the normal playback of the Parent Lottie, say on a button press is as follows:</p><pre>private fun playParentLottieForJson(parentLottie: ParentLottie) {<br>    binding.lottieParent.apply {<br>        LottieCompositionFactory.fromUrl(requireContext(), parentLottie.url)<br>            .addListener { composition -&gt;<br>                setComposition(composition)<br>                setMinAndMaxFrame(<br>                    parentLottie.entry.startFrame,<br>                    parentLottie.entry.endFrame.minus(1)<br>                )<br>                addAnimatorUpdateListener {<br>                    it.doOnEnd {<br>                        setMinAndMaxFrame(<br>                            parentLottie.entry.startFrame,<br>                            parentLottie.exit.endFrame<br>                        )<br>                        isEntryAnimationPlayed = true<br>                        playChildLottie(<br>                            onBoardingData.childLotties[0],<br>                            onBoardingData.lottieFormat<br>                        )<br>                    }<br>                }<br>                playAnimation()<br>            }.addFailureListener { e -&gt; e.printStackTrace() }<br>    }<br>}</pre><p>As its quite self-evident that ParentLottie is data model class which has properties such as url of the Lottie, start and end frames modelled as a FrameTuple for both entry and exit sections of the animation, and a list of pages or screens in-between modelled as a List&lt;FrameTuple&gt;.</p><p>We begin by using LottieCompositionFactory to load the Lottie from a url hosted on a network, and add a callback listener to await and set its composition. This is followed by setting the min and max frames of the Lottie, to the startFrame and endFrame of the entry section. Finally, at the end of playback of this section, we again reset the minand max frames to cover the entire range of the Lottie animation, and also initiate playback of that screen’s specific Child Lottie.</p><p>Similarly, the playback of Child Lottie is handled as follows</p><pre>private fun playChildLottieForJson(childLottie: ChildLottie) {<br>        binding.lottieChild.apply {<br>            cancelAnimation()<br>            LottieCompositionFactory.fromUrl(requireContext(), childLottie.url)<br>                .addListener { composition -&gt;<br>                    setComposition(composition)<br>                    setMinAndMaxFrame(<br>                        childLottie.entry.startFrame,<br>                        childLottie.loop.endFrame<br>                    )<br>                    addAnimatorUpdateListener {<br>                        if (frame == childLottie.entry.endFrame.minus(1)) {<br>                            removeAllUpdateListeners()<br>                            setMinAndMaxFrame(<br>                                childLottie.loop.startFrame,<br>                                childLottie.loop.endFrame<br>                            )<br>                            repeatCount = LottieDrawable.INFINITE<br>                        }<br>                    }<br>                    playAnimation()<br>                }.addFailureListener { e -&gt; e.printStackTrace() }<br>        }<br>    }</pre><p>Here, too the handling is very similar to how Parent Lottie is handled, except a few differences like we call cancelAnimation() at the top to terminate any existing Child Lottie that might be playing from the previous screen. Additionally, we add an update listener and inside it we check if the current frame is the endFrame of the entry section for Child Lottie, and if it is, we remove the update listeners to prevent any potential memory leaks, and unnecessary GC collections.</p><p>More importantly, we reset the min and max frames to startFrame and endFrame of the loop section of Child Lottie, and set the repeatCount property of the Lottie view to LottieDrawable.INFINITE.</p><h3>Background colour transitions.</h3><pre>private fun handleBackgroundColorTransitions(<br>    colors: List&lt;ColorTuple&gt;,<br>    position: Int,<br>    positionOffset: Float,<br>    totalTransitions: Int<br>) {<br>    binding.viewpagerUserOnboarding.apply {<br>        when (position) {<br>            in 0 until totalTransitions -&gt; {<br>                ArgbEvaluatorCompat().evaluate(<br>                    positionOffset,<br>                    Color.parseColor(colors[position].background),<br>                    Color.parseColor(colors[position + 1].background)<br>                ).apply(::setBackgroundColor)<br>            }<br>            else -&gt; setBackgroundColor(Color.parseColor(colors[colors.size - 1].background))<br>        }<br>    }<br>}</pre><p>The smooth background colour transition between, Black, White and Yellow, and the transitory colours in-between are calculated using ArgbEvaluatorCompat class available as part of the Android Material library.</p><h3>Synchronisation of UI elements with scroll.</h3><p>The visibility, alpha, and translation behaviour of the UI elements like the Page Indicator and the text in the Navbar are controlled using two appropriately name methods — showBottomNavBar() and hideBottomNavBar() given as follows:</p><pre>private fun showBottomNavBar(): AnimatorSet {<br>    binding.apply {<br>        viewpagerIndicator.visibility = View.VISIBLE<br>        textViewProceed.visibility = View.VISIBLE<br>        proceedButton.visibility = View.VISIBLE<br>    }</pre><pre>    val indicatorTranslateAnim = binding.viewpagerIndicator.translateY(from = 200f, to = 0f)<br>    val indicatorAlphaAnim = binding.viewpagerIndicator.transformAlpha(from = 0f, to = 1f)</pre><pre>    val proceedTextTranslateAnim = binding.textViewProceed.translateY(from = 200f, to = 0f)<br>    val proceedTextAlphaAnim = binding.textViewProceed.transformAlpha(from = 0f, to = 1f)</pre><pre>    val proceedButtonTranslateAnim = binding.proceedButton.translateY(from = 200f, to = 0f)<br>    val proceedButtonAlphaAnim = binding.proceedButton.transformAlpha(from = 0f, to = 1f)</pre><pre>    return showNavBarAnimatorSet.apply {<br>        play(indicatorTranslateAnim).with(indicatorAlphaAnim)<br>        play(indicatorAlphaAnim).with(proceedTextTranslateAnim)<br>        play(proceedTextTranslateAnim).with(proceedTextAlphaAnim)<br>        play(proceedButtonTranslateAnim).with(proceedButtonAlphaAnim)</pre><pre>        duration = 500L<br>        startDelay = 1000L<br>        interpolator = DecelerateInterpolator()<br>        start()<br>    }<br>}</pre><pre>private fun hideBottomNavBar(): AnimatorSet {<br>    val indicatorTranslateAnim = binding.viewpagerIndicator.translateY(from = 0f, to = 200f)<br>    val indicatorAlphaAnim = binding.viewpagerIndicator.transformAlpha(from = 1f, to = 0f)</pre><pre>    val proceedTextTranslateAnim = binding.textViewProceed.translateY(from = 0f, to = 200f)<br>    val proceedTextAlphaAnim = binding.textViewProceed.transformAlpha(from = 1f, to = 0f)</pre><pre>    val proceedButtonTranslateAnim = binding.proceedButton.translateY(from = 0f, to = 200f)<br>    val proceedButtonAlphaAnim = binding.proceedButton.transformAlpha(from = 1f, to = 0f)</pre><pre>    return hideNavBarAnimatorSet.apply {<br>        play(indicatorTranslateAnim).with(indicatorAlphaAnim)<br>        play(indicatorAlphaAnim).with(proceedTextTranslateAnim)<br>        play(proceedTextTranslateAnim).with(proceedTextAlphaAnim)<br>        play(proceedButtonTranslateAnim).with(proceedButtonAlphaAnim)</pre><pre>        duration = 200L<br>        interpolator = AccelerateInterpolator()<br>        start()<br>    }<br>}</pre><pre>// Extension functions to handle translation and alpha<br>fun View.translateY(from: Float, to: Float): ObjectAnimator =<br>    ObjectAnimator.ofFloat(this, View.TRANSLATION_Y, from, to)</pre><pre>fun View.transformAlpha(from: Float, to: Float): ObjectAnimator =<br>    ObjectAnimator.ofFloat(this, View.ALPHA, from, to)</pre><p>The implementation is pretty straight forward with the usage of ObjectAnimator to control the Y-axis translation and Alpha channel transformation of the Navbar UI elements, which are handled using the extension functions translateY() and transformAlpha() on the View class.</p><p>This brings us to the end, where we saw how Lottie Animations working with JSON files, coupled with ViewPager and some clever maths can allow us to create powerful and elegant animations so easily.</p><p>If you liked the article please show some love by clicking ♥ and sharing with your friends. You can follow me on <a href="https://twitter.com/AtriTripathi">Twitter</a> or hit me up on <a href="https://www.linkedin.com/in/atritripathi/">LinkedIn</a> if you want to get in touch.</p><p>Ciao!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5ce9b6be518" width="1" height="1" alt=""><hr><p><a href="https://medium.com/supershare-blog/the-fascinating-dance-of-lottie-android-with-viewpager2-and-then-some-d5ce9b6be518">The fascinating dance of Lottie Android with ViewPager2 and then some.</a> was originally published in <a href="https://medium.com/supershare-blog">SuperShare</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Art and Aesthetics of Work]]></title>
            <link>https://atritripathi.medium.com/the-art-and-aesthetics-of-work-31ad9128bdf5?source=rss-5367763e2e09------2</link>
            <guid isPermaLink="false">https://medium.com/p/31ad9128bdf5</guid>
            <category><![CDATA[beauty]]></category>
            <category><![CDATA[imagination]]></category>
            <category><![CDATA[aesthetics]]></category>
            <category><![CDATA[work]]></category>
            <category><![CDATA[art]]></category>
            <dc:creator><![CDATA[Atri Tripathi]]></dc:creator>
            <pubDate>Sun, 27 Jun 2021 11:46:15 GMT</pubDate>
            <atom:updated>2021-06-27T11:46:15.593Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P0tKFsbJvKC8gk31wOKm1Q.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@igormiske?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Igor Miske</a> on <a href="https://unsplash.com/collections/2189373/my-first-collection/72c98c51105c42d51b8797890209a72b?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><blockquote>“When you’re a carpenter making a beautiful chest of drawers, you’re not going to use a piece of plywood on the back, even though it faces the wall and nobody will ever see it. You’ll know it’s there, so you’re going to use a beautiful piece of wood on the back.<br> — Steve Jobs</blockquote><p>Art is that subtle reality of nature to infuse the world, its bosom, with symmetry and asymmetry, chaos and order, in the same manifestation of the subject. And to assimilate art is to exercise keenness in our observation of the existence.</p><h3>The veneer of aesthetics</h3><p>Aesthetics is the science of art.</p><p>It is the joint result of an intellectual and a sensitive life: requiring an exquisite delicacy in the organisation of the nervous system, to convey to the mind the slightest impressions from the external world, with intellectual power to appreciate them.</p><p>To enjoy these more refined delights of sense, which a perfect and harmonious form, or richness and delicacy of colour, or the harmonies and melodies of sound, supply to the cultivated eye or ear, is the privilege of many.</p><p>But to give these <strong>“void nothings a local existence and a name”</strong>; to fix in marble an ideal form, or to render permanent on canvas the gentle light of morning, or the bright yellow afternoon sun with heavenly alchemy; or with words alone to represent the luxurious existence itself, is the prerogative of a genius artist.</p><h3>Beauty in observation</h3><p>It takes patience to observe admittedly that the canvas of the painting has been artful, well before the painter made his first stroke. But it lacked beauty; a superior possibility to offer the self-satisfaction of a pleasant experience to the beholder.</p><blockquote>Whatever the subject, a true artist always transfers to the canvas, and renders permanent to all visible eyes — a moral beauty: not mere animal beauty, not even the mere virtue of the form, but a higher kind, a spiritual beauty.</blockquote><p>There are times when the calm of external nature sink deepest into our hearts. The golden glow in which the evening sun steeps the earth seems more precious; the early morning light casts more exquisitely delicate shadows; the grass and the trees above them are of a fresher, brighter green against a bluer sky; the evening clouds are more vibrant in their gorgeous glories, and the artist feels more earnestly that these all are the outward visible emblems of mother nature impregnating his mind with enigmatic imaginations.</p><p>The poet’s range is even higher, from the faculties of his instruments. His words are his wealth and go at once to the collective human heart. His embodiments of the artistry and the ideal are carried in the memories of humanity, long after he takes the eternal nap.</p><h3>Truth of imagination</h3><p>Imagination is the inherent power of an artist, who clothes profound truths in his work, through words in poetry, by sound in music, by colours and forms in painting, by form alone in architecture. The eye to see in the visible forms the “invisible law”, combined with the hand to give to the visible the invisible power, constitutes genius; the union of reason and imagination.</p><p>If imagination is the power of embodying invisible truths in our minds, its use in our work would consist in conveying, in the best manner, the highest truths. As the painter does this in colour, the sculptor in marble, the architect in stone, the musician in sound, the poet in verse, so can make the rest of the humanity in their work; and the manner in which the artist conveys his truths can make so significant a difference in their reception, that the imagination becomes a faculty of high importance.</p><p>Therefore, as two of the principle faculties of our nature — a refined intellectual power, and an exquisite material instrument, are thus brought into active and harmonious union, their possessors become the favourites of humanity.</p><h3>The artistry</h3><p>The first criteria for being an artist is to have taste.</p><p>It is a hopeful sign when any artist becomes intellectually self-reliant — a sure sign of developing character and taste: when he accepts an inspiration because, in his recognisance, he believes it to be intrinsically good. Self-trust is inseparable from his being, and to inspire anyone to a higher degree of self-trust with his work is above all, to help him to help himself.</p><p>His work possesses grace and poise. He can impersonate the highest beauty in his work, the beauty of his being, and the union of goodness, gracefulness, dignity, humility, tenderness, repose, joy and love.</p><p>He is an artist who is able to look at those truths which, transient and rare though it may be, others make still rarer by overlooking.</p><p>Be an artist.</p><blockquote><em>Follow me for more on </em><a href="https://twitter.com/AtriTripathi"><em>Twitter</em></a><em> and </em><a href="https://www.linkedin.com/in/atritripathi/"><em>LinkedIn</em></a><em>!</em></blockquote><p><em>This post originally appeared on my website:</em></p><p><a href="https://atritripathi.com/posts/the-art-and-aesthetics-of-work/">The Art and Aesthetics of Work</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31ad9128bdf5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>