diff --git a/app/src/main/java/de/salomax/currencies/view/preference/ChangelogDialog.kt b/app/src/main/java/de/salomax/currencies/view/preference/ChangelogDialog.kt new file mode 100644 index 00000000..faa0acb8 --- /dev/null +++ b/app/src/main/java/de/salomax/currencies/view/preference/ChangelogDialog.kt @@ -0,0 +1,22 @@ +package de.salomax.currencies.view.preference + +import android.app.Dialog +import android.os.Bundle +import android.view.View +import androidx.appcompat.app.AlertDialog +import androidx.appcompat.app.AppCompatDialogFragment +import de.salomax.currencies.R + +class ChangelogDialog : AppCompatDialogFragment() { + + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { + val view = View.inflate(context, R.layout.fragment_changelog, null) + + return AlertDialog.Builder(requireContext()) + .setPositiveButton(android.R.string.ok, null) + .setTitle(R.string.title_changelog) + .setView(view) + .create() + } + +} diff --git a/app/src/main/java/de/salomax/currencies/view/preference/PreferenceFragment.kt b/app/src/main/java/de/salomax/currencies/view/preference/PreferenceFragment.kt index eab30535..7a8262a1 100644 --- a/app/src/main/java/de/salomax/currencies/view/preference/PreferenceFragment.kt +++ b/app/src/main/java/de/salomax/currencies/view/preference/PreferenceFragment.kt @@ -31,6 +31,10 @@ class PreferenceFragment: PreferenceFragmentCompat() { val aboutPreference = findPreference(getString(R.string.prefKey_about))!! aboutPreference.title = getString(R.string.prefTitle_about, BuildConfig.VERSION_NAME) aboutPreference.summary = getString(R.string.prefSummary_about, Calendar.getInstance().get(Calendar.YEAR)) + aboutPreference.setOnPreferenceClickListener { + ChangelogDialog().show(childFragmentManager, null) + true + } } } diff --git a/app/src/main/res/layout/fragment_changelog.xml b/app/src/main/res/layout/fragment_changelog.xml new file mode 100644 index 00000000..c2721568 --- /dev/null +++ b/app/src/main/res/layout/fragment_changelog.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/app/src/main/res/values/changelog.xml b/app/src/main/res/values/changelog.xml new file mode 100644 index 00000000..0e418204 --- /dev/null +++ b/app/src/main/res/values/changelog.xml @@ -0,0 +1,17 @@ + + + Changelog + + + 0.1.0 + \n + \n• More fail-proof updating of the currency rates + \n• Added a disclaimer + \n• Added this changelog + \n + \n0.0.1 + \n + \n• Initial pre-release + + +