<?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 Alex Tizfahmfard on Medium]]></title>
        <description><![CDATA[Stories by Alex Tizfahmfard on Medium]]></description>
        <link>https://medium.com/@alirezat775?source=rss-67d27289894e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RD6wzDRgN0QM4PGYuXnNwg.jpeg</url>
            <title>Stories by Alex Tizfahmfard on Medium</title>
            <link>https://medium.com/@alirezat775?source=rss-67d27289894e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 01:58:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alirezat775/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[The trick big apps use to skip App Store reviews]]></title>
            <link>https://medium.com/nativeblocks/the-trick-big-apps-use-to-skip-app-store-reviews-93803ddc0b4c?source=rss-67d27289894e------2</link>
            <guid isPermaLink="false">https://medium.com/p/93803ddc0b4c</guid>
            <category><![CDATA[nativeblocks]]></category>
            <category><![CDATA[app-store]]></category>
            <category><![CDATA[server-driven-ui]]></category>
            <category><![CDATA[google-play]]></category>
            <dc:creator><![CDATA[Alex Tizfahmfard]]></dc:creator>
            <pubDate>Mon, 07 Apr 2025 07:47:21 GMT</pubDate>
            <atom:updated>2025-04-07T07:47:21.353Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ctFUBLaok3NHq4zuAcS-_A.jpeg" /></figure><p>Why do companies like <a href="https://medium.com/airbnb-engineering/a-deep-dive-into-airbnbs-server-driven-ui-system-842244c5f5">Airbnb</a> and <a href="https://shopify.engineering/server-driven-ui-in-shop-app">Shopify</a> use SDUI? Because it helps them move fast. No more waiting for app store reviews just to tweak a button or update a layout. Instead of building UI updates into the app and resubmitting it every time, they use a smarter approach. That smarter approach is Server-Driven UI.</p><h3><strong>What is SDUI (Server-Driven UI)?</strong></h3><p>Server-driven UI, or SDUI, puts control of your app’s UI on the server. Instead of hardcoding screens inside the app, the backend sends a JSON payload that tells the app what to render. This payload includes components like buttons, text, images, and layout instructions. The app reads this and shows the right screen using native components. It’s fast, flexible, and doesn’t need a full release cycle to push updates.</p><p>Companies like Netflix, Shopify, Airbnb, and Spotify use SDUI to deliver UI updates without touching the app stores. It’s especially useful when you want to stay consistent across platforms like iOS and Android, or when you’re testing new designs, running experiments, or reacting to fast-changing content. With SDUI, teams can move faster without compromising quality.</p><h3><strong>Why building your own SDUI system is hard</strong></h3><p>But here’s the problem. Building your own SDUI system is hard. It might sound simple on paper, but once you get into it, you realize how complex it gets. You need to design a schema for your blocks, build a backend that returns valid JSON, create a system on the app side that can understand it, and then figure out how to keep everything in sync. Every new component or feature adds more complexity. And without the right setup, it becomes a mess to manage.</p><h3><strong>The best way to use SDUI</strong></h3><p>Use a production-ready framework, that gives you everything you need to build and use SDUI in your mobile app, without starting from scratch.<br>One of the best framework out there is <strong>Nativeblocks</strong>, it includes a visual editor called Studio, where you build screens using blocks. These screens are stored in the backend and delivered as JSON to your app. On the app side, the Nativeblocks SDK reads the JSON and tells the app what to render using your existing native components like SwiftUI or Jetpack Compose. Nativeblocks makes sure your omponents, and schema stay in sync with SDUI backend.</p><p>Unlike other frameworks, like <a href="https://divkit.tech/en">Divkit</a> You still control your UI. You still write your own components. But you don’t have to build the SDUI system yourself. Nativeblocks handles the hard stuff like syncing data, validating schemas, and managing screen structure. So you get the benefits of SDU, like instant UI updates and faster iterations, without rebuilding your entire architecture.</p><p>Let’s say you want to update a login screen. With Nativeblocks, you open the Studio, make your changes, and publish. The new screen is live immediately. No code changes, no app release, no waiting for Apple or Google to approve it. You can do the same with onboarding flows, promo banners, A/B tests, or anything else that needs to be flexible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JCGQ6ElNyVBwTvSaUB_wbw.gif" /></figure><h3><strong>How to get started with Nativeblocks</strong></h3><p>Getting started is simple. You add the Nativeblocks Core SDK to your app. You define your components using your native UI framework. You build screens in the Studio. And the Compiler makes sure everything stays in sync. From there, your app can fetch screens from the backend and render them on the fly.</p><p>Nativeblocks is especially helpful if you’re working on a fast-moving product or a small team that needs to ship often. It saves you time, reduces risk, and helps you deliver features faster. You don’t need to rebuild what Airbnb and Shopify already figured out. You just need the right tool.</p><h3><strong>Learn more about Nativeblocks</strong></h3><p>If you want to try Nativeblocks, check out <a href="https://nativeblocks.io/">nativeblocks.io</a>. You’ll find documentation, examples, and everything you need to get started.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93803ddc0b4c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nativeblocks/the-trick-big-apps-use-to-skip-app-store-reviews-93803ddc0b4c">The trick big apps use to skip App Store reviews</a> was originally published in <a href="https://medium.com/nativeblocks">nativeblocks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Nativeblocks?]]></title>
            <link>https://medium.com/nativeblocks/what-is-nativeblocks-ed6954b10817?source=rss-67d27289894e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed6954b10817</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[server-driven-ui]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[swiftui]]></category>
            <dc:creator><![CDATA[Alex Tizfahmfard]]></dc:creator>
            <pubDate>Mon, 31 Mar 2025 06:32:10 GMT</pubDate>
            <atom:updated>2025-03-31T06:32:10.066Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nAEXHJphvD5diJ2LSgXrmg.jpeg" /></figure><p>Nativeblocks is a tool for building native mobile apps faster, without waiting on app store approvals. It uses a server-driven UI (SDUI) approach, which means you can update your app’s design and behavior by changing the data on the backend instead of shipping a new app version. Nativeblocks helps you deliver updates instantly, work with your team more efficiently, and debug faster. You stay in full control while moving faster.</p><h3>What is SDUI?</h3><p>It’s all powered by SDUI or server-driven UI. In SDUI, the user interface is controlled by the backend. The server sends a <strong>JSON payload</strong> that describes the layout and components — buttons, text, images, and whatever the screen needs. The app then reads that JSON and shows the UI based on it. This pattern helps teams make fast, dynamic updates without touching app code. Companies like <strong>Shopify</strong>, <strong>Airbnb</strong>, and <strong>Spotify</strong> use this method to build scalable UI systems across platforms like iOS and Android</p><h3>SDUI challenges</h3><p>Building a full SDUI system from scratch isn’t easy. You’d need to handle schema design, backend rendering logic, UI coordination on the client, and a way to keep everything in sync across platforms. It takes a lot of time, effort, and maintenance, especially when you’re trying to support both iOS and Android. That’s why many teams end up needing a proper SDUI framework that handles the heavy lifting, so they can focus on building features, not infrastructure.</p><p>That’s exactly where Nativeblocks comes in. It gives you all the pieces you need to run a complete SDUI setup without having to build and maintain it yourself. From the visual studio where you design screens, to the backend that stores them, to the Core SDK that renders everything natively in your app, Nativeblocks handles the entire flow. You still have full control over your components and platform logic, but you don’t have to reinvent the system.</p><h3>How Nativeblocks works?</h3><p>Nativeblocks builds on this idea. At the center of it all is the <strong>Core SDK </strong>a lightweight engine that handles logic like screen loading and state management. It doesn’t include UI components or application logic itself. Instead, it connects with your components, built-in <strong>SwiftUI</strong>, and <strong>Jetpack Compose,</strong> which orbit around the SDK like planets in a solar system. This setup gives you full control to style, structure, and optimize your UI however you want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-mL1AqsBDCp6KPuZq2xsMg.jpeg" /></figure><p>To design screens, you use <strong>Nativeblocks Studio</strong>, a simple web-based editor. You drag and drop blocks to build screens visually, like buttons, images, or inputs. It’s quick, and you don’t have to write UI code manually. These block-based screens get synced to the <strong>Nativeblocks Backend</strong>. The backend stores all the screens and components, and a sync server keeps everything up-to-date.</p><p>When your app runs, it talks to the backend. The backend sends back a JSON screen definition, which describes what blocks to show and how to arrange them. The <strong>Nativeblocks core SDK</strong> reads that JSON and tells the app which UI components to display. It doesn’t draw anything itself, it just knows how to match blocks to the right native components. So you get a fully native UI, just like if you coded it yourself.</p><p>Behind the scenes, there’s also a <strong>Compiler and Plugin</strong>. This tool generates the actual code and schema for your components. If you create a new block in the Studio, the Compiler ensures your Kotlin or Swift code can render it. It also helps the Studio, backend, and SDK all understand each other by generating consistent schemas. The Compiler connects to your component system, not directly to the SDK, so you’re always in control of how your components behave.</p><p><strong>So here’s how it all works:</strong></p><ul><li>You build screens visually in the Studio.</li><li>The backend stores and serves them as JSON.</li><li>The Core SDK reads the JSON in your app.</li><li>Your custom components render the screen.</li><li>The Compiler keeps the system in sync across platforms.</li></ul><p>With Nativeblocks, you can update the UI instantly, keep everything native, and skip the hassle of app store redeploys. It’s great for things like onboarding screens, feature flags, A/B tests, or even full production screens</p><h3><strong>Getting started is simple. Just:</strong></h3><ul><li>Add the <strong>Nativeblocks SDK</strong> to your iOS or Android app (just a few lines of code).</li><li>Define your components with <strong>SwiftUI</strong>, <strong>Jetpack Compose</strong>, or use the built-in <strong>Nativeblocks Foundation</strong> blocks/actions.</li><li>Let the Compiler generate the schema and component code and then sync them with the backend.</li><li>Use <strong>Nativeblocks Studio</strong> to build and update screens without touching native code.</li></ul><p>Once set up, your app pulls screens from the backend, and the SDK handles the rest, matching blocks to components and showing the correct screen. No app updates, no waiting.</p><h3><strong>To learn more, check out:</strong></h3><ul><li><strong>Website: </strong><a href="https://nativeblocks.io/">nativeblocks.io</a></li><li><strong>Docs &amp; SDK Setup</strong>: <a href="https://nativeblocks.io/references/">nativeblocks.io/references</a></li><li><strong>GitHub Examples</strong>: <a href="https://github.com/nativeblocks">github.com/nativeblocks</a> <em>(sample components and SDK demos)</em></li><li><strong>Product Updates &amp; Blog</strong>: <a href="https://nativeblocks.io/blog/">nativeblocks.io/blog</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed6954b10817" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nativeblocks/what-is-nativeblocks-ed6954b10817">What is Nativeblocks?</a> was originally published in <a href="https://medium.com/nativeblocks">nativeblocks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build a custom design system with Jetpack compose]]></title>
            <link>https://proandroiddev.com/how-to-build-a-custom-design-system-with-jetpack-compose-980ecf2fc78d?source=rss-67d27289894e------2</link>
            <guid isPermaLink="false">https://medium.com/p/980ecf2fc78d</guid>
            <category><![CDATA[ui-design]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Alex Tizfahmfard]]></dc:creator>
            <pubDate>Fri, 15 Mar 2024 20:09:00 GMT</pubDate>
            <atom:updated>2024-04-15T11:10:49.115Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Image by Balázs Kétyi https://unsplash.com/photos/silver-imac-displaying-color-gradient-_x335IZXxfc" src="https://cdn-images-1.medium.com/max/1000/0*HZvKagpELcZz2Gy5" /></figure><p>I will share my experience building a custom design system in this article.</p><p>Because all of the technology has developed with Jetpack Compose it means you can use it on any platform that you want and of course, Jetpack Compose is supported :))</p><p>Firstly, we need to learn what a design system is, for sure this is a short version of a design system because it’s a whole other topic, here we just take a quick look at the fundamentals.</p><blockquote>The purpose of a Design System is that the look and feel of a product from the start to the end should be the same.</blockquote><p>A design system components contain:</p><ul><li>Component Library.</li><li>Pattern Library.</li><li>Brand Style Guide.</li><li>Brand Values.</li><li>Design Principles.</li><li>Icon Library.</li><li>Content Guidelines.</li><li>Accessibility Guidelines.</li></ul><p>So, in a Jetpack Compose project usually, we use MaterialTheme or MaterialTheme3, what if we do not want to use Material naming or convention, or we want to customize some part of that, for these cases we need to learn how we can define a design system.</p><p>For the first step we have to define a holder to hold all our configurations, we call it the “AwesomeTheme”</p><pre>object AwesomeTheme {<br><br>    val colors: AwesomeColor<br>        @Composable<br>        @ReadOnlyComposable<br>        get() = LocalColors.current<br><br>    val typography: AwesomeTypography<br>        @Composable<br>        @ReadOnlyComposable<br>        get() = LocalTypography.current<br><br>    val dimensions: AwesomeDimension<br>        @Composable<br>        @ReadOnlyComposable<br>        get() = LocalDimensions.current<br><br>    val radius: AwesomeRadius<br>        @Composable<br>        @ReadOnlyComposable<br>        get() = LocalRadius.current<br><br>    val elevation: AwesomeElevation<br>        @Composable<br>        @ReadOnlyComposable<br>        get() = LocalElevation.current<br><br>    val icons: AwesomeIcon<br>        @Composable<br>        @ReadOnlyComposable<br>        get() = LocaleIcon.current<br>}</pre><p>Then we need a composable function to use the values of the AwesomeTheme object</p><pre>@Composable<br>fun AwesomeTheme(<br>    colors: AwesomeColor = AwesomeTheme.colors,<br>    typography: AwesomeTypography = AwesomeTheme.typography,<br>    dimensions: AwesomeDimension = AwesomeTheme.dimensions,<br>    elevation: AwesomeElevation = AwesomeTheme.elevation,<br>    radius: AwesomeRadius = AwesomeTheme.radius,<br>    icons: AwesomeIcon = AwesomeTheme.icons,<br>    content: @Composable () -&gt; Unit,<br>) {<br>    val rememberedColors = remember { colors.copy() }.apply { updateColors(colors) }<br>    CompositionLocalProvider(<br>        LocalColors provides rememberedColors,<br>        LocalDimensions provides dimensions,<br>        LocalTypography provides typography,<br>        LocalElevation provides elevation,<br>        LocaleIcon provides icons,<br>        LocalIndication provides rememberRipple(),<br>    ) {<br>        content()<br>    }<br>}</pre><p>Perfect!.</p><p>Here, we used CompositionLocalProvider,</p><blockquote>CompositionLocalProvider in Jetpack Compose is a mechanism that allows you to provide a reference to an object from a higher level in the UI tree, making it accessible to any child within that subtree. It enables the implementation of the Provider pattern in Jetpack Compose, where values can be accessed globally without the need to pass them down the tree explicitly. By using CompositionLocalProvider, you can set values that are available to all descendants within a specific subtree, simplifying the management of shared data in your UI components</blockquote><p>We defined all properties of our theme, now it’s time to implement details of them.</p><pre>class AwesomeColor(<br>    primary: Color,<br>    onPrimary: Color,<br>    error: Color,<br>    onError: Color,<br>    success: Color,<br>    onSuccess: Color,<br>    warning: Color,<br>    onWarning: Color,<br>    background: Color,<br>    onBackground: Color,<br>    surface: Color,<br>    onSurface: Color,<br>    outline: Color,<br>    isLight: Boolean,<br>) {<br>    var primary by mutableStateOf(primary)<br>        private set<br><br>    var onPrimary by mutableStateOf(onPrimary)<br>        private set<br><br>    var error by mutableStateOf(error)<br>        private set<br><br>    var onError by mutableStateOf(onError)<br>        private set<br><br>    var success by mutableStateOf(success)<br>        private set<br><br>    var onSuccess by mutableStateOf(onSuccess)<br>        private set<br><br>    var warning by mutableStateOf(warning)<br>        private set<br><br>    var onWarning by mutableStateOf(onWarning)<br>        private set<br><br>    var background by mutableStateOf(background)<br>        private set<br><br>    var onBackground by mutableStateOf(onBackground)<br>        private set<br><br>    var surface by mutableStateOf(surface)<br>        private set<br><br>    var onSurface by mutableStateOf(onSurface)<br>        private set<br><br>    var outline by mutableStateOf(outline)<br>        private set<br><br>    var isLight by mutableStateOf(isLight)<br>        internal set<br><br>    fun copy(<br>        primary: Color = this.primary,<br>        onPrimary: Color = this.onPrimary,<br>        error: Color = this.error,<br>        onError: Color = this.onError,<br>        success: Color = this.success,<br>        onSuccess: Color = this.onSuccess,<br>        warning: Color = this.warning,<br>        onWarning: Color = this.onWarning,<br>        background: Color = this.background,<br>        onBackground: Color = this.onBackground,<br>        surface: Color = this.surface,<br>        onSurface: Color = this.onSurface,<br>        outline: Color = this.outline,<br>        isLight: Boolean = this.isLight,<br>    ): AwesomeColor = AwesomeColor(<br>        primary,<br>        onPrimary,<br>        error,<br>        onError,<br>        success,<br>        onSuccess,<br>        warning,<br>        onWarning,<br>        background,<br>        onBackground,<br>        surface,<br>        onSurface,<br>        outline,<br>        isLight,<br>    )<br>}</pre><p>Now we have all the color properties of our theme, and if we have multiple instances of the color class, we can have multiple color themes.</p><p>To improve the passing theme, we need to pass just a new instance and it should replace new values with old values</p><pre>class AwesomeColor {<br><br>  ...<br><br>  fun updateColors(other: AwesomeColor) {<br>        primary = other.primary<br>        onPrimary = other.onPrimary<br>        error = other.error<br>        onError = other.onError<br>        success = other.success<br>        onSuccess = other.onSuccess<br>        warning = other.warning<br>        onWarning = other.onWarning<br>        background = other.background<br>        onBackground = other.onBackground<br>        surface = other.surface<br>        onSurface = other.onSurface<br>        outline = other.outline<br>        isLight = other.isLight<br>    }<br><br>  ...<br>}</pre><p>It’s great, isn’t it?</p><p>To complete our theme we need to implement typography, dimensions, radius, elevation, and icons.</p><pre><br>class AwesomeTypography {<br>    val h1: TextStyle<br>        @Composable<br>        get() = TextStyle(<br>            fontFamily = InterFont,<br>            fontSize = 30.sp,<br>            fontWeight = FontWeight.Bold,<br>            lineHeight = 38.sp,<br>        )<br>    val h2: TextStyle<br>        @Composable<br>        get() = TextStyle(<br>            fontFamily = InterFont,<br>            fontSize = 24.ssp,<br>            fontWeight = FontWeight.Bold,<br>            lineHeight = 32.ssp,<br>        )<br>    val h3: TextStyle<br>        @Composable<br>        get() = TextStyle(<br>            fontFamily = InterFont,<br>            fontSize = 22.ssp,<br>            fontWeight = FontWeight.Bold,<br>            lineHeight = 30.ssp,<br>        )<br>    ...<br>}<br><br>internal val LocalTypography = staticCompositionLocalOf { AwesomeTypography() }</pre><p>There is a small difference between color and typography, for the typography we defined a new instance of AwesomeTypography in a “staticCompositionLocalOf” variable</p><blockquote>staticCompositionLocalOf is an API in Jetpack Compose that is used to create a CompositionLocal. This API is specifically designed to handle cases where the value in the CompositionLocal is not expected to change frequently. When using staticCompositionLocalOf, changing the value will trigger the entire content lambda where the CompositionLocal is provided to be recomposed, instead of just the places where the value is read. This API is recommended for scenarios where the value in the CompositionLocal is constant and unlikely to change often, as it helps improve performance by minimizing unnecessary recompositions</blockquote><p>Next is the AwesomeDimension,</p><pre>class AwesomeDimension {<br>    val spacing0: Dp<br>        @Composable<br>        get() = 0.dp<br>    val spacing1: Dp<br>        @Composable<br>        get() = 4.dp<br>    val spacing2: Dp<br>        @Composable<br>        get() = 8.dp<br>    val spacing3: Dp<br>        @Composable<br>        get() = 12.dp<br>    val spacing4: Dp<br>        @Composable<br>        get() = 16.dp<br>    val spacing5: Dp<br>        @Composable<br>        get() = 20.dp<br>    ...<br>}<br><br>internal val LocalDimensions = staticCompositionLocalOf { AwesomeDimension() }</pre><p>We can define spacing based on whatever metric we want, in this case, I preferred using values to multiple of 4, which means we have spacing1 with the value of 4, and with a little mathematical calculation, we can guess if we need 16 dp space we have to use spacing4.</p><p>The AwesomeRadius and AwesomeElevation are the same as AwesomeDimension,</p><p>For padding and margin, we can use AwesomeDimension, however, for corner radius, we can use AwesomeRadius, and for shadow and elevation effect we use AwesomeElevation.</p><p>We will get to the usage of AwesomeTheme.</p><p>The last part is AwesomeIcon, To have a consistent icon set across the application avoid duplication, and maintain the icon set for the future, we define all icons in one place.</p><pre><br>class AwesomeIcon {<br><br>    val direction: ImageVector<br>        @Composable<br>        get() = ImageVector.vectorResource(id = R.drawable.ic_direction_24)<br><br>    val feedback: ImageVector<br>        @Composable<br>        get() = ImageVector.vectorResource(id = R.drawable.ic_feedback_24)<br><br>    val coin: ImageVector<br>        @Composable<br>        get() = ImageVector.vectorResource(id = R.drawable.ic_coin_24)<br><br>    val play: ImageVector<br>        @Composable<br>        get() = ImageVector.vectorResource(id = R.drawable.ic_play_24)<br>    ...<br>    ...<br>    ...<br>}<br><br>internal val LocaleIcon = staticCompositionLocalOf { AwesomeIcon() }</pre><p>Because we are using staticCompositionLocalOf and ImageVector the recomposition has been minimized as possible.</p><p>And at the end, we can use the Theme.</p><pre>AwesomeTheme {<br>    Home()<br>}</pre><p>Up to here, we learned how to define a new theme, now it’s time to use the defined variables inside of our components</p><pre>@Composable<br>fun AwesomeCheckbox(<br>    modifier: Modifier = Modifier,<br>    checked: Boolean,<br>    enabled: Boolean = true,<br>    onCheckedChange: ((Boolean) -&gt; Unit)?,<br>) {<br>    Checkbox(<br>        checked = checked,<br>        onCheckedChange = { onCheckedChange?.invoke(it) },<br>        modifier = modifier,<br>        enabled = enabled,<br>        colors = CheckboxDefaults.colors(<br>            checkedColor = AwesomeTheme.colors.primary,<br>        ),<br>    )<br>}</pre><p>In this example, we used the primary color that has been provided by the Theme, and without reassigning the color value to the component we have access to the high-level variable because we are in the same scope.</p><h3>In conclusion</h3><p>we learned a real-world usage of <strong>CompositionLocalProvider</strong> and <strong>staticCompositionLocalOf,</strong> with this approach we can provide high-level variables through the Compose tree and use it in the child-level component.</p><p>In addition, we covered building a custom design system with Jetpack Compose offers a powerful and flexible approach to crafting intuitive user interfaces for modern applications.</p><p>I recommend if you are interested in the design system topic read more about it, such as:</p><ul><li><a href="https://m3.material.io/">Material Design</a></li><li><a href="https://developer.apple.com/design/human-interface-guidelines">Human Interface Guidelines | Apple Developer Documentation</a></li><li><a href="https://polaris.shopify.com/">Shopify Polaris React</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=980ecf2fc78d" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/how-to-build-a-custom-design-system-with-jetpack-compose-980ecf2fc78d">How to build a custom design system with Jetpack compose</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[Modularization of mobile applications at scale]]></title>
            <link>https://medium.com/teknasyon-engineering/modularization-of-mobile-applications-at-scale-df57815ff19a?source=rss-67d27289894e------2</link>
            <guid isPermaLink="false">https://medium.com/p/df57815ff19a</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[mobile-development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[modularization]]></category>
            <dc:creator><![CDATA[Alex Tizfahmfard]]></dc:creator>
            <pubDate>Mon, 19 Jun 2023 13:02:39 GMT</pubDate>
            <atom:updated>2024-01-29T09:53:08.105Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HGgscvNLxrZ8RqBy5SYgTA.jpeg" /></figure><p>Here are the best practices of modularization at scale, that we applied in the <a href="https://getcontact.com/">Getcontact</a> application, by powering feature modularization rather than layer modularization.</p><p>The story has begun on the date that the <a href="https://play.google.com/store/apps/details?id=app.source.getcontact">Getcontact</a> application gained more users and the application codebase increased and increased, on the other hand, new developers joined us to deliver new features.</p><p>We needed to have a more autonomous and independent team, and in this case, we found a monolithic codebase is not suited. then we decided to modularize our application and here is the story.</p><p>In the beginning, we had a complex application with tons of unknown dependencies, which made separating dependencies hard,</p><p>Transforming a monolithic application into a modular architecture is a journey toward scalability, it is crucial to establish a set of rules for building a scalable project. This involves creating different types of modules, each serving specific purposes, these rules became our lantern to see and solve the upcoming challenges.</p><p>Let’s see one by one what is the meaning of each of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*9phE56Antyy3aAcMT0PSxA.png" /></figure><h3>Feature module</h3><p>The Feature module is a small portion of the application, it is responsible for handling tasks such as business logic, UI logic, or data logic, focusing on a specific area.</p><p>Now, here’s the trick to prevent any messy circular dependencies: Feature modules should mind their own business and avoid getting tangled up with each other. That means Feature A shouldn’t have a clue about what Feature B is up to. Let them be independent and self-contained.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*StuuFEAclgSl8cBzhnsv2Q.png" /><figcaption>Feature module circular dependency</figcaption></figure><h3>Coordinator Module</h3><p>Sometimes, we find ourselves in a situation where we need to bring together two feature modules on a single page. In this case, the coordinator modules come into play, enabling us to use multiple feature modules within the same graph.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*9eTx8nw7uBl8xC1W71rhLw.png" /><figcaption>Coordinator sample screen</figcaption></figure><p>Now, you might be wondering how this works. Well, here’s the implementation: We create a shiny new module and add both Feature A and Feature B to the dependency manager inside it. Then, in the code layer, we can effortlessly create a page or component that showcases the combined power of these features. It’s like having a super team-up of features working together harmoniously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ispRIcx9g_D7nEI6r6vvug.png" /></figure><p>Also, coordinators give us the freedom to replace features on the top-level module, based on some logic, like showing a feature to a specific group of users or enabling a feature as an experiment in a specific version or A/B testing, all of these are responsibilities of coordinators.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*E6w_d5a4s3n9eT28g_fQtw.gif" /><figcaption>Coordinator module</figcaption></figure><p>In addition in some cases, we need to have shared business logic like checking authentication or user data. for this case, we need to have plugin modules</p><h3>Plugin module</h3><p>Let’s imagine a scenario where we have a remote configuration that we want to use throughout the entire application. The initial approach might be to implement this request separately in each feature module where it’s needed. However, this approach isn’t ideal because if there are any future changes to the model or business logic, we would have to carefully modify all the code that has been written.</p><p>In a nutshell, this is where plugin modules come into play. They take on the responsibility of handling small snippets of shared business logic. If we have a piece of code that needs to be shared across modules and doesn’t involve any user interface elements, nor provide infrastructure functionalities, then it fits perfectly as a plugin module. This allows for easier management and maintenance of the shared code, making future modifications and updates less cumbersome.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*XVEoK5rDYKPUQ1uqyD-yFQ.gif" /><figcaption>Plugin showcase</figcaption></figure><h3>Library module</h3><p>In addition to coordinator and plugin modules, it is essential to have a few shared classes, data structures, or libraries. This helps us avoid duplicating code and promotes code reusability. To achieve this, we introduce a special type of module: library modules.</p><p>Library modules take on the crucial role of providing infrastructure components or operating system libraries. For instance, if we need to handle tasks like sending network requests or storing data locally, we create modules such as Network, Cache, and Database. These modules encapsulate the necessary functionalities, ensuring that we have organized and reusable code for these specific purposes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QqL7a_SAc6CqtrRnGpgrGQ.png" /></figure><h3>Launcher module</h3><p>Last but not least we have the launcher module type,</p><p>Imagine we’ve completed the module refactoring and separation, resulting in multiple modules, each performing its specific role like individual Lego pieces. We now have a puzzle with several pieces, and it’s time to bring them together. To accomplish this, we create a new module that acts as the connector, responsible for gathering all the other modules and building a dependency graph for the entire application.</p><p>Think of it as the builder in the Lego world, assembling all the individual components into a cohesive structure. This central module acts as the glue, connecting the pieces and ensuring they work harmoniously as a unified whole. It’s like putting the final touches on our puzzle, transforming it into a complete and functional modular project.</p><p>Here’s another aspect to consider: to boost development speed and developer experience, we have the flexibility to create multiple launcher modules. Let’s say Team A is focused on developing Features A, B, C, and D, while Team B is working on Features X, Y, and Z.</p><p>In this scenario, both teams can create their dedicated launcher module during the development phase. This approach allows them to work independently without worrying about unnecessary dependencies or loading unrelated modules. All they need to do is add their specific features and coordinators to their respective launcher modules. With each run, instead of navigating through the entire application flow, they can simply focus on and interact with their specific features.</p><p>Note: here is a sample that gives more insight <a href="https://github.com/Teknasyon-Teknoloji/Getcontact-Bootcamp">Getcontact-Bootcamp</a>, however, consider it is not a full implementation of this architecture.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df57815ff19a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/teknasyon-engineering/modularization-of-mobile-applications-at-scale-df57815ff19a">Modularization of mobile applications at scale</a> was originally published in <a href="https://medium.com/teknasyon-engineering">Teknasyon Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>