Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 643bb573 authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé Committed by GitHub
Browse files

Merge pull request #8262 from wmontwe/add-funding-ui-part-2

Add funding UI - part 2
parents fbcce726 3687d89f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
plugins {
    id(ThunderbirdPlugins.Library.androidCompose)
}

android {
    namespace = "app.k9mail.core.ui.compose.navigation"
    resourcePrefix = "core_ui_navigation_"
}
+23 −0
Original line number Diff line number Diff line
package app.k9mail.core.ui.compose.navigation

import androidx.navigation.NavGraphBuilder

/**
 * A Navigation is responsible for registering routes with the navigation graph.
 *
 * @param T the type of route
 */
interface Navigation<T : Route> {

    /**
     * Register all routes for this navigation.
     *
     * @param onBack the action to perform when the back button is pressed
     * @param onFinish the action to perform when a route is finished
     */
    fun registerRoutes(
        navGraphBuilder: NavGraphBuilder,
        onBack: () -> Unit,
        onFinish: (T) -> Unit,
    )
}
+22 −0
Original line number Diff line number Diff line
package app.k9mail.core.ui.compose.navigation

import androidx.compose.animation.AnimatedContentScope
import androidx.compose.runtime.Composable
import androidx.navigation.NavBackStackEntry
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
import androidx.navigation.navDeepLink

inline fun <reified T : Route> NavGraphBuilder.deepLinkComposable(
    route: T,
    noinline content: @Composable AnimatedContentScope.(NavBackStackEntry) -> Unit,
) {
    composable<T>(
        deepLinks = listOf(
            navDeepLink<T>(
                basePath = route.deepLink,
            ),
        ),
        content = content,
    )
}
+18 −0
Original line number Diff line number Diff line
package app.k9mail.core.ui.compose.navigation

import android.net.Uri
import androidx.core.net.toUri

/**
 * A Route represents a destination in the app.
 *
 * It is used to navigate to a specific screen using type-safe composable navigation
 * and deep links.
 *
 * @see Navigation
 */
interface Route {
    val deepLink: String

    fun toDeepLinkUri(): Uri = deepLink.toUri()
}
+11 −2
Original line number Diff line number Diff line
plugins {
    id(ThunderbirdPlugins.Library.jvm)
    alias(libs.plugins.android.lint)
    id(ThunderbirdPlugins.Library.androidCompose)
    alias(libs.plugins.kotlin.serialization)
}

android {
    namespace = "app.k9mail.feature.funding.api"
    resourcePrefix = "funding_api_"
}

dependencies {
    api(projects.core.ui.compose.navigation)
}
Loading