<?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 Jamal A Mohammed on Medium]]></title>
        <description><![CDATA[Stories by Jamal A Mohammed on Medium]]></description>
        <link>https://medium.com/@jamalamohammed?source=rss-b009e108a7e7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*wJFyhe9OD71vL70f.jpg</url>
            <title>Stories by Jamal A Mohammed on Medium</title>
            <link>https://medium.com/@jamalamohammed?source=rss-b009e108a7e7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 21:08:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jamalamohammed/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[I Don’t Own a 3D Printer. AI Helped Me Print a Grip for My Nintendo 2DS XL Anyway]]></title>
            <link>https://medium.com/@jamalamohammed/i-dont-own-a-3d-printer-ai-helped-me-print-a-grip-for-my-nintendo-2ds-xl-anyway-57de28c9b188?source=rss-b009e108a7e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/57de28c9b188</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[3d-printing]]></category>
            <category><![CDATA[nintendo]]></category>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Jamal A Mohammed]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 06:05:25 GMT</pubDate>
            <atom:updated>2026-11-11T06:05:25.118Z</atom:updated>
            <content:encoded><![CDATA[<p>I‘m a Rails developer. I have never touched a 3D model, never owned a printer, and never had a reason to care. Then my wrist started hurting from a ten-year-old handheld.</p><p>Here’s how a Castlevania game got me from sore wrist to a custom-printed grip for for about $14 (failed first attempt included), with an AI doing most of the thinking.</p><figure><img alt="The 3D-printed grip on my Nintendo 2DS XL" src="https://cdn-images-1.medium.com/max/1024/1*MMIov4vb6HJPcYOHYkOScw.jpeg" /><figcaption>The 3D-printed grip on my Nintendo 2DS XL</figcaption></figure><h3>Castlevania Is to Blame</h3><p>I dusted off my trusty decade-old Nintendo 2DS XL and started <em>Castlevania: Lords of Shadow — Mirror of Fate</em>. It’s my first Castlevania in decades, and I actually finished it. I usually start games and never reach the end.</p><p>The game was good enough that sessions stretched to an hour at a time. Then the wrist pain showed up.</p><p>The 2DS XL is small in my hands. Compare it to my Nintendo Switch OLED with the Mobapad M6 controller and it feels like gaming on a pack of cards. Ergonomics, it turns out, is a thing.</p><h3>The Grip Case Price Shock</h3><p>I asked Gemini for a fix and it suggested a grip case. Fair enough. Then I went shopping.</p><ul><li><strong>Amazon and Etsy:</strong> anywhere from 2,500 INR (roughly $27) and upwards.</li><li><strong>Etsy, mostly 3D printed and shipped from the US:</strong> add 2,000+ INR (roughly $21) in shipping.</li></ul><p>Yup, you read that right. Shipping alone cost almost as much as the grip.</p><p><em>A note on money: every dollar figure in this post uses ₹93.6 to $1, the rate at the time of writing (10 November 2026). Rates move, so your numbers will differ.</em></p><h3>Gemini Said: Why Not Print It?</h3><p>While I was complaining to Gemini about those prices, it suggested the obvious thing: why not 3D print it yourself?</p><p>Duh. Why didn’t I think of that?</p><p>Well, I don’t own a printer, and I have zero hands-on experience with 3D anything. I write software. My happy place is Ruby on Rails, not slicers and filament.</p><p>That’s where Gemini earned its keep. It pointed me to a free model to download and an online service that prints it for you. I’ll be straight about it: I didn’t find any of this myself. I had no clue these services existed. Credit where it’s due.</p><h3>Round One: Almost, and Almost Doesn’t Count</h3><p>Gemini sent me to Printables, which has a free STL model: <a href="https://www.printables.com/model/593168-new-2ds-xl-grip">New Nintendo 2DS XL Grip</a>. I read the comments before downloading, and people there reported it fitting fine at the original size. Good enough for me.</p><p>I uploaded the original file to <a href="https://robu.in/">Robu.in</a>, an FDM printing service in India (another Gemini find).</p><ul><li><strong>Scale:</strong> 100% (the original STL)</li><li><strong>Material:</strong> PETG, black</li><li><strong>Cost:</strong> ₹644 (about $7), including ₹49 shipping</li></ul><p>The print arrived and the console wouldn’t slide in. It almost fit. The internal clearance just wasn’t enough. I didn’t measure anything, I just tried it, and my 2DS XL was clearly a hair too wide.</p><h3>The 2% Fix</h3><p>I went back to Gemini. Its suggestion: scale the model from 100% to 102%. No Blender, no redesign, no fighting with CAD software.</p><p>Later I ran the same question past ChatGPT, which had better tools for working with 3D models, and it confirmed the 2%. Two AIs agreeing is not proof, but I was out of ideas and out of patience.</p><p>So I used a free online STL scaling tool, bumped the whole model to 102%, and sent it back to Robu.in.</p><ul><li><strong>Scale:</strong> 102%</li><li><strong>Material:</strong> PLA, black</li><li><strong>Dimensions:</strong> 191.37 × 118.63 × 40.85 mm</li><li><strong>Estimated print time:</strong> 6 hours, 2 minutes, 58 seconds</li><li><strong>Cost:</strong> ₹629 (about $7), including ₹49 shipping</li></ul><figure><img alt="Both printed grips side by side" src="https://cdn-images-1.medium.com/max/1024/1*fT6xzjOIXPNOISsHgLWa_Q.jpeg" /><figcaption><em>Left: the 100% print in PETG. Right: the 102% print in PLA.</em></figcaption></figure><h3>It Clicks</h3><p>It fit perfectly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wf96rRwp3W4IpHEZTFxHUQ.jpeg" /><figcaption>Holding the 2DS XL with the printed grip</figcaption></figure><figure><img alt="The grip-equipped 2DS XL next to an Xbox controller for size" src="https://cdn-images-1.medium.com/max/1024/1*xY2VlrgYc3rAOPrRvOWzBg.jpeg" /><figcaption>The grip-equipped 2DS XL next to an Xbox controller for size</figcaption></figure><p>The console clicks into place at the back and stays firmly attached. It’s also surprisingly easy to remove, which I didn’t expect. Neat, right?</p><figure><img alt="The clip that holds it all together" src="https://cdn-images-1.medium.com/max/1024/1*roXIiHGGOeY9gj3lWi9neQ.jpeg" /><figcaption>The clip that holds it all together</figcaption></figure><p>Now the honest part. Between attempt one and two I changed two things: the scale (100% to 102%) and the material (PETG to PLA). One Printables commenter had recommended PLA, which is why I switched. So I can’t tell you which change did the work. The only way to find out is to print the 102% model in PETG, and that’s on my list for later.</p><h3>What I Actually Learned</h3><p>Sometimes you don’t need to redesign anything. A small scale change fixed a real-world fit problem, and I didn’t have to learn a single modelling tool to do it.</p><p>The money part surprised me too. Both prints together cost ₹1,273 (about $14). That’s roughly half the starting price of a store-bought grip, failed print included, and before Etsy’s 2,000+ INR shipping.</p><p>It also made me think about how I use AI. Gemini found the idea, the model, and the printing service. ChatGPT helped me sanity-check the scaling. I still had to be the one who ordered the thing and held it in my hands. AI can point you at a door you didn’t know existed, but you have to walk through it.</p><h3>Now I Get Why Non-Coders Call It Magic</h3><p>I use AI every day at work, Claude Code especially. It’s super helpful. It helps me write and ship in days what used to take weeks.</p><p>But I come from the software side, so I always saw it as an uber-useful tool, not magic. I know what it’s doing and roughly how.</p><p>Then came the grip. I didn’t know an ounce of 3D modelling, and I still went from a sore wrist to a custom-fitted part in my hands. All I did was scale an existing model with a free online STL tool. That one felt like magic.</p><p>And it made me realise something: this is how non-coders must feel when they build an app with AI. They can’t read the code either, and the thing works anyway. Now I see it.</p><h3>Want to Try It?</h3><p>Grab the free model from <a href="https://www.printables.com/model/593168-new-2ds-xl-grip">Printables</a>, and if you’re in India, <a href="https://robu.in/">Robu.in</a> will print it for you. If it’s too snug on your console, scale the model to 102%. My final combo was 102%, black PLA, printed at Robu.in.</p><p>Now if you’ll excuse me, I have a Castlevania sequel to start. 🦇</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57de28c9b188" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ten-Plus Years of Rails, Zero Automated Tests. Here’s What Fixing That Actually Looked Like.]]></title>
            <link>https://medium.com/@jamalamohammed/ten-plus-years-of-rails-zero-automated-tests-heres-what-fixing-that-actually-looked-like-f10f45ce6053?source=rss-b009e108a7e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/f10f45ce6053</guid>
            <category><![CDATA[rspec]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Jamal A Mohammed]]></dc:creator>
            <pubDate>Thu, 01 Oct 2026 11:25:05 GMT</pubDate>
            <atom:updated>2026-10-01T11:25:05.640Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Cover graphic: “Ten-Plus Years of Rails. Zero Automated Tests,” with a terminal snippet reading “47 examples, 0 failures.”" src="https://cdn-images-1.medium.com/max/1024/1*olHrw6cQlM_gAvdTWjWtsg.png" /></figure><p>I’ve been writing Rails for over ten years. In that entire time, I never once wrote an automated test. Not one. My testing strategy was clicking around the app and hoping I hadn’t broken anything I’d forgotten about. It worked, right up until it didn’t.</p><p>Nothing dramatic finally pushed me to fix this. It’s just that the codebases I actually care about — client projects, a production app I lead — have quietly gotten too complex for “I’ll just check it manually” to hold up anymore. So I picked a week, picked my own five-year-old Rails 6 side project, <a href="https://stockoji.com/">Stockoji</a>, and sat down to actually learn RSpec. Properly. Book open, real models, real controllers, no toy examples.</p><p>Here’s the part nobody warns you about going in: <strong>the tests themselves were the easy part.</strong> The week taught me a lot more about my own codebase than it taught me about RSpec syntax.</p><h3>Day One: RSpec Said Hello, My Gemfile Said No</h3><p>I installed rspec-rails, ran the generator, and immediately hit a wall that had nothing to do with testing. Turns out a couple of gems I needed had quietly bumped their minimum Ruby version to 3.0 in a recent release, and I&#39;m still on Ruby 2.7.2. Nothing exploded in a useful way — just a wall of cryptic syntax errors from deep inside a gem I&#39;d never opened. Pinned two gems to specific older versions, added comments explaining why, moved on. Neat right? Not really. But it worked.</p><h3>Days Two and Three: Writing Real Specs, Meeting FactoryBot</h3><p>Once the environment behaved, the actual RSpec part was refreshingly normal. Validation specs on my Photo and User models. Then FactoryBot, which took me embarrassingly long to appreciate — a factory is just a recipe for “give me a valid version of this object,” and once that clicked, writing specs stopped feeling like setup and started feeling like actually testing something.</p><p>Small wrinkle worth mentioning: my Photo model uses Shrine for file uploads, not ActiveStorage, so I had to build a small fixture image and switch file storage to memory-only for tests, so specs never actually write real files to disk. Every Rails app has its own little flavor of “normal,” and testing forces you to learn yours properly for the first time.</p><h3>Day Four: Making Peace with DRY</h3><p>describe, context, let, before. This is the day I went from &quot;specs that work&quot; to &quot;specs I&#39;d actually want to read again in six months.&quot; Nothing broke, nothing dramatic — just cleanup. Somehow the most boring day of the week was also one of the most satisfying.</p><h3>Day Five: The www Mystery (a.k.a. How I Debugged a Ghost)</h3><p>This one deserves its own paragraph because it genuinely had me stumped for twenty minutes. I wrote a request spec expecting a redirect to my homepage. Instead, the test kept redirecting somewhere else entirely, and the failure message made no sense against the controller code I was staring at.</p><p>Turns out: Rails’ default test host is www.example.com. My app has a route rule — from actual production behavior — that strips www. off any request before it hits a controller. So my test wasn&#39;t testing the redirect I thought it was. It was tripping a completely unrelated rule first, then bouncing somewhere else, then never even reaching the code I meant to test. One line fixed it: tell the test to use a plain host without www. The fix was trivial. Figuring out <em>why</em> it was happening was not. Debugging your own app&#39;s edge cases through a test is a very different experience than debugging them through a browser.</p><h3>Day Six: The Wall I Didn’t Get Past (Yet)</h3><p>Not every day ends in a win, and I’d rather say that plainly than pretend otherwise. Day Six was supposed to be a Capybara system test — actually driving a browser through my photo upload form. I hit a genuine dead end: the tooling needed to control a modern Chrome browser requires Ruby 3.0+, and no version of it works with my current Ruby 2.7.2. Not a bug I could pin my way out of. A real prerequisite I don’t have yet.</p><p>So I documented it, marked the test as intentionally skipped with a clear reason, and moved on. Upgrading Ruby is now its own task, sitting on my list, not something I forced into this week just to say I “finished.” Honestly, knowing when to stop and name a blocker instead of hacking around it is its own kind of testing discipline.</p><h3>Day Seven: The Plot Twist That Taught Me the Real Lesson</h3><p>This is the one I actually want you to remember from this whole post.</p><p>On the last day, I did something slightly unhinged on purpose: I disabled a piece of working code, just to watch my tests catch it. Specifically, I commented out the callback that assigns a unique ID to a new photo before saving it. I still had a validates_uniqueness_of sitting right there on that field, looking perfectly responsible. I fully expected my whole suite to light up red.</p><p>One test failed. Exactly one — the test written specifically against that callback. Every other test, including the uniqueness validation, stayed green.</p><p>Why? Postgres doesn’t treat two NULL values as duplicates of each other. So a &quot;unique&quot; field full of nothing passes a uniqueness check every single time, no matter how many rows share that nothing.</p><p>Here’s the sentence I keep coming back to: <strong>a validation existing in your code is not the same thing as it catching the bug you assume it catches.</strong> I would have sworn, hand on heart, that field was protected. It wasn’t. The only reason I know that now is because I broke it on purpose and actually watched what happened, instead of assuming.</p><h3>Yes, I Used AI For This. No, That Doesn’t Make It Cheating.</h3><p>Let’s just say the quiet part out loud: Claude was with me through most of this week, and it made me faster, not lazier. It told me which book chapter to read before each day’s work instead of me guessing. It helped me actually diagnose the environment issues instead of searching Stack Overflow at 11pm. It pushed back on a couple of my own decisions mid-week, which, credit where due, I needed.</p><p>I think a lot of developers — especially ones of us with a decade-plus behind us — get a little weird about admitting this. Like using AI to learn something makes the learning less real. I’d push back on that hard. AI is very obviously where building software is headed, and pretending otherwise is its own kind of technical debt you’re quietly accumulating. But here’s the part that actually matters: none of it replaced sitting with the material myself. AI can hand you a working fix in ten seconds flat. It cannot hand you the moment where you watch a validation you trusted completely fail to do its one job. You have to be in the room for that one, on purpose, paying attention.</p><p>So: use the tools. Use them well. Just don’t let them become the reason you stop actually learning how the thing works underneath.</p><h3>The Book That Made It Click</h3><p>I worked through <em>Everyday Rails Testing with RSpec</em> by Aaron Sumner — <a href="https://leanpub.com/everydayrailsrspec">leanpub.com/everydayrailsrspec</a> — one chapter at a time, applied directly to my own app instead of following along with someone else’s toy examples. If you’re a Rails dev sitting where I was a week ago, I can’t recommend it enough.</p><p>Happy testing. 🧪</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f10f45ce6053" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I coded the iOS app UI for NativeScript Uplabs competition using Vue Js]]></title>
            <link>https://medium.com/@jamalamohammed/how-i-coded-the-ios-app-ui-for-nativescript-uplabs-competition-using-vue-js-baa7332a7876?source=rss-b009e108a7e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/baa7332a7876</guid>
            <category><![CDATA[nativescript]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[vue]]></category>
            <dc:creator><![CDATA[Jamal A Mohammed]]></dc:creator>
            <pubDate>Mon, 03 Dec 2018 08:29:42 GMT</pubDate>
            <atom:updated>2018-12-05T12:02:55.857Z</atom:updated>
            <content:encoded><![CDATA[<p>The idea behind this post is to share my experience coding the Finances App UI for <a href="https://www.uplabs.com/challenges/nativescript-uplabs-challenge/vote">NativeScript Uplabs Competition</a>, in addition to sharing my experience I have made it also as a guide for people new to NativeScript to try coding an UI and see how simple and easy is to build a Pure Native App for iOS and Android, using almost the same code base and with technology that you already know HTM/XML, CSS, and JS.</p><blockquote><a href="https://www.uplabs.com/posts/finance-nativescript-vue-app-n-playground">Click here</a> to check out the Finances App submission that made it to the finalist <a href="https://www.uplabs.com/posts/finance-nativescript-vue-app-n-playground">Finance NativeScript Vue App — Uplabs</a></blockquote><p>First thing, as you are aware NativeScript apps are built using web technologies CSS, JS and XML not HTML.</p><p><em>Note: I’ve used Vue JS but you can have the same UI built for NativeScript using JavaScript, TypeScript, and Angular.</em></p><p>The UI we would be building is based on the awesome <a href="https://www.uplabs.com/posts/finances-interface">Finances</a> iOS app design by Alex Soi. I had to use a different font <a href="https://www.dafont.com/quicksand.font">Quicksand</a> as the one originally used by Alex was paid font :-)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*74U1coWWMmbbsXtT.png" /><figcaption>Completed UI</figcaption></figure><p>As you can see Alex has laid out the UI components in a Perfect Grid, and I made use of NativeScript <a href="https://nativescript-vue.org/en/docs/elements/layouts/grid-layout/">GridLayout</a> and <a href="https://nativescript-vue.org/en/docs/elements/layouts/dock-layout/">DockLayout</a> to code Finances App UI.</p><p>Recommend <a href="https://www.nslayouts.com/">LEARN {N} LAYOUTS</a> to learn basic NativeScript Layouts. This should put some sense on how the NativeScript layouts works compared to the CSS layouts and grid. Any Twitter bootstrap fans here?</p><p>And the amazing <a href="https://developer.telerik.com/author/jlooper/">Jen Looper</a> blog post <a href="https://developer.telerik.com/featured/demystifying-nativescript-layouts/">Demystifying NativeScript Layouts</a> will set you in the right path, from here it’s on you Padawan practice by coding your own UI or hacking UI <a href="https://market.nativescript.org/?tab=samples&amp;framework=vue&amp;category=all_samples">samples from NativeScript Marketplace</a>. Myself I did both :-)</p><h3>So let’s get started</h3><p>Download the UI Design files from Uplabs <a href="https://www.uplabs.com/posts/finances-interface/download?license=personal_only">here</a>, you would need Sketch App to view and export images and icons used in the app. I have also uploaded the Icons, images and fonts in a zip file, for those who don’t have Sketch App.</p><p><a href="https://cl.ly/79afad09cf82"><strong>Click here to download the assets in zip file.</strong></a></p><p>Head to <a href="https://play.nativescript.org/">NativeScript Playground</a> an awesome tool to get started without the need to install any additional development software or SDK for developing this iOS app. Recommend that you Login so that you can save your work, and each time you save, a new version is created, so it makes easy to revisit earlier builds, think of it as a mini git versioning, I find it very helpful.</p><p><em>Note: And I have added the link to the NativeScript Playground below each of the code block. Just click and follow instructions to preview on your Mobile.</em></p><p>Once you are there Select from any of the four [Angular, Vue.js, Plain TypeScript or Plain JavaScript] I selected Vue.js. From here on all the code example will be NativeScript-Vue based.</p><p>Let revisit the UI now with Grid overlays, it makes things slightly easy to understand and how we are going to plan our layout in code and what NativeScript components to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2xwzBh9xIlhR98Af.jpg" /><figcaption>Grid overlay</figcaption></figure><p>As you can see on a high level the app consists of 3 sections, <strong>top,</strong> <strong>middle</strong> and <strong>bottom</strong> docked all the way to the absolute bottom of the screen.</p><h3>What’s up DockLayout</h3><p>We could just stack them all in order of appearance and have the last item child horizontalAlignment set to bottom.</p><p>But NativeScript provides with <a href="https://nativescript-vue.org/en/docs/elements/layouts/dock-layout/">DockLayout</a> which serves our exact purpose so I went with it. The whole layout is wrapped inside &lt;DockLayout&gt;, think of this as the main wrapper we use in HTML like &lt;section&gt;.</p><p>Copy and paste the below code in your <em>HelloWorld.vue</em> template section.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3acd10a4b4c75b3534ef6167b8e1e548/href">https://medium.com/media/3acd10a4b4c75b3534ef6167b8e1e548/href</a></iframe><p>Hit Save and click Preview. The app should look like the below screenshot, and congratulations you have just built your first pure native app with NativeScript.</p><p>This was my first step towards building the rest of the app. The most important part was figuring what NativeScript layout components to use and the grids, the number of rows and columns. Once I figured this out the rest of the code was less overwhelming to write. Remember from here on it’s going to be all CSS and JS that you already know from the web development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*gMxZTVzt_-p2TumM.jpeg" /><figcaption><a href="https://play.nativescript.org/?template=play-vue&amp;id=p8iriS&amp;v=1">NativeScript Playground — Version 1</a></figcaption></figure><h3>The Dark Theme</h3><blockquote><em>Because he’s the hero Gotham deserves, but not the one it needs…</em></blockquote><blockquote><em>The Dark Knight</em></blockquote><p>Alright now that we have the base layout figured out, let’s continue with adding a dark theme for our app. Again NativeScript have this already figured out we simply have to make use of the awesome <a href="https://docs.nativescript.org/ui/theme#color-schemes">dark scheme</a>.</p><p>In your NativeScript Playground open and edit app.css, around line #13 update code to make use of dark CSS file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ba79e54865970fd7b2891d145b0d3f3/href">https://medium.com/media/4ba79e54865970fd7b2891d145b0d3f3/href</a></iframe><p>The preview app will refresh to show the text in white color (previously black color text) this confirms that black theme is applied successfully.</p><h3>The Navigator</h3><p>For our app, we will not be using the NativeScript ActionBar, instead a simple 3 columns grid with icons to navigate between screens. Why? our app does not have features to navigate back and forth between parent and child screens. So we don’t need back buttons, titles, custom ActionBar and Status Bar color that you normally see on 90% of the apps.</p><p>With reference to our Grid overlay diagram, we need 1 row with 3 columns to place our 3 navigation icons. I have already sliced and diced the icons (<a href="https://cl.ly/79afad09cf82">download them here</a>). Let’s upload them to our Playground by creating a “<strong>images</strong>” folder inside of the “<strong>app</strong>” folder.</p><p>To upload select the “<strong>images</strong>” folder, click the icon that looks like 3 vertical dots and click “<em>Upload resources</em>” follow the instructions to upload all 3 icon image files. Copy and paste the below code in your <strong><em>HelloWorld.vue</em></strong> template section to include the navigation icons.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/52c99fd87725d750739e54c7294bbe6b/href">https://medium.com/media/52c99fd87725d750739e54c7294bbe6b/href</a></iframe><p>Explaining the above code.</p><ul><li>We added a GridLayout with 1 row and 3 columns where the first and last column width set to 75 and the middle column denoted with * makes use of the remaining space.</li><li>The grid has a class .p-20 set, this is nothing but a <a href="https://docs.nativescript.org/ui/theme#padding-and-margin">CSS helper class</a> that sets padding 20 on all sides. Much like the helper class in Bootstrap 4.</li><li>In the Image we set the row and column properties to have them placed in the required order. Rows and columns order is 0 indexes based, meaning it starts with 0 just like in javascript / jQuery. So Icon one col is set to 0, Icon two col set to 1 and Icon three col set to 2.</li><li>Even though we are not using the NativeScript ActionBar component we are using the CSS class .action-bar and .action-item to style our navigation section. To learn more about this click <a href="https://docs.nativescript.org/ui/theme#actionbar">here</a>.</li><li>Image stretch property allows us to describe how content is resized to fill its allocated space, read more about <a href="https://docs.nativescript.org/ui/ns-ui-widgets/image#stretching">stretching</a>.</li><li>Width and Opacity are <a href="https://docs.nativescript.org/ui/styling#supported-css-properties">CSS properties</a> supported by NativeScript. Please note they don’t have measurement unit postfixed.</li></ul><p>At the end of this step, our app should look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*thb_54676UV60aEa.jpeg" /><figcaption><a href="https://play.nativescript.org/?template=play-vue&amp;id=p8iriS&amp;v=2">NativeScript Playground — Version 2</a></figcaption></figure><h3>Custom color, custom font, custom everything!</h3><p>Now that we have the dark theme and navigation setup. Let’s continue adding the custom dark blue shade Cloud Burst background color and the custom Quicksand font <a href="https://cl.ly/79afad09cf82">download here</a> if not already downloaded.</p><p>Let us quickly complete the following steps to set this up and move on to scrolling Transactions list.</p><p>Upload the font files by creating a “<strong>fonts</strong>” folder inside of “<strong>app</strong>” folder in your NativeScript playground. Select the “<strong>fonts</strong>” folder and upload the 2 font files.</p><p>Copy and paste the following CSS code in your <strong><em>HelloWorld.vue</em></strong> file replacing the current CSS styles.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ab1674a06412eeaf6b63aebe9a8f475/href">https://medium.com/media/7ab1674a06412eeaf6b63aebe9a8f475/href</a></iframe><p>These are simple and straightforward CSS properties, here are all the NativeScript <a href="https://docs.nativescript.org/ui/styling#supported-css-properties">Supported CSS properties</a>.</p><p>Update the StackLayouts inside the &lt;template&gt;, what we have done is removed the backgroundColor property so that we can see the newly applied background color. And applied the CSS class .large and .medium to the &lt;Label&gt;. Save and Preview you should see something like this.</p><p><em>Tips: Did you notice how the font is declared, it’s to support both iOS and Android. You can learn more about it here </em><a href="https://www.nativescript.org/blog/using-custom-fonts-in-a-nativescript-app"><em>Using Custom Fonts in a NativeScript App</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*BGDsOCROP7o-OBJ1.jpeg" /><figcaption><a href="https://play.nativescript.org/?template=play-vue&amp;id=p8iriS&amp;v=4">NativeScript Playground — Version 3</a></figcaption></figure><h3>Today’s Spending</h3><p>Continuing with the next section the one below the navigation, I am calling it spending because I can :-).</p><p>It’s a simple 2 rows and 2 columns NativeScript GridLayout with generous margin and padding. Nothing new that you have not already done before in web design. So let’s get the code for this.</p><p>Copy and paste the below code in your <strong><em>HelloWorld.vue</em></strong> template section to include the summary section.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/16e9104717561271f54003a1396bd823/href">https://medium.com/media/16e9104717561271f54003a1396bd823/href</a></iframe><p>The newly added section is between the &lt;!-- Spending --&gt; comment block. So what have we done here?</p><p>We have added a GridLayout with 2 rows and 2 columns, the columns have * “star” == greedy (takes all the space it can), this makes sure our columns width is adjusted as per the needs of the content. Neat right?</p><p>Next, the &lt;Label/&gt; has the relevant row and column set, remember rows and columns order is 0 indexes based. CSS class .large and .small to customize the font size and the Color property to set the relevant color as per UI Design. We have used a mix of CSS class and inline property.</p><p>CSS class .body and .text-right are NativeScript <a href="https://docs.nativescript.org/ui/theme#text">Text utility</a> CSS class from the dark theme.</p><p><em>Note: We have added </em><em>horizontalAlignment property to the navigation icons so that they are aligned left and right to the Spending section.</em></p><p>Save and hit Preview, your app should look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*66cADEifqFQSjwJK.jpeg" /><figcaption><a href="https://play.nativescript.org/?template=play-vue&amp;id=p8iriS&amp;v=5">NativeScript Playground — Version 4</a></figcaption></figure><h3>Fortune Tips not cookies</h3><p>We will complete the Tip’s section first and then move on to the Scrollable Transactions section, the most important and challenging section in this UI, also remember its place as the last child item inside the &lt;DockLayout&gt;.</p><p>As always, let’s start with the code. Copy and paste this in your <strong><em>HelloWorld.vue</em></strong> template section.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d07b7b33d1baf24e32d25a3c886ae7e/href">https://medium.com/media/1d07b7b33d1baf24e32d25a3c886ae7e/href</a></iframe><p>So here’s what we have added to the code.</p><p>The Tips section is very simple 1 row and 2 columns layout, positioned at bottom of the &lt;DockLayout&gt;. This section has it’s own slightly darker version of the background color.</p><p>The left column has the “<strong>tip-chart-icon.png</strong><em>”</em> image. <a href="https://cl.ly/79afad09cf82">Download it from here</a>, and upload to the “<strong>images</strong>” folder.</p><p>Rest all it’s self-explanatory if you think otherwise please let me know in comments.</p><p>Save and Preview and your app should like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*wmJR04-FkkbhF5NA.jpeg" /><figcaption><a href="https://play.nativescript.org/?template=play-vue&amp;id=p8iriS&amp;v=7">NativeScript Playground — Version 5</a></figcaption></figure><h3>Finally, it’s all about Transactions honey!</h3><p>Now to the final and most important section Transactions we will be using NativeScript scrollable ListView using JSON as the data source. So without much ado let’s get cracking.</p><p>Here is the completed XML &lt;template&gt; code, copy and paste this in your <strong><em>HelloWorld.vue</em></strong> template section.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b518f6b27acf327f9052748800cd3aef/href">https://medium.com/media/b518f6b27acf327f9052748800cd3aef/href</a></iframe><p>And the javascript code with JSON data.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f97cce2ba16052de80765dcecef60fc/href">https://medium.com/media/0f97cce2ba16052de80765dcecef60fc/href</a></iframe><p>Do not fret it looks like a lot but it is not, the JavaScript just holds the JSON data and we have imported the <a href="https://docs.nativescript.org/ui/rich-components#listview">RadListView</a> a NativeScript Pro UI component.</p><p>Inside the RadListView Vue JS for loop is the actual template part that we will be focusing. It’s a NativeScript GridLayout with 3 rows and 2 columns. The first column with a fixed width of 100 and second * “Star” to fill the remaining space.</p><p>In the 1st row we have the “<em>amount</em>” in column 1 and the “<em>name</em>” in column 2. Each of these &lt;Lablel&gt; has their own style and CSS class applied.</p><p>The 2nd row has the relative human “<em>date</em>” in column 1 and the location “<em>address</em>” in column 2 and again each of these has their own style and CSS class applied to match the UI design.</p><p>The 3rd row is wrapped in Vue JS if else statement to add the bottom divider for all items in the list except the last item. Also, the border starts from column 2 leaving column 1 empty resulting in a nice looking iOS style list separator.</p><p>On second thought this is not so complicated, it’s again a simple GridLayout placed inside the ListView which loops through all the items in JSON data.</p><p>Phew, we have come to end of this article. Hit Save and Preview and this is how your screen should look like now.</p><p>Also, did you notice how smooth the scroll is, this is the Native app for you baby, not something you see in PhoneGap apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*61oPbfaO3sh-a7lr.jpeg" /><figcaption><a href="https://play.nativescript.org/?template=play-vue&amp;id=p8iriS&amp;v=8">NativeScript Playground — Version 6</a></figcaption></figure><p>Thank you for reading, and I sincerely hope this has been somewhat helpful in getting you started with NativeScript.</p><p><a href="https://gist.github.com/mdjamal/ecb21a4c9a3b239631f97f1e453d58c0"><strong>Here is the link to the HelloWorld.vue file with completed code.</strong></a></p><p>Also, I am planning to continue a part 2 and 3 of this articles that would cover the remaining 2 screens submitted for the NativeScript Uplabs Competition. Let me know if you would like to see them. The next two screens look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eGOX9TTKNCXyFjaY.jpg" /><figcaption>Screens one, two and three.</figcaption></figure><p>Watch out for the links to the follow-up articles in this space.</p><p>Thanks again and Happy Coding, and remember the awesome and active <a href="https://discourse.nativescript.org/">NativeScript community</a> is always there to help.</p><p>Thanks to excellent articles from <a href="https://www.nativescript.org/blog/author/jen-looper">Jen Looper</a>, <a href="https://www.nativescript.org/blog/author/tj-vantoll">TJ Van Toll</a> which helped me a lot when I was getting started. And also the <a href="https://www.youtube.com/playlist?list=PLiKWVuUOQtPZ98ZM2EDiWkD91X-_lOrSZ">YouTube Channel</a> and webcasts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=baa7332a7876" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>