Skip to content

Commit

Permalink
Add app version display to the UI
Browse files Browse the repository at this point in the history
This commit introduces a new Text component to display the app version retrieved using the `getAppVersion` function. Additionally, minor adjustments were made to text styles for consistency in the UI.
  • Loading branch information
kdroidFilter committed Jan 8, 2025
1 parent 711c974 commit 0c517b3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions sample/composeApp/src/commonMain/kotlin/sample/app/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import io.github.kdroidfilter.platformtools.appmanager.getAppInstaller
import io.github.kdroidfilter.platformtools.getAppVersion
import io.github.kdroidfilter.platformtools.getPlatform
import io.github.kdroidfilter.platformtools.releasefetcher.downloader.Downloader
import io.github.kdroidfilter.platformtools.releasefetcher.github.GitHubReleaseFetcher
Expand All @@ -29,11 +30,17 @@ fun App() {
UpdateCheckerUI(GitHubReleaseFetcher(owner = "kdroidfilter", repo = "KmpRealTimeLogger"))

Text(
"Platform: " +
getPlatform().name.lowercase().replaceFirstChar { it.uppercase() },
style = MaterialTheme.typography.titleLarge,
"Platform: " + getPlatform().name.lowercase().replaceFirstChar { it.uppercase() },
style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.onBackground
)

Text(
"Version: " + getAppVersion(),
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onBackground
)

}
}
}
Expand Down

0 comments on commit 0c517b3

Please sign in to comment.