Cleanup about screen.
This commit is contained in:
parent
0a02198f5f
commit
95967532aa
3 changed files with 39 additions and 10 deletions
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
[](httpd://mobile.thauvin.net/android/)
|
[](httpd://mobile.thauvin.net/android/)
|
||||||
|
|
||||||
Program your Telephone Entry System remotely (off-site) using your phone.
|
Easily program your Telephone Entry System remotely from anywhere using your phone.
|
||||||
|
|
||||||
Most Telephone Entry Systems can be programmed from the front keypad or remotely from an off-premise location using any touch-tone phone. TES Remote Programmer streamlines the often cumbersome remote programming process by providing data entry screens and automated dial-in options.
|
Most Telephone Entry Systems can be programmed from the front keypad or remotely from an off-premise location using any touch-tone phone. TES Remote Programmer streamlines the often cumbersome remote programming process by providing data entry screens and automated dial-in options.
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,13 @@ import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
import mehdi.sakout.aboutpage.AboutPage
|
import mehdi.sakout.aboutpage.AboutPage
|
||||||
import mehdi.sakout.aboutpage.Element
|
import mehdi.sakout.aboutpage.Element
|
||||||
import net.thauvin.erik.android.tesremoteprogrammer.util.fromHtml
|
import org.jetbrains.anko.design.snackbar
|
||||||
import java.util.Calendar
|
import java.time.Instant
|
||||||
|
import java.time.ZoneId
|
||||||
|
import java.time.ZonedDateTime
|
||||||
|
import java.time.format.DateTimeFormatter
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The <code>net.thauvin.erik.android.tesremoteprogrammer.AboutActivity</code> class.
|
* The <code>net.thauvin.erik.android.tesremoteprogrammer.AboutActivity</code> class.
|
||||||
|
@ -36,26 +41,28 @@ import java.util.Calendar
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
class AboutActivity : AppCompatActivity() {
|
class AboutActivity : AppCompatActivity() {
|
||||||
|
private val dateTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(BuildConfig.TIMESTAMP),
|
||||||
|
ZoneId.of("America/Los_Angeles"))
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||||
|
|
||||||
AppCompatDelegate.setDefaultNightMode(
|
AppCompatDelegate.setDefaultNightMode(
|
||||||
AppCompatDelegate.MODE_NIGHT_NO
|
AppCompatDelegate.MODE_NIGHT_NO
|
||||||
)
|
)
|
||||||
|
|
||||||
val aboutPage = AboutPage(this).apply {
|
val aboutPage = AboutPage(this).apply {
|
||||||
isRTL(false)
|
isRTL(false)
|
||||||
setImage(R.drawable.background_splash)
|
setImage(R.drawable.background_splash)
|
||||||
val version = String.format(getString(R.string.about_version), BuildConfig.VERSION_NAME)
|
setDescription(getString(R.string.about_description))
|
||||||
setDescription(
|
addItem(getVersion())
|
||||||
"<strong>$version</strong><br><small>© ${Calendar.getInstance().get(Calendar.YEAR)} Erik C. Thauvin</small>️".fromHtml()
|
|
||||||
)
|
|
||||||
addEmail("erik@thauvin.net")
|
addEmail("erik@thauvin.net")
|
||||||
addGitHub("ethauvin/TESRemoteProgrammer")
|
addGitHub("ethauvin/TESRemoteProgrammer")
|
||||||
addWebsite("https://m.thauvin.net/android/TESRemoteProgrammer/licenses.shtml")
|
addWebsite("https://m.thauvin.net/android/TESRemoteProgrammer/licenses.shtml")
|
||||||
addItem(getPrivacyPolicy())
|
addItem(getPrivacyPolicy())
|
||||||
addTwitter("ethauvin")
|
addTwitter("ethauvin")
|
||||||
|
addItem(getCopyright())
|
||||||
|
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
addItem(getCrashTest())
|
addItem(getCrashTest())
|
||||||
|
@ -76,6 +83,16 @@ class AboutActivity : AppCompatActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun getCopyright(): Element {
|
||||||
|
return Element().apply {
|
||||||
|
title = "© ${Calendar.getInstance().get(Calendar.YEAR)} Erik C. Thauvin"
|
||||||
|
intent = Intent(
|
||||||
|
Intent.ACTION_VIEW,
|
||||||
|
Uri.parse("https://m.thauvin.net/android/")
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun getPrivacyPolicy(): Element {
|
private fun getPrivacyPolicy(): Element {
|
||||||
return Element().apply {
|
return Element().apply {
|
||||||
title = getString(R.string.about_privacy)
|
title = getString(R.string.about_privacy)
|
||||||
|
@ -83,9 +100,19 @@ class AboutActivity : AppCompatActivity() {
|
||||||
iconTint = R.color.about_github_color
|
iconTint = R.color.about_github_color
|
||||||
value = "privacy"
|
value = "privacy"
|
||||||
intent = Intent(
|
intent = Intent(
|
||||||
Intent.ACTION_VIEW,
|
Intent.ACTION_VIEW,
|
||||||
Uri.parse("https://m.thauvin.net/android/TESRemoteProgrammer/privacy.shtml")
|
Uri.parse("https://m.thauvin.net/android/TESRemoteProgrammer/privacy.shtml")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun getVersion(): Element {
|
||||||
|
val dateTimeFormatter = DateTimeFormatter.ofPattern(getString(R.string.about_built_on))
|
||||||
|
return Element().apply {
|
||||||
|
title = String.format(getString(R.string.about_version), BuildConfig.VERSION_NAME)
|
||||||
|
onClickListener = View.OnClickListener {
|
||||||
|
it.snackbar(dateTime.format(dateTimeFormatter))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
<item quantity="one">property</item>
|
<item quantity="one">property</item>
|
||||||
<item quantity="other">properties</item>
|
<item quantity="other">properties</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
|
<string name="about_description">Easily program your Telephone Entry System remotely from anywhere using your phone.</string>
|
||||||
<string name="about_version">Version <xliff:g id="version">%1$s</xliff:g></string>
|
<string name="about_version">Version <xliff:g id="version">%1$s</xliff:g></string>
|
||||||
|
<string name="about_built_on">\'Built on\' YYYY-MM-dd \'at\' HH:mm zzz</string>
|
||||||
<string name="about_contact_us">Contact me</string>
|
<string name="about_contact_us">Contact me</string>
|
||||||
<string name="about_github">Documentation on GitHub</string>
|
<string name="about_github">Documentation on GitHub</string>
|
||||||
<string name="about_twitter">Follow me on Twitter</string>
|
<string name="about_twitter">Follow me on Twitter</string>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue