Skip to content

Commit

Permalink
Display app version
Browse files Browse the repository at this point in the history
  • Loading branch information
roshanrajaratnam committed May 28, 2024
1 parent 7999ad4 commit fdd08cf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,25 @@ import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import kotlinx.coroutines.launch
import no.nordicsemi.android.common.navigation.viewmodel.SimpleNavigationViewModel
import no.nordicsemi.android.common.theme.view.NordicAppBar
import no.nordicsemi.android.wifi.provisioner.app.BuildConfig
import no.nordicsemi.android.wifi.provisioner.app.R
import no.nordicsemi.android.wifi.provisioner.ble.sections.ProvisionOverBleSection
import no.nordicsemi.android.wifi.provisioner.ble.view.BleDestination
Expand Down Expand Up @@ -114,12 +118,6 @@ fun HomeScreen() {
)
}
}
/*item {
NordicText(
text = stringResource(id = R.string.app_info),
style = MaterialTheme.typography.bodyMedium
)
}*/
item {
ProvisionOverBleSection {
vm.navigateTo(BleDestination)
Expand All @@ -137,6 +135,18 @@ fun HomeScreen() {
}
}
}
item {
Text(
text = stringResource(
id = R.string.app_version,
BuildConfig.VERSION_NAME,
BuildConfig.VERSION_CODE
),
modifier = Modifier.fillMaxWidth().padding(end = 16.dp),
textAlign = TextAlign.End,
style = MaterialTheme.typography.labelMedium
)
}
}
}
}
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,5 @@
<string name="sorting_name">Name</string>
<string name="sorting_rssi">RSSI</string>
<string name="error_softap_not_supported">This feature requires an Android device running Android 10 or above.</string>
<string name="app_version">Version: %s (%s)</string>
</resources>

0 comments on commit fdd08cf

Please sign in to comment.