<?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 Damanpreet Singh on Medium]]></title>
        <description><![CDATA[Stories by Damanpreet Singh on Medium]]></description>
        <link>https://medium.com/@damanpreetsb?source=rss-865045e2aad4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*aLEELQukHQ_6E5qh.</url>
            <title>Stories by Damanpreet Singh on Medium</title>
            <link>https://medium.com/@damanpreetsb?source=rss-865045e2aad4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 04:47:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@damanpreetsb/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[My journey from Android to React]]></title>
            <link>https://proandroiddev.com/my-journey-from-android-to-react-d9cb750b5d8?source=rss-865045e2aad4------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9cb750b5d8</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Damanpreet Singh]]></dc:creator>
            <pubDate>Thu, 31 Oct 2019 09:04:51 GMT</pubDate>
            <atom:updated>2019-10-31T09:17:39.849Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*StJlu0Da4z8mQYhxDOo5aA.png" /></figure><p>As technology grows fast you need to develop your skills faster. There are different technical languages which are available in the market and every language has its own pros and cons.</p><p>It’s always been procrastination for me to start a different language. I am an Android Developer and was developing apps for more than 3 years and had never touched any other language. I wanted to be a pro in Android application development.</p><p>A few months back, I got an opportunity to start with React. I started discussing the same with my seniors and friends.</p><blockquote><strong>Should I try another language too or stick with Android Development?</strong></blockquote><p>After a few discussions, I convinced myself to give a try to React.</p><p>I started going through the syntax of Javascript and moved to React development in a week. It was very easy to learn React Development for me because I was an Android Developer. I was able to relate quite a lot of things of React with Android.</p><p>Before I start to tell you about my experience, I want you to give it a try first.</p><p>Let’s have a look, how it’s related to Android.</p><h4><strong>Props (React) works as Extras in Intent (Android)</strong></h4><p>We can pass any information from one component to another using ‘<a href="https://www.w3schools.com/react/react_props.asp"><em>props</em></a><em>’</em>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e3796ab7865e0efcd82c82743a2481f9/href">https://medium.com/media/e3796ab7865e0efcd82c82743a2481f9/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d4d5e1264110e5533bed9839c91c8a2d/href">https://medium.com/media/d4d5e1264110e5533bed9839c91c8a2d/href</a></iframe><h4>Render (React) works similar to LayoutInflator (Android)</h4><p><a href="https://reactjs.org/docs/rendering-elements.html"><em>Render</em></a> function in React is used to inflate any view on the screen. We can pass any HTML element or Component to render.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/56a262957e2e6e1eb80ff6e843d584da/href">https://medium.com/media/56a262957e2e6e1eb80ff6e843d584da/href</a></iframe><h4>Architecture (React) has almost the same layers (Android)</h4><p>The architecture of any software completely depends on the use-case of the product. But, we can adopt the same architecture of Android in React.</p><ul><li>Presentation Layer: It includes Components and Containers</li><li>Domain Layer: It includes Actions and Reducers</li><li>Data Layer: It includes Services</li></ul><h4>App.css (React) is like styles.xml (Android)</h4><p>We can write different attributes under one class name and provide that class name to any element and it will inherit all the properties of that class.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/26b853c508d5fa15dc30ada038d1a6ff/href">https://medium.com/media/26b853c508d5fa15dc30ada038d1a6ff/href</a></iframe><h4>JSX (React) behaves like JetPack Compose (Android)</h4><p>JSX allows us to write HTML in React. All we need to provide .jsx extension to our file and it will start accepting HTML elements.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/adc079a4bbb054e53c57e823a01a7bab/href">https://medium.com/media/adc079a4bbb054e53c57e823a01a7bab/href</a></iframe><h4>MainCompnent (React) can behave like Activity (Android) and SubComponents (React) can behave like Fragments (Android)</h4><p>We can also use components as Activities or Fragments. We can render a component inside a component and provides all the features as we provide in Android. Because of this feature, it is easy to achieve bottom navigation, tabbed activity or navigation drawer feature in React.</p><h4>Package.json (React) is very similar to build.gradle (Android)</h4><p>We can provide all the dependencies in package.json. We can also separate d<em>ev</em> dependencies from <em>prod</em> dependencies.</p><h3><strong><em>External Dependencies</em></strong></h3><h4>Ant-D/Material UI (React) behave similarly to Material Design (Android)</h4><p>We can use any of the designing libraries in React. My personal favorite is <a href="https://ant.design/"><em>Ant-D</em></a></p><h4>Redux (React) works as EventBus (Android)</h4><p><a href="https://redux.js.org/introduction/getting-started"><em>Redux</em></a> is very helpful for state management of the whole app. It stores the state in an object tree inside a single store.</p><h4>Axios (React) works as Retrofit (Android)</h4><p><a href="https://github.com/axios/axios"><em>Axios</em></a> is an Http client that we can use to call REST APIs. It is a promise-based client so we can take advantage of async or await.</p><h3>React Over Android</h3><h4>Fast reload</h4><p>This is the best feature in any web-based language. React only render changes so there is no need to reload the whole page again. Also, the reloading time of an application is very less as compared to Android.</p><h4>No more ANR or crash popups</h4><p>There is no need to worry about it in React as a bug will not crash your application.</p><h4>Easier state management</h4><p>React has a very good mechanism to manage states. We can create states for every component which helps to handle UI according to the state of the component ex. Fetching Data, Loading, Error, Success, etc.</p><h3>Conclusion</h3><p>I adapt many things from React which I am trying to do in Android. Different languages help you to think in different ways. Every language has its own beauty. IMHO, we should try different languages to learn and adapt more. It’s okay to be a monolingual programmer but it limits your potential and your usefulness.</p><p>You can connect with me at <a href="https://github.com/damanpreetsb">Github</a>, <a href="https://www.linkedin.com/in/damanpreetsb/">Linkedin</a>, and <a href="https://twitter.com/damanpreetsb">Twitter</a>.</p><p>Thanks for reading the article. Suggestions, corrections or comments are always welcomed. If you like it, don’t forget to clap and share the article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9cb750b5d8" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/my-journey-from-android-to-react-d9cb750b5d8">My journey from Android to React</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Make UX better with Android Animations]]></title>
            <link>https://proandroiddev.com/make-ux-better-with-android-animations-207992d6f98a?source=rss-865045e2aad4------2</link>
            <guid isPermaLink="false">https://medium.com/p/207992d6f98a</guid>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Damanpreet Singh]]></dc:creator>
            <pubDate>Sat, 25 May 2019 16:30:51 GMT</pubDate>
            <atom:updated>2019-05-28T17:12:57.237Z</atom:updated>
            <content:encoded><![CDATA[<p>In the world of functionality first, sometimes we underestimate the power of User experience. Admit it, users don’t like the apps which are not visually appealing. To make an app out of the box we need to give our functionality a booster of Animations.</p><p>Let’s take a use case:</p><p><em>We need an app in which a user can order a pizza with some customizations. Now think for a minute, How will you showcase this use case?</em></p><p>After a lot of searching, I got stuck upon a design which changed my way of representing functionalities to end-user.</p><p>So here is the design:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*pmXLiiDpfQqIYjzxWDEskQ.gif" /><figcaption><a href="https://www.uplabs.com/posts/pizza-ordering-interaction-design">https://www.uplabs.com/posts/pizza-ordering-interaction-design</a></figcaption></figure><p>Now we need to convert this design into code. Easy job? Not actually.</p><p>Firstly, we need to convert the GIF file into the frames by using any tool like <a href="https://ezgif.com/split">ezgif</a> or slow down the GIF for better understanding of animation.</p><p>Let’s take a closer look and check out each screen one by one.</p><ol><li><strong>Pizza list screen</strong></li><li><strong>Customization screen</strong></li><li><strong>Track your delivery screen</strong></li></ol><p>Now we have a better understanding of design. It’s time to convert it into code.</p><h3><strong>Pizza List Screen</strong></h3><p>This screen is showing a list of pizzas and by clicking on “CUSTOMISE” button we navigate to another screen with the morphing of pizza image of the current screen and pizza base of another screen.</p><p>Have you heard about <a href="https://guides.codepath.com/android/shared-element-activity-transition"><em>SharedElementTransition</em></a>? If not, Please have a look.</p><p>By adding a few lines we can achieve this.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9a06fcf396b8d98472ece9c54701bd31/href">https://medium.com/media/9a06fcf396b8d98472ece9c54701bd31/href</a></iframe><p>Don’t forget to mention below code line in your styles.xml</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9eafae177dc8ce003d3fd54b1e08a66f/href">https://medium.com/media/9eafae177dc8ce003d3fd54b1e08a66f/href</a></iframe><p><strong>Customization screen</strong></p><p>Here we need plenty of animations. Before starting this screen let’s take a brief of <a href="https://developer.android.com/reference/android/animation/ObjectAnimator">ObjectAnimator</a>, <a href="https://developer.android.com/reference/android/animation/ValueAnimator">ValueAnimator</a>, and <a href="https://developer.android.com/reference/android/view/animation/AnimationSet">AnimationSet</a></p><blockquote>ObjectAnimator : This subclass of ValueAnimator provides support for animating properties on target objects.</blockquote><p>I chose ObjectAnimator because it has some named properties like ScaleX, Rotate, etc. which automatically animates and we don’t need to update them as we need in ValueAnimator.</p><blockquote>ValueAnimator: This class provides a simple timing engine for running animations which calculate animated values and set them on target objects.</blockquote><p>I chose ValueAnimator where I need to animate a value like Int, Float, etc. We need to update our value every time on animation updates.</p><blockquote>AnimationSet: Represents a group of Animations that should be played together.</blockquote><p>I need to show multiple animations together or in sequential order. AnimationSet is the best fit for this.</p><p>Let’s breakdown the animations what we need in this screen.</p><h4>AnimateCheeseHeight</h4><p>When we start this screen we noticed the height of cheese of Pizza is increasing. So to change the height we need ValueAnimator. We will increase the height from 10dp to 30dp. As I mention above we need to update the value on AnimatorUpdateListener. Hence, I am getting the updated height value and updating the layout params of PizzaCheeseImageView.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b6c48e6a8d22c7bc7df6005aa37173c/href">https://medium.com/media/8b6c48e6a8d22c7bc7df6005aa37173c/href</a></iframe><h4>AnimateCrustHeight</h4><p>With an increase of cheese height, our crust height is also increasing. I am using ValueAnimator here also. Also, when our height increases, we need to change the corner radius to provide a uniform shape to our view. So, I am also updating the radius along with the height of PizzaCrustImageView.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb1364e3a2e88fef28754bdc03f6665b/href">https://medium.com/media/bb1364e3a2e88fef28754bdc03f6665b/href</a></iframe><h4>AnimateToppings</h4><p>When a user selects a topping we need to show a falling animation of toppings from top of the screen to above cheese of pizza. I am using ObjectAnimator here as it has a property called “translationY” which helps of toppings to animate from intialY to destinationY position. Also, I am using AccelerateInterpolator which helps to speed up my animation gradually.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3fb29b7c7f126f9b82ad5abbd41c052/href">https://medium.com/media/a3fb29b7c7f126f9b82ad5abbd41c052/href</a></iframe><h4>AnimatePizzaLayout</h4><p>As we can observe that multiple animations are going on. So, we can further break them down into parts.</p><p><em>FadeCheeseAnimation</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5173489d8095e04761dfdb5fe061386e/href">https://medium.com/media/5173489d8095e04761dfdb5fe061386e/href</a></iframe><p><em>FadeCrustAnimation</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d322e5e12e7adf49b1deddfa09ac8da5/href">https://medium.com/media/d322e5e12e7adf49b1deddfa09ac8da5/href</a></iframe><p><em>FadeInPizzaAnimation</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/68b828dfcd59f5917c4cd2163d81e41a/href">https://medium.com/media/68b828dfcd59f5917c4cd2163d81e41a/href</a></iframe><p><em>ScaleUpPizzaXAnimation</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8df52a04e49f92de3cf4977ae4a2e2fd/href">https://medium.com/media/8df52a04e49f92de3cf4977ae4a2e2fd/href</a></iframe><p><em>ScaleUpPizzaYAnimation</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/652020776772e5e31b3e8127f72731b0/href">https://medium.com/media/652020776772e5e31b3e8127f72731b0/href</a></iframe><p><em>TranslatePizzaYAnimation</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9424939cf6aa3dcbecedeb37be2d895e/href">https://medium.com/media/9424939cf6aa3dcbecedeb37be2d895e/href</a></iframe><p><em>PlayAnimationsTogether</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/141e4a44bd27551811db4112fe43d6b0/href">https://medium.com/media/141e4a44bd27551811db4112fe43d6b0/href</a></iframe><h3>Track your delivery screen</h3><p>In this screen, we need to animate front of the box and rotate complete box along with the scaling and translation.</p><h4>AnimateFrontCover</h4><p>We can also use <a href="https://developer.android.com/reference/android/view/ViewPropertyAnimator">ViewPropertyAnimator</a> instead of ObjectAnimator for animation. By using ViewPropertyAnimator, we can perform multiple animations together without using AnimtionSet. It provides a better syntax and an optimized way to animate a view.</p><blockquote>NOTE: If only one or two properties on a View object are being animated, then using an <a href="https://developer.android.com/reference/android/animation/ObjectAnimator.html">ObjectAnimator</a> is fine; the property setters called by ObjectAnimator are well equipped to do the right thing to set the property and invalidate the view appropriately. But if several properties are animated simultaneously, or if you just want a more convenient syntax to animate a specific property, then ViewPropertyAnimator might be more well-suited to the task.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6dff53ddd8ccd58d826f2eb03f6c00b9/href">https://medium.com/media/6dff53ddd8ccd58d826f2eb03f6c00b9/href</a></iframe><h4>RotateBoxAnimation (along with scaling and translation)</h4><p>Again, multiple animations are going on. So, we need to further break them down into parts.</p><p><em>ScaleDownXAnimation</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c68bc72485405d343e8791758cc50338/href">https://medium.com/media/c68bc72485405d343e8791758cc50338/href</a></iframe><p><em>ScaleDownYAnimation</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b94ce79939b16afde9c50f0e81ff0d1a/href">https://medium.com/media/b94ce79939b16afde9c50f0e81ff0d1a/href</a></iframe><p><em>RotateBoxAnimation</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/53c7f74a962c9325d1a16aa41717f9ea/href">https://medium.com/media/53c7f74a962c9325d1a16aa41717f9ea/href</a></iframe><p><em>TranslateXAnimation</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c96d96f533d9e718681a1fe476324850/href">https://medium.com/media/c96d96f533d9e718681a1fe476324850/href</a></iframe><p><em>PlayAnimationsTogether</em></p><p>We need to play ScaleDownX, ScaleDownY, and RotateBox animations together and after that, we need to play TranslateX animation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/69847118515411ac9ed0dea47d4374f3/href">https://medium.com/media/69847118515411ac9ed0dea47d4374f3/href</a></iframe><p>That’s all!</p><h3>Showtime</h3><p>Let’s run the code and see the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*VLu0E_8TLrpjIN8SIyFupg.gif" /></figure><p>We have successfully converted the design into code by observing the animations carefully and applying a few animations properties of Android.</p><p>You can check out the full source code on <a href="https://github.com/damanpreetsb/PizzaZone">Github</a>.</p><p>You can connect with me at <a href="https://github.com/damanpreetsb">Github</a>, <a href="https://www.linkedin.com/in/damanpreetsb/">Linkedin</a>, and <a href="https://twitter.com/damanpreetsb">Twitter</a>.</p><p>Thanks for reading the article. Suggestions/ Corrections/ Comments are always welcomed. If you like it, please hit the like button and share the article with the Android community. Let’s share the knowledge as much as we can.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=207992d6f98a" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/make-ux-better-with-android-animations-207992d6f98a">Make UX better with Android Animations</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>