Skip to content

Commit

Permalink
Merge pull request #67 from capcom6/issue/64-app-version
Browse files Browse the repository at this point in the history
[settings] add app version text
  • Loading branch information
capcom6 committed May 14, 2024
2 parents bc860c1 + c0c20e3 commit a362673
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/src/main/java/me/capcom/smsgateway/ui/SettingsFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.core.content.edit
import androidx.preference.EditTextPreference
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import me.capcom.smsgateway.BuildConfig
import me.capcom.smsgateway.R
import me.capcom.smsgateway.modules.gateway.GatewaySettings

Expand Down Expand Up @@ -45,6 +46,9 @@ class SettingsFragment : PreferenceFragmentCompat() {
}
return@setSummaryProvider hostname
}

findPreference<Preference>("transient.app_version")?.summary =
"${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})"
}

override fun onDisplayPreferenceDialog(preference: Preference) {
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@
<string name="minimum">Minimum</string>
<string name="maximum">Maximum</string>
<string name="set_maximum_value_to_activate">Set maximum value to activate</string>
<string name="information">Information</string>
<string name="app_version_build">App version (build)</string>
</resources>
8 changes: 8 additions & 0 deletions app/src/main/res/xml/root_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,12 @@
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>

<PreferenceCategory app:title="@string/information">
<Preference
android:key="transient.app_version"
android:title="@string/app_version_build"
app:persistent="false"
app:selectable="false" />
</PreferenceCategory>

</PreferenceScreen>

0 comments on commit a362673

Please sign in to comment.