kopia lustrzana https://github.com/rt-bishop/Look4Sat
Various changes to layouts, styles, strings and drawables
rodzic
567200cfe4
commit
9fd0d5f2e2
|
@ -69,8 +69,8 @@ dependencies {
|
|||
kapt "androidx.room:room-compiler:2.4.1"
|
||||
|
||||
implementation "com.google.android.material:material:1.5.0"
|
||||
implementation "com.google.dagger:hilt-android:2.40.5"
|
||||
kapt "com.google.dagger:hilt-compiler:2.40.5"
|
||||
implementation "com.google.dagger:hilt-android:2.41"
|
||||
kapt "com.google.dagger:hilt-compiler:2.41"
|
||||
|
||||
implementation "org.osmdroid:osmdroid-android:6.1.11"
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Look4Sat.Main">
|
||||
<activity
|
||||
android:name=".presentation.MainActivity"
|
||||
|
|
|
@ -29,9 +29,9 @@ import com.rtbishop.look4sat.R
|
|||
import com.rtbishop.look4sat.data.ISettingsHandler
|
||||
import com.rtbishop.look4sat.domain.ILocationHandler
|
||||
import com.rtbishop.look4sat.domain.QthConverter
|
||||
import com.rtbishop.look4sat.domain.QthConverter.round
|
||||
import com.rtbishop.look4sat.domain.model.DataState
|
||||
import com.rtbishop.look4sat.domain.predict.GeoPos
|
||||
import com.rtbishop.look4sat.domain.round
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
|
|
|
@ -65,6 +65,7 @@ class LocalSource(
|
|||
return radiosDao.getRadios(catnum).toDomainRadios()
|
||||
}
|
||||
|
||||
@Suppress("BlockingMethodInNonBlockingContext")
|
||||
override suspend fun getFileStream(uri: String): InputStream? {
|
||||
return withContext(ioDispatcher) { resolver.openInputStream(Uri.parse(uri)) }
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.net.URL
|
|||
|
||||
class RemoteSource(private val ioDispatcher: CoroutineDispatcher) : IRemoteSource {
|
||||
|
||||
@Suppress("BlockingMethodInNonBlockingContext")
|
||||
override suspend fun getFileStream(url: String): InputStream? {
|
||||
return withContext(ioDispatcher) { URL(url).openStream() }
|
||||
}
|
||||
|
|
|
@ -19,21 +19,12 @@ package com.rtbishop.look4sat.presentation
|
|||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.content.res.Resources
|
||||
import android.widget.EditText
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.Toast
|
||||
import androidx.annotation.IdRes
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.LifecycleEventObserver
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import java.net.InetSocketAddress
|
||||
import java.net.Socket
|
||||
import java.security.MessageDigest
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.regex.Pattern
|
||||
|
||||
fun Context.toast(text: String, duration: Int = Toast.LENGTH_SHORT) {
|
||||
Toast.makeText(this, text, duration).apply { show() }
|
||||
|
@ -64,79 +55,3 @@ fun <T> Fragment.getNavResult(@IdRes id: Int, key: String, onResult: (result: T)
|
|||
fun <T> Fragment.setNavResult(key: String, value: T) {
|
||||
findNavController().previousBackStackEntry?.savedStateHandle?.set(key, value)
|
||||
}
|
||||
|
||||
fun Long.toTimerString(): String {
|
||||
val format = "%02d:%02d:%02d"
|
||||
val hours = TimeUnit.MILLISECONDS.toHours(this)
|
||||
val minutes = TimeUnit.MILLISECONDS.toMinutes(this) % 60
|
||||
val seconds = TimeUnit.MILLISECONDS.toSeconds(this) % 60
|
||||
return String.format(format, hours, minutes, seconds)
|
||||
}
|
||||
|
||||
fun Double.round(decimals: Int): Double {
|
||||
var multiplier = 1.0
|
||||
repeat(decimals) { multiplier *= 10 }
|
||||
return kotlin.math.round(this * multiplier) / multiplier
|
||||
}
|
||||
|
||||
fun String.getHash(type: String = "SHA-256"): String {
|
||||
val hexChars = "0123456789ABCDEF"
|
||||
val bytes = MessageDigest.getInstance(type).digest(this.toByteArray())
|
||||
val result = StringBuilder(bytes.size * 2)
|
||||
bytes.forEach {
|
||||
val i = it.toInt()
|
||||
result.append(hexChars[i shr 4 and 0x0f])
|
||||
result.append(hexChars[i and 0x0f])
|
||||
}
|
||||
return result.toString()
|
||||
}
|
||||
|
||||
fun String.isValidEmail(): Boolean {
|
||||
val expression = "^[\\w.-]+@([\\w\\-]+\\.)+[A-Z]{2,8}$"
|
||||
val pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE)
|
||||
return pattern.matcher(this).matches()
|
||||
}
|
||||
|
||||
fun String.isValidIPv4(): Boolean {
|
||||
val ip4 = "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\.(?!\$)|\$)){4}\$"
|
||||
return this.matches(ip4.toRegex())
|
||||
}
|
||||
|
||||
fun String.isValidPort(): Boolean {
|
||||
return this.isNotEmpty() && this.toInt() in 1024..65535
|
||||
}
|
||||
|
||||
fun Float.toPx(): Int = (this * Resources.getSystem().displayMetrics.density).toInt()
|
||||
|
||||
fun AlertDialog.Builder.setEditText(editText: EditText): AlertDialog.Builder {
|
||||
val container = FrameLayout(context)
|
||||
container.addView(editText)
|
||||
val containerParams = FrameLayout.LayoutParams(
|
||||
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
FrameLayout.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
val marginHorizontal = 32F
|
||||
val marginTop = 24F
|
||||
containerParams.topMargin = (marginTop / 2).toPx()
|
||||
containerParams.leftMargin = marginHorizontal.toInt()
|
||||
containerParams.rightMargin = marginHorizontal.toInt()
|
||||
container.layoutParams = containerParams
|
||||
val superContainer = FrameLayout(context)
|
||||
superContainer.addView(container)
|
||||
setView(superContainer)
|
||||
return this
|
||||
}
|
||||
|
||||
fun ping(hostname: String, port: Int): Int {
|
||||
val start = System.currentTimeMillis()
|
||||
val socket = Socket()
|
||||
try {
|
||||
socket.connect(InetSocketAddress(hostname, port), 6000)
|
||||
socket.close()
|
||||
} catch (exception: Exception) {
|
||||
exception.printStackTrace()
|
||||
println("Failed to ping: $hostname")
|
||||
return Int.MAX_VALUE
|
||||
}
|
||||
return (System.currentTimeMillis() - start).toInt()
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
*/
|
||||
package com.rtbishop.look4sat.presentation
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.pm.ActivityInfo
|
||||
import android.os.Bundle
|
||||
import androidx.activity.viewModels
|
||||
|
@ -30,6 +31,7 @@ class MainActivity : AppCompatActivity() {
|
|||
|
||||
private val mainViewModel: MainViewModel by viewModels()
|
||||
|
||||
@SuppressLint("SourceLockedOrientationActivity")
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||
installSplashScreen()
|
||||
|
|
|
@ -129,7 +129,7 @@ class MapFragment : Fragment(R.layout.fragment_map) {
|
|||
textLabelFontSize = 24
|
||||
textLabelBackgroundColor = Color.TRANSPARENT
|
||||
textLabelForegroundColor =
|
||||
ContextCompat.getColor(requireContext(), R.color.themeAccent)
|
||||
ContextCompat.getColor(requireContext(), R.color.accent)
|
||||
setTextIcon(it.key.data.name)
|
||||
setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_CENTER)
|
||||
try {
|
||||
|
|
|
@ -30,8 +30,8 @@ import com.rtbishop.look4sat.R
|
|||
import com.rtbishop.look4sat.databinding.FragmentPassesBinding
|
||||
import com.rtbishop.look4sat.domain.model.DataState
|
||||
import com.rtbishop.look4sat.domain.predict.SatPass
|
||||
import com.rtbishop.look4sat.domain.toTimerString
|
||||
import com.rtbishop.look4sat.presentation.getNavResult
|
||||
import com.rtbishop.look4sat.presentation.toTimerString
|
||||
import com.rtbishop.look4sat.presentation.toast
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import com.rtbishop.look4sat.data.ISettingsHandler
|
|||
import com.rtbishop.look4sat.databinding.FragmentRadarBinding
|
||||
import com.rtbishop.look4sat.domain.predict.SatPass
|
||||
import com.rtbishop.look4sat.domain.predict.SatPos
|
||||
import com.rtbishop.look4sat.presentation.toTimerString
|
||||
import com.rtbishop.look4sat.domain.toTimerString
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import javax.inject.Inject
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import kotlin.math.sin
|
|||
|
||||
class RadarView(context: Context) : View(context) {
|
||||
|
||||
private val defaultColor = ContextCompat.getColor(context, R.color.themeAccent)
|
||||
private val defaultColor = ContextCompat.getColor(context, R.color.accent)
|
||||
private val scale = resources.displayMetrics.density
|
||||
private val radarWidth = resources.displayMetrics.widthPixels
|
||||
private val radarRadius = radarWidth * 0.48f
|
||||
|
@ -38,7 +38,7 @@ class RadarView(context: Context) : View(context) {
|
|||
private var position: SatPos? = null
|
||||
private var positions: List<SatPos> = emptyList()
|
||||
|
||||
private var radarColor = ContextCompat.getColor(context, R.color.themeLight)
|
||||
private var radarColor = ContextCompat.getColor(context, R.color.textMain)
|
||||
private var radarCircleNum = 3
|
||||
private var radarPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||
color = radarColor
|
||||
|
@ -79,7 +79,7 @@ class RadarView(context: Context) : View(context) {
|
|||
|
||||
private val arrowPath = Path()
|
||||
private var arrowPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||
color = ContextCompat.getColor(context, R.color.themeAccent)
|
||||
color = ContextCompat.getColor(context, R.color.accent)
|
||||
style = Paint.Style.FILL
|
||||
strokeWidth = strokeSize
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ class RadarView(context: Context) : View(context) {
|
|||
isTrackCreated = true
|
||||
}
|
||||
|
||||
canvas.drawColor(ContextCompat.getColor(context, R.color.surfaceCard))
|
||||
canvas.drawColor(ContextCompat.getColor(context, R.color.cardRegular))
|
||||
drawRadarCircle(canvas, cx, cy, radarRadius)
|
||||
drawRadarCross(canvas, cx, cy, radarRadius)
|
||||
drawRadarText(canvas, cx, radarRadius)
|
||||
|
|
|
@ -27,8 +27,8 @@ import com.rtbishop.look4sat.domain.predict.GeoPos
|
|||
import com.rtbishop.look4sat.domain.predict.Predictor
|
||||
import com.rtbishop.look4sat.domain.predict.SatPass
|
||||
import com.rtbishop.look4sat.domain.predict.SatPos
|
||||
import com.rtbishop.look4sat.domain.round
|
||||
import com.rtbishop.look4sat.framework.OrientationHandler
|
||||
import com.rtbishop.look4sat.presentation.round
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.isActive
|
||||
|
|
|
@ -34,11 +34,11 @@ import androidx.navigation.fragment.findNavController
|
|||
import com.rtbishop.look4sat.BuildConfig
|
||||
import com.rtbishop.look4sat.R
|
||||
import com.rtbishop.look4sat.databinding.FragmentSettingsBinding
|
||||
import com.rtbishop.look4sat.domain.isValidIPv4
|
||||
import com.rtbishop.look4sat.domain.isValidPort
|
||||
import com.rtbishop.look4sat.domain.model.DataState
|
||||
import com.rtbishop.look4sat.domain.predict.GeoPos
|
||||
import com.rtbishop.look4sat.presentation.getNavResult
|
||||
import com.rtbishop.look4sat.presentation.isValidIPv4
|
||||
import com.rtbishop.look4sat.presentation.isValidPort
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@AndroidEntryPoint
|
||||
|
@ -94,28 +94,28 @@ class SettingsFragment : Fragment(R.layout.fragment_settings) {
|
|||
|
||||
private fun setupAboutCard() {
|
||||
binding.settingsInfo.aboutVersion.text =
|
||||
String.format(getString(R.string.about_version), BuildConfig.VERSION_NAME)
|
||||
// binding.settingsInfo.aboutBtnGithub.setOnClickListener {
|
||||
// gotoUrl("https://github.com/rt-bishop/Look4Sat/")
|
||||
// }
|
||||
// binding.settingsInfo.aboutBtnDonate.setOnClickListener {
|
||||
// gotoUrl("https://www.buymeacoffee.com/rtbishop")
|
||||
// }
|
||||
// binding.settingsInfo.aboutBtnFdroid.setOnClickListener {
|
||||
// gotoUrl("https://f-droid.org/en/packages/com.rtbishop.look4sat/")
|
||||
// }
|
||||
String.format(getString(R.string.app_version), BuildConfig.VERSION_NAME)
|
||||
binding.settingsGithubBtn.setOnClickListener {
|
||||
gotoUrl("https://github.com/rt-bishop/Look4Sat/")
|
||||
}
|
||||
binding.settingsFab.setOnClickListener {
|
||||
gotoUrl("https://www.buymeacoffee.com/rtbishop")
|
||||
}
|
||||
binding.settingsFdroidBtn.setOnClickListener {
|
||||
gotoUrl("https://f-droid.org/en/packages/com.rtbishop.look4sat/")
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupLocationCard() {
|
||||
setPositionText(viewModel.getStationPosition())
|
||||
binding.settingsLocation.locationBtnGps.setOnClickListener {
|
||||
binding.settingsLocation.positionBtnGps.setOnClickListener {
|
||||
locationRequest.launch(arrayOf(locationFine, locationCoarse))
|
||||
}
|
||||
binding.settingsLocation.locationBtnManual.setOnClickListener {
|
||||
binding.settingsLocation.positionBtnManual.setOnClickListener {
|
||||
val action = SettingsFragmentDirections.actionPrefsToLocation()
|
||||
findNavController().navigate(action)
|
||||
}
|
||||
binding.settingsLocation.locationBtnQth.setOnClickListener {
|
||||
binding.settingsLocation.positionBtnQth.setOnClickListener {
|
||||
val action = SettingsFragmentDirections.actionPrefsToLocator()
|
||||
findNavController().navigate(action)
|
||||
}
|
||||
|
@ -136,11 +136,11 @@ class SettingsFragment : Fragment(R.layout.fragment_settings) {
|
|||
binding.settingsData.dataBtnClear.setOnClickListener { viewModel.clearData() }
|
||||
viewModel.entries.observe(viewLifecycleOwner) { number ->
|
||||
val entriesFormat = getString(R.string.fmt_entries)
|
||||
binding.settingsData.dataSatellites.text = String.format(entriesFormat, number)
|
||||
binding.settingsData.dataEntries.text = String.format(entriesFormat, number)
|
||||
}
|
||||
viewModel.radios.observe(viewLifecycleOwner) { number ->
|
||||
val radiosFormat = getString(R.string.fmt_radios)
|
||||
binding.settingsData.dataTransmitters.text = String.format(radiosFormat, number)
|
||||
binding.settingsData.dataRadios.text = String.format(radiosFormat, number)
|
||||
}
|
||||
getNavResult<List<String>>(R.id.nav_settings, "sources") { sources ->
|
||||
viewModel.updateDataFromWeb(sources)
|
||||
|
@ -148,22 +148,22 @@ class SettingsFragment : Fragment(R.layout.fragment_settings) {
|
|||
}
|
||||
|
||||
private fun setupTrackingCard() {
|
||||
binding.settingsTracking.trackingSwitch.apply {
|
||||
binding.settingsTracking.remoteSwitch.apply {
|
||||
isChecked = viewModel.getRotatorEnabled()
|
||||
binding.settingsTracking.trackingIp.isEnabled = isChecked
|
||||
binding.settingsTracking.trackingIpEdit.setText(viewModel.getRotatorServer())
|
||||
binding.settingsTracking.trackingPort.isEnabled = isChecked
|
||||
binding.settingsTracking.trackingPortEdit.setText(viewModel.getRotatorPort())
|
||||
binding.settingsTracking.remoteIp.isEnabled = isChecked
|
||||
binding.settingsTracking.remoteIpEdit.setText(viewModel.getRotatorServer())
|
||||
binding.settingsTracking.remotePort.isEnabled = isChecked
|
||||
binding.settingsTracking.remotePortEdit.setText(viewModel.getRotatorPort())
|
||||
setOnCheckedChangeListener { _, isChecked ->
|
||||
viewModel.setRotatorEnabled(isChecked)
|
||||
binding.settingsTracking.trackingIp.isEnabled = isChecked
|
||||
binding.settingsTracking.trackingPort.isEnabled = isChecked
|
||||
binding.settingsTracking.remoteIp.isEnabled = isChecked
|
||||
binding.settingsTracking.remotePort.isEnabled = isChecked
|
||||
}
|
||||
}
|
||||
binding.settingsTracking.trackingIpEdit.doOnTextChanged { text, _, _, _ ->
|
||||
binding.settingsTracking.remoteIpEdit.doOnTextChanged { text, _, _, _ ->
|
||||
if (text.toString().isValidIPv4()) viewModel.setRotatorServer(text.toString())
|
||||
}
|
||||
binding.settingsTracking.trackingPortEdit.doOnTextChanged { text, _, _, _ ->
|
||||
binding.settingsTracking.remotePortEdit.doOnTextChanged { text, _, _, _ ->
|
||||
if (text.toString().isValidPort()) viewModel.setRotatorPort(text.toString())
|
||||
}
|
||||
}
|
||||
|
@ -184,32 +184,32 @@ class SettingsFragment : Fragment(R.layout.fragment_settings) {
|
|||
}
|
||||
|
||||
private fun setupWarrantyCard() {
|
||||
binding.settingsWarranty.warrantyThanks.movementMethod = LinkMovementMethod.getInstance()
|
||||
binding.settingsWarranty.warrantyLicense.movementMethod = LinkMovementMethod.getInstance()
|
||||
binding.settingsWarranty.outroThanks.movementMethod = LinkMovementMethod.getInstance()
|
||||
binding.settingsWarranty.outroLicense.movementMethod = LinkMovementMethod.getInstance()
|
||||
}
|
||||
|
||||
private fun setPositionText(geoPos: GeoPos) {
|
||||
val latFormat = getString(R.string.location_lat)
|
||||
val lonFormat = getString(R.string.location_lon)
|
||||
binding.settingsLocation.locationLat.text = String.format(latFormat, geoPos.latitude)
|
||||
binding.settingsLocation.locationLon.text = String.format(lonFormat, geoPos.longitude)
|
||||
binding.settingsLocation.positionLat.text = String.format(latFormat, geoPos.latitude)
|
||||
binding.settingsLocation.positionLon.text = String.format(lonFormat, geoPos.longitude)
|
||||
}
|
||||
|
||||
private fun handleStationPosition(pos: DataState<GeoPos>) {
|
||||
when (pos) {
|
||||
is DataState.Success -> {
|
||||
setPositionText(pos.data)
|
||||
binding.settingsLocation.locationProgress.isIndeterminate = false
|
||||
binding.settingsLocation.positionProgress.isIndeterminate = false
|
||||
viewModel.setPositionHandled()
|
||||
showToast(getString(R.string.pref_pos_success))
|
||||
}
|
||||
is DataState.Error -> {
|
||||
binding.settingsLocation.locationProgress.isIndeterminate = false
|
||||
binding.settingsLocation.positionProgress.isIndeterminate = false
|
||||
viewModel.setPositionHandled()
|
||||
showToast(pos.message.toString())
|
||||
}
|
||||
DataState.Loading -> {
|
||||
binding.settingsLocation.locationProgress.isIndeterminate = true
|
||||
binding.settingsLocation.positionProgress.isIndeterminate = true
|
||||
}
|
||||
DataState.Handled -> {}
|
||||
}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
|
||||
</vector>
|
|
@ -1,6 +1,7 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z" />
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z" />
|
||||
</vector>
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M18,7l-1.41,-1.41 -6.34,6.34 1.41,1.41L18,7zM22.24,5.59L11.66,16.17 7.48,12l-1.41,1.41L11.66,19l12,-12 -1.42,-1.41zM0.41,13.41L6,19l1.41,-1.41L1.83,12 0.41,13.41z"/>
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M18,7l-1.41,-1.41 -6.34,6.34 1.41,1.41L18,7zM22.24,5.59L11.66,16.17 7.48,12l-1.41,1.41L11.66,19l12,-12 -1.42,-1.41zM0.41,13.41L6,19l1.41,-1.41L1.83,12 0.41,13.41z" />
|
||||
</vector>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/themeAccent"
|
||||
android:fillColor="@color/accent"
|
||||
android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z" />
|
||||
</vector>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/surfaceBg" />
|
||||
<solid android:color="@color/background" />
|
||||
</shape>
|
|
@ -1,6 +1,7 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:autoMirrored="true"
|
||||
android:viewportWidth="271.2439"
|
||||
android:viewportHeight="271.2439">
|
||||
<group
|
||||
|
@ -10,10 +11,10 @@
|
|||
android:translateX="70.26573"
|
||||
android:translateY="70.26573">
|
||||
<path
|
||||
android:fillColor="@color/themeAccent"
|
||||
android:fillColor="@color/accent"
|
||||
android:pathData="m96.642,31.504c7.911,7.997 17.143,13.584 25.365,15.581l1.754,-3.997C123.78,43.048 123.786,43.005 123.802,42.965 125.834,38.995 127,34.495 127,29.715 127,13.881 114.379,1 98.867,1c-5.125,0 -9.92,1.429 -14.064,3.884l-3.398,1.598c0.08,0.306 0.133,0.599 0.221,0.91 2.32,8.104 7.652,16.667 15.016,24.112z" />
|
||||
<path
|
||||
android:fillColor="@color/themeAccent"
|
||||
android:fillColor="@color/accent"
|
||||
android:pathData="M93.876,34.3C86.053,26.391 80.369,17.225 77.87,8.49 77.84,8.385 77.818,8.285 77.788,8.181L2.629,43.513c-1.404,0.66 -2.019,2.358 -1.372,3.791 0.472,1.046 1.485,1.663 2.545,1.663 0.392,0 0.79,-0.084 1.169,-0.263L74.045,16.235c-1.873,3.578 -2.997,7.611 -3.228,11.885L35.566,51.732c-1.294,0.866 -1.653,2.638 -0.805,3.957 0.538,0.836 1.431,1.29 2.344,1.29 0.526,0 1.06,-0.151 1.533,-0.469L71.189,34.707c1.4,8.11 6.135,15.044 12.715,19.285l-54.945,68.337c-0.981,1.22 -0.808,3.021 0.388,4.023 0.521,0.437 1.149,0.649 1.775,0.649 0.809,0 1.611,-0.357 2.166,-1.045L89.056,56.595c3.06,1.168 6.357,1.838 9.811,1.838 4.932,0 9.566,-1.312 13.601,-3.597L84.602,118.323c-0.633,1.44 0,3.131 1.41,3.777 0.372,0.17 0.76,0.25 1.144,0.25 1.07,0 2.092,-0.629 2.556,-1.691L120.402,50.739C111.642,48.416 102.042,42.555 93.876,34.3Z" />
|
||||
</group>
|
||||
</group>
|
|
@ -1,6 +1,7 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19,8l-4,4h3c0,3.31 -2.69,6 -6,6 -1.01,0 -1.97,-0.25 -2.8,-0.7l-1.46,1.46C8.97,19.54 10.43,20 12,20c4.42,0 8,-3.58 8,-8h3l-4,-4zM6,12c0,-3.31 2.69,-6 6,-6 1.01,0 1.97,0.25 2.8,0.7l1.46,-1.46C15.03,4.46 13.57,4 12,4c-4.42,0 -8,3.58 -8,8H1l4,4 4,-4H6z"/>
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19,8l-4,4h3c0,3.31 -2.69,6 -6,6 -1.01,0 -1.97,-0.25 -2.8,-0.7l-1.46,1.46C8.97,19.54 10.43,20 12,20c4.42,0 8,-3.58 8,-8h3l-4,-4zM6,12c0,-3.31 2.69,-6 6,-6 1.01,0 1.97,0.25 2.8,0.7l1.46,-1.46C15.03,4.46 13.57,4 12,4c-4.42,0 -8,3.58 -8,8H1l4,4 4,-4H6z" />
|
||||
</vector>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="128"
|
||||
android:viewportHeight="128">
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,7 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="128"
|
||||
android:viewportHeight="128">
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M14,21c1.93,0 3.62,-1.17 4,-3l-1.75,-0.88C16,18.21 15.33,19 14,19l-4.9,0c0.83,-1 1.5,-2.34 1.5,-4c0,-0.35 -0.03,-0.69 -0.08,-1L14,14v-2l-4.18,0C9,10.42 8,9.6 8,8c0,-1.93 1.57,-3.5 3.5,-3.5c1.5,0 2.79,0.95 3.28,2.28L16.63,6c-0.8,-2.05 -2.79,-3.5 -5.13,-3.5C8.46,2.5 6,4.96 6,8c0,1.78 0.79,2.9 1.49,4L6,12v2l2.47,0c0.08,0.31 0.13,0.64 0.13,1c0,2.7 -2.6,4 -2.6,4v2H14z"/>
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M14,21c1.93,0 3.62,-1.17 4,-3l-1.75,-0.88C16,18.21 15.33,19 14,19l-4.9,0c0.83,-1 1.5,-2.34 1.5,-4c0,-0.35 -0.03,-0.69 -0.08,-1L14,14v-2l-4.18,0C9,10.42 8,9.6 8,8c0,-1.93 1.57,-3.5 3.5,-3.5c1.5,0 2.79,0.95 3.28,2.28L16.63,6c-0.8,-2.05 -2.79,-3.5 -5.13,-3.5C8.46,2.5 6,4.96 6,8c0,1.78 0.79,2.9 1.49,4L6,12v2l2.47,0c0.08,0.31 0.13,0.64 0.13,1c0,2.7 -2.6,4 -2.6,4v2H14z" />
|
||||
</vector>
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
<size
|
||||
android:width="1dp"
|
||||
android:height="1dp" />
|
||||
<solid android:color="@color/surfaceBg" />
|
||||
<solid android:color="@color/background" />
|
||||
</shape>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.fragment.app.FragmentContainerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/navigation_host"
|
||||
android:id="@+id/nav_host"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:defaultNavHost="true"
|
||||
app:navGraph="@navigation/navigation_graph" />
|
||||
app:navGraph="@navigation/nav_graph" />
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/about_title"
|
||||
app:tint="@color/themeAccent" />
|
||||
app:tint="@color/accent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/about_title"
|
||||
|
@ -32,7 +32,7 @@
|
|||
android:layout_marginEnd="8dp"
|
||||
android:includeFontPadding="false"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/themeAccent"
|
||||
android:textColor="@color/accent"
|
||||
android:textSize="@dimen/text_size_app_title"
|
||||
app:layout_constraintBottom_toTopOf="@+id/about_version"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -45,8 +45,8 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="@string/about_version"
|
||||
android:textColor="@color/themeLight"
|
||||
android:text="@string/app_version"
|
||||
android:textColor="@color/textMain"
|
||||
android:textSize="@dimen/text_size_large"
|
||||
app:layout_constraintBottom_toTopOf="@+id/about_subtitle"
|
||||
app:layout_constraintEnd_toEndOf="@+id/about_title"
|
||||
|
@ -59,8 +59,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:text="@string/about_subtitle"
|
||||
android:textColor="@color/themeLight"
|
||||
android:text="@string/app_subtitle"
|
||||
android:textColor="@color/textMain"
|
||||
android:textSize="@dimen/text_size_large"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
@ -31,48 +31,50 @@
|
|||
app:layout_constraintTop_toTopOf="@+id/data_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/data_satellites"
|
||||
android:id="@+id/data_entries"
|
||||
style="@style/SettingsText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/location_lat"
|
||||
app:layout_constraintEnd_toStartOf="@+id/data_transmitters"
|
||||
android:text="@string/fmt_entries"
|
||||
app:layout_constraintEnd_toStartOf="@+id/data_radios"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||
app:layout_constraintStart_toStartOf="@+id/data_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/data_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/data_transmitters"
|
||||
android:id="@+id/data_radios"
|
||||
style="@style/SettingsText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/location_lon"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/data_satellites"
|
||||
android:text="@string/fmt_radios"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/data_entries"
|
||||
app:layout_constraintEnd_toEndOf="@+id/data_progress"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@+id/data_satellites" />
|
||||
app:layout_constraintStart_toEndOf="@+id/data_entries" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/data_btn_web"
|
||||
style="@style/NormalButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="@string/btn_web"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/data_btn_file"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/data_satellites" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/data_entries" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/data_btn_file"
|
||||
style="@style/NormalButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:text="@string/btn_file"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/data_btn_web"
|
||||
app:layout_constraintEnd_toStartOf="@+id/data_btn_clear"
|
||||
|
@ -83,7 +85,7 @@
|
|||
style="@style/NormalButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:text="@string/btn_clear"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/data_btn_web"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="@+id/other_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/other_title"
|
||||
app:trackTint="@color/themeDisabled" />
|
||||
app:trackTint="@color/textDisabled" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/other_switch_sweep"
|
||||
|
@ -49,7 +49,7 @@
|
|||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="@+id/other_switch_utc"
|
||||
app:layout_constraintTop_toBottomOf="@+id/other_switch_utc"
|
||||
app:trackTint="@color/themeDisabled" />
|
||||
app:trackTint="@color/textDisabled" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/other_switch_sensors"
|
||||
|
@ -64,7 +64,7 @@
|
|||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="@+id/other_switch_utc"
|
||||
app:layout_constraintTop_toBottomOf="@+id/other_switch_sweep"
|
||||
app:trackTint="@color/themeDisabled" />
|
||||
app:trackTint="@color/textDisabled" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
|
|
@ -8,45 +8,45 @@
|
|||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/warranty_title"
|
||||
android:id="@+id/outro_title"
|
||||
style="@style/SettingsTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="@string/warranty_title"
|
||||
app:layout_constraintBottom_toTopOf="@+id/warranty_thanks"
|
||||
android:text="@string/outro_title"
|
||||
app:layout_constraintBottom_toTopOf="@+id/outro_thanks"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/warranty_thanks"
|
||||
android:id="@+id/outro_thanks"
|
||||
style="@style/SettingsText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="@string/warranty_thanks"
|
||||
app:layout_constraintBottom_toTopOf="@+id/warranty_license"
|
||||
app:layout_constraintEnd_toEndOf="@+id/warranty_title"
|
||||
android:text="@string/outro_thanks"
|
||||
app:layout_constraintBottom_toTopOf="@+id/outro_license"
|
||||
app:layout_constraintEnd_toEndOf="@+id/outro_title"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="@+id/warranty_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/warranty_title" />
|
||||
app:layout_constraintStart_toStartOf="@+id/outro_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/outro_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/warranty_license"
|
||||
android:id="@+id/outro_license"
|
||||
style="@style/SettingsText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/warranty_license"
|
||||
android:text="@string/outro_license"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/warranty_title"
|
||||
app:layout_constraintEnd_toEndOf="@+id/outro_title"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="@+id/warranty_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/warranty_thanks" />
|
||||
app:layout_constraintStart_toStartOf="@+id/outro_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/outro_thanks" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/location_title"
|
||||
android:id="@+id/position_title"
|
||||
style="@style/SettingsTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -19,81 +19,83 @@
|
|||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/location_progress"
|
||||
android:id="@+id/position_progress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/location_title"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/position_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/location_title"
|
||||
app:layout_constraintTop_toTopOf="@+id/location_title" />
|
||||
app:layout_constraintStart_toEndOf="@+id/position_title"
|
||||
app:layout_constraintTop_toTopOf="@+id/position_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/location_lat"
|
||||
android:id="@+id/position_lat"
|
||||
style="@style/SettingsText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/location_lat"
|
||||
app:layout_constraintEnd_toStartOf="@+id/location_lon"
|
||||
app:layout_constraintEnd_toStartOf="@+id/position_lon"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||
app:layout_constraintStart_toStartOf="@+id/location_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/location_title" />
|
||||
app:layout_constraintStart_toStartOf="@+id/position_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/position_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/location_lon"
|
||||
android:id="@+id/position_lon"
|
||||
style="@style/SettingsText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/location_lon"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/location_lat"
|
||||
app:layout_constraintEnd_toEndOf="@+id/location_progress"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/position_lat"
|
||||
app:layout_constraintEnd_toEndOf="@+id/position_progress"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@+id/location_lat" />
|
||||
app:layout_constraintStart_toEndOf="@+id/position_lat" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/location_btn_gps"
|
||||
android:id="@+id/position_btn_gps"
|
||||
style="@style/NormalButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:drawableStart="@drawable/ic_gps"
|
||||
android:text="@string/btn_gps"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/location_btn_manual"
|
||||
app:layout_constraintEnd_toStartOf="@+id/position_btn_manual"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/location_lat" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/position_lat" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/location_btn_manual"
|
||||
android:id="@+id/position_btn_manual"
|
||||
style="@style/NormalButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:drawableStart="@drawable/ic_gps"
|
||||
android:text="@string/btn_manual"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/location_btn_gps"
|
||||
app:layout_constraintEnd_toStartOf="@+id/location_btn_qth"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/position_btn_gps"
|
||||
app:layout_constraintEnd_toStartOf="@+id/position_btn_qth"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@+id/location_btn_gps" />
|
||||
app:layout_constraintStart_toEndOf="@+id/position_btn_gps" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/location_btn_qth"
|
||||
android:id="@+id/position_btn_qth"
|
||||
style="@style/NormalButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:drawableStart="@drawable/ic_qth"
|
||||
android:text="@string/btn_qth"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/location_btn_gps"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/position_btn_gps"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@+id/location_btn_manual" />
|
||||
app:layout_constraintStart_toEndOf="@+id/position_btn_manual" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tracking_title"
|
||||
android:id="@+id/remote_title"
|
||||
style="@style/SettingsTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -21,54 +21,54 @@
|
|||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/tracking_switch"
|
||||
android:id="@+id/remote_switch"
|
||||
style="@style/SettingsText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="42dp"
|
||||
android:text="@string/tracking_switch"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tracking_title"
|
||||
app:layout_constraintStart_toStartOf="@+id/tracking_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tracking_title"
|
||||
app:trackTint="@color/themeDisabled" />
|
||||
app:layout_constraintEnd_toEndOf="@+id/remote_title"
|
||||
app:layout_constraintStart_toStartOf="@+id/remote_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/remote_title"
|
||||
app:trackTint="@color/textDisabled" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tracking_ip"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:id="@+id/remote_ip"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tracking_port"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="@+id/tracking_switch"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tracking_switch"
|
||||
app:layout_constraintWidth_percent="0.69">
|
||||
app:layout_constraintEnd_toStartOf="@+id/remote_port"
|
||||
app:layout_constraintStart_toStartOf="@+id/remote_switch"
|
||||
app:layout_constraintTop_toBottomOf="@+id/remote_switch"
|
||||
app:layout_constraintWidth_percent="0.64">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/tracking_ip_edit"
|
||||
android:id="@+id/remote_ip_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/tracking_ip_hint" />
|
||||
android:hint="@string/tracking_ip_hint"
|
||||
android:textColorHint="@color/textMain" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tracking_port"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:id="@+id/remote_port"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tracking_ip"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tracking_switch"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@+id/tracking_ip"
|
||||
app:layout_constraintTop_toTopOf="@+id/tracking_ip">
|
||||
app:layout_constraintBottom_toBottomOf="@+id/remote_ip"
|
||||
app:layout_constraintEnd_toEndOf="@+id/remote_switch"
|
||||
app:layout_constraintStart_toEndOf="@+id/remote_ip"
|
||||
app:layout_constraintTop_toTopOf="@+id/remote_ip">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/tracking_port_edit"
|
||||
android:id="@+id/remote_port_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/tracking_port_hint" />
|
||||
android:hint="@string/tracking_port_hint"
|
||||
android:textColorHint="@color/textMain" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -103,9 +103,9 @@
|
|||
style="@style/NormalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="@string/btn_cancel"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/filter_pos_btn"
|
||||
|
@ -119,7 +119,7 @@
|
|||
style="@style/NormalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:text="@string/btn_accept"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/filter_neg_btn"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/location_title"
|
||||
android:id="@+id/position_title"
|
||||
style="@style/DialogTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -34,9 +34,9 @@
|
|||
android:minHeight="48dp"
|
||||
app:endIconMode="clear_text"
|
||||
app:layout_constraintBottom_toTopOf="@+id/location_lon_layout"
|
||||
app:layout_constraintEnd_toEndOf="@+id/location_title"
|
||||
app:layout_constraintStart_toStartOf="@+id/location_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/location_title">
|
||||
app:layout_constraintEnd_toEndOf="@+id/position_title"
|
||||
app:layout_constraintStart_toStartOf="@+id/position_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/position_title">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/location_lat_edit"
|
||||
|
@ -74,9 +74,9 @@
|
|||
style="@style/NormalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="@string/btn_cancel"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/location_pos_btn"
|
||||
|
@ -90,7 +90,7 @@
|
|||
style="@style/NormalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:text="@string/btn_accept"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/location_neg_btn"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
@ -66,9 +66,9 @@
|
|||
style="@style/NormalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="@string/btn_cancel"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/locator_pos_btn"
|
||||
|
@ -82,7 +82,7 @@
|
|||
style="@style/NormalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:text="@string/btn_accept"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/locator_neg_btn"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="@string/sources_title"
|
||||
android:text="@string/entries_modes"
|
||||
android:minHeight="48dp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/modes_btn_pos"
|
||||
app:layout_constraintStart_toStartOf="@+id/modes_btn_neg"
|
||||
|
@ -40,8 +40,8 @@
|
|||
style="@style/NormalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="@string/btn_cancel"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/modes_btn_pos"
|
||||
|
@ -54,7 +54,7 @@
|
|||
style="@style/NormalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:text="@string/btn_accept"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/modes_btn_neg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
@ -58,9 +58,8 @@
|
|||
style="@style/NormalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="@string/btn_cancel"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/sources_btn_pos"
|
||||
|
@ -73,8 +72,7 @@
|
|||
style="@style/NormalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:text="@string/btn_accept"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/sources_btn_neg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:text="@string/map_copyright"
|
||||
android:textColor="@color/themeDisabled"
|
||||
android:textColor="@color/textDisabled"
|
||||
android:textSize="@dimen/text_size_copyright"
|
||||
app:layout_constraintEnd_toEndOf="@+id/map_card"
|
||||
app:layout_constraintStart_toStartOf="@+id/map_card"
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<TextView
|
||||
android:id="@+id/settings_title"
|
||||
style="@style/ToolbarTitle"
|
||||
android:text="@string/settings_title" />
|
||||
android:text="@string/btn_settings" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
|||
android:layout_marginTop="60dp"
|
||||
android:layout_marginEnd="@dimen/view_default_margin"
|
||||
android:layout_marginBottom="62dp"
|
||||
android:backgroundTint="@color/surfaceBg">
|
||||
android:backgroundTint="@color/background">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/settings_scroll"
|
||||
|
@ -53,7 +53,7 @@
|
|||
|
||||
<include
|
||||
android:id="@+id/settings_location"
|
||||
layout="@layout/card_location"
|
||||
layout="@layout/card_position"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/view_default_margin"
|
||||
|
@ -73,7 +73,7 @@
|
|||
|
||||
<include
|
||||
android:id="@+id/settings_tracking"
|
||||
layout="@layout/card_tracking"
|
||||
layout="@layout/card_remote"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/view_default_margin"
|
||||
|
@ -93,7 +93,7 @@
|
|||
|
||||
<include
|
||||
android:id="@+id/settings_warranty"
|
||||
layout="@layout/card_info"
|
||||
layout="@layout/card_outro"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/view_default_margin"
|
||||
|
@ -113,7 +113,7 @@
|
|||
style="@style/BottomBar">
|
||||
|
||||
<Button
|
||||
android:id="@+id/settings_prev_btn"
|
||||
android:id="@+id/settings_github_btn"
|
||||
style="@style/NormalButton"
|
||||
android:layout_width="@dimen/button_width_max"
|
||||
android:layout_marginStart="@dimen/button_margin_side"
|
||||
|
@ -121,7 +121,7 @@
|
|||
android:text="@string/btn_github" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/settings_next_btn"
|
||||
android:id="@+id/settings_fdroid_btn"
|
||||
style="@style/NormalButton"
|
||||
android:layout_width="@dimen/button_width_max"
|
||||
android:layout_marginEnd="@dimen/button_margin_side"
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="41dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@color/surfaceCard"
|
||||
android:background="@color/cardRegular"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:padding="6dp"
|
||||
android:textColor="@color/themeLight"
|
||||
android:textColor="@color/textMain"
|
||||
android:textSize="@dimen/text_size_medium" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="41dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:background="@color/surfaceCard"
|
||||
android:background="@color/cardRegular"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:padding="4dp"
|
||||
android:textColor="@color/themeLight"
|
||||
android:textColor="@color/textMain"
|
||||
android:textSize="@dimen/text_size_medium" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
android:layout_marginTop="4dp"
|
||||
android:text="@string/pass_satName"
|
||||
android:textSize="@dimen/text_size_small"
|
||||
android:textColor="@color/themeAccent"
|
||||
android:textColor="@color/accent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
|||
android:layout_marginEnd="6dp"
|
||||
android:text="@string/pass_satId"
|
||||
android:textSize="@dimen/text_size_small"
|
||||
android:textColor="@color/themeAccent"
|
||||
android:textColor="@color/accent"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/pass_name"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
app:layout_constraintBottom_toBottomOf="@+id/radio_info"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/radio_info"
|
||||
android:contentDescription="@string/downlink"
|
||||
app:srcCompat="@drawable/ic_next" />
|
||||
|
||||
<TextView
|
||||
|
@ -58,6 +59,7 @@
|
|||
app:layout_constraintBottom_toBottomOf="@+id/radio_info"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/radio_info"
|
||||
android:contentDescription="@string/uplink"
|
||||
app:srcCompat="@drawable/ic_next" />
|
||||
|
||||
<TextView
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<background android:drawable="@drawable/ic_launcher_bg" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_fg" />
|
||||
</adaptive-icon>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<background android:drawable="@drawable/ic_launcher_bg" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_fg" />
|
||||
</adaptive-icon>
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Look4Sat</string>
|
||||
<string name="app_version">Версия: %s</string>
|
||||
<string name="app_subtitle">Трекер спутников для Android</string>
|
||||
|
||||
<string name="btn_add">Добавить</string>
|
||||
<string name="btn_accept">Принять</string>
|
||||
<string name="btn_cancel">Отмена</string>
|
||||
<string name="btn_cancel">Отменить</string>
|
||||
<string name="btn_back">Назад</string>
|
||||
<string name="btn_modes">Режимы</string>
|
||||
<string name="btn_select">Выбрать</string>
|
||||
<string name="btn_done">Готово</string>
|
||||
<string name="btn_clear">Очистка</string>
|
||||
<string name="btn_clear">Очистить</string>
|
||||
<string name="btn_refresh">Обновить</string>
|
||||
<string name="btn_map">Карта</string>
|
||||
<string name="btn_filter">Фильтр</string>
|
||||
|
@ -28,26 +32,19 @@
|
|||
<string name="fmt_entries">Спутников: %s</string>
|
||||
<string name="fmt_radios">Трансиверов: %s</string>
|
||||
|
||||
<string name="downlink">Даунлинк</string>
|
||||
<string name="uplink">Аплинк</string>
|
||||
|
||||
<string name="yes">Да</string>
|
||||
<string name="no">Нет</string>
|
||||
|
||||
<string name="menu_satellites">Спутники</string>
|
||||
<string name="menu_passes">Пролеты</string>
|
||||
<string name="menu_radar">Радар</string>
|
||||
<string name="menu_map">Карта</string>
|
||||
<string name="menu_settings">Настройки</string>
|
||||
|
||||
<string name="sources_title">Источники данных</string>
|
||||
<string name="sources_hint">Протокол HTTPS</string>
|
||||
|
||||
<string name="entries_title">Спутники</string>
|
||||
<string name="entries_update">Обновить спутники:</string>
|
||||
<string name="entries_modes">Выберите тип модуляции</string>
|
||||
<string name="entries_search_hint">Поиск по Имени / Id</string>
|
||||
<string name="entries_select_all">Выбрать Все/Нет</string>
|
||||
<string name="entries_update_error">Ошибка обновления спутников</string>
|
||||
|
||||
<string name="modes_title">Выберите модуляцию трансивера</string>
|
||||
|
||||
<string name="passes_error">Нет предстоящих пролётов</string>
|
||||
|
||||
<string name="pass_aosAz">НПС - %.1f°</string>
|
||||
|
@ -101,12 +98,6 @@
|
|||
<string name="pref_min_el_summary">Показать пролеты с элевацией более</string>
|
||||
<string name="pref_min_el_input_error">Введите значение между 0° и 90°</string>
|
||||
|
||||
<string name="settings_title">Настройки</string>
|
||||
|
||||
<string name="about_version">Версия: %s</string>
|
||||
<string name="about_subtitle">Трекер спутников для Android</string>
|
||||
<string name="about_support">Поддержать</string>
|
||||
|
||||
<string name="location_title">Местоположение</string>
|
||||
<string name="location_lat">Широта: %.4f°</string>
|
||||
<string name="location_lon">Долгота: %.4f°</string>
|
||||
|
@ -130,16 +121,13 @@
|
|||
<string name="tracking_port_invalid">Введите порт в диапазоне от 1024 до 65535</string>
|
||||
|
||||
<string name="update_title">Обновление данных</string>
|
||||
<string name="update_web">Вэб</string>
|
||||
<string name="update_file">Файл</string>
|
||||
<string name="update_clear">Удалить</string>
|
||||
<string name="update_error">При обновлении возникли ошибки</string>
|
||||
|
||||
<string name="warranty_title">Я хотел бы сказать спасибо:</string>
|
||||
<string name="warranty_thanks"> • Вам за использование этого приложения! \nЖелаю всегда чистого неба над головой!
|
||||
<string name="outro_title">Я хотел бы сказать спасибо:</string>
|
||||
<string name="outro_thanks"> • Вам за использование этого приложения! \nЖелаю всегда чистого неба над головой!
|
||||
\n • <a href="https://github.com/g4dpz">David A. B. Johnson</a> и
|
||||
<a href="https://github.com/davidmoten">Dave Moten</a> за работу над predict4java и
|
||||
доступ к ней по <a href="https://gnu.org/licenses/old-licenses/gpl-2.0.en.html">GNU GPLv2</a>
|
||||
<a href="https://github.com/davidmoten">Dave Moten</a> за работу над predict4java и доступ
|
||||
к ней по <a href="https://gnu.org/licenses/old-licenses/gpl-2.0.en.html">GNU GPLv2</a>
|
||||
\n • <a href="https://github.com/csete">Alexandru Csete</a> за его программу
|
||||
Gpredict, которая послужила для меня вдохновением.
|
||||
\n • <a href="https://celestrak.com/webmaster.php">Доктору T.S. Kelso</a> за его сайт
|
||||
|
@ -147,7 +135,7 @@
|
|||
\n • <a href="https://libre.space/">Libre Space Foundation</a> за проект
|
||||
<a href="https://db.satnogs.org/">SatNOGS</a>, API и базу данных с информацией о спутниках.
|
||||
</string>
|
||||
<string name="warranty_license"><a href="https://sites.google.com/view/look4sat-privacy-policy/home">Политика конфиденциальности.</a>
|
||||
<string name="outro_license"><a href="https://sites.google.com/view/look4sat-privacy-policy/home">Политика конфиденциальности.</a>
|
||||
\nЭто ПО поставляется без гарантий. \nПодробности в лицензии <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU GPLv3</a>.
|
||||
</string>
|
||||
</resources>
|
||||
|
|
|
@ -1,19 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="themeAccent">#FFE082</color>
|
||||
<color name="themeLight">#D6FFFFFF</color>
|
||||
<color name="themeGrey">#99FFFFFF</color>
|
||||
<color name="themeDisabled">#5CFFFFFF</color>
|
||||
<color name="themeDark">#121212</color>
|
||||
<color name="surfaceIcon">#404040</color>
|
||||
<color name="surfaceTop">#383838</color>
|
||||
<color name="surfaceChip">#303030</color>
|
||||
<color name="surfaceButton">#242424</color>
|
||||
<color name="surfaceToolbar">#1A1A1A</color>
|
||||
<color name="bottomAppBar">#1A1A1A</color>
|
||||
<color name="surfaceSystem">#1A1A1A</color>
|
||||
<color name="surfaceCard">#1A1A1A</color>
|
||||
<color name="surfaceBg">#121212</color>
|
||||
<color name="mapInfoLayout">#B3181818</color>
|
||||
<color name="transparent">@android:color/transparent</color>
|
||||
<color name="accent">#FFE082</color>
|
||||
<color name="textMain">#CCFFFFFF</color>
|
||||
<color name="textDisabled">#66FFFFFF</color>
|
||||
<color name="buttonRegular">#242424</color>
|
||||
<color name="systemBar">#1A1A1A</color>
|
||||
<color name="toolbar">#1A1A1A</color>
|
||||
<color name="cardRegular">#1A1A1A</color>
|
||||
<color name="bottomBar">#1A1A1A</color>
|
||||
<color name="background">#121212</color>
|
||||
<color name="transparent">#00000000</color>
|
||||
</resources>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name" translatable="false">Look4Sat</string>
|
||||
<string name="app_name">Look4Sat</string>
|
||||
<string name="app_version">Version: %s</string>
|
||||
<string name="app_subtitle">Satellite tracker and pass predictor</string>
|
||||
|
||||
<string name="btn_add">Add</string>
|
||||
<string name="btn_accept">Accept</string>
|
||||
|
@ -30,28 +32,20 @@
|
|||
<string name="fmt_entries">Satellites: %s</string>
|
||||
<string name="fmt_radios">Transceivers: %s</string>
|
||||
|
||||
<string name="downlink">Downlink</string>
|
||||
<string name="uplink">Uplink</string>
|
||||
|
||||
<string name="yes">Yes</string>
|
||||
<string name="no">No</string>
|
||||
|
||||
<string name="menu_satellites">Satellites</string>
|
||||
<string name="menu_passes">Passes</string>
|
||||
<string name="menu_radar">Radar</string>
|
||||
<string name="menu_map">World Map</string>
|
||||
<string name="menu_settings">Settings</string>
|
||||
|
||||
<string name="sources_title">Manage data sources</string>
|
||||
<string name="sources_hint">HTTPS Source</string>
|
||||
|
||||
<string name="entries_title">Satellites</string>
|
||||
<string name="entries_update">TLE data update:</string>
|
||||
<string name="entries_modes">Select modulation type</string>
|
||||
<string name="entries_search_hint">Search by Name / Id</string>
|
||||
<string name="entries_select_all">Select All/None</string>
|
||||
<string name="entries_update_error">Error importing satellite data</string>
|
||||
|
||||
<string name="modes_title">Choose transceiver mode</string>
|
||||
|
||||
<string name="timer_zero" translatable="false">00:00:00</string>
|
||||
<string name="timer_placeholder" translatable="false">-</string>
|
||||
|
||||
<string name="passes_error">No upcoming passes</string>
|
||||
|
||||
|
@ -115,18 +109,10 @@
|
|||
<string name="pref_hours_ahead_summary">Show passes that occur within X hours</string>
|
||||
<string name="pref_hours_ahead_input_error">Set the value between 1h and 168h</string>
|
||||
<string name="pref_min_el_key" translatable="false">minEl</string>
|
||||
<string name="pref_min_el_hint">Minimum elevation</string>
|
||||
<string name="pref_min_el_hint">Minimal elevation</string>
|
||||
<string name="pref_min_el_summary">Show passes with max elevation above</string>
|
||||
<string name="pref_min_el_input_error">Set the value between 0° and 90°</string>
|
||||
|
||||
<string name="settings_title">Settings</string>
|
||||
|
||||
<string name="about_version">Version: %s</string>
|
||||
<string name="about_subtitle">Satellite tracker and pass predictor</string>
|
||||
<string name="about_github" translatable="false">GitHub</string>
|
||||
<string name="about_support">Support</string>
|
||||
<string name="about_fdroid" translatable="false">F-Droid</string>
|
||||
|
||||
<string name="location_title">Station position</string>
|
||||
<string name="location_lat">Latitude: %.4f°</string>
|
||||
<string name="location_lon">Longitude: %.4f°</string>
|
||||
|
@ -150,24 +136,21 @@
|
|||
<string name="tracking_port_invalid">Please enter a port between 1024 to 65535</string>
|
||||
|
||||
<string name="update_title">Satellite data update</string>
|
||||
<string name="update_web">Web</string>
|
||||
<string name="update_file">File</string>
|
||||
<string name="update_clear">Clear</string>
|
||||
<string name="update_error">Update completed with errors</string>
|
||||
|
||||
<string name="warranty_title">I would like to say thanks to:</string>
|
||||
<string name="warranty_thanks"> • You for downloading and using Look4Sat! \nMay your sky always be clear!
|
||||
<string name="outro_title">I would like to say thanks to:</string>
|
||||
<string name="outro_thanks"> • You for downloading and using Look4Sat! \nMay your sky always be clear!
|
||||
\n • <a href="https://github.com/g4dpz">David A. B. Johnson</a>
|
||||
and <a href="https://github.com/davidmoten">Dave Moten</a> for creating predict4java lib
|
||||
under the <a href="https://gnu.org/licenses/old-licenses/gpl-2.0.en.html">GNU GPLv2</a>
|
||||
under the <a href="https://gnu.org/licenses/old-licenses/gpl-2.0.en.html">GNU GPLv2</a>.
|
||||
\n • <a href="https://github.com/csete">Alexandru Csete</a> for creating Gpredict
|
||||
satellite tracker that inspired the creation of Look4Sat
|
||||
satellite tracker that inspired the creation of Look4Sat.
|
||||
\n • <a href="https://celestrak.com/webmaster.php">Dr T.S. Kelso</a> for maintaining his
|
||||
<a href="https://celestrak.com/">Celestrak</a> website that provides access to the TLE data
|
||||
<a href="https://celestrak.com/">Celestrak</a> website that provides access to the TLE data.
|
||||
\n • <a href="https://libre.space/">Libre Space Foundation</a> for their
|
||||
<a href="https://db.satnogs.org/">SatNOGS</a> API and DB providing a huge amount of satellite data
|
||||
<a href="https://db.satnogs.org/">SatNOGS</a> API and DB providing a huge amount of satellite data.
|
||||
</string>
|
||||
<string name="warranty_license"><a href="https://sites.google.com/view/look4sat-privacy-policy/home">Privacy Policy.</a>
|
||||
<string name="outro_license"><a href="https://sites.google.com/view/look4sat-privacy-policy/home">Privacy Policy.</a>
|
||||
The app comes with no warranty. \nSee the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU GPLv3</a> license for details.
|
||||
</string>
|
||||
</resources>
|
||||
|
|
|
@ -3,27 +3,22 @@
|
|||
<style name="Theme.Look4Sat.SplashScreen" parent="Theme.SplashScreen">
|
||||
<item name="android:forceDarkAllowed" tools:targetApi="q">false</item>
|
||||
<item name="postSplashScreenTheme">@style/Theme.Look4Sat.Main</item>
|
||||
<item name="windowSplashScreenBackground">@color/surfaceBg</item>
|
||||
<item name="windowSplashScreenBackground">@color/background</item>
|
||||
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_splash</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Look4Sat.Main" parent="Theme.Material3.Dark.NoActionBar">
|
||||
<item name="colorAccent">@color/themeAccent</item>
|
||||
<item name="colorControlNormal">@color/themeLight</item>
|
||||
<item name="colorPrimary">@color/themeAccent</item>
|
||||
<item name="colorSecondary">@color/themeAccent</item>
|
||||
<!-- Bottom bar colors-->
|
||||
<item name="colorOnSecondaryContainer">@color/themeLight</item>
|
||||
<item name="colorOnPrimaryContainer">@color/surfaceBg</item>
|
||||
<item name="colorOnSurfaceVariant">@color/themeLight</item>
|
||||
<item name="colorSecondaryContainer">@color/surfaceIcon</item>
|
||||
<!-- -->
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
<item name="colorControlNormal">@color/textMain</item>
|
||||
<item name="colorPrimary">@color/accent</item>
|
||||
<item name="colorSecondary">@color/accent</item>
|
||||
<item name="colorOnPrimaryContainer">@color/background</item>
|
||||
<item name="android:forceDarkAllowed" tools:targetApi="q">false</item>
|
||||
<item name="android:listDivider">@drawable/item_divider</item>
|
||||
<item name="android:navigationBarColor">@color/surfaceBg</item>
|
||||
<item name="android:textColorPrimary">@color/themeLight</item>
|
||||
<item name="android:statusBarColor">@color/surfaceBg</item>
|
||||
<item name="android:windowBackground">@color/surfaceBg</item>
|
||||
<item name="android:navigationBarColor">@color/background</item>
|
||||
<item name="android:textColorPrimary">@color/textMain</item>
|
||||
<item name="android:statusBarColor">@color/background</item>
|
||||
<item name="android:windowBackground">@color/background</item>
|
||||
</style>
|
||||
|
||||
<style name="Toolbar">
|
||||
|
@ -33,7 +28,7 @@
|
|||
<item name="android:layout_marginStart">@dimen/view_default_margin</item>
|
||||
<item name="android:layout_marginTop">@dimen/view_default_margin</item>
|
||||
<item name="android:layout_marginEnd">@dimen/view_default_margin</item>
|
||||
<item name="cardBackgroundColor">@color/surfaceToolbar</item>
|
||||
<item name="cardBackgroundColor">@color/toolbar</item>
|
||||
<item name="cardCornerRadius">@dimen/card_corner_high</item>
|
||||
<item name="cardElevation">@dimen/card_elev_low</item>
|
||||
</style>
|
||||
|
@ -42,7 +37,7 @@
|
|||
<item name="android:layout_width">@dimen/toolbar_icon_size</item>
|
||||
<item name="android:layout_height">@dimen/toolbar_icon_size</item>
|
||||
<item name="android:background">?actionBarItemBackground</item>
|
||||
<item name="android:tint">@color/themeLight</item>
|
||||
<item name="android:tint">@color/textMain</item>
|
||||
</style>
|
||||
|
||||
<style name="ToolbarTimer">
|
||||
|
@ -51,7 +46,7 @@
|
|||
<item name="android:layout_gravity">center</item>
|
||||
<item name="android:includeFontPadding">false</item>
|
||||
<item name="android:text">@string/timer_zero</item>
|
||||
<item name="android:textColor">@color/themeAccent</item>
|
||||
<item name="android:textColor">@color/accent</item>
|
||||
<item name="android:textSize">@dimen/text_size_app_timer</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
@ -63,30 +58,30 @@
|
|||
<item name="android:background">@color/transparent</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:includeFontPadding">false</item>
|
||||
<item name="android:textColor">@color/themeAccent</item>
|
||||
<item name="android:textColorHint">@color/themeAccent</item>
|
||||
<item name="android:textColor">@color/accent</item>
|
||||
<item name="android:textColorHint">@color/accent</item>
|
||||
<item name="android:textSize">@dimen/text_size_large</item>
|
||||
</style>
|
||||
|
||||
<style name="FloatingActionButton">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:backgroundTint">@color/themeAccent</item>
|
||||
<item name="android:backgroundTint">@color/accent</item>
|
||||
</style>
|
||||
|
||||
<style name="NormalButton" parent="Widget.Material3.Button.IconButton">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:backgroundTint">@color/surfaceButton</item>
|
||||
<item name="android:backgroundTint">@color/buttonRegular</item>
|
||||
<item name="android:ellipsize">end</item>
|
||||
<item name="android:minWidth">96dp</item>
|
||||
<item name="android:maxLines">1</item>
|
||||
<item name="android:textAllCaps">false</item>
|
||||
<item name="android:textColor">@color/themeLight</item>
|
||||
<item name="android:textColor">@color/textMain</item>
|
||||
<item name="android:textSize">@dimen/text_size_medium</item>
|
||||
<item name="cornerRadius">@dimen/btn_corner_high</item>
|
||||
<item name="iconTint">@color/themeLight</item>
|
||||
<item name="rippleColor">@color/themeLight</item>
|
||||
<item name="iconTint">@color/textMain</item>
|
||||
<item name="rippleColor">@color/textMain</item>
|
||||
</style>
|
||||
|
||||
<style name="RadioFreq">
|
||||
|
@ -94,7 +89,7 @@
|
|||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:includeFontPadding">false</item>
|
||||
<item name="android:text">@string/trans_link_low</item>
|
||||
<item name="android:textColor">@color/themeAccent</item>
|
||||
<item name="android:textColor">@color/accent</item>
|
||||
<item name="android:textSize">@dimen/text_size_frequency</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
@ -113,7 +108,7 @@
|
|||
<style name="RecyclerItemCard">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="cardBackgroundColor">@color/surfaceCard</item>
|
||||
<item name="cardBackgroundColor">@color/cardRegular</item>
|
||||
<item name="cardCornerRadius">@dimen/card_corner_low</item>
|
||||
<item name="cardElevation">@dimen/card_elev_low</item>
|
||||
</style>
|
||||
|
@ -121,7 +116,7 @@
|
|||
<style name="SurfaceCard">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="cardBackgroundColor">@color/surfaceCard</item>
|
||||
<item name="cardBackgroundColor">@color/cardRegular</item>
|
||||
<item name="cardCornerRadius">@dimen/card_corner_high</item>
|
||||
<item name="cardElevation">@dimen/card_elev_low</item>
|
||||
</style>
|
||||
|
@ -130,7 +125,7 @@
|
|||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">@dimen/bottom_bar_size</item>
|
||||
<item name="android:layout_gravity">bottom</item>
|
||||
<item name="android:backgroundTint">@color/bottomAppBar</item>
|
||||
<item name="android:backgroundTint">@color/bottomBar</item>
|
||||
<item name="contentInsetStart">@dimen/bottom_bar_inset</item>
|
||||
<item name="contentInsetEnd">@dimen/bottom_bar_inset</item>
|
||||
<item name="fabCradleMargin">@dimen/view_default_margin</item>
|
||||
|
@ -139,44 +134,29 @@
|
|||
|
||||
<style name="WorldMapText">
|
||||
<item name="android:textSize">@dimen/text_size_medium</item>
|
||||
<item name="android:textColor">@color/themeLight</item>
|
||||
<item name="android:textColor">@color/textMain</item>
|
||||
</style>
|
||||
|
||||
<style name="WorldMapTitle">
|
||||
<item name="android:textSize">@dimen/text_size_medium</item>
|
||||
<item name="android:textColor">@color/themeLight</item>
|
||||
<item name="android:textColor">@color/textMain</item>
|
||||
</style>
|
||||
|
||||
<style name="SettingsText">
|
||||
<item name="android:textSize">@dimen/text_size_medium</item>
|
||||
<item name="android:textColor">@color/themeLight</item>
|
||||
<item name="android:textColor">@color/textMain</item>
|
||||
</style>
|
||||
|
||||
<style name="SettingsTitle">
|
||||
<item name="android:includeFontPadding">false</item>
|
||||
<item name="android:textSize">@dimen/text_size_medium</item>
|
||||
<item name="android:textColor">@color/themeAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="DialogButton">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:backgroundTint">@color/surfaceButton</item>
|
||||
<item name="android:ellipsize">end</item>
|
||||
<item name="android:minWidth">96dp</item>
|
||||
<item name="android:maxLines">1</item>
|
||||
<item name="android:textAllCaps">false</item>
|
||||
<item name="android:textColor">@color/themeLight</item>
|
||||
<item name="android:textSize">@dimen/text_size_medium</item>
|
||||
<item name="cornerRadius">@dimen/btn_corner_high</item>
|
||||
<item name="iconTint">@color/themeLight</item>
|
||||
<item name="rippleColor">@color/themeLight</item>
|
||||
<item name="android:textColor">@color/accent</item>
|
||||
</style>
|
||||
|
||||
<style name="DialogText">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:textColor">@color/themeLight</item>
|
||||
<item name="android:textColor">@color/textMain</item>
|
||||
<item name="android:textSize">@dimen/text_size_medium</item>
|
||||
</style>
|
||||
|
||||
|
|
|
@ -25,27 +25,28 @@ import java.nio.channels.SocketChannel
|
|||
class DataReporter(reporterDispatcher: CoroutineDispatcher) {
|
||||
|
||||
private val reporterScope = CoroutineScope(reporterDispatcher)
|
||||
private var frequencySocketChannel: SocketChannel? = null
|
||||
private var rotationSocketChannel: SocketChannel? = null
|
||||
private var frequencyReporting: Job? = null
|
||||
private var rotationReporting: Job? = null
|
||||
|
||||
fun reportFrequency(server: String, port: Int, frequency: Long) {
|
||||
frequencyReporting = reporterScope.launch {
|
||||
runCatching {
|
||||
if (frequencySocketChannel == null) {
|
||||
frequencySocketChannel = SocketChannel.open(InetSocketAddress(server, port))
|
||||
} else {
|
||||
val buffer = ByteBuffer.wrap("\\set_freq $frequency\n".toByteArray())
|
||||
frequencySocketChannel?.write(buffer)
|
||||
}
|
||||
}.onFailure { error ->
|
||||
println(error.localizedMessage)
|
||||
frequencySocketChannel = null
|
||||
frequencyReporting?.cancelAndJoin()
|
||||
}
|
||||
}
|
||||
}
|
||||
// private var frequencySocketChannel: SocketChannel? = null
|
||||
// private var frequencyReporting: Job? = null
|
||||
//
|
||||
// fun reportFrequency(server: String, port: Int, frequency: Long) {
|
||||
// frequencyReporting = reporterScope.launch {
|
||||
// runCatching {
|
||||
// if (frequencySocketChannel == null) {
|
||||
// frequencySocketChannel = SocketChannel.open(InetSocketAddress(server, port))
|
||||
// } else {
|
||||
// val buffer = ByteBuffer.wrap("\\set_freq $frequency\n".toByteArray())
|
||||
// frequencySocketChannel?.write(buffer)
|
||||
// }
|
||||
// }.onFailure { error ->
|
||||
// println(error.localizedMessage)
|
||||
// frequencySocketChannel = null
|
||||
// frequencyReporting?.cancelAndJoin()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
fun reportRotation(server: String, port: Int, azimuth: Double, elevation: Double) {
|
||||
rotationReporting = reporterScope.launch {
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
package com.rtbishop.look4sat.domain
|
||||
|
||||
import java.net.InetSocketAddress
|
||||
import java.net.Socket
|
||||
import java.security.MessageDigest
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.regex.Pattern
|
||||
|
||||
fun Long.toTimerString(): String {
|
||||
val format = "%02d:%02d:%02d"
|
||||
val hours = TimeUnit.MILLISECONDS.toHours(this)
|
||||
val minutes = TimeUnit.MILLISECONDS.toMinutes(this) % 60
|
||||
val seconds = TimeUnit.MILLISECONDS.toSeconds(this) % 60
|
||||
return String.format(format, hours, minutes, seconds)
|
||||
}
|
||||
|
||||
fun Double.round(decimals: Int): Double {
|
||||
var multiplier = 1.0
|
||||
repeat(decimals) { multiplier *= 10 }
|
||||
return kotlin.math.round(this * multiplier) / multiplier
|
||||
}
|
||||
|
||||
fun String.getHash(type: String = "SHA-256"): String {
|
||||
val hexChars = "0123456789ABCDEF"
|
||||
val bytes = MessageDigest.getInstance(type).digest(this.toByteArray())
|
||||
val result = StringBuilder(bytes.size * 2)
|
||||
bytes.forEach {
|
||||
val i = it.toInt()
|
||||
result.append(hexChars[i shr 4 and 0x0f])
|
||||
result.append(hexChars[i and 0x0f])
|
||||
}
|
||||
return result.toString()
|
||||
}
|
||||
|
||||
fun String.isValidEmail(): Boolean {
|
||||
val expression = "^[\\w.-]+@([\\w\\-]+\\.)+[A-Z]{2,8}$"
|
||||
val pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE)
|
||||
return pattern.matcher(this).matches()
|
||||
}
|
||||
|
||||
fun String.isValidIPv4(): Boolean {
|
||||
val ip4 = "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\.(?!\$)|\$)){4}\$"
|
||||
return this.matches(ip4.toRegex())
|
||||
}
|
||||
|
||||
fun String.isValidPort(): Boolean {
|
||||
return this.isNotEmpty() && this.toInt() in 1024..65535
|
||||
}
|
||||
|
||||
fun ping(hostname: String, port: Int): Int {
|
||||
val start = System.currentTimeMillis()
|
||||
val socket = Socket()
|
||||
try {
|
||||
socket.connect(InetSocketAddress(hostname, port), 5000)
|
||||
socket.close()
|
||||
} catch (exception: Exception) {
|
||||
exception.printStackTrace()
|
||||
println("Failed to ping: $hostname")
|
||||
return Int.MAX_VALUE
|
||||
}
|
||||
return (System.currentTimeMillis() - start).toInt()
|
||||
}
|
|
@ -18,7 +18,6 @@
|
|||
package com.rtbishop.look4sat.domain
|
||||
|
||||
import com.rtbishop.look4sat.domain.predict.GeoPos
|
||||
import kotlin.math.round
|
||||
|
||||
object QthConverter {
|
||||
|
||||
|
@ -59,10 +58,4 @@ object QthConverter {
|
|||
fun isValidLocator(locator: String): Boolean {
|
||||
return locator.matches("[a-xA-X][a-xA-X][0-9][0-9][a-xA-X][a-xA-X]".toRegex())
|
||||
}
|
||||
|
||||
fun Double.round(decimals: Int): Double {
|
||||
var multiplier = 1.0
|
||||
repeat(decimals) { multiplier *= 10 }
|
||||
return round(this * multiplier) / multiplier
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue