Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ android {
}
buildFeatures {
viewBinding = true
buildConfig = true
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import net.ardevd.tagius.BuildConfig
import androidx.lifecycle.lifecycleScope
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import kotlinx.coroutines.flow.first
Expand All @@ -26,6 +27,10 @@ class SettingsBottomSheet(
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

// Show version info
val version = BuildConfig.VERSION_NAME
binding.versionText.text = "v$version"

Comment on lines +30 to +33
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version label is built with a hardcoded prefix ("v$version"). For localization and consistency with Android string handling, prefer a formatted string resource (e.g., @string/settings_version_format with %1$s) and set binding.versionText.text = getString(...).

Copilot uses AI. Check for mistakes.
// Display the stored URL so the user knows which server they are on
viewLifecycleOwner.lifecycleScope.launch {
val url = TokenManager(requireContext()).serverUrlFlow.first()
Expand Down
30 changes: 21 additions & 9 deletions app/src/main/res/layout/fragment_settings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="32dp">
Expand All @@ -16,9 +16,9 @@
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:text="@string/settings_account_settings"
android:textAppearance="?attr/textAppearanceHeadlineSmall"
android:layout_marginStart="24dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/dragHandle" />

Expand Down Expand Up @@ -49,12 +49,12 @@
android:id="@+id/serverUrlText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="https://timetagger.app"
android:textAppearance="?attr/textAppearanceBodyLarge"
android:textStyle="bold"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:maxLines="1" />
android:maxLines="1"
android:text="@string/login_server_url_default"
android:textAppearance="?attr/textAppearanceBodyLarge"
android:textStyle="bold" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>

Expand All @@ -67,7 +67,19 @@
android:layout_marginTop="32dp"
android:text="@string/settings_log_out"
app:icon="@drawable/ic_logout"
app:layout_constraintTop_toBottomOf="@id/serverCard"
app:layout_constraintBottom_toBottomOf="parent" />
app:layout_constraintTop_toBottomOf="@id/serverCard" />

<TextView
android:id="@+id/versionText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:textAppearance="?attr/textAppearanceBodySmall"
android:textColor="?attr/colorOutline"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/logoutButton"
tools:text="v1.0.0" />

</androidx.constraintlayout.widget.ConstraintLayout>
Loading