Added version number to settings.

This commit is contained in:
Antoine POPINEAU 2020-05-29 01:30:05 +02:00
parent d53bee8f31
commit d9b7ed5b3f
No known key found for this signature in database
GPG Key ID: A78AC64694F84063
2 changed files with 9 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import androidx.preference.ListPreference
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SeekBarPreference
import com.github.apognu.otter.BuildConfig
import com.github.apognu.otter.R
import com.github.apognu.otter.utils.AppContext
import com.github.apognu.otter.utils.Command
@ -129,6 +130,10 @@ class SettingsFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedP
preferenceManager.findPreference<SeekBarPreference>("media_cache_size")?.let {
it.summary = getString(R.string.settings_media_cache_size_summary, it.value)
}
preferenceManager.findPreference<Preference>("version")?.let {
it.summary = "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})"
}
}
}
}

View File

@ -66,6 +66,10 @@
android:key="oss_licences"
android:title="@string/title_oss_licences" />
<Preference
android:key="version"
android:title="Version" />
</PreferenceCategory>
</androidx.preference.PreferenceScreen>