<?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 Emre Ozsahin on Medium]]></title>
        <description><![CDATA[Stories by Emre Ozsahin on Medium]]></description>
        <link>https://medium.com/@eozsahin1993?source=rss-8be5b957162f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vyqAFru2rjUJSDgSdSkU5A.jpeg</url>
            <title>Stories by Emre Ozsahin on Medium</title>
            <link>https://medium.com/@eozsahin1993?source=rss-8be5b957162f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 03:22:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@eozsahin1993/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[TIL: Streaming Data in Go with iter and yield]]></title>
            <link>https://medium.com/@eozsahin1993/til-streaming-data-in-go-with-iter-and-yield-2f8cacd46f01?source=rss-8be5b957162f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f8cacd46f01</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Emre Ozsahin]]></dc:creator>
            <pubDate>Sat, 04 Jul 2026 17:16:35 GMT</pubDate>
            <atom:updated>2026-07-04T17:16:35.688Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A-XDDRiI8EQ_4yQz" /><figcaption>Photo by <a href="https://unsplash.com/@viktortalashuk?utm_source=medium&amp;utm_medium=referral">Viktor Talashuk</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>While building <a href="https://github.com/eozsahin1993/ragpack">RagPack</a>, a library that chunks files for embedding, I needed a common way to stream parsed content from multiple file formats. RagPack supports CSV, PDF, DOCX, HTML, XLSX, Markdown, JSON and more. Each format has its own parser, but the ingester that consumes them should not care which one it is talking to. I needed a shared contract. In Java I would have reached for an Iterator&lt;T&gt; or an InputStream, but in Go the answer turned out to be the iter package, introduced in Go 1.23.</p><h3>The Parser interface</h3><p>The iter package introduces two types. Seq[V] yields a single value at a time, and Seq2[K, V] yields a pair:</p><pre>type Seq[V any]     func(yield func(V) bool)<br>type Seq2[K, V any] func(yield func(K, V) bool)</pre><p>Seq2 is the right fit here because each iteration naturally produces two things: a parsed unit and any read error. This matches Go&#39;s standard (value, error) convention and lets the caller handle errors inline without wrapping them in a struct.</p><p>That made iter.Seq2[Unit, error] a natural return type for the Parser interface:</p><pre>type Parser interface {<br>    Parse(ctx context.Context, r io.ReadCloser) iter.Seq2[Unit, error]<br>}</pre><p>Every sub-parser, CSVParser, PDFParser, DocxParser, HTMLParser and so on, implements this one method. The ingester does not need to know which format it is dealing with.</p><h3>Implementing a parser</h3><p>Here is what a parser implementation looks like:</p><pre>func (p *Parser) Parse(_ context.Context, r io.ReadCloser) iter.Seq2[Unit, error] {<br>    return func(yield func(Unit, error) bool) {<br>        defer r.Close()<br><br>        reader := bufio.NewReader(r)<br>        for {<br>            line, err := reader.ReadString(&#39;\n&#39;)<br>            if err == io.EOF {<br>                break<br>            }<br>            if err != nil {<br>                yield(Unit{}, err)<br>                return<br>            }<br>            if !yield(Unit{Text: strings.TrimRight(line, &quot;\n&quot;)}, nil) {<br>                return<br>            }<br>        }<br>    }<br>}</pre><p>The if !yield(...) { return } part is the key. If the caller breaks out of the loop early, yield returns false and we stop reading. No wasted work.</p><h3>Using it with range</h3><p>Because all parsers return the same type, the ingester ranges over any of them the same way:</p><pre>for unit, err := range parser.Parse(ctx, file) {<br>    if err != nil {<br>        // handle error<br>    }<br>    embed(unit)<br>}</pre><p>Swap in a different parser and the loop does not change. That is one big win. Memory was also in our minds when designing this. For streaming formats like CSV, JSON, or plain text, yielding one unit at a time keeps the footprint flat no matter how large the file is. For formats like PDF it is a bit more nuanced since the underlying parser has to load the full file first to parse it.</p><p>Happy coding!</p><p><em>Originally published at </em><a href="https://www.emrecodes.net/posts/2026/07/03/go-iter-yield.html"><em>https://www.emrecodes.net</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f8cacd46f01" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Publishing npm Package Without an Auth Token]]></title>
            <link>https://medium.com/@eozsahin1993/publishing-npm-package-without-an-auth-token-9ec60654ecb7?source=rss-8be5b957162f------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ec60654ecb7</guid>
            <category><![CDATA[npm-scripts]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[npm-publish]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Emre Ozsahin]]></dc:creator>
            <pubDate>Fri, 03 Jul 2026 01:42:54 GMT</pubDate>
            <atom:updated>2026-07-03T01:42:54.531Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9pyxwTNlUJ5jJsGw" /><figcaption>Photo by <a href="https://unsplash.com/@rubaitulazad?utm_source=medium&amp;utm_medium=referral">Rubaitul Azad</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When setting up CI/CD for <a href="https://github.com/eozsahin1993/ragpack">RagPack</a>, I wanted to publish to npm from GitHub Actions without storing a long-lived token as a secret. Tokens are annoying: they expire, need rotating, and if they leak you have a problem.</p><p>Turns out there is already a feature in npm called <strong>trusted publishing</strong>, and it uses OIDC to let GitHub Actions authenticate directly with npm, no NPM_TOKEN required.</p><p>Here’s what the setup actually looks like, including a few things the docs gloss over.</p><h3>How it works</h3><p>Instead of a static token, GitHub Actions gets a short-lived OIDC token for each run. npm verifies that token came from the specific repo and workflow you authorized, then allows the publish. The token is scoped to that single job and can’t be extracted or reused.</p><h3>Requirements</h3><ul><li>npm CLI <strong>11.5.1</strong> or later</li><li>Node <strong>24</strong> or later (Node 22 is not sufficient — use 24)</li><li>actions/setup-node <strong>v6</strong> or later</li></ul><p>If you pin an older Node version or an older version of setup-node, it won&#39;t work.</p><h3>Step 1: Configure trusted publishers on npmjs.com</h3><p>This is the step the docs bury. You need to do this <strong>per package</strong>, on the package’s own settings page, not in your account settings.</p><p>Go to npmjs.com/package/&lt;your-package&gt;, click the <strong>Settings</strong> tab, find <strong>Publishing access</strong>, and add a trusted publisher. For GitHub Actions:</p><ul><li><strong>Owner:</strong> your GitHub username or org</li><li><strong>Repository:</strong> the repo name</li><li><strong>Workflow:</strong> the filename of your workflow (e.g. publish-cli.yml)</li><li><strong>Environment:</strong> leave blank unless you use GitHub environments</li></ul><p>If you have multiple packages in the same monorepo (like I do, a CLI and a JS SDK), you repeat this for each package but point to the respective workflow file.</p><h3>Step 2: Update your CI workflow</h3><p>You need id-token: write permission so the job can request an OIDC token. Then just run npm publish --access public, no NODE_AUTH_TOKEN, no secrets.</p><p>Here is the github actions workflow:</p><pre>name: Publish CLI<br><br>on:<br>  push:<br>    tags: [&#39;cli/v*.*.*&#39;]<br><br>permissions:<br>  id-token: write<br>  contents: write<br><br>jobs:<br>  publish:<br>    runs-on: ubuntu-latest<br>    defaults:<br>      run:<br>        working-directory: cli<br><br>    steps:<br>      - uses: actions/checkout@v6<br>      - uses: actions/setup-node@v6<br>        with:<br>          node-version: &#39;24&#39;<br>          registry-url: &#39;https://registry.npmjs.org&#39;<br>          package-manager-cache: false<br><br>      - run: npm ci<br>      - run: npm publish --access public</pre><p>That’s it. No secrets to manage.</p><p>One gotcha with tag-triggered workflows: the tag is just a trigger. Nothing enforces that cli/v0.2.0 matches &quot;version&quot;: &quot;0.2.0&quot; in package.json. They can silently drift.</p><p>I added a version check step that fails the job early if they don’t match:</p><pre>- name: Verify version matches tag<br>  run: |<br>    PKG_VERSION=&quot;v$(node -p &quot;require(&#39;./package.json&#39;).version&quot;)&quot;<br>    TAG_VERSION=&quot;${GITHUB_REF_NAME#cli/}&quot;<br>    if [ &quot;$PKG_VERSION&quot; != &quot;$TAG_VERSION&quot; ]; then<br>      echo &quot;Version mismatch: package.json=$PKG_VERSION tag=$TAG_VERSION&quot;<br>      exit 1<br>    fi</pre><p>The release process then becomes: bump the version in package.json, commit, push, tag. If the version and tag don&#39;t match you get a clear error instead of publishing the wrong version silently.</p><h3>First publish</h3><p>One thing worth knowing: trusted publishing works for subsequent publishes but the package still needs to exist on npm first. For a brand new package, do a one-time manual publish from your machine:</p><pre>npm login<br>npm publish --access public</pre><p>After that, the CI workflow handles everything.</p><h3>The result</h3><p>The packages page on npm now shows a provenance badge. Users can see exactly which commit and GitHub Actions run produced each version. And there are no tokens to rotate, expire, or accidentally commit.</p><p>Happy coding!</p><p><em>Originally published at </em><a href="https://www.emrecodes.net/posts/2026/06/26/npm-trusted-publishing.html"><em>https://www.emrecodes.net</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ec60654ecb7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using pg_cron for Match Notifications]]></title>
            <link>https://medium.com/@eozsahin1993/using-pg-cron-for-match-notifications-6220047465c7?source=rss-8be5b957162f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6220047465c7</guid>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[push-notification]]></category>
            <category><![CDATA[nextjs]]></category>
            <dc:creator><![CDATA[Emre Ozsahin]]></dc:creator>
            <pubDate>Fri, 26 Jun 2026 19:00:43 GMT</pubDate>
            <atom:updated>2026-06-26T19:00:43.050Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dw-yiCHZbcEkJsWD" /><figcaption>Photo by <a href="https://unsplash.com/@brett_jordan?utm_source=medium&amp;utm_medium=referral">Brett Jordan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>While working on my side project, <a href="https://www.worldcuppicks.co/">worldcuppicks.co</a> (a site where you predict World Cup games), I needed to add web push notifications. To build this, I used a Postgres extension I’d been wanting to try: pg_cron. It ended up doing more than I expected, so I wanted to write about it.</p><p>pg_cron lets you schedule cron jobs directly inside the database. World Cup matches kick off on a fixed schedule, and I wanted a notification to fire 10 minutes before each one. I could have wired this up externally, with something like AWS EventBridge, but doing it inside Postgres turned out to be much simpler.</p><h3>Why pg_cron?</h3><pre>CREATE EXTENSION IF NOT EXISTS pg_cron;<br><br>SELECT cron.schedule(<br>  &#39;notify-upcoming-matches&#39;,<br>  &#39;50 * * * *&#39;,<br>  $$<br>    INSERT INTO match_notifications (match_id, status, scheduled_at)<br>    SELECT<br>      id, &#39;scheduled&#39;, now()<br>    FROM matches<br>    WHERE<br>      match_date BETWEEN now() AND now() + interval &#39;20 minutes&#39;<br>      AND id NOT IN (SELECT match_id FROM match_notifications)<br>    ON CONFLICT DO NOTHING;<br>  $$<br>);</pre><p>Deciding whether to fire a notification, and what to put in it, depends entirely on the match schedule, which already lives in the database. An external scheduler would just turn around and hit an API to ask the database the same question. So instead of standing up a separate service for that, it only takes a few lines of SQL:</p><p>This job fires at exactly the 50th minute of every hour and inserts a row into match_notifications for each match that&#39;s about to kick off and hasn&#39;t been notified yet. From there, all you need is a database webhook on INSERTs to that table, which calls a lambda/edge function to actually send the push notification.</p><p>Normally, scheduling something like this needs separate infrastructure, but with pg_cron it lives entirely inside Postgres. Happy coding!</p><p><em>Originally published at </em><a href="https://www.emrecodes.net/posts/2026/06/16/postgres-extensions.html"><em>https://www.emrecodes.net</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6220047465c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interactive Donut Chart using Jetpack Compose]]></title>
            <link>https://medium.com/@eozsahin1993/interactive-donut-chart-using-jetpack-compose-140ca6b0e68c?source=rss-8be5b957162f------2</link>
            <guid isPermaLink="false">https://medium.com/p/140ca6b0e68c</guid>
            <dc:creator><![CDATA[Emre Ozsahin]]></dc:creator>
            <pubDate>Sun, 02 Jul 2023 19:20:34 GMT</pubDate>
            <atom:updated>2023-07-02T19:20:34.351Z</atom:updated>
            <content:encoded><![CDATA[<h4>In this blog, we are going to implement an interactive Donut Chart using Jetpack Compose from scratch.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/0*azmeHT2w23pgx5Fm.gif" /><figcaption>Figure 1: Interactive Donut Chart</figcaption></figure><h4>Outline</h4><ul><li>Defining data models</li><li>Simple donut chart without interaction</li><li>Adding touch detection and stroke animation</li><li>Putting everything together</li></ul><h4>Defining data models</h4><p>The data model will hold the user data that will be used to display the graph. It will include preferences on how the data should be displayed in the graph as well. Let’s dive in!</p><ol><li><strong>DonutChartDataCollection</strong> — will consist of list of data points that will construct the chart.</li><li><strong>DonutChartData </strong>— Model to hold individual data points. Contains amount, title of the item, and the color representation.</li><li><strong>DrawingAngles </strong>— a helper class to be used when calculating tap actions.</li></ol><pre>private const val TOTAL_ANGLE = 360.0f<br>private val STROKE_SIZE_UNSELECTED = 40.dp<br>private val STROKE_SIZE_SELECTED = 60.dp<br><br>data class DonutChartData(<br>    val amount: Float,<br>    val color: Color,<br>    val title: String,<br>)<br><br>data class DonutChartDataCollection(<br>    var items: List&lt;DonutChartData&gt;<br>) {<br>    internal var totalAmount: Float = items.sumOf { it.amount.toDouble() }.toFloat()<br>        private set<br>}<br><br>private data class DrawingAngles(val start: Float, val end: Float)</pre><h4>Donut chart without interaction</h4><p>Now that we have created our data classes, our first implementation will simply draw the donut chart without any interactions. We will use the <strong>Canvas </strong>class for this. At the end, our code will simply result in the figure 2 shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*i1EBxmj5ldAlJKVdS1zxKw.png" /><figcaption>Figure 2: Simple donut chart with no interactions</figcaption></figure><p>It’s usually more straightforward to implement the donut chart without attempting to calculate the gaps but this will come in handy when we integrate animations to it. Let’s dive into the code!</p><pre>@Composable<br>fun DonutChart(<br>    data: DonutChartDataCollection,<br>    modifier: Modifier = Modifier,<br>    chartSize: Dp = 350.dp,<br>    gapPercentage: Float = 0.04f,<br>    selectionView: @Composable (selectedItem: DonutChartData?) -&gt; Unit = {},<br>) {<br>    val anglesList: MutableList&lt;DrawingAngles&gt; = remember { mutableListOf() }<br>    val gapAngle = data.calculateGapAngle(gapPercentage)<br><br>    // 1<br>    Box(<br>        modifier = modifier.fillMaxWidth()<br>        contentAlignment = Alignment.Center,<br>    ) {<br>        // 2<br>        Canvas(<br>            modifier = Modifier<br>                .size(chartSize),<br>            // 3<br>            onDraw = {<br>                val defaultStrokeWidth = STROKE_SIZE_UNSELECTED.toPx()<br>                anglesList.clear()<br>                var lastAngle = 0f<br>                data.items.forEachIndexed { ind, item -&gt;<br>                    val sweepAngle = data.findSweepAngle(ind, gapPercentage)<br>                    anglesList.add(DrawingAngles(lastAngle, sweepAngle))<br>                    // 4<br>                    drawArc(<br>                        color = item.color,<br>                        startAngle = lastAngle,<br>                        sweepAngle = sweepAngle,<br>                        useCenter = false,<br>                        topLeft = Offset(defaultStrokeWidth / 2, defaultStrokeWidth / 2),<br>                        style = Stroke(defaultStrokeWidth, cap = StrokeCap.Butt),<br>                        size = Size(size.width - defaultStrokeWidth,<br>                            size.height - defaultStrokeWidth)<br>                    )<br>                    // 5 <br>                    lastAngle += sweepAngle + gapAngle<br>                }<br>            }<br>        )<br>    }<br>}</pre><p>It seems to be a lot of code in one single place, but don’t worry, we will deep dive into each major building block.</p><ol><li>Basically we use a <strong>Box </strong>that contains a <strong>Canvas</strong> object inside.</li><li>Inside the <strong>Canvas</strong>, we will be drawing custom arc inside the <strong>onDraw </strong>definition by iterating our data.</li><li>Inside <strong>onDraw </strong>definition we are iterating over list of <strong>DonutChartData </strong>points to calculate data points to draw the arc based on the data. For this, we have couple of extension functions to make our lives easier. I will share those once we get to the nitty gritty details here.</li><li>For each data point, we are drawing an arc based on the color, startAngle, sweepAngle, and other minor metrics. Please refer to figure 3 below.</li></ol><ul><li><strong>startAngle</strong> — the angle that we will start drawing the arc. This will keep track of our latest drawn angle so that we don’t have collapsing arcs. <strong><em>This is indicated as A in figure 3 below.</em></strong></li><li><strong>sweepAngle </strong>— the actual angle for the arc that will be drawn from the starting point. A sweep angle is calculated by the ratio of the current item count to the total count. <strong><em>This is indicated as theta in figure 3</em></strong>.</li><li><strong>lastAngle — </strong>a custom variable to keep track of last angle to draw the next graph without colliding and respecting the gap. <strong><em>This is indicated as B in figure 3 below</em></strong>.</li><li><strong>topLeft</strong> — the top left starting point of the graph. We have to accommodate the stroke width, which other will end up exceeding the chart size. Thus, it will hinder our touch detection logic.</li><li><strong>size</strong> — size of the arc which is how far it is from the center point.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/210/0*uv0sd3fmVhCS3GZy.png" /><figcaption>Figure 3: Arc calculations</figcaption></figure><p>Now that we have the <strong>Canvas </strong>and <strong>drawArc</strong> ui pieces covered, we will have to take a look at the extension functions used in the code snippet above to calculate the <strong>sweepAngle </strong>for a given data point in the collection<strong>. </strong>The sweep angle calculation must take the gap into account as well.</p><pre>/**<br> * Calculate the gap width between the arcs based on [gapPercentage]. The percentage is applied <br> * to the average count to determine the width in pixels. <br> */<br>private fun DonutChartDataCollection.calculateGap(gapPercentage: Float): Float {<br>    if (this.items.isEmpty()) return 0f<br><br>    return (this.totalAmount / this.items.size) * gapPercentage<br>}<br><br>/**<br> * Returns the total data points including the individual gap widths indicated by the <br> * [gapPercentage]. <br> */<br>private fun DonutChartDataCollection.getTotalAmountWithGapIncluded(gapPercentage: Float): Float {<br>    val gap = this.calculateGap(gapPercentage)<br>    return this.totalAmount + (this.items.size * gap)<br>}<br><br>/**<br> * Calculate the sweep angle of an arc including the gap as well. The gap is derived based <br> * on [gapPercentage].<br> */<br>private fun DonutChartDataCollection.calculateGapAngle(gapPercentage: Float): Float {<br>    val gap = this.calculateGap(gapPercentage)<br>    val totalAmountWithGap = this.getTotalAmountWithGapIncluded(gapPercentage)<br><br>    return (gap / totalAmountWithGap) * TOTAL_ANGLE<br>}<br><br>/**<br> * Returns the sweep angle of a given point in the [DonutChartDataCollection]. This calculations <br> * takes the gap between arcs into the account.<br> */<br>private fun DonutChartDataCollection.findSweepAngle(<br>    index: Int,<br>    gapPercentage: Float<br>): Float {<br>    val amount = items[index].amount<br>    val gap = this.calculateGap(gapPercentage)<br>    val totalWithGap = getTotalAmountWithGapIncluded(gapPercentage)<br>    val gapAngle = this.calculateGapAngle(gapPercentage)<br>    return ((((amount + gap) / totalWithGap) * TOTAL_ANGLE)) - gapAngle<br>}</pre><p>What <strong>findSweepAngle </strong>method<strong> </strong>essentially does is to calculate the gap width based on the gapPercentage specified in the composable function. The gap percentage is multiplied by the average data point in the data set to find the width in pixels.</p><p>Then we simply find the sweep angle and draw the arc accordingly. As a final step, we increase the following starting angle by the gap angle to preserve our gap between arcs. The gap angle will be unified across the graph.</p><h4>Steps to add interactivity</h4><p>Awesome, now that we have a non-interactive version of the Donut Chart code working, let’s take a look at how we can make this more interesting!</p><p>We would need the following things to achieve interactivity:</p><ol><li>Store the state of the donut chart in our composable function and update it when necessary.</li><li>Ability to detect taps on the our drawn canvas.</li><li>Update the state to reflect the <strong>strokeWidth </strong>change and animate.</li></ol><h4>Introducing State</h4><p>For storing the state of the graph, we will have to use another data class called <strong>DonutChartState </strong>shown below. The state can be changed to <strong>Selected </strong>or <strong>Unselected </strong>which will automatically update its stroke property. The data class is shown below.</p><p>This state will be available for every data point on the graph.</p><pre>private class DonutChartState(<br>    val state: State = State.Unselected<br>) {<br>    val stroke: Dp<br>        get() = when (state) {<br>            State.Selected -&gt; STROKE_SIZE_SELECTED<br>            State.Unselected -&gt; STROKE_SIZE_UNSELECTED<br>        }<br><br>    enum class State {<br>        Selected, Unselected<br>    }<br>}</pre><h4>Tracking State</h4><p>Our composable function will have to track state and immediately update the view if anything changes. For that purposes, we create the following states:</p><pre>var selectedIndex by remember { mutableStateOf(-1) }<br>val animationTargetState = (0..data.items.size).map {<br>    remember { mutableStateOf(DonutChartState()) }<br>}<br>val animValues = (0..data.items.size).map {<br>    animateDpAsState(<br>        targetValue = animationTargetState[it].value.stroke,<br>        animationSpec = TweenSpec(700)<br>    )<br>}</pre><ul><li><strong>selectedIndex</strong> — indicates the current selected item. The value is set to -1 if nothing is selected.</li><li><strong>animationTargetState — </strong>holds the state of each data provided to the graph. Index values match the given data points.</li><li><strong>animValues — </strong>this is the same list but it holds <strong>stroke</strong> width indicated by <strong>animateDpAsState() </strong>to be used in the arc. This will allow us to animate the stroke changes whenever the value is updated.</li></ul><h4>Implementing touch detection</h4><p>Next step is to implement tap detection in our canvas. We will use a modifier called <strong>pointerInput </strong>and we will detect tap gestures using <strong>detectTapGestures </strong>method.</p><pre>Canvas(<br>    modifier = Modifier<br>        .size(chartSize)<br>        .pointerInput(Unit) {<br>            detectTapGestures(<br>                onTap = { tapOffset -&gt;<br>                    handleCanvasTap()<br>                }<br>            )<br>        },<br>    onDraw = { ... }<br>)</pre><p>For us to be able to implement <strong>handleCanvasTap </strong>we would need to some math. Now this will be a bit tricky and confusing bare with me while I try my best to digest some of these methods and calculations. Here is our logic to determine if a tap falls on to a drawn arc:</p><ol><li>Find the center of the canvas. This will not be (0,0) as that’s the topLeft point.</li><li>Calculate the touch angle according to the canvas</li><li>Calculate the touch distance from the center</li><li>Combine angle + distance to check if it corresponds to an arc that’s already drawn.</li></ol><p>Here is our implementation:</p><pre>private fun handleCanvasTap(<br>    center: Offset,<br>    tapOffset: Offset,<br>    anglesList: List&lt;DrawingAngles&gt;,<br>    currentSelectedIndex: Int,<br>    currentStrokeValues: List&lt;Float&gt;,<br>    onItemSelected: (Int) -&gt; Unit = {},<br>    onItemDeselected: (Int) -&gt; Unit = {},<br>    onNoItemSelected: () -&gt; Unit = {},<br>) {<br>    val normalized = tapOffset.findNormalizedPointFromTouch(center)<br>    val touchAngle =<br>        calculateTouchAngleAccordingToCanvas(center, normalized)<br>    val distance = findTouchDistanceFromCenter(center, normalized)<br><br>    var selectedIndex = -1<br>    var newDataTapped = false<br><br>    anglesList.forEachIndexed { ind, angle -&gt;<br>        val stroke = currentStrokeValues[ind]<br>        if (angle.isInsideAngle(touchAngle)) {<br>            if (distance &gt; (center.x - stroke) &amp;&amp;<br>                distance &lt; (center.x)<br>            ) { // since it&#39;s a square center.x or center.y will be the same<br>                selectedIndex = ind<br>                newDataTapped = true<br>            }<br>        }<br>    }<br><br>    if (selectedIndex &gt;= 0 &amp;&amp; newDataTapped) {<br>        onItemSelected(selectedIndex)<br>    }<br>    if (currentSelectedIndex &gt;= 0) {<br>        onItemDeselected(currentSelectedIndex)<br>        if (currentSelectedIndex == selectedIndex || !newDataTapped) {<br>            onNoItemSelected()<br>        }<br>    }<br>}</pre><p>We check if our drawn arc angles are inside the touch points and check the distance to make sure it corresponds to the drawn arc. This will eliminate the case where user taps outside of the graph or inside without tapping the arcs.</p><p>Then we record the selected item and fire the callbacks <strong>onItemSelected, onItemDeselected, onNoItemSelected</strong> respectively.</p><h4>Touch detection calculations</h4><p>Below, you can find a list of extension functions I have implemented to be used in touch detection calculations.</p><pre>/**<br> * Find the distance between two points in a graph. <br> * Calculated using the pythagorean theorem.<br> */<br>private fun findTouchDistanceFromCenter(center: Offset, touch: Offset) =<br>    sqrt((touch.x - center.x).pow(2) + (touch.y - center.y).pow(2))<br><br>/**<br> * The touch point starts from Canvas top left which ranges <br> * from (0,0) -&gt; (canvas.width, canvas.height). We need to normalize this<br> * point so that the (0,0) is located in the center of the graph instead.<br> */<br>private fun Offset.findNormalizedPointFromTouch(canvasCenter: Offset) =<br>    Offset(this.x, canvasCenter.y + (canvasCenter.y - this.y))<br><br>/**<br> * Calculate the touch angle based on the canvas center. Then <br> * adjust the angle so that drawing starts from the 4th quadrant <br> * instead of the first.<br> */<br>private fun calculateTouchAngleAccordingToCanvas(canvasCenter: Offset, normalizedPoint: Offset): Float {<br>    val angle = calculateTouchAngleInDegrees(canvasCenter, normalizedPoint)<br>    return adjustAngleToCanvas(angle).toFloat()<br>}<br><br>/**<br> * Calculate touch angle in radian using atan2(). Afterwards, convert the <br> * radian to degrees to be compared to arc data points.<br> */<br>private fun calculateTouchAngleInDegrees(canvasCenter: Offset, normalizedPoint: Offset): Double {<br>    val touchInRadian = kotlin.math.atan2(normalizedPoint.y - canvasCenter.y,<br>        normalizedPoint.x - canvasCenter.x)<br>    return touchInRadian * -180 / Math.PI // Convert radians to angle in degrees<br>}<br><br>/**<br> * Start from 4th quadrant going to 1st quadrant, degrees ranging from 0 to 360<br> */<br>private fun adjustAngleToCanvas(angle: Double) = (angle + TOTAL_ANGLE) % TOTAL_ANGLE</pre><h4>Displaying the graph</h4><p>Awesome, the implementation is so far going well. Our next step is to actually use our composable function to display some fancy donut chart and provide a selection screen inside it.</p><pre>// 1<br>val viewData = DonutChartDataCollection(<br>        listOf(<br>            DonutChartData(1200.0f, Sapphire, title = &quot;Food &amp; Groceries&quot;),<br>            DonutChartData(1500.0f, RobingEggBlue, title = &quot;Rent&quot;),<br>            DonutChartData(300.0f, MetallicYellow, title = &quot;Gas&quot;),<br>            DonutChartData(700.0f, OxfordBlue, title = &quot;Online Purchases&quot;),<br>            DonutChartData(300.0f, VividOrange, title = &quot;Clothing&quot;)<br>        )<br>    )<br><br>class MainActivity : ComponentActivity() {<br>    override fun onCreate(savedInstanceState: Bundle?) {<br>        super.onCreate(savedInstanceState)<br>        setContent {<br>            DonutChartTheme {<br>                Content()<br>            }<br>        }<br>    }<br>}<br><br>@OptIn(ExperimentalMaterial3Api::class, ExperimentalAnimationApi::class)<br>@Composable<br>fun Content() {<br>    Scaffold(<br>        topBar = {<br>            Text(&quot;Fancy Donut Chart&quot;,<br>                style = Typography.displaySmall,<br>                textAlign = TextAlign.Center,<br>                modifier = Modifier<br>                    .fillMaxWidth()<br>                    .padding(20.dp))<br>        }<br>    ) { paddingValues -&gt;<br>        // 2 <br>        DonutChart(Modifier.padding(paddingValues), data = viewData) { selected -&gt;<br>            // 3<br>            AnimatedContent(targetState = selected) {<br>                val amount = it?.amount ?: viewData.totalAmount<br>                val text = it?.title ?: &quot;Total&quot;<br><br>                // 4<br>                Column(<br>                    modifier = Modifier.fillMaxWidth(),<br>                    horizontalAlignment = Alignment.CenterHorizontally<br>                ) {<br>                    Text(&quot;$${amount.toMoneyFormat(true)}&quot;,<br>                        style = moneyAmountStyle, color = PetroleumGray)<br>                    Text(text, style = itemTextStyle, color = PetroleumLightGray)<br>                }<br>            }<br>        }<br>    }<br>}</pre><p>Let’s dissect each step to to further explain the details in the commented items.</p><ol><li>First step is to define dummy data to be used.</li><li>Inside our Scaffold view, we integrate the donut chart we just created.</li><li>We go ahead and override the <strong>selectionView </strong>in the Donut Chart composable function. <strong>AnimatedContent </strong>will animate the view changes whenever the donut chart selection is updated.</li><li>Our view logic to display the amount and the title of the item inside the donut chart.</li></ol><h4>Conclusion</h4><p>Donut chart is a fancy way to show user budgets or expenses on apps and they are extremely popular. Using Canvas, this is rather simple to implement this natively on Android using Jetpack Compose.</p><p>You can find the link to the full code below:</p><p><a href="https://github.com/eozsahin1993/Fancy-Donut-Chart-Compose">GitHub - eozsahin1993/Fancy-Donut-Chart-Compose: Fancy Donut Chart implementation in Jetpack Compose</a></p><p>That’s all for now! Stay tuned for more articles on Android development and Jetpack Compose.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=140ca6b0e68c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accordion Menu in Jetpack Compose]]></title>
            <link>https://medium.com/@eozsahin1993/accordion-menu-in-jetpack-compose-32151adf6d80?source=rss-8be5b957162f------2</link>
            <guid isPermaLink="false">https://medium.com/p/32151adf6d80</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Emre Ozsahin]]></dc:creator>
            <pubDate>Wed, 01 Jun 2022 02:39:45 GMT</pubDate>
            <atom:updated>2022-06-01T02:39:45.845Z</atom:updated>
            <content:encoded><![CDATA[<h4>In this blog, we are going to implement an accordion style menu from scratch using Jetpack Compose.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K9yDaizSWTkaOusw" /><figcaption>Photo by <a href="https://unsplash.com/@musicfox?utm_source=medium&amp;utm_medium=referral">River Fx</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Today, we will create a custom Accordion component for our markets app using Jetpack Compose shown in Figure 1 below. Before we quickly dive in to the implementation, let’s first figure out how to dissect the design into reusable code blocks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/231/1*mhqI9VI-W1KzXSTOPsxpTA.gif" /><figcaption>Figure 1</figcaption></figure><p>Here are the following steps needed to implement the design:</p><ol><li>Create a data class model that will hold the information that will be displayed by the UI, let’s call this the <strong><em>AccordionModel</em></strong>.</li><li>The content of the Accordion when expanded, which is a list of rows with stock securities and its share prices. Let’s call this the <strong><em>AccordionRow</em></strong>.</li><li><strong><em>AccordionHeader</em></strong> that will contain header title and the arrow icon on the very right showing the expanded or collapsed state.</li><li>A component called <strong><em>Accordion</em></strong> that holds the header and the stock price rows. It handles the animation where tapping on the header will show or hide the rows.</li><li>A view that can show multiple accordions together, let’s refer this as the <strong><em>AccordionGroup</em></strong>.</li></ol><h4>Accordion Model Data Class</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b586b67f67557607685f0ee02cc6e658/href">https://medium.com/media/b586b67f67557607685f0ee02cc6e658/href</a></iframe><p>Here is our data class implementation which contains a header and a list of rows. For this specific case, our rows contain securities and their current stock prices for a given share.</p><h4>Accordion Row</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62c51ce955ed2bfa23ce9eadcb3b86f5/href">https://medium.com/media/62c51ce955ed2bfa23ce9eadcb3b86f5/href</a></iframe><p>Preview output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*k1hLxVy07btrkU02Mhi8Jw.png" /></figure><p>Couple things to note here.</p><ul><li>Our Row element requires its vertical alignment to be centered vertically. Not passing this will align the content to the top which is the default value for the Row element.</li></ul><pre>verticalAlignment = Alignment.CenterVertically</pre><ul><li>The Row itself has no background, this will be passed on via a Surface element in the Accordion element.</li><li>Text that holds the security name has a 1f weight modifier defined. This will give 100% of the space priority to the title text, pushing the price tags to the end of the view.</li></ul><pre>Modifier.weight(1f)</pre><h4>Accordion Header</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8a14df5f53430f57674e189baaaa80c7/href">https://medium.com/media/8a14df5f53430f57674e189baaaa80c7/href</a></iframe><p>Preview output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*Uuns26Ex_bgc5Fz2d754yw.png" /></figure><p>Notes:</p><ul><li>The function declaration includes onTapped callback variable to let the caller know about user interactions. This is called inside the Rows’ clickable modifier.</li></ul><pre>onTapped: () -&gt; Unit = {}</pre><ul><li>The header doesn’t track the expanded state, it is rather hoisted up to the parent.</li></ul><pre>isExpanded: Boolean = false</pre><ul><li>The degrees variable tracks the rotation of the drop down arrow based on the expanded state. The icon is then rotated based on the degrees provided.</li></ul><pre>val degrees = if (isExpanded) 180f else 0f</pre><ul><li>Header text has the weight modifier to be 100%. This is similar to the row that we have seen earlier.</li><li>The nested Surface element let us create the blue circle with an icon on it.</li></ul><pre>Surface(CircleShape, color = LightBlue900.copy(alpha = 0.6f))</pre><h4>Accordion</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9c9d0047bba69dde713d0871d9971111/href">https://medium.com/media/9c9d0047bba69dde713d0871d9971111/href</a></iframe><p>Notes:</p><ul><li>This component tracks expanded state which is false by default. The tracked state is changed whenever AccordionHeader onTapped callback is triggered.</li></ul><pre>AccordionHeader(<br>   title = model.header, <br>   isExpanded = expanded<br>) {            <br>   expanded = !expanded        <br>}</pre><ul><li>We use <em>AnimatedVisibility</em> to expand or collapse the rows. It’s visible when the expanded state is true. Also we don’t have to create our own animation because the parent is a Column element. The AnimatedVisibility uses the default Column animation defined in the ColumnScope.</li></ul><pre>fun ColumnScope.AnimatedVisibility(<br>    visible: Boolean,<br>    modifier: Modifier = Modifier,<br>    enter: EnterTransition = <em>fadeIn</em>() + <em>expandVertically</em>(),<br>    exit: ExitTransition = <em>fadeOut</em>() + <em>shrinkVertically</em>(),<br>    content: @Composable AnimatedVisibilityScope.() -&gt; Unit<br>)</pre><ul><li>For rows, we use a LazyColumn which is the RecyclerView equivalent in Jetpack Compose. This will be much more memory efficient by simply loading the rows that are visible to the user.</li></ul><h4>Accordion Group</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c6338fb508b51b822621fe74ef7abe0/href">https://medium.com/media/8c6338fb508b51b822621fe74ef7abe0/href</a></iframe><p>Notes:</p><ul><li>We don’t use a LazyColumn here because there is currently no support for nested LazyColumn views in Jetpack Compose. Also according to our implementation, the market groups are somewhat constant (separated by sectors which is limited) and it can be okay to show it like this.</li></ul><h4>Conclusion</h4><p>Accordion menus are extremely popular on web and mobile platforms. Jetpack Compose allows us to create these elements easily and intuitively.</p><p>Here is the link for the full code: <a href="https://github.com/eozsahin1993/Accordion-Menu-Example">https://github.com/eozsahin1993/Accordion-Menu-Example</a></p><p>That’s all for now! Stay tuned for more articles on Android development and Jetpack Compose.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32151adf6d80" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Custom Progress Bars in Jetpack Compose]]></title>
            <link>https://medium.com/@eozsahin1993/custom-progress-bars-in-jetpack-compose-723afb60c81c?source=rss-8be5b957162f------2</link>
            <guid isPermaLink="false">https://medium.com/p/723afb60c81c</guid>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <dc:creator><![CDATA[Emre Ozsahin]]></dc:creator>
            <pubDate>Thu, 26 May 2022 20:04:54 GMT</pubDate>
            <atom:updated>2022-05-26T20:04:54.673Z</atom:updated>
            <content:encoded><![CDATA[<h4>In this blog, we will explore built-in Progress Bar implementations in Jetpack Compose and try to make our own custom ones from scratch.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PBj1FcEuq5Am4qa_" /><figcaption>Photo by <a href="https://unsplash.com/@theeastlondonphotographer?utm_source=medium&amp;utm_medium=referral">Ehimetalor Akhere Unuabona</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Out of the box, Jetpack Compose library supports multiple built-in progress indicators that can be used through out your application. It is super easy to use and available in different forms such as linear and circular. Unfortunately, it doesn’t allow us to fully customize the progress indicators to our like and needs.</p><p>Let’s take a look at what can be achieved using the library components.</p><p><strong>Built in Progress Bars</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/00b852af63582b491d6938d90fa1cd66/href">https://medium.com/media/00b852af63582b491d6938d90fa1cd66/href</a></iframe><p>Linear progress indicator can be created two different ways shown above. Passing an optional progress parameter allows the indicator to show a static progress value that never changes. Omitting the progress parameter will turn the indicator into an indeterminate loading progress bar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/208/1*3t7nScplu8a0p7oWO77Jjw.png" /><figcaption>Figure 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*WKAdY59vOGCB1LM026Tycg.png" /><figcaption>Figure 2</figcaption></figure><p><strong>Modifications to Library Components</strong></p><p>As of Compose version 1.0.1, the only customization we can do on the progress bars is to change the background and foreground color and make the edges rounded with Modifiers.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/071c7fbab55daa7abe9a393e66ffc538/href">https://medium.com/media/071c7fbab55daa7abe9a393e66ffc538/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/266/1*gnduVBYCATi_Fiyw8ckPWA.png" /><figcaption>Figure 3</figcaption></figure><p>The colors Green700 and Green100 are obtained from the material design color system <a href="https://material.io/design/color/the-color-system.html#tools-for-picking-colors">website</a>.</p><p>What if this is not enough for our case? What if we wanted to:</p><ul><li>Create a progress bar with multiple progress values</li><li>Pattern instead of a single color</li></ul><p><strong>Custom Linear Progress Bar</strong></p><p>Let’s start off by creating the exact same progress bar using other components.</p><p>We are going to use the Box component in this case. Box automatically stacks its children based on the order of declaration.</p><ul><li>The parent box will be our background in this case. We are adding a modifier to change the width and height of our component to be determined by the caller.</li><li>The child box will simply grow in width by the progress percentage. The height should match the parent so that changing the parent size is reflected accordingly.</li></ul><p>Here is how our custom component looks now:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/68d18f456e8f6cad6fe6138bc804d032/href">https://medium.com/media/68d18f456e8f6cad6fe6138bc804d032/href</a></iframe><p>Here is the output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/266/1*gnduVBYCATi_Fiyw8ckPWA.png" /><figcaption>Figure 4</figcaption></figure><p>This is a great start. We can do a lot by simply creating our own elements shown above which gives us a lot of freedom. Let’s tackle a more complicated problem which is a progress bar with multiple progress indicators.</p><p><strong>Multi Linear Progress Indicator</strong></p><p>Using the sample above lets create a progress bar that contains two progress values inside.</p><p>The principle is the same this time, we are going to use box within box to create the same effect.</p><ul><li>The parent box will be our background in this case again.</li><li>We create 2 child boxes that will grow as indicated by the progress.</li><li>There is a limitation here that the secondary progress will have to be greater than main progress for it to be displayed, otherwise it will be hidden.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7d30ffe018821f0a957d3233c2f7b0b3/href">https://medium.com/media/7d30ffe018821f0a957d3233c2f7b0b3/href</a></iframe><p>Here is the output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*ll_SB3OM3MpAZ2qLkwBzlw.png" /><figcaption>primary progress: 0.6f, secondary progress: 0.78f</figcaption></figure><p>We can extend this to display a list of progress easily. Has it’s limitations but overall looks great! <em>But…</em> What if we wanted to create a more complex progress bar. Something like shown below on <em>Figure 5</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/263/1*aApHgZpV_S11sadUd3dfLg.png" /><figcaption>Figure 5</figcaption></figure><p><strong>Striped Linear Progress Indicator</strong></p><p>This is extremely similar to our initial custom linear progress bar, just one difference being striped background color instead of a solid one. The code turns out to be exactly similar as well.</p><p>The only difference is that the child Box will have to accept a Brush instance which allows us to create a repeating pattern.</p><p>Here is the implementation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6bc9f3e66fecdb8877c33b990913dd34/href">https://medium.com/media/6bc9f3e66fecdb8877c33b990913dd34/href</a></iframe><p>Here is the output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/263/1*aApHgZpV_S11sadUd3dfLg.png" /><figcaption>Striped with progress 0.68f</figcaption></figure><p><strong>Conclusion:</strong></p><p>Jetpack Compose built in progress bars are very useful. I find myself using indeterminate circular progress bars for button loading animations quite often. If we aim to do something fancier, I always go with my own custom implementation which gives the freedom I need.</p><p>That’s all for now! Stay tuned for more articles on Android development and Jetpack Compose.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=723afb60c81c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>