Changes to strings.xml and InfoFragment.kt

This commit is contained in:
Arty Bishop committed 2020-10-19 23:17:09 +01:00
1 parent 9930fc9bde
commit 1c766abd24
14 files changed
+204 -218

No files matched your search

@@ -37,8 +37,8 @@ class TransAdapter(context: Context) : RecyclerView.Adapter<TransAdapter.TransHo
private val strNo = context.getString(R.string.btn_no)
private val strYes = context.getString(R.string.btn_yes)
private val mode = context.getString(R.string.trans_mode)
private val formatLink = context.getString(R.string.trans_down_low_doppler)
private val formatLinkNull = context.getString(R.string.no_downlink_doppler)
private val formatLink = context.getString(R.string.trans_link_low)
private val formatLinkNull = context.getString(R.string.trans_no_link)
private val isInverted = context.getString(R.string.trans_inverted)
private var transmittersList = emptyList<SatTrans>()
@@ -74,12 +74,12 @@ class TransAdapter(context: Context) : RecyclerView.Adapter<TransAdapter.TransHo
if (satTrans.downlinkLow != null) {
val downFreq = predictor.getDownlinkFreq(satTrans.downlinkLow, dateNow) / divider
binding.downlink.text = String.format(formatLink, downFreq)
binding.downlink.text = String.format(Locale.ENGLISH, formatLink, downFreq)
} else binding.downlink.text = formatLinkNull
if (satTrans.uplinkLow != null) {
val upFreq = predictor.getUplinkFreq(satTrans.uplinkLow, dateNow) / divider
binding.uplink.text = String.format(formatLink, upFreq)
binding.uplink.text = String.format(Locale.ENGLISH, formatLink, upFreq)
} else binding.uplink.text = formatLinkNull
if (satTrans.mode != null) binding.mode.text = String.format(mode, satTrans.mode)
@@ -66,7 +66,7 @@ class EntriesFragment : Fragment(R.layout.fragment_entries) {
event.getContentIfNotHandled()?.let {
if (it == 0) setLoading()
else if (it == 1) {
getString(R.string.error_updating_data).snack(requireView())
getString(R.string.entries_update_error).snack(requireView())
setError()
}
}
@@ -37,13 +37,17 @@ class InfoFragment : Fragment(R.layout.fragment_info) {
super.onViewCreated(view, savedInstanceState)
FragmentInfoBinding.bind(view).apply {
version.text = String.format(getString(R.string.app_version), BuildConfig.VERSION_NAME)
btnGithub.setOnClickListener {
gotoUrl("https://github.com/rt-bishop/Look4Sat/")
}
btnFdroid.setOnClickListener {
gotoUrl("https://f-droid.org/en/packages/com.rtbishop.look4sat/")
}
message.movementMethod = LinkMovementMethod.getInstance()
}
}
private fun gotoGitHub() {
val gitHubUrl = "https://github.com/rt-bishop/LookingSat"
val githubIntent = Intent(Intent.ACTION_VIEW, Uri.parse(gitHubUrl))
startActivity(githubIntent)
private fun gotoUrl(url: String) {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
}
}
@@ -113,7 +113,7 @@ class MapFragment : Fragment(R.layout.fragment_map) {
256,
".png",
arrayOf("https://maps.wikimedia.org/osm-intl/"),
resources.getString(R.string.osmCopyright),
resources.getString(R.string.map_copyright),
TileSourcePolicy(
1, TileSourcePolicy.FLAG_NO_BULK and TileSourcePolicy.FLAG_NO_PREVENTIVE and
TileSourcePolicy.FLAG_USER_AGENT_MEANINGFUL and TileSourcePolicy.FLAG_USER_AGENT_NORMALIZED