mirror of
https://github.com/afollestad/nock-nock.git
synced 2025-04-20 03:25:14 +00:00
Show app version in about dialog title
This commit is contained in:
parent
8a4c7448f5
commit
2fe6f171ba
2 changed files with 6 additions and 3 deletions
|
@ -20,6 +20,7 @@ import android.os.Bundle
|
|||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.afollestad.nocknock.BuildConfig
|
||||
import com.afollestad.nocknock.R
|
||||
|
||||
/** @author Aidan Follestad (@afollestad) */
|
||||
|
@ -34,8 +35,9 @@ class AboutDialog : DialogFragment() {
|
|||
}
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
return MaterialDialog(activity!!)
|
||||
.title(R.string.about)
|
||||
val context = activity ?: throw IllegalStateException("Oh no!")
|
||||
return MaterialDialog(context)
|
||||
.title(text = getString(R.string.app_name_x, BuildConfig.VERSION_NAME))
|
||||
.positiveButton(R.string.dismiss)
|
||||
.message(R.string.about_body, html = true, lineHeightMultiplier = 1.4f)
|
||||
}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
<resources>
|
||||
|
||||
<string name="app_name">Nock Nock</string>
|
||||
<string name="app_name_x">Nock Nock %1$s</string>
|
||||
|
||||
<string name="no_sites_added">No sites added!</string>
|
||||
|
||||
<string name="about">About</string>
|
||||
<string name="about_body"><![CDATA[
|
||||
<b>Nock Nock</b>, a simple app designed by <b>Aidan Follestad</b>.<br/>
|
||||
A simple app designed by <b>Aidan Follestad</b>.<br/>
|
||||
<a href=\'https://af.codes\'>Website</a>
|
||||
<a href=\'https://twitter.com/afollestad\'>Twitter</a>
|
||||
<a href=\'https://github.com/afollestad\'>GitHub</a>
|
||||
|
|
Loading…
Add table
Reference in a new issue