Skip to content

Commit

Permalink
Add dynamic version name
Browse files Browse the repository at this point in the history
  • Loading branch information
tevincent committed Aug 27, 2024
1 parent ccc1199 commit 2b6bad6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
5 changes: 5 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ android {
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}

buildFeatures {
buildConfig = true
}

compileOptions {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fun MainScaffold(
navController: NavHostController,
currentDestination: MainNavigation,
windowAdaptiveInfo: WindowAdaptiveInfo,
content: @Composable (Boolean) -> Unit = {},
content: @Composable () -> Unit = {},
) {

val navType by rememberNavType(currentDestination, windowAdaptiveInfo)
Expand All @@ -57,15 +57,15 @@ private fun MainScaffold(
navType: NavigationSuiteType,
currentDestination: MainNavigation,
navigateToSelectedItem: (MainNavigation) -> Unit,
content: @Composable (Boolean) -> Unit,
content: @Composable () -> Unit,
) {
AppNavigationSuiteScaffold(navType, NavigationItem.entries, currentDestination, navigateToSelectedItem) {
if (navType == NavigationSuiteType.None) {
content(it)
content()
} else {
Column {
Box(modifier = Modifier.weight(1f)) {
content(it)
content()
}
HorizontalDivider()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fun AppNavigationSuiteScaffold(
navigationItems: List<NavigationItem>,
currentDestination: MainNavigation,
navigateToSelectedItem: (MainNavigation) -> Unit,
content: @Composable (Boolean) -> Unit,
content: @Composable () -> Unit,
) {
Surface(color = SwissTransferTheme.materialColors.background) {
NavigationSuiteScaffoldLayout(
Expand Down Expand Up @@ -88,7 +88,7 @@ fun AppNavigationSuiteScaffold(
}
)
) {
content(layoutType == NavigationSuiteType.NavigationBar)
content()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.infomaniak.swisstransfer.BuildConfig
import com.infomaniak.swisstransfer.R
import com.infomaniak.swisstransfer.ui.components.BrandTobAppBar
import com.infomaniak.swisstransfer.ui.icons.AppIcons
Expand Down Expand Up @@ -128,7 +129,7 @@ fun SettingsScreen(onItemClick: (SettingsOptionScreens) -> Unit, getSelectedSett
SettingItem(R.string.settingsOptionGiveFeedback, { selectedSetting == GIVE_FEEDBACK }, endIcon = OPEN_OUTSIDE) {
onItemClick(GIVE_FEEDBACK)
}
SettingItem(R.string.version, isSelected = { false }, description = "0.0.1", onClick = null)
SettingItem(R.string.version, isSelected = { false }, description = BuildConfig.VERSION_NAME, onClick = null)
}
}
}
Expand Down

0 comments on commit 2b6bad6

Please sign in to comment.