Skip to content

Commit

Permalink
Refactor AboutComponentsKt and AboutScreenRoute in About Module
Browse files Browse the repository at this point in the history
  • Loading branch information
teogor committed Oct 29, 2023
1 parent 01e61b0 commit 33baa24
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 28 deletions.
26 changes: 12 additions & 14 deletions screen/ui/api/ui.api
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
public final class dev/teogor/ceres/screen/ui/about/AboutComponentsKt {
public static final fun aboutApkSignature (Landroidx/compose/foundation/lazy/LazyListScope;)V
public static final fun aboutAppVersion (Landroidx/compose/foundation/lazy/LazyListScope;)V
public static final fun aboutBuildDate (Landroidx/compose/foundation/lazy/LazyListScope;)V
public static final fun aboutBuildHash (Landroidx/compose/foundation/lazy/LazyListScope;)V
public static final fun aboutApkSignature (Landroidx/compose/foundation/lazy/LazyListScope;Ljava/lang/String;)V
public static synthetic fun aboutApkSignature$default (Landroidx/compose/foundation/lazy/LazyListScope;Ljava/lang/String;ILjava/lang/Object;)V
public static final fun aboutAppVersion (Landroidx/compose/foundation/lazy/LazyListScope;Ljava/lang/String;)V
public static synthetic fun aboutAppVersion$default (Landroidx/compose/foundation/lazy/LazyListScope;Ljava/lang/String;ILjava/lang/Object;)V
public static final fun aboutBuildDate (Landroidx/compose/foundation/lazy/LazyListScope;Ljava/time/LocalDateTime;)V
public static synthetic fun aboutBuildDate$default (Landroidx/compose/foundation/lazy/LazyListScope;Ljava/time/LocalDateTime;ILjava/lang/Object;)V
public static final fun aboutBuildHash (Landroidx/compose/foundation/lazy/LazyListScope;Ljava/lang/String;)V
public static synthetic fun aboutBuildHash$default (Landroidx/compose/foundation/lazy/LazyListScope;Ljava/lang/String;ILjava/lang/Object;)V
public static final fun aboutCeresFramework (Landroidx/compose/foundation/lazy/LazyListScope;Ljava/lang/String;)V
public static synthetic fun aboutCeresFramework$default (Landroidx/compose/foundation/lazy/LazyListScope;Ljava/lang/String;ILjava/lang/Object;)V
public static final fun aboutHeaderAboutUs (Landroidx/compose/foundation/lazy/LazyListScope;)V
Expand Down Expand Up @@ -38,26 +42,20 @@ public final class dev/teogor/ceres/screen/ui/about/AboutScreenRoute : dev/teogo
public final class dev/teogor/ceres/screen/ui/about/ComposableSingletons$AboutComponentsKt {
public static final field INSTANCE Ldev/teogor/ceres/screen/ui/about/ComposableSingletons$AboutComponentsKt;
public static field lambda-1 Lkotlin/jvm/functions/Function3;
public static field lambda-10 Lkotlin/jvm/functions/Function3;
public static field lambda-11 Lkotlin/jvm/functions/Function3;
public static field lambda-12 Lkotlin/jvm/functions/Function3;
public static field lambda-2 Lkotlin/jvm/functions/Function3;
public static field lambda-3 Lkotlin/jvm/functions/Function3;
public static field lambda-3 Lkotlin/jvm/functions/Function2;
public static field lambda-4 Lkotlin/jvm/functions/Function2;
public static field lambda-5 Lkotlin/jvm/functions/Function2;
public static field lambda-5 Lkotlin/jvm/functions/Function3;
public static field lambda-6 Lkotlin/jvm/functions/Function3;
public static field lambda-7 Lkotlin/jvm/functions/Function3;
public static field lambda-8 Lkotlin/jvm/functions/Function3;
public static field lambda-9 Lkotlin/jvm/functions/Function3;
public fun <init> ()V
public final fun getLambda-1$ui_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-10$ui_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-11$ui_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-12$ui_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-2$ui_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-3$ui_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-3$ui_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-4$ui_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-5$ui_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-5$ui_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-6$ui_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-7$ui_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-8$ui_release ()Lkotlin/jvm/functions/Function3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import dev.teogor.ceres.ui.designsystem.Surface
import dev.teogor.ceres.ui.designsystem.Text
import dev.teogor.ceres.ui.foundation.graphics.asImageVectorIcon
import dev.teogor.ceres.ui.theme.MaterialTheme
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.time.format.FormatStyle

Expand Down Expand Up @@ -86,10 +87,12 @@ fun ScreenListScope.aboutHeaderVersion() = item {
)
}

fun ScreenListScope.aboutAppVersion() = item {
fun ScreenListScope.aboutAppVersion(
version: String = AppMetadataManager.versionName,
) = item {
SimpleView(
title = "App version",
subtitle = AppMetadataManager.versionName,
subtitle = version,
icon = Icons.Default.Info,
)
}
Expand Down Expand Up @@ -145,14 +148,19 @@ fun ScreenListScope.aboutCeresFramework(
}
}

fun ScreenListScope.aboutBuildDate() = item {
SimpleView(
title = "Build date",
subtitle = AppMetadataManager.buildDateTime.format(
fun ScreenListScope.aboutBuildDate(
buildDateTime: LocalDateTime = AppMetadataManager.buildDateTime,
) {
item {
val formattedDate = buildDateTime.format(
DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM),
),
icon = Icons.Default.DateRange,
)
)
SimpleView(
title = "Build date",
subtitle = formattedDate,
icon = Icons.Default.DateRange,
)
}
}

fun ScreenListScope.aboutHeaderAboutUs() = item {
Expand All @@ -175,20 +183,24 @@ fun ScreenListScope.aboutHeaderSecurityPatch() = item {
)
}

fun ScreenListScope.aboutBuildHash() = item {
fun ScreenListScope.aboutBuildHash(
hash: String = AppMetadataManager.gitHash,
) = item {
SimpleView(
title = "Build hash",
subtitle = AppMetadataManager.gitHash,
subtitle = hash,
icon = Icons.Default.DomainVerification,
)
}

fun ScreenListScope.aboutApkSignature() {
AppMetadataManager.apkSignature?.let { apkSignature ->
fun ScreenListScope.aboutApkSignature(
apkSignature: String? = AppMetadataManager.apkSignature,
) {
apkSignature?.let { signature ->
item {
SimpleView(
title = "APK signature",
subtitle = apkSignature,
subtitle = signature,
icon = Icons.Default.Verified,
)
}
Expand Down

0 comments on commit 33baa24

Please sign in to comment.