<?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 Luís Mestre on Medium]]></title>
        <description><![CDATA[Stories by Luís Mestre on Medium]]></description>
        <link>https://medium.com/@lmestre?source=rss-dd2832364d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*f4CQ3x_z96Hywzr9NSd47Q.jpeg</url>
            <title>Stories by Luís Mestre on Medium</title>
            <link>https://medium.com/@lmestre?source=rss-dd2832364d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 06:36:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lmestre/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[#2 RN Development: How to create a Parallax ScrollView]]></title>
            <link>https://medium.com/@lmestre/2-rn-development-how-to-create-a-parallax-scrollview-1be31aa1137e?source=rss-dd2832364d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1be31aa1137e</guid>
            <category><![CDATA[parallax-effect]]></category>
            <category><![CDATA[parallax-scrolling]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Luís Mestre]]></dc:creator>
            <pubDate>Sun, 26 Apr 2020 19:20:16 GMT</pubDate>
            <atom:updated>2020-04-26T19:20:16.369Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iuqYwpjCu5tQJNRwX8QTcA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@frostroomhead?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Rodion Kutsaev</a> on <a href="https://unsplash.com/s/photos/mobile?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Although there are some components that allow you to create this type of animation, I’ve always been curious about creating my own in order to have full control over the component itself. The first component that I’ve used that could achieve this effect was <a href="https://github.com/i6mi6/react-native-parallax-scroll-view">react-native-parallax-scroll-view</a> by <a href="https://github.com/i6mi6">Alexander Vitanov</a> in one of my first professional projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/1*iF5pfbOOTmFGkuOzBTnkyA.gif" /><figcaption><a href="https://github.com/i6mi6">Alexander Vitanov</a> component in action</figcaption></figure><p>While I was reading the documentation and implementing it I’d always feel amazed at how that was done, what calculations were made and how the code was organized, this thought grew on me and since I’ve moved on to other projects there was never the tendency to think about that until last month.</p><p>Because of the pandemic the company I work on decided to send everyone to work remotely, and as the days passed the company decided to start working on a new project that could help people during the situation, and in this project one we had to implement an app in which in the design they decided to add screens that would have this effect, but since then I’ve grown and learned so much about React-Native that I decided this time I would implement my own parallax-scrollview.</p><p>So in this tutorial I hope to help you learn about animations, structure, and hopefully some logic along the way.</p><p>In terms of components we are only going to use 2 components, View and Animated from react-native, and to begin we’re going to declare our animated value and add a listener to our Animated value (it’ll be explained later on).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7133407308c06f6dfb4991d671956d94/href">https://medium.com/media/7133407308c06f6dfb4991d671956d94/href</a></iframe><p>Next we’re going to create the animated event and map it to our scrollview</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/78baee6e1e2b8f9cb08962411d9a5db6/href">https://medium.com/media/78baee6e1e2b8f9cb08962411d9a5db6/href</a></iframe><p>Now we already have mapped the on scroll event, we’re going to create 3 sections: ParallaxHeader, StickyHeader, FixedHeader; like so</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f06af28a8535157b19dedec0e9806118/href">https://medium.com/media/f06af28a8535157b19dedec0e9806118/href</a></iframe><p>Basic explanation for those 3 sections:</p><ul><li>ParallaxHeader is normally the image or background you want to display when you’re at the beginning of the scrollview;</li><li>StickyHeader is that part you want to be over the parallax header but stick to the top of the scrollview and continue during the entire scroll;</li><li>FixedHeader is normally the actions you want to be available on top of the scroll at all times</li></ul><p>It’s common practive for the sticky and fixed headers to be of same height, normally I use my header component.</p><p>Now that we’ve mapped the sections there are only 3 things missing, finishing the onScroll listener, adding the stickyHeaderIndices prop and adding a “margin” View for the sticky header. This will basically place in a better way the sticky header, like so</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fe37c5f40de75f1c33922d87f9d97d78/href">https://medium.com/media/fe37c5f40de75f1c33922d87f9d97d78/href</a></iframe><p>At this point you’ve probably saw that we’ve updated the onScroll method, so basically by accessing the props you can receive the current scroll value if you pass on a onScroll function, and onSticky is basically the function that will be called when the sticky component gets “sticky”.</p><p>And with this you are basically done with a normal ParallaxScrollView, and as a result, to use this component you only have to something like this, and this is the final result</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de084cc1e5e16028e24aa2ab3bf2fda5/href">https://medium.com/media/de084cc1e5e16028e24aa2ab3bf2fda5/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*JnnX5p06TJ8odyLptzo8zw.gif" /></figure><p>Last notes, the component has to receive the follwing props:</p><ul><li>parallaxHeaderHeight: height of the Parallax Header Component</li><li>stickyHeaderHeight: height of the Sticky Header Component</li><li>parallaxHeader: function that returns the Parallax Header Component</li><li>fixedHeader: function that returns the Fixed Header Component</li><li>stickyHeader: function that returns the Sticky Header Component</li></ul><p>All the code used is available in my github repository:</p><p><a href="https://github.com/LMestre14/RN-Challeng-2/">LMestre14/RN-Challeng-2</a></p><p>Hope you liked it and learned something along the way. Any questions or suggestions will be gladly taken in consideration for future posts. Hope you have a nice week.</p><p>And of course stay safe, wash your hands and stay positive :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1be31aa1137e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I wrote a Suicide Note]]></title>
            <link>https://medium.com/@lmestre/i-wrote-a-suicide-note-c644a94ee003?source=rss-dd2832364d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c644a94ee003</guid>
            <category><![CDATA[true-story]]></category>
            <category><![CDATA[bullying]]></category>
            <category><![CDATA[suicide]]></category>
            <category><![CDATA[stor]]></category>
            <dc:creator><![CDATA[Luís Mestre]]></dc:creator>
            <pubDate>Thu, 16 Apr 2020 11:27:24 GMT</pubDate>
            <atom:updated>2020-04-16T11:29:03.507Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nrybi4lKJzoWHTl1B1d1yQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@elijahsad?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Elijah O’Donnell</a> on <a href="https://unsplash.com/s/photos/suicide?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>I was in 6th grade, it was the end of the last semester and at school we were all celebrating the coming of Summer. It was literally a school party, just music and everyone dancing at the rhythm.</p><p>But I wasn’t that much of a dancer nor was I even in a party spirit. The school year wasn’t the best for me, at least that’s how I thought about it. It wasn’t bad in terms of grades, I was actually above average and at the top of my class. Math, English, Geography, you name it.</p><p>And it wasn’t because I was lonely, I had a handful of friends that I would spend the recesses with. Sure sometimes I would alone, but mostly it was by choice since most of the times I felt like I was just there and not a part of the group.</p><p>To pass the time I would normally listen to music, it was like my <em>escapé</em> and companion through those times. And I was really passionate about music as well, I would sometimes listen to music before going to sleep and browse through the internet over my favorite artists, and sometimes I would use stereo to play my cds. Queen, Michael Jackson, Def Leppard were my favorites at the time.</p><p>And also I would always use my free time at home to even write my lyrics about anything, but it would mostly go around the romantic route. I didn’t have a girlfriend at the time but there was always someone who would catch my eye.</p><p>Getting a bit off track… as I said, it wasn’t my best year, the previous year there was a guy in my class that for some reason just didn’t like me. He would always push my buttons somehow and always had something to say to me back then, either it was something “just for laughs” or even just to offend/make fun of me.</p><p>There was this one time I actually confronted and insulted him right in front of the class, little did I know that his friends would just grab me, put me in my knees and he just came up to me, asked to repeat what I said and than punched my face 5 times in a row. My eybrow basically swole enough to cover my eye and couldn’t see anything for like 3 days straight.</p><p>Even though he eventually “apologized” for it I never did accept his apology and he didn’t stop picking on me afterwards.</p><p>I can’t exactly remember what happened that day, that last day before summer. I remember the party and the music, but I don’t know what exactly happened in detail. All I remember is that I was so sick of the shitty day I was having that instead of taking the bus home I decided to walk home. During that 2 km (1.42 miles) walk I remember listening to music, specifically Eminem, and as I was crying and walking, I started to write in my head like lyrics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6LKuKNtInUryoHUmRLh9pQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@stevenhoustonfitness?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Steven Houston</a> on <a href="https://unsplash.com/s/photos/write?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>As soon as I got home I wrote everything on paper. All the thoughts, all the suffering. When I finished I felt relieved in a way, as in my anger was transfered to that piece of paper, and in a bit of irony it was in a way the most personal lyric I wrote. In a way I thought it was too good to even keep it with the others, and since I was going to leave home at the end of the day to spend my first 2 weeks of holidays away I kept it inside one of my school books.</p><p>When I finally arrived at my destination I would later that night call my mom to reassure her that the trip went well and that I was fine. And she was silent for a while and answered “That’s great honey… hum just so you know, I went to your bedroom and was going to organize your books and this piece of paper fell from one of the books.” as I heard my heart for a moment stopped and didn’t know what to say. The only thing I could think of to answer was “Oh right, that paper is nothing mom, no worries”, and after she said “We’ll talk after you return… have fun sweetie”.</p><p>Those 2 weeks passed by, every night I would call my mom just to let her know the day went well and had fun, but my voice would always tremble a bit because I didn’t know how she was and what was she thinking. And then the trip ended, my father drop me off and said goodbye, and right after I entered my house, and there was my mom. She hugged me, which took me by surprise at first and I hugged her back obviously, I actually thought that she was over it. And when I was going to my bedroom I looked at the living room’s table and saw the piece of paper.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8SC-6Sa5zkGa9Mfu3WXmXA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@andrewtneel?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Andrew Neel</a> on <a href="https://unsplash.com/s/photos/sad?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>After I left my bags in my room my mom was waiting for me in the living room, sitting on the sofa. I approached and as soon I got close I told her that she didn’t need to worry that I was just letting of steam when I wrote it. She calmly asked me to sit down so we could talk, and so I did.</p><p>After that she said that even though I was “blowing of steam” what I wrote was <strong>dangerous</strong> and <strong>serious</strong>, writting that you’d prefer to just <strong>disappear</strong>, that your presence <strong>wasn’t important</strong> to anyone, that you was always were “put aside” and that’s where you should be — <em>I was going to stop her, I was already having tears in my eyes, but then she said</em> — and writing that YOU’d rather <strong>DIE</strong> because your life was already terrible as it is</p><p>I couldn’t help myself, my mom was already starting to cry in front of me and I never saw her crying before. I approached her, took the paper from her hands and shreded it right before our eyes, and just took a deep breath and said “It’s just a stupid piece of paper! I was going through stuff and that was the only way I got to get the anger out! I never thought of things like that intentionally and I was never going to end my life.”</p><p>We hugged and cried together that day, I never thought it was going to be this damaging. In a way it was a relief, even though the passing years there was always someone that would target me to make fun or whatever, it wasn’t so damaging as it was back then.</p><p>Years have passed since then and I was thinking about this situation the other day because of the current COVID-19 pandemic, since because of this there are lots of people going through a tough time, either because of the current isolation or because the virus is affecting their loved ones, or even affecting themselves.</p><p>In either of those situations I hope that these types of thoughts don’t popup, because either way there are still people around you that care about you, and your absence will be noticed and you will be missed even you think the opposite.</p><p>I know my story can’t really be used as a comparison for the current situation, but I hope that you’re doing well and if you have these thoughts talk to someone, don’t isolate yourself.</p><p>I hope you liked my story, and I wish you a pleasant day today and all future days ahead. Stay safe and stay positive.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c644a94ee003" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#1 RN Development: Webtoon’s chapter scroll screen]]></title>
            <link>https://medium.com/@lmestre/1-rn-development-webtoons-chapter-scroll-screen-e48f0dc57d54?source=rss-dd2832364d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e48f0dc57d54</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[webtoon]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[code]]></category>
            <dc:creator><![CDATA[Luís Mestre]]></dc:creator>
            <pubDate>Mon, 06 Apr 2020 01:12:15 GMT</pubDate>
            <atom:updated>2020-04-26T18:25:34.289Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PNmX2DQYoqoHWb7ClgN9Ag.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@rohittandon?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Rohit Tandon</a> on <a href="https://unsplash.com/s/photos/mobile-scroll?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Being in mobile development for basically three years now, mainly with React-Native framework, I’ve always wondered the limits of React-Native in terms of visual challenges. There’s always something, some native behavior or some mobile design that looks incredible/beautiful and gives great value to the app itself in terms of UI/UX for the user.</p><p>This is going to be the first of what I hope to be many future articles, hopefully about challenges like this one I’m going to approach. It’s not the most difficult challenge but since it’s my first and it’s about one of the apps that I use on a regular basis, I find that it would be a good choice and I hope that I can help you learn something about coding. So let’s get this started!</p><p>For those who don’t know or ever heard of webtoon, the effect I’m going to show you is the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*GV9b-3HghxBEE5yQskSeGg.gif" /></figure><p>As you can see it’s a basic scroll view, or flatlist if you prefer for listing items and better performance.</p><p>In this case what intrigued me was the fact the image wasn’t part of the scroll content, but what was on top of it was, and the image also is used as a background for the top Navigation Bar.</p><p>So seeing this I can destruct as the following:<br>1 — Image is in position absolute and it’s first thing rendered;</p><p>2 — Navigation Bar is the 2nd component with background transparent</p><p>3 — Scroll Component with the info and items</p><p><strong><em>Note: at this stage I’m going to render icons in this chapter, but if you want a new chapter with icons and maybe some redering styles to make it event more like what I showed feel free to ask and I’ll post with a new update!</em></strong></p><p>First I’m going to create my screen component and I’m going to use only the components from React-Native (no third-parties code required for this one).</p><p>With that I’ll start with creating the root view with an image in position absolute:</p><pre>render() {<br><br>  return (<br>    <strong>&lt;View style={Styles.root}&gt;<br>       &lt;Image source={{uri: IMAGE}} style={Styles.image} resizeMode=”cover” /&gt;<br>    &lt;/View&gt;</strong><br>  );<br>}</pre><p>After this I’m going to render my NavBar and my content section, in this case for it to be just like Webtoons screen, I’m going to use FlatList.</p><pre>render() {<br><br>  return (<br>    &lt;View style={Styles.root}&gt;<br>      &lt;Image source={{uri: IMAGE}} style={Styles.image} resizeMode=”cover” /&gt;<br>      <strong>&lt;View style={Styles.navbar}&gt;<br>        &lt;Text&gt;Navbar&lt;/Text&gt;<br>      &lt;/View&gt;<br>      &lt;FlatList<br>        style={Styles.content}<br>        ListHeaderComponent={this.renderContentHeader}<br>        data={ITEMS}<br>        renderItem={this.renderItem}<br>        keyExtractor={(item, index) =&gt; `chapter_${index}`}<br>        ItemSeparatorComponent={() =&gt; &lt;View style={Styles.separator} /&gt;}</strong><br>      <strong>/&gt;</strong><br>    &lt;/View&gt;<br>  );<br>}</pre><p>The List Header component will serve as the “Info section” of the scroll with the comics info, just like in the example. I normally prefer dividing the flatlist render props into functions for more readable code, even if what you’re going to render is simple, I think it’s best to separate, so that in the future if you need to add or change code, it’s scoped and easy to find.</p><p>Unless we’re talking about the <strong><em>ItemSeparatorComponent</em></strong>, if that’s the case and it’s only a View then I think it can be inline, but if it’s more complex I would suggest separating in a function</p><p>Now I’m going to struture my item, and since I’m going to do a simple one, I’m just going to add a title to my item and render a card with the same aspect and position as the elements in it.</p><pre>renderItem = ({index}) =&gt; {<br>  <strong>const chapter = `${ITEMS.length - index}`.padStart(2, &#39;0&#39;);</strong></pre><pre>  return (<br>    <strong>&lt;View style={Styles.card}&gt;<br>      &lt;View style={Styles.cardImage} /&gt;<br>      &lt;View style={Styles.cardInfo}&gt;<br>        &lt;Text style={Styles.cardTitle}&gt;Episode {chapter}&lt;/Text&gt;<br>      &lt;/View&gt;<br>      &lt;Text style={Styles.cardNumber}&gt;#{chapter}&lt;/Text<br>    &lt;/View&gt;</strong><br>  );<br>};</pre><p>Now that I have my item render established, I’m going to work on my Header Component. In this case it’s going to be a View with some Texts to represent the genre, title, author and description.</p><pre>renderContentHeader = () =&gt; {</pre><pre>  return (<br>    <strong>&lt;View style={Styles.headerInfo}&gt;<br>      &lt;Text style={Styles.headerGenre}&gt;{GENRE}&lt;/Text&gt;<br>      &lt;Text numberOfLines={1} style={Styles.headerTitle}&gt;{TITLE}&lt;/Text&gt;<br>      &lt;Text style={Styles.headerAuthor}&gt;{AUTHOR}&lt;/Text&gt;<br>      &lt;Text numberOfLines={2} style={Styles.headerDescription}&gt;{DESCRIPTION}&lt;/Text&gt;<br>    &lt;/View&gt;</strong><br>  );<br>};</pre><p>And there you have it, and this basically has the following result:</p><figure><img alt="Photo by Orlova Maria on Unsplash" src="https://cdn-images-1.medium.com/max/350/1*HjgCPjhaxvM_ZTnSPVy8sA.gif" /></figure><p>Since I have to develop for iOS and Android, instead of using my main render start with a View, I made it start with SafeAreaView from React-Native, in order to have in account the spacing for iOS status bar and bottom bar (like in iPhone XR).</p><p>If you want to achieve the visual just like Webtoon has, I advise you to establish a height for your image and that height has to be basically the height of the NavBar and the height of the HeaderContent, in order for it to be exactly like it.</p><p>All the code developed for this article is in the following repository:</p><p><a href="https://github.com/LMestre14/RN-Challenge1">LMestre14/RN-Challenge1</a></p><p>Hope you liked it and learned something along the way. Any questions or suggestions will be gladely taken in consideration for future posts. Hope you have a nice week.</p><p>And of course stay safe, wash your hands and stay positive :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e48f0dc57d54" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>