Moved and renamed several classes
This commit is contained in:
1 parent
f295b3b224
commit
1fafd04190
43 files changed
+424
-403
No files matched your search
+3
-3
@@ -17,9 +17,9 @@ android {
|
||||
versionCode 254
|
||||
versionName "2.5.4"
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
|
||||
kapt {
|
||||
arguments {
|
||||
arg("room.schemaLocation", "$projectDir/schemas")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,19 +33,19 @@ object Converters {
|
||||
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun tleToString(tle: TLE): String {
|
||||
fun paramsToString(tle: TLE): String {
|
||||
return paramsAdapter.toJson(tle)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun tleFromString(string: String): TLE? {
|
||||
fun paramsFromString(string: String): TLE? {
|
||||
return paramsAdapter.fromJson(string)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun satFromString(string: String): Satellite? {
|
||||
fun satelliteFromString(string: String): Satellite? {
|
||||
return paramsAdapter.fromJson(string)?.createSat()
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ class Look4SatActivity : AppCompatActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
val binding = ActivityMainBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
val navHost = supportFragmentManager.findFragmentById(R.id.nav_host) as NavHostFragment
|
||||
binding.navBottom.setupWithNavController(navHost.navController)
|
||||
val navHost = supportFragmentManager.findFragmentById(R.id.main_nav_host) as NavHostFragment
|
||||
binding.mainNavBottom.setupWithNavController(navHost.navController)
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -15,17 +15,17 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.satItemScreen
|
||||
package com.rtbishop.look4sat.presentation.entriesScreen
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.AsyncListDiffer
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.rtbishop.look4sat.databinding.SatItemBinding
|
||||
import com.rtbishop.look4sat.data.SatItem
|
||||
import com.rtbishop.look4sat.databinding.ItemEntryBinding
|
||||
|
||||
class SatItemAdapter : RecyclerView.Adapter<SatItemAdapter.SatItemHolder>() {
|
||||
class EntriesAdapter : RecyclerView.Adapter<EntriesAdapter.SatItemHolder>() {
|
||||
|
||||
private val diffCallback = object : DiffUtil.ItemCallback<SatItem>() {
|
||||
override fun areItemsTheSame(oldItem: SatItem, newItem: SatItem): Boolean {
|
||||
@@ -61,12 +61,12 @@ class SatItemAdapter : RecyclerView.Adapter<SatItemAdapter.SatItemHolder>() {
|
||||
holder.bind(differ.currentList[position], clickListener)
|
||||
}
|
||||
|
||||
class SatItemHolder private constructor(private val binding: SatItemBinding) :
|
||||
class SatItemHolder private constructor(private val binding: ItemEntryBinding) :
|
||||
RecyclerView.ViewHolder(binding.root) {
|
||||
|
||||
fun bind(item: SatItem, listener: EntriesClickListener) {
|
||||
binding.satItemCheckbox.text = item.name
|
||||
binding.satItemCheckbox.isChecked = item.isSelected
|
||||
binding.entryCheckbox.text = item.name
|
||||
binding.entryCheckbox.isChecked = item.isSelected
|
||||
itemView.setOnClickListener {
|
||||
listener.updateSelection(listOf(item.catNum), item.isSelected.not())
|
||||
}
|
||||
@@ -75,7 +75,7 @@ class SatItemAdapter : RecyclerView.Adapter<SatItemAdapter.SatItemHolder>() {
|
||||
companion object {
|
||||
fun from(parent: ViewGroup): SatItemHolder {
|
||||
val inflater = LayoutInflater.from(parent.context)
|
||||
return SatItemHolder(SatItemBinding.inflate(inflater, parent, false))
|
||||
return SatItemHolder(ItemEntryBinding.inflate(inflater, parent, false))
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
-12
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.satItemScreen
|
||||
package com.rtbishop.look4sat.presentation.entriesScreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
@@ -27,8 +27,8 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.rtbishop.look4sat.R
|
||||
import com.rtbishop.look4sat.databinding.FragmentEntriesBinding
|
||||
import com.rtbishop.look4sat.data.SatItem
|
||||
import com.rtbishop.look4sat.databinding.FragmentEntriesBinding
|
||||
import com.rtbishop.look4sat.framework.model.Result
|
||||
import com.rtbishop.look4sat.utility.RecyclerDivider
|
||||
import com.rtbishop.look4sat.utility.getNavResult
|
||||
@@ -37,9 +37,9 @@ import com.rtbishop.look4sat.utility.showSnack
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@AndroidEntryPoint
|
||||
class SatItemFragment : Fragment(R.layout.fragment_entries) {
|
||||
class EntriesFragment : Fragment(R.layout.fragment_entries) {
|
||||
|
||||
private val viewModel: SatItemViewModel by viewModels()
|
||||
private val viewModel: EntriesViewModel by viewModels()
|
||||
private val contentContract = ActivityResultContracts.GetContent()
|
||||
private val filePicker = registerForActivityResult(contentContract) { uri ->
|
||||
uri?.let { viewModel.updateEntriesFromFile(uri) }
|
||||
@@ -51,7 +51,7 @@ class SatItemFragment : Fragment(R.layout.fragment_entries) {
|
||||
}
|
||||
|
||||
private fun setupComponents(view: View) {
|
||||
val entriesAdapter = SatItemAdapter().apply {
|
||||
val entriesAdapter = EntriesAdapter().apply {
|
||||
setEntriesClickListener(viewModel)
|
||||
}
|
||||
val binding = FragmentEntriesBinding.bind(view).apply {
|
||||
@@ -62,13 +62,13 @@ class SatItemFragment : Fragment(R.layout.fragment_entries) {
|
||||
(itemAnimator as SimpleItemAnimator).supportsChangeAnimations = false
|
||||
addItemDecoration(RecyclerDivider(R.drawable.rec_divider_light))
|
||||
}
|
||||
importWeb.setOnClickListener {
|
||||
entriesImportWeb.setOnClickListener {
|
||||
findNavController().navigateSafe(R.id.action_entries_to_sources)
|
||||
}
|
||||
importFile.setOnClickListener { filePicker.launch("*/*") }
|
||||
selectMode.setOnClickListener { showModesDialog() }
|
||||
selectAll.setOnClickListener { viewModel.selectCurrentItems() }
|
||||
searchBar.setOnQueryTextListener(viewModel)
|
||||
entriesImportFile.setOnClickListener { filePicker.launch("*/*") }
|
||||
entriesSelectMode.setOnClickListener { showModesDialog() }
|
||||
entriesSelectAll.setOnClickListener { viewModel.selectCurrentItems() }
|
||||
entriesSearchBar.setOnQueryTextListener(viewModel)
|
||||
}
|
||||
viewModel.satData.observe(viewLifecycleOwner, { satData ->
|
||||
handleSatData(satData, binding, entriesAdapter)
|
||||
@@ -81,11 +81,11 @@ class SatItemFragment : Fragment(R.layout.fragment_entries) {
|
||||
private fun handleSatData(
|
||||
result: Result<List<SatItem>>,
|
||||
binding: FragmentEntriesBinding,
|
||||
satItemAdapter: SatItemAdapter
|
||||
entriesAdapter: EntriesAdapter
|
||||
) {
|
||||
when (result) {
|
||||
is Result.Success -> {
|
||||
satItemAdapter.submitList(result.data)
|
||||
entriesAdapter.submitList(result.data)
|
||||
binding.entriesProgress.visibility = View.INVISIBLE
|
||||
binding.entriesRecycler.visibility = View.VISIBLE
|
||||
}
|
||||
+3
-3
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.satItemScreen
|
||||
package com.rtbishop.look4sat.presentation.entriesScreen
|
||||
|
||||
import android.content.ContentResolver
|
||||
import android.net.Uri
|
||||
@@ -32,11 +32,11 @@ import java.util.*
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltViewModel
|
||||
class SatItemViewModel @Inject constructor(
|
||||
class EntriesViewModel @Inject constructor(
|
||||
private val preferencesSource: PreferencesSource,
|
||||
private val resolver: ContentResolver,
|
||||
private val satelliteRepo: SatelliteRepo,
|
||||
) : ViewModel(), SatItemAdapter.EntriesClickListener, SearchView.OnQueryTextListener {
|
||||
) : ViewModel(), EntriesAdapter.EntriesClickListener, SearchView.OnQueryTextListener {
|
||||
|
||||
private val transModes = MutableLiveData(satelliteRepo.loadSelectedModes())
|
||||
private val currentQuery = MutableLiveData(String())
|
||||
+5
-5
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.appInfoScreen
|
||||
package com.rtbishop.look4sat.presentation.infoScreen
|
||||
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
@@ -27,20 +27,20 @@ import com.rtbishop.look4sat.BuildConfig
|
||||
import com.rtbishop.look4sat.R
|
||||
import com.rtbishop.look4sat.databinding.FragmentInfoBinding
|
||||
|
||||
class AppInfoFragment : Fragment(R.layout.fragment_info) {
|
||||
class InfoFragment : Fragment(R.layout.fragment_info) {
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
FragmentInfoBinding.bind(view).apply {
|
||||
infoVersion.text =
|
||||
String.format(getString(R.string.info_version), BuildConfig.VERSION_NAME)
|
||||
infoGithub.setOnClickListener {
|
||||
infoBtnGithub.setOnClickListener {
|
||||
gotoUrl("https://github.com/rt-bishop/Look4Sat/")
|
||||
}
|
||||
infoFdroid.setOnClickListener {
|
||||
infoBtnFdroid.setOnClickListener {
|
||||
gotoUrl("https://f-droid.org/en/packages/com.rtbishop.look4sat/")
|
||||
}
|
||||
infoBmc.setOnClickListener {
|
||||
infoBtnDonate.setOnClickListener {
|
||||
gotoUrl("https://www.buymeacoffee.com/rtbishop")
|
||||
}
|
||||
val moveMethod = LinkMovementMethod.getInstance()
|
||||
+2
-2
@@ -15,12 +15,12 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.data
|
||||
package com.rtbishop.look4sat.presentation.mapScreen
|
||||
|
||||
import com.rtbishop.look4sat.domain.GeoPos
|
||||
import com.rtbishop.look4sat.domain.Satellite
|
||||
|
||||
data class SatData(
|
||||
data class MapData(
|
||||
val pass: Satellite,
|
||||
val catNum: Int,
|
||||
val name: String,
|
||||
+17
-16
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.satMapScreen
|
||||
package com.rtbishop.look4sat.presentation.mapScreen
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.Color
|
||||
@@ -31,7 +31,6 @@ import com.rtbishop.look4sat.R
|
||||
import com.rtbishop.look4sat.databinding.FragmentMapBinding
|
||||
import com.rtbishop.look4sat.domain.GeoPos
|
||||
import com.rtbishop.look4sat.domain.Satellite
|
||||
import com.rtbishop.look4sat.data.SatData
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import org.osmdroid.config.Configuration
|
||||
import org.osmdroid.tileprovider.tilesource.TileSourceFactory
|
||||
@@ -44,12 +43,12 @@ import java.util.*
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class SatMapFragment : Fragment(R.layout.fragment_map) {
|
||||
class MapFragment : Fragment(R.layout.fragment_map) {
|
||||
|
||||
@Inject
|
||||
lateinit var sharedPreferences: SharedPreferences
|
||||
|
||||
private val viewModel: SatMapViewModel by viewModels()
|
||||
private val viewModel: MapViewModel by viewModels()
|
||||
private val minLat = MapView.getTileSystem().minLatitude
|
||||
private val maxLat = MapView.getTileSystem().maxLatitude
|
||||
private val trackPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||
@@ -83,8 +82,8 @@ class SatMapFragment : Fragment(R.layout.fragment_map) {
|
||||
overlays.addAll(Array(4) { FolderOverlay() })
|
||||
}
|
||||
}
|
||||
binding.fabPrev.setOnClickListener { viewModel.scrollSelection(true) }
|
||||
binding.fabNext.setOnClickListener { viewModel.scrollSelection(false) }
|
||||
binding.mapBtnPrev.setOnClickListener { viewModel.scrollSelection(true) }
|
||||
binding.mapBtnNext.setOnClickListener { viewModel.scrollSelection(false) }
|
||||
setupObservers(binding)
|
||||
}
|
||||
|
||||
@@ -93,7 +92,7 @@ class SatMapFragment : Fragment(R.layout.fragment_map) {
|
||||
viewModel.satPositions.observe(viewLifecycleOwner, { renderSatPositions(it, binding) })
|
||||
viewModel.satTrack.observe(viewLifecycleOwner, { renderSatTrack(it, binding) })
|
||||
viewModel.satFootprint.observe(viewLifecycleOwner, { renderSatFootprint(it, binding) })
|
||||
viewModel.satData.observe(viewLifecycleOwner, { renderSatData(it, binding) })
|
||||
viewModel.mapData.observe(viewLifecycleOwner, { renderSatData(it, binding) })
|
||||
}
|
||||
|
||||
private fun renderStationPos(stationPos: GeoPos, binding: FragmentMapBinding) {
|
||||
@@ -183,16 +182,18 @@ class SatMapFragment : Fragment(R.layout.fragment_map) {
|
||||
binding.mapView.overlays[2] = footprintOverlay
|
||||
}
|
||||
|
||||
private fun renderSatData(satData: SatData, binding: FragmentMapBinding) {
|
||||
private fun renderSatData(mapData: MapData, binding: FragmentMapBinding) {
|
||||
binding.apply {
|
||||
idName.text =
|
||||
String.format(getString(R.string.pat_osm_idName), satData.catNum, satData.name)
|
||||
qthLocator.text = String.format(getString(R.string.map_qth), satData.qthLoc)
|
||||
altitude.text = String.format(getString(R.string.pat_altitude), satData.altitude)
|
||||
distance.text = String.format(getString(R.string.pat_distance), satData.range)
|
||||
velocity.text = String.format(getString(R.string.pat_osm_vel), satData.velocity)
|
||||
mapLat.text = String.format(getString(R.string.pat_osm_lat), satData.osmPos.latitude)
|
||||
mapLon.text = String.format(getString(R.string.pat_osm_lon), satData.osmPos.longitude)
|
||||
mapDataName.text =
|
||||
String.format(getString(R.string.pat_osm_idName), mapData.catNum, mapData.name)
|
||||
mapDataQth.text = String.format(getString(R.string.map_qth), mapData.qthLoc)
|
||||
mapDataAlt.text = String.format(getString(R.string.pat_altitude), mapData.altitude)
|
||||
mapDataDst.text = String.format(getString(R.string.pat_distance), mapData.range)
|
||||
mapDataVel.text = String.format(getString(R.string.pat_osm_vel), mapData.velocity)
|
||||
mapDataLat.text =
|
||||
String.format(getString(R.string.pat_osm_lat), mapData.osmPos.latitude)
|
||||
mapDataLon.text =
|
||||
String.format(getString(R.string.pat_osm_lon), mapData.osmPos.longitude)
|
||||
}
|
||||
binding.mapView.invalidate()
|
||||
}
|
||||
+5
-6
@@ -15,12 +15,11 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.satMapScreen
|
||||
package com.rtbishop.look4sat.presentation.mapScreen
|
||||
|
||||
import androidx.lifecycle.*
|
||||
import com.rtbishop.look4sat.domain.Predictor
|
||||
import com.rtbishop.look4sat.data.PreferencesSource
|
||||
import com.rtbishop.look4sat.data.SatData
|
||||
import com.rtbishop.look4sat.data.SatelliteRepo
|
||||
import com.rtbishop.look4sat.domain.*
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
@@ -31,7 +30,7 @@ import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
@HiltViewModel
|
||||
class SatMapViewModel @Inject constructor(
|
||||
class MapViewModel @Inject constructor(
|
||||
private val satelliteRepo: SatelliteRepo,
|
||||
private val predictor: Predictor,
|
||||
private val preferences: PreferencesSource,
|
||||
@@ -54,8 +53,8 @@ class SatMapViewModel @Inject constructor(
|
||||
private val _satFootprint = MutableLiveData<List<GeoPos>>()
|
||||
val satFootprint: LiveData<List<GeoPos>> = _satFootprint
|
||||
|
||||
private val _satData = MutableLiveData<SatData>()
|
||||
val satData: LiveData<SatData> = this._satData
|
||||
private val _satData = MutableLiveData<MapData>()
|
||||
val mapData: LiveData<MapData> = this._satData
|
||||
|
||||
private val _satPositions = MutableLiveData<Map<Satellite, GeoPos>>()
|
||||
val satPositions: LiveData<Map<Satellite, GeoPos>> = _satPositions
|
||||
@@ -162,7 +161,7 @@ class SatMapViewModel @Inject constructor(
|
||||
val osmLon = clipLon(Math.toDegrees(satPos.longitude))
|
||||
val osmPos = GeoPos(osmLat, osmLon)
|
||||
val qthLoc = QthConverter.positionToQTH(osmPos.latitude, osmPos.longitude) ?: "-- --"
|
||||
val satData = SatData(
|
||||
val satData = MapData(
|
||||
satellite, satellite.params.catnum, satellite.params.name, satPos.range,
|
||||
satPos.altitude, satPos.getOrbitalVelocity(), qthLoc, osmPos
|
||||
)
|
||||
+10
-10
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.satPassScreen
|
||||
package com.rtbishop.look4sat.presentation.passesScreen
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
@@ -29,7 +29,7 @@ import com.rtbishop.look4sat.domain.SatPass
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
class SatPassAdapter(private val isUTC: Boolean, private val clickListener: PassesClickListener) :
|
||||
class PassesAdapter(private val isUTC: Boolean, private val clickListener: PassesClickListener) :
|
||||
RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
|
||||
private val diffCallback = object : DiffUtil.ItemCallback<SatPass>() {
|
||||
@@ -94,13 +94,13 @@ class SatPassAdapter(private val isUTC: Boolean, private val clickListener: Pass
|
||||
startFormat.timeZone = timeZoneUTC
|
||||
endFormat.timeZone = timeZoneUTC
|
||||
}
|
||||
passLeoSatName.text = satPass.name
|
||||
passLeoSatId.text = String.format(satIdFormat, satPass.catNum)
|
||||
passLeoAosAz.text = String.format(aosAzFormat, satPass.aosAzimuth)
|
||||
passLeoMaxEl.text = String.format(maxElFormat, satPass.maxElevation)
|
||||
passLeoLosAz.text = String.format(losAzFormat, satPass.losAzimuth)
|
||||
passLeoName.text = satPass.name
|
||||
passLeoId.text = String.format(satIdFormat, satPass.catNum)
|
||||
passLeoAos.text = String.format(aosAzFormat, satPass.aosAzimuth)
|
||||
passLeoElev.text = String.format(maxElFormat, satPass.maxElevation)
|
||||
passLeoLos.text = String.format(losAzFormat, satPass.losAzimuth)
|
||||
passLeoStart.text = startFormat.format(Date(satPass.aosTime))
|
||||
passLeoTcaAz.text = String.format(tcaAzFormat, satPass.tcaAzimuth)
|
||||
passLeoTca.text = String.format(tcaAzFormat, satPass.tcaAzimuth)
|
||||
passLeoEnd.text = endFormat.format(Date(satPass.losTime))
|
||||
passLeoProgress.progress = satPass.progress
|
||||
}
|
||||
@@ -128,8 +128,8 @@ class SatPassAdapter(private val isUTC: Boolean, private val clickListener: Pass
|
||||
|
||||
fun bind(satPass: SatPass, listener: PassesClickListener) {
|
||||
binding.apply {
|
||||
passGeoSatName.text = satPass.name
|
||||
passGeoSatId.text = String.format(satIdFormat, satPass.catNum)
|
||||
passGeoName.text = satPass.name
|
||||
passGeoId.text = String.format(satIdFormat, satPass.catNum)
|
||||
passGeoAz.text = String.format(azFormat, satPass.tcaAzimuth)
|
||||
passGeoAlt.text = String.format(altFormat, satPass.altitude)
|
||||
passGeoEl.text = String.format(elevFormat, satPass.maxElevation)
|
||||
+11
-11
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.satPassScreen
|
||||
package com.rtbishop.look4sat.presentation.passesScreen
|
||||
|
||||
import android.Manifest
|
||||
import android.os.Bundle
|
||||
@@ -38,12 +38,12 @@ import dagger.hilt.android.AndroidEntryPoint
|
||||
import java.util.*
|
||||
|
||||
@AndroidEntryPoint
|
||||
class SatPassFragment : Fragment(R.layout.fragment_passes), SatPassAdapter.PassesClickListener {
|
||||
class PassesFragment : Fragment(R.layout.fragment_passes), PassesAdapter.PassesClickListener {
|
||||
|
||||
private val viewModel: SatPassViewModel by viewModels()
|
||||
private val passesViewModel: PassesViewModel by viewModels()
|
||||
private val permRequest = ActivityResultContracts.RequestPermission()
|
||||
private val permRequestLauncher = registerForActivityResult(permRequest) {
|
||||
viewModel.triggerInitialSetup()
|
||||
passesViewModel.triggerInitialSetup()
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
@@ -52,7 +52,7 @@ class SatPassFragment : Fragment(R.layout.fragment_passes), SatPassAdapter.Passe
|
||||
}
|
||||
|
||||
private fun setupComponents(view: View) {
|
||||
val passesAdapter = SatPassAdapter(viewModel.shouldUseUTC(), this)
|
||||
val passesAdapter = PassesAdapter(passesViewModel.shouldUseUTC(), this)
|
||||
val binding = FragmentPassesBinding.bind(view).apply {
|
||||
passesRecycler.apply {
|
||||
setHasFixedSize(true)
|
||||
@@ -62,24 +62,24 @@ class SatPassFragment : Fragment(R.layout.fragment_passes), SatPassAdapter.Passe
|
||||
(itemAnimator as SimpleItemAnimator).supportsChangeAnimations = false
|
||||
addItemDecoration(RecyclerDivider(R.drawable.rec_divider_dark))
|
||||
}
|
||||
passesRefresh.setOnClickListener { viewModel.forceCalculation() }
|
||||
passesRefresh.setOnClickListener { passesViewModel.forceCalculation() }
|
||||
}
|
||||
viewModel.passes.observe(viewLifecycleOwner, { passesResult ->
|
||||
passesViewModel.passes.observe(viewLifecycleOwner, { passesResult ->
|
||||
handleNewPasses(passesResult, passesAdapter, binding)
|
||||
})
|
||||
viewModel.isFirstLaunchDone.observe(viewLifecycleOwner, { setupDone ->
|
||||
passesViewModel.isFirstLaunchDone.observe(viewLifecycleOwner, { setupDone ->
|
||||
if (!setupDone) permRequestLauncher.launch(Manifest.permission.ACCESS_FINE_LOCATION)
|
||||
})
|
||||
}
|
||||
|
||||
private fun handleNewPasses(
|
||||
result: Result<List<SatPass>>,
|
||||
satPassAdapter: SatPassAdapter,
|
||||
passesAdapter: PassesAdapter,
|
||||
binding: FragmentPassesBinding
|
||||
) {
|
||||
when (result) {
|
||||
is Result.Success -> {
|
||||
satPassAdapter.submitList(result.data)
|
||||
passesAdapter.submitList(result.data)
|
||||
binding.apply {
|
||||
passesError.visibility = View.INVISIBLE
|
||||
passesProgress.visibility = View.INVISIBLE
|
||||
@@ -126,7 +126,7 @@ class SatPassFragment : Fragment(R.layout.fragment_passes), SatPassAdapter.Passe
|
||||
override fun navigateToPass(satPass: SatPass) {
|
||||
if (satPass.progress < 100) {
|
||||
val bundle = bundleOf("catNum" to satPass.catNum, "aosTime" to satPass.aosTime)
|
||||
findNavController().navigateSafe(R.id.action_passes_to_polar, bundle)
|
||||
findNavController().navigateSafe(R.id.action_passes_to_radar, bundle)
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.satPassScreen
|
||||
package com.rtbishop.look4sat.presentation.passesScreen
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
@@ -32,7 +32,7 @@ import kotlinx.coroutines.flow.collect
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltViewModel
|
||||
class SatPassViewModel @Inject constructor(
|
||||
class PassesViewModel @Inject constructor(
|
||||
private val satelliteRepo: SatelliteRepo,
|
||||
private val predictor: Predictor,
|
||||
private val preferencesSource: PreferencesSource
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.rtbishop.look4sat.presentation.radarScreen
|
||||
|
||||
import com.rtbishop.look4sat.domain.SatPos
|
||||
|
||||
data class RadarData(val satPos: SatPos, val satTrack: List<SatPos> = emptyList())
|
||||
+36
-33
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.satPassInfoScreen
|
||||
package com.rtbishop.look4sat.presentation.radarScreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
@@ -26,7 +26,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator
|
||||
import com.rtbishop.look4sat.R
|
||||
import com.rtbishop.look4sat.data.PreferencesSource
|
||||
import com.rtbishop.look4sat.databinding.FragmentPolarBinding
|
||||
import com.rtbishop.look4sat.databinding.FragmentRadarBinding
|
||||
import com.rtbishop.look4sat.domain.SatPass
|
||||
import com.rtbishop.look4sat.domain.SatPos
|
||||
import com.rtbishop.look4sat.utility.RecyclerDivider
|
||||
@@ -36,18 +36,18 @@ import dagger.hilt.android.AndroidEntryPoint
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class PassInfoFragment : Fragment(R.layout.fragment_polar) {
|
||||
class RadarFragment : Fragment(R.layout.fragment_radar) {
|
||||
|
||||
@Inject
|
||||
lateinit var preferences: PreferencesSource
|
||||
private val viewModel: PassInfoViewModel by viewModels()
|
||||
private var passInfoView: PassInfoView? = null
|
||||
private val viewModel: RadarViewModel by viewModels()
|
||||
private var radarView: RadarView? = null
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
FragmentPolarBinding.bind(view).apply {
|
||||
val transAdapter = SatTransAdapter()
|
||||
recycler.apply {
|
||||
FragmentRadarBinding.bind(view).apply {
|
||||
val transAdapter = TransmittersAdapter()
|
||||
radarRecycler.apply {
|
||||
setHasFixedSize(true)
|
||||
adapter = transAdapter
|
||||
isVerticalScrollBarEnabled = false
|
||||
@@ -69,33 +69,36 @@ class PassInfoFragment : Fragment(R.layout.fragment_polar) {
|
||||
viewModel.disableSensor()
|
||||
}
|
||||
|
||||
private fun setupObservers(transAdapter: SatTransAdapter, binding: FragmentPolarBinding) {
|
||||
private fun setupObservers(
|
||||
transmittersAdapter: TransmittersAdapter,
|
||||
binding: FragmentRadarBinding
|
||||
) {
|
||||
val catNum = requireArguments().getInt("catNum")
|
||||
val aosTime = requireArguments().getLong("aosTime")
|
||||
viewModel.getPass(catNum, aosTime).observe(viewLifecycleOwner) { pass ->
|
||||
passInfoView = PassInfoView(requireContext()).apply {
|
||||
radarView = RadarView(requireContext()).apply {
|
||||
setShowAim(preferences.shouldUseCompass())
|
||||
setScanning(preferences.shouldShowSweep())
|
||||
}
|
||||
binding.frame.addView(passInfoView)
|
||||
viewModel.passData.observe(viewLifecycleOwner, { passData ->
|
||||
passInfoView?.setPosition(passData.position)
|
||||
passInfoView?.setPositions(passData.positions)
|
||||
setPassText(pass, passData.position, binding)
|
||||
binding.radarFrame.addView(radarView)
|
||||
viewModel.radarData.observe(viewLifecycleOwner, { passData ->
|
||||
radarView?.setPosition(passData.satPos)
|
||||
radarView?.setPositions(passData.satTrack)
|
||||
setPassText(pass, passData.satPos, binding)
|
||||
})
|
||||
viewModel.transmitters.observe(viewLifecycleOwner, { list ->
|
||||
if (list.isNotEmpty()) {
|
||||
transAdapter.submitList(list)
|
||||
binding.recycler.visibility = View.VISIBLE
|
||||
binding.noTransMsg.visibility = View.INVISIBLE
|
||||
transmittersAdapter.submitList(list)
|
||||
binding.radarRecycler.visibility = View.VISIBLE
|
||||
binding.radarRecyclerMsg.visibility = View.INVISIBLE
|
||||
} else {
|
||||
binding.recycler.visibility = View.INVISIBLE
|
||||
binding.noTransMsg.visibility = View.VISIBLE
|
||||
binding.radarRecycler.visibility = View.INVISIBLE
|
||||
binding.radarRecyclerMsg.visibility = View.VISIBLE
|
||||
}
|
||||
passInfoView?.invalidate()
|
||||
radarView?.invalidate()
|
||||
})
|
||||
viewModel.orientation.observe(viewLifecycleOwner, { orientation ->
|
||||
passInfoView?.setOrientation(
|
||||
radarView?.setOrientation(
|
||||
orientation.first,
|
||||
orientation.second,
|
||||
orientation.third
|
||||
@@ -104,32 +107,32 @@ class PassInfoFragment : Fragment(R.layout.fragment_polar) {
|
||||
}
|
||||
}
|
||||
|
||||
private fun setPassText(satPass: SatPass, satPos: SatPos, binding: FragmentPolarBinding) {
|
||||
private fun setPassText(satPass: SatPass, satPos: SatPos, binding: FragmentRadarBinding) {
|
||||
val timeNow = System.currentTimeMillis()
|
||||
val polarAz = getString(R.string.pat_azimuth)
|
||||
val polarEl = getString(R.string.pat_elevation)
|
||||
val polarRng = getString(R.string.pat_distance)
|
||||
val polarAlt = getString(R.string.pat_altitude)
|
||||
binding.azimuth.text = String.format(polarAz, Math.toDegrees(satPos.azimuth))
|
||||
binding.elevation.text = String.format(polarEl, Math.toDegrees(satPos.elevation))
|
||||
binding.distance.text = String.format(polarRng, satPos.range)
|
||||
binding.altitude.text = String.format(polarAlt, satPos.altitude)
|
||||
binding.satName.text = satPass.name
|
||||
binding.radarAz.text = String.format(polarAz, Math.toDegrees(satPos.azimuth))
|
||||
binding.radarEl.text = String.format(polarEl, Math.toDegrees(satPos.elevation))
|
||||
binding.radarDst.text = String.format(polarRng, satPos.range)
|
||||
binding.radarAlt.text = String.format(polarAlt, satPos.altitude)
|
||||
binding.radarName.text = satPass.name
|
||||
|
||||
if (!satPass.isDeepSpace) {
|
||||
if (timeNow < satPass.aosTime) {
|
||||
val millisBeforeStart = satPass.aosTime.minus(timeNow)
|
||||
binding.polarTimer.text = millisBeforeStart.toTimerString()
|
||||
binding.radarTimer.text = millisBeforeStart.toTimerString()
|
||||
} else {
|
||||
val millisBeforeEnd = satPass.losTime.minus(timeNow)
|
||||
binding.polarTimer.text = millisBeforeEnd.toTimerString()
|
||||
binding.radarTimer.text = millisBeforeEnd.toTimerString()
|
||||
if (timeNow > satPass.losTime) {
|
||||
binding.polarTimer.text = 0L.toTimerString()
|
||||
findNavController().navigateSafe(R.id.action_polar_to_passes)
|
||||
binding.radarTimer.text = 0L.toTimerString()
|
||||
findNavController().navigateSafe(R.id.action_radar_to_passes)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
binding.polarTimer.text = 0L.toTimerString()
|
||||
binding.radarTimer.text = 0L.toTimerString()
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.satPassInfoScreen
|
||||
package com.rtbishop.look4sat.presentation.radarScreen
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.*
|
||||
@@ -27,7 +27,7 @@ import kotlin.math.cos
|
||||
import kotlin.math.min
|
||||
import kotlin.math.sin
|
||||
|
||||
class PassInfoView(context: Context) : View(context) {
|
||||
class RadarView(context: Context) : View(context) {
|
||||
|
||||
private val defaultColor = ContextCompat.getColor(context, R.color.themeLight)
|
||||
private val scale = resources.displayMetrics.density
|
||||
+5
-9
@@ -15,11 +15,9 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.satPassInfoScreen
|
||||
package com.rtbishop.look4sat.presentation.radarScreen
|
||||
|
||||
import androidx.lifecycle.*
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import com.rtbishop.look4sat.R
|
||||
import com.rtbishop.look4sat.data.PreferencesSource
|
||||
import com.rtbishop.look4sat.data.SatelliteRepo
|
||||
import com.rtbishop.look4sat.domain.Predictor
|
||||
@@ -28,9 +26,7 @@ import com.rtbishop.look4sat.domain.SatPos
|
||||
import com.rtbishop.look4sat.domain.Transmitter
|
||||
import com.rtbishop.look4sat.framework.OrientationProvider
|
||||
import com.rtbishop.look4sat.injection.IoDispatcher
|
||||
import com.rtbishop.look4sat.utility.navigateSafe
|
||||
import com.rtbishop.look4sat.utility.round
|
||||
import com.rtbishop.look4sat.utility.toTimerString
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.flow.collect
|
||||
@@ -40,7 +36,7 @@ import java.util.*
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltViewModel
|
||||
class PassInfoViewModel @Inject constructor(
|
||||
class RadarViewModel @Inject constructor(
|
||||
private val orientationProvider: OrientationProvider,
|
||||
private val preferences: PreferencesSource,
|
||||
private val predictor: Predictor,
|
||||
@@ -49,10 +45,10 @@ class PassInfoViewModel @Inject constructor(
|
||||
) : ViewModel(), OrientationProvider.OrientationListener {
|
||||
|
||||
private val stationPos = preferences.loadStationPosition()
|
||||
private val _passData = MutableLiveData<PassData>()
|
||||
private val _passData = MutableLiveData<RadarData>()
|
||||
private val _transmitters = MutableLiveData<List<Transmitter>>()
|
||||
private val _orientation = MutableLiveData<Triple<Float, Float, Float>>()
|
||||
val passData: LiveData<PassData> = _passData
|
||||
val radarData: LiveData<RadarData> = _passData
|
||||
val transmitters: LiveData<List<Transmitter>> = _transmitters
|
||||
val orientation: LiveData<Triple<Float, Float, Float>> = _orientation
|
||||
|
||||
@@ -90,7 +86,7 @@ class PassInfoViewModel @Inject constructor(
|
||||
}
|
||||
while (isActive) {
|
||||
val pos = predictor.getSatPos(satPass.satellite, stationPos, Date())
|
||||
_passData.postValue(PassData(pos, track))
|
||||
_passData.postValue(RadarData(pos, track))
|
||||
delay(1000)
|
||||
}
|
||||
}
|
||||
+22
-11
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.satPassInfoScreen
|
||||
package com.rtbishop.look4sat.presentation.radarScreen
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
@@ -27,7 +27,7 @@ import com.rtbishop.look4sat.databinding.ItemTransBinding
|
||||
import com.rtbishop.look4sat.domain.Transmitter
|
||||
import java.util.*
|
||||
|
||||
class SatTransAdapter : RecyclerView.Adapter<SatTransAdapter.TransHolder>() {
|
||||
class TransmittersAdapter : RecyclerView.Adapter<TransmittersAdapter.TransHolder>() {
|
||||
|
||||
private val diffCallback = object : DiffUtil.ItemCallback<Transmitter>() {
|
||||
override fun areItemsTheSame(oldItem: Transmitter, newItem: Transmitter): Boolean {
|
||||
@@ -66,27 +66,38 @@ class SatTransAdapter : RecyclerView.Adapter<SatTransAdapter.TransHolder>() {
|
||||
private val isInverted = itemView.context.getString(R.string.trans_inverted)
|
||||
|
||||
fun bind(transmitter: Transmitter) {
|
||||
binding.description.text = transmitter.info
|
||||
binding.transDesc.text = transmitter.info
|
||||
|
||||
transmitter.downlink.let { downlink ->
|
||||
if (downlink != null) {
|
||||
val downlinkFreq = downlink / divider
|
||||
binding.downlink.text = String.format(Locale.ENGLISH, formatLink, downlinkFreq)
|
||||
} else binding.downlink.text = formatLinkNull
|
||||
binding.transDownlink.text =
|
||||
String.format(Locale.ENGLISH, formatLink, downlinkFreq)
|
||||
} else {
|
||||
binding.transDownlink.text = formatLinkNull
|
||||
}
|
||||
}
|
||||
|
||||
transmitter.uplink.let { uplink ->
|
||||
if (uplink != null) {
|
||||
val uplinkFreq = uplink / divider
|
||||
binding.uplink.text = String.format(Locale.ENGLISH, formatLink, uplinkFreq)
|
||||
} else binding.uplink.text = formatLinkNull
|
||||
binding.transUplink.text = String.format(Locale.ENGLISH, formatLink, uplinkFreq)
|
||||
} else {
|
||||
binding.transUplink.text = formatLinkNull
|
||||
}
|
||||
}
|
||||
|
||||
if (transmitter.mode != null) binding.mode.text = String.format(mode, transmitter.mode)
|
||||
else binding.mode.text = String.format(mode, strNo)
|
||||
if (transmitter.mode != null) {
|
||||
binding.transMode.text = String.format(mode, transmitter.mode)
|
||||
} else {
|
||||
binding.transMode.text = String.format(mode, strNo)
|
||||
}
|
||||
|
||||
if (transmitter.isInverted) binding.isInverted.text = String.format(isInverted, strYes)
|
||||
else binding.isInverted.text = String.format(isInverted, strNo)
|
||||
if (transmitter.isInverted) {
|
||||
binding.transInverted.text = String.format(isInverted, strYes)
|
||||
} else {
|
||||
binding.transInverted.text = String.format(isInverted, strNo)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.rtbishop.look4sat.presentation.satPassInfoScreen
|
||||
|
||||
import com.rtbishop.look4sat.domain.SatPos
|
||||
|
||||
data class PassData(val position: SatPos, val positions: List<SatPos> = emptyList())
|
||||
+5
-5
@@ -15,13 +15,12 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.appSettingsScreen
|
||||
package com.rtbishop.look4sat.presentation.settingsScreen
|
||||
|
||||
import android.Manifest
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Bundle
|
||||
import android.text.InputType
|
||||
import android.util.Patterns
|
||||
import android.view.View
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.core.content.ContextCompat
|
||||
@@ -36,7 +35,7 @@ import dagger.hilt.android.AndroidEntryPoint
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class AppSettingsFragment : PreferenceFragmentCompat() {
|
||||
class SettingsFragment : PreferenceFragmentCompat() {
|
||||
|
||||
@Inject
|
||||
lateinit var preferencesSource: PreferencesSource
|
||||
@@ -72,7 +71,8 @@ class AppSettingsFragment : PreferenceFragmentCompat() {
|
||||
|
||||
findPreference<EditTextPreference>(PreferencesProvider.keyRotatorAddress)?.apply {
|
||||
setOnPreferenceChangeListener { _, newValue ->
|
||||
if (Patterns.IP_ADDRESS.matcher(newValue.toString()).matches()) {
|
||||
val ip4 = "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\.(?!\$)|\$)){4}\$"
|
||||
if (newValue.toString().matches(ip4.toRegex())) {
|
||||
return@setOnPreferenceChangeListener true
|
||||
} else {
|
||||
showSnack(getString(R.string.tracking_rotator_address_invalid))
|
||||
@@ -119,7 +119,7 @@ class AppSettingsFragment : PreferenceFragmentCompat() {
|
||||
|
||||
private fun showSnack(message: String) {
|
||||
Snackbar.make(requireView(), message, Snackbar.LENGTH_SHORT).apply {
|
||||
setAnchorView(R.id.nav_bottom)
|
||||
setAnchorView(R.id.main_nav_bottom)
|
||||
}.show()
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -15,6 +15,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.satSourcesScreen
|
||||
package com.rtbishop.look4sat.presentation.sourcesScreen
|
||||
|
||||
class TleSource(var url: String = String())
|
||||
class DataSource(var url: String = String())
|
||||
+12
-12
@@ -15,33 +15,33 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.satSourcesScreen
|
||||
package com.rtbishop.look4sat.presentation.sourcesScreen
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.widget.doOnTextChanged
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.rtbishop.look4sat.databinding.ItemTleSourceBinding
|
||||
import com.rtbishop.look4sat.databinding.ItemSourceBinding
|
||||
|
||||
class SourcesAdapter(private val sources: MutableList<TleSource> = mutableListOf()) :
|
||||
class SourcesAdapter(private val sources: MutableList<DataSource> = mutableListOf()) :
|
||||
RecyclerView.Adapter<SourcesAdapter.TleSourceHolder>() {
|
||||
|
||||
fun getSources(): List<TleSource> {
|
||||
fun getSources(): List<DataSource> {
|
||||
return sources.filter { it.url.contains("https://") }
|
||||
}
|
||||
|
||||
fun setSources(list: List<TleSource>) {
|
||||
fun setSources(list: List<DataSource>) {
|
||||
sources.clear()
|
||||
sources.addAll(list)
|
||||
}
|
||||
|
||||
fun addSource() {
|
||||
sources.add(TleSource())
|
||||
sources.add(DataSource())
|
||||
notifyItemInserted(itemCount - 1)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TleSourceHolder {
|
||||
val binding = ItemTleSourceBinding
|
||||
val binding = ItemSourceBinding
|
||||
.inflate(LayoutInflater.from(parent.context), parent, false)
|
||||
return TleSourceHolder(binding)
|
||||
}
|
||||
@@ -54,13 +54,13 @@ class SourcesAdapter(private val sources: MutableList<TleSource> = mutableListOf
|
||||
return sources.size
|
||||
}
|
||||
|
||||
inner class TleSourceHolder(private val binding: ItemTleSourceBinding) :
|
||||
inner class TleSourceHolder(private val binding: ItemSourceBinding) :
|
||||
RecyclerView.ViewHolder(binding.root) {
|
||||
|
||||
fun bind(source: TleSource) {
|
||||
binding.tleSourceUrl.setText(source.url)
|
||||
binding.tleSourceUrl.doOnTextChanged { text, _, _, _ -> source.url = text.toString() }
|
||||
binding.tleSourceInputLayout.setEndIconOnClickListener {
|
||||
fun bind(source: DataSource) {
|
||||
binding.sourceUrl.setText(source.url)
|
||||
binding.sourceUrl.doOnTextChanged { text, _, _, _ -> source.url = text.toString() }
|
||||
binding.sourceInput.setEndIconOnClickListener {
|
||||
sources.remove(source)
|
||||
notifyItemRemoved(adapterPosition)
|
||||
}
|
||||
+3
-3
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.presentation.satSourcesScreen
|
||||
package com.rtbishop.look4sat.presentation.sourcesScreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
@@ -43,7 +43,7 @@ class SourcesDialog : AppCompatDialogFragment() {
|
||||
|
||||
override fun onViewCreated(view: View, state: Bundle?) {
|
||||
super.onViewCreated(view, state)
|
||||
val sources = prefsManager.loadTleSources().map { TleSource(it) }
|
||||
val sources = prefsManager.loadTleSources().map { DataSource(it) }
|
||||
val sourcesAdapter = SourcesAdapter().apply { setSources(sources) }
|
||||
DialogSourcesBinding.bind(view).apply {
|
||||
dialog?.window?.setLayout(
|
||||
@@ -54,7 +54,7 @@ class SourcesDialog : AppCompatDialogFragment() {
|
||||
adapter = sourcesAdapter
|
||||
layoutManager = LinearLayoutManager(requireContext())
|
||||
}
|
||||
sourceBtnAdd.setOnClickListener {
|
||||
sourcesBtnAdd.setOnClickListener {
|
||||
sourcesAdapter.addSource()
|
||||
}
|
||||
sourcesBtnPos.setOnClickListener {
|
||||
@@ -43,7 +43,7 @@ import java.util.regex.Pattern
|
||||
|
||||
fun View.showSnack(message: String, isAnchored: Boolean = true) {
|
||||
Snackbar.make(this, message, Snackbar.LENGTH_SHORT).apply {
|
||||
if (isAnchored) setAnchorView(R.id.nav_bottom)
|
||||
if (isAnchored) setAnchorView(R.id.main_nav_bottom)
|
||||
}.show()
|
||||
}
|
||||
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,23 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/main_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/nav_host"
|
||||
android:id="@+id/main_nav_host"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:defaultNavHost="true"
|
||||
app:layout_constraintBottom_toTopOf="@+id/nav_bottom"
|
||||
app:layout_constraintBottom_toTopOf="@+id/main_nav_bottom"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:navGraph="@navigation/nav_graph" />
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/nav_bottom"
|
||||
android:id="@+id/main_nav_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:elevation="1dp"
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/tleSourcesDialog"
|
||||
android:id="@+id/sources_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/greyDark"
|
||||
android:padding="4dp">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/sourcesTitle"
|
||||
android:id="@+id/sources_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/sources_title"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||
app:layout_constraintStart_toStartOf="@+id/sourcesRecycler"
|
||||
app:layout_constraintStart_toStartOf="@+id/sources_recycler"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/sourcesWarning"
|
||||
android:id="@+id/sources_warning"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/sources_https"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toStartOf="@+id/sourcesRecycler"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sourcesTitle" />
|
||||
app:layout_constraintStart_toStartOf="@+id/sources_recycler"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sources_title" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/sourceBtnAdd"
|
||||
android:id="@+id/sources_btn_add"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:backgroundTint="@color/greySurface"
|
||||
android:contentDescription="@string/placeholder"
|
||||
android:src="@drawable/ic_add"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/sourcesWarning"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/sources_warning"
|
||||
app:layout_constraintDimensionRatio="h,1:1"
|
||||
app:layout_constraintEnd_toEndOf="@+id/sourcesRecycler"
|
||||
app:layout_constraintTop_toTopOf="@+id/sourcesTitle" />
|
||||
app:layout_constraintEnd_toEndOf="@+id/sources_recycler"
|
||||
app:layout_constraintTop_toTopOf="@+id/sources_title" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/sourcesRecycler"
|
||||
android:id="@+id/sources_recycler"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
@@ -50,24 +50,24 @@
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sourcesWarning">
|
||||
app:layout_constraintTop_toBottomOf="@+id/sources_warning">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/sourcesBtnNeg"
|
||||
android:id="@+id/sources_btn_neg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/greySurface"
|
||||
android:text="@string/btn_cancel"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/themeLight"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/sourcesBtnPos"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/sources_btn_pos"
|
||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||
app:layout_constraintStart_toStartOf="@+id/sourcesRecycler" />
|
||||
app:layout_constraintStart_toStartOf="@+id/sources_recycler" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/sourcesBtnPos"
|
||||
android:id="@+id/sources_btn_pos"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
@@ -77,7 +77,7 @@
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/themeLight"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/sourcesRecycler"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sourcesRecycler" />
|
||||
app:layout_constraintEnd_toEndOf="@+id/sources_recycler"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sources_recycler" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/entries_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
@@ -12,31 +14,32 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/import_msg"
|
||||
android:id="@+id/entries_import_msg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:elevation="4dp"
|
||||
android:text="@string/entries_update"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/import_web"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/entries_import_web"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/import_web" />
|
||||
app:layout_constraintTop_toTopOf="@+id/entries_import_web" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/import_web"
|
||||
android:id="@+id/entries_import_web"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="48dp"
|
||||
android:backgroundTint="@color/greyDark"
|
||||
android:contentDescription="@string/placeholder"
|
||||
android:elevation="4dp"
|
||||
android:src="@drawable/ic_update_web"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/import_file"
|
||||
app:layout_constraintEnd_toStartOf="@+id/import_file"
|
||||
app:layout_constraintTop_toTopOf="@+id/import_file" />
|
||||
app:layout_constraintBottom_toBottomOf="@+id/entries_import_file"
|
||||
app:layout_constraintEnd_toStartOf="@+id/entries_import_file"
|
||||
app:layout_constraintTop_toTopOf="@+id/entries_import_file"
|
||||
tools:ignore="DuplicateSpeakableTextCheck" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/import_file"
|
||||
android:id="@+id/entries_import_file"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
@@ -48,36 +51,36 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<SearchView
|
||||
android:id="@+id/search_bar"
|
||||
android:id="@+id/entries_search_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:iconifiedByDefault="false"
|
||||
android:queryHint="@string/entries_search_hint"
|
||||
app:layout_constraintEnd_toStartOf="@+id/select_mode"
|
||||
app:layout_constraintEnd_toStartOf="@+id/entries_select_mode"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/entries_bar" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/select_mode"
|
||||
android:id="@+id/entries_select_mode"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="48dp"
|
||||
android:backgroundTint="@color/greySurface"
|
||||
android:contentDescription="@string/placeholder"
|
||||
android:src="@drawable/ic_satellite"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/select_all"
|
||||
app:layout_constraintEnd_toStartOf="@+id/select_all"
|
||||
app:layout_constraintTop_toTopOf="@+id/select_all" />
|
||||
app:layout_constraintBottom_toBottomOf="@+id/entries_select_all"
|
||||
app:layout_constraintEnd_toStartOf="@+id/entries_select_all"
|
||||
app:layout_constraintTop_toTopOf="@+id/entries_select_all" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/select_all"
|
||||
android:id="@+id/entries_select_all"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="48dp"
|
||||
android:backgroundTint="@color/greySurface"
|
||||
android:contentDescription="@string/placeholder"
|
||||
android:src="@drawable/ic_select_all"
|
||||
app:layout_constraintEnd_toEndOf="@+id/import_file"
|
||||
app:layout_constraintTop_toBottomOf="@+id/import_file" />
|
||||
app:layout_constraintEnd_toEndOf="@+id/entries_import_file"
|
||||
app:layout_constraintTop_toBottomOf="@+id/entries_import_file" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/entries_recycler"
|
||||
@@ -86,7 +89,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/search_bar" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/entries_search_bar" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/entries_progress"
|
||||
|
||||
@@ -2,29 +2,31 @@
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/info_scroll"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".presentation.appInfoScreen.AppInfoFragment">
|
||||
tools:context=".presentation.infoScreen.InfoFragment">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/info_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/infoTitleImg"
|
||||
android:id="@+id/info_title_img"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:contentDescription="@string/placeholder"
|
||||
android:src="@drawable/ic_menu_entries"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/infoTitle"
|
||||
app:layout_constraintEnd_toStartOf="@+id/infoTitle"
|
||||
android:src="@drawable/ic_nav_entries"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/info_title"
|
||||
app:layout_constraintEnd_toStartOf="@+id/info_title"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/infoTitle" />
|
||||
app:layout_constraintTop_toTopOf="@+id/info_title" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/infoTitle"
|
||||
android:id="@+id/info_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
@@ -32,11 +34,11 @@
|
||||
android:textColor="@color/themeLight"
|
||||
android:textSize="48sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/infoTitleImg"
|
||||
app:layout_constraintStart_toEndOf="@+id/info_title_img"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/infoVersion"
|
||||
android:id="@+id/info_version"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
@@ -45,10 +47,10 @@
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/infoTitle" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/info_title" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/infoSubtitle"
|
||||
android:id="@+id/info_subtitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
@@ -56,39 +58,39 @@
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/infoVersion" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/info_version" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/infoGithub"
|
||||
android:id="@+id/info_btn_github"
|
||||
style="@style/InfoButton"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/info_github"
|
||||
app:icon="@drawable/ic_github"
|
||||
app:layout_constraintEnd_toStartOf="@+id/infoFdroid"
|
||||
app:layout_constraintEnd_toStartOf="@+id/info_btn_fdroid"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/infoSubtitle" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/info_subtitle" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/infoFdroid"
|
||||
android:id="@+id/info_btn_fdroid"
|
||||
style="@style/InfoButton"
|
||||
android:text="@string/info_fdroid"
|
||||
app:icon="@drawable/ic_fdroid"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/infoGithub"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/info_btn_github"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/infoGithub" />
|
||||
app:layout_constraintStart_toEndOf="@+id/info_btn_github" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/infoBmc"
|
||||
android:id="@+id/info_btn_donate"
|
||||
style="@style/InfoButton"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/info_bmc"
|
||||
app:icon="@drawable/ic_bmc"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/infoGithub" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/info_btn_github" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/infoThanks"
|
||||
android:id="@+id/info_thanks"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
@@ -99,10 +101,10 @@
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/infoBmc" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/info_btn_donate" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/infoWarranty"
|
||||
android:id="@+id/info_warranty"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
@@ -111,9 +113,9 @@
|
||||
android:text="@string/info_warranty"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/infoThanks"
|
||||
app:layout_constraintStart_toStartOf="@+id/infoThanks"
|
||||
app:layout_constraintTop_toBottomOf="@+id/infoThanks" />
|
||||
app:layout_constraintEnd_toEndOf="@+id/info_thanks"
|
||||
app:layout_constraintStart_toStartOf="@+id/info_thanks"
|
||||
app:layout_constraintTop_toBottomOf="@+id/info_thanks" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
||||
@@ -1,12 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/map_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:keepScreenOn="true">
|
||||
|
||||
<org.osmdroid.views.MapView
|
||||
android:id="@+id/mapView"
|
||||
android:id="@+id/map_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -17,6 +19,7 @@
|
||||
</org.osmdroid.views.MapView>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/map_data_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
@@ -28,7 +31,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/mapLat"
|
||||
android:id="@+id/map_data_lat"
|
||||
style="@style/MapInfoText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -39,94 +42,95 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/mapLon"
|
||||
android:id="@+id/map_data_lon"
|
||||
style="@style/MapInfoText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="@string/pat_osm_lon"
|
||||
app:layout_constraintStart_toStartOf="@+id/mapLat"
|
||||
app:layout_constraintTop_toBottomOf="@+id/mapLat" />
|
||||
app:layout_constraintStart_toStartOf="@+id/map_data_lat"
|
||||
app:layout_constraintTop_toBottomOf="@+id/map_data_lat" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/qthLocator"
|
||||
android:id="@+id/map_data_qth"
|
||||
style="@style/MapInfoText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="@string/map_qth"
|
||||
app:layout_constraintStart_toStartOf="@+id/mapLon"
|
||||
app:layout_constraintTop_toBottomOf="@+id/mapLon" />
|
||||
app:layout_constraintStart_toStartOf="@+id/map_data_lon"
|
||||
app:layout_constraintTop_toBottomOf="@+id/map_data_lon" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/altitude"
|
||||
android:id="@+id/map_data_alt"
|
||||
style="@style/MapInfoText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/MapInfoText"
|
||||
android:text="@string/pat_altitude"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/mapLat"
|
||||
android:text="@string/pat_altitude"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/map_data_lat"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/velocity"
|
||||
style="@style/MapInfoText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pat_osm_vel"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/qthLocator"
|
||||
app:layout_constraintEnd_toEndOf="@+id/distance" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/distance"
|
||||
android:id="@+id/map_data_dst"
|
||||
style="@style/MapInfoText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pat_distance"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/mapLon"
|
||||
app:layout_constraintEnd_toEndOf="@+id/altitude" />
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/map_data_lon"
|
||||
app:layout_constraintEnd_toEndOf="@+id/map_data_alt" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/idName"
|
||||
android:id="@+id/map_data_vel"
|
||||
style="@style/MapInfoText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pat_osm_vel"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/map_data_qth"
|
||||
app:layout_constraintEnd_toEndOf="@+id/map_data_dst" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/map_data_name"
|
||||
style="@style/MapInfoText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:text="@string/pat_osm_idName"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qthLocator" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/map_data_qth" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/fabPrev"
|
||||
android:id="@+id/map_btn_prev"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginStart="@dimen/fab_padding"
|
||||
android:layout_marginBottom="@dimen/fab_padding"
|
||||
android:backgroundTint="@color/greySurface"
|
||||
android:contentDescription="@string/placeholder"
|
||||
android:rotation="180"
|
||||
android:backgroundTint="@color/greySurface"
|
||||
android:src="@drawable/ic_next"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:src="@drawable/ic_next" />
|
||||
tools:ignore="DuplicateSpeakableTextCheck" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/fabNext"
|
||||
android:id="@+id/map_btn_next"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginEnd="@dimen/fab_padding"
|
||||
android:layout_marginBottom="@dimen/fab_padding"
|
||||
android:backgroundTint="@color/greySurface"
|
||||
android:contentDescription="@string/placeholder"
|
||||
android:src="@drawable/ic_next"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:src="@drawable/ic_next" />
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/copyright"
|
||||
android:id="@+id/map_copyright"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/passes_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
@@ -18,7 +19,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:elevation="4dp"
|
||||
android:text="@string/timer_zero"
|
||||
android:textSize="40dp"
|
||||
android:textSize="40sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/passes_bar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/passes_bar"
|
||||
|
||||
+25
-24
@@ -1,91 +1,92 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/radar_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:keepScreenOn="true">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/polar_bar"
|
||||
android:id="@+id/radar_bar"
|
||||
style="@style/TopBar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/polar_timer"
|
||||
android:id="@+id/radar_timer"
|
||||
style="@style/TimerText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:elevation="4dp"
|
||||
android:text="@string/timer_zero"
|
||||
android:textSize="40sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/polar_bar"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/radar_bar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/polar_bar"
|
||||
app:layout_constraintStart_toStartOf="@id/radar_bar"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/frame"
|
||||
android:id="@+id/radar_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/polar_bar" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/radar_bar" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/azimuth"
|
||||
android:id="@+id/radar_az"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@string/pat_azimuth"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintStart_toStartOf="@+id/frame"
|
||||
app:layout_constraintTop_toTopOf="@+id/frame" />
|
||||
app:layout_constraintStart_toStartOf="@+id/radar_frame"
|
||||
app:layout_constraintTop_toTopOf="@+id/radar_frame" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/elevation"
|
||||
android:id="@+id/radar_el"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:text="@string/pat_elevation"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/frame"
|
||||
app:layout_constraintTop_toTopOf="@+id/frame" />
|
||||
app:layout_constraintEnd_toEndOf="@+id/radar_frame"
|
||||
app:layout_constraintTop_toTopOf="@+id/radar_frame" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/altitude"
|
||||
android:id="@+id/radar_alt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@string/pat_altitude"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/frame"
|
||||
app:layout_constraintStart_toStartOf="@+id/frame" />
|
||||
app:layout_constraintBottom_toBottomOf="@+id/radar_frame"
|
||||
app:layout_constraintStart_toStartOf="@+id/radar_frame" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/distance"
|
||||
android:id="@+id/radar_dst"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:text="@string/pat_distance"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/frame"
|
||||
app:layout_constraintEnd_toEndOf="@+id/frame" />
|
||||
app:layout_constraintBottom_toBottomOf="@+id/radar_frame"
|
||||
app:layout_constraintEnd_toEndOf="@+id/radar_frame" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler"
|
||||
android:id="@+id/radar_recycler"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:padding="2dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sat_name" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/radar_name" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/no_trans_msg"
|
||||
android:id="@+id/radar_recycler_msg"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
@@ -94,10 +95,10 @@
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/recycler" />
|
||||
app:layout_constraintTop_toTopOf="@+id/radar_recycler" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/sat_name"
|
||||
android:id="@+id/radar_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="0dp"
|
||||
@@ -107,5 +108,5 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/frame" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/radar_frame" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.checkbox.MaterialCheckBox xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/sat_item_checkbox"
|
||||
android:id="@+id/entry_checkbox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32dp"
|
||||
android:background="@null"
|
||||
@@ -7,6 +7,7 @@
|
||||
app:cardCornerRadius="0dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/pass_geo_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
@@ -23,28 +24,28 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/pass_geo_satName"
|
||||
android:id="@+id/pass_geo_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="@string/pass_satName"
|
||||
android:textColor="@color/themeLight"
|
||||
app:layout_constraintEnd_toStartOf="@+id/pass_geo_satId"
|
||||
app:layout_constraintEnd_toStartOf="@+id/pass_geo_id"
|
||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/pass_geo_satId"
|
||||
android:id="@+id/pass_geo_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:text="@string/pass_satId"
|
||||
android:textColor="@color/themeLight"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/pass_geo_satName"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/pass_geo_name"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/pass_geo_satName" />
|
||||
app:layout_constraintStart_toEndOf="@+id/pass_geo_name" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/pass_geo_az"
|
||||
@@ -57,8 +58,8 @@
|
||||
app:layout_constraintEnd_toStartOf="@+id/pass_geo_el"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||
app:layout_constraintStart_toStartOf="@+id/pass_geo_satName"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pass_geo_satName" />
|
||||
app:layout_constraintStart_toStartOf="@+id/pass_geo_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pass_geo_name" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/pass_geo_alt"
|
||||
@@ -75,7 +76,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pat_elevation"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/pass_geo_az"
|
||||
app:layout_constraintEnd_toEndOf="@+id/pass_geo_satId"
|
||||
app:layout_constraintEnd_toEndOf="@+id/pass_geo_id"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@+id/pass_geo_az" />
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
app:cardCornerRadius="0dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/pass_leo_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
@@ -23,7 +24,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/pass_leo_satName"
|
||||
android:id="@+id/pass_leo_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
@@ -34,28 +35,28 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/pass_leo_satId"
|
||||
android:id="@+id/pass_leo_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:text="@string/pass_satId"
|
||||
android:textColor="@color/themeLight"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/pass_leo_satName"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/pass_leo_name"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/pass_leo_aosAz"
|
||||
android:id="@+id/pass_leo_aos"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="@string/pass_aosAz"
|
||||
app:layout_constraintEnd_toStartOf="@+id/pass_leo_losAz"
|
||||
app:layout_constraintEnd_toStartOf="@+id/pass_leo_los"
|
||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||
app:layout_constraintStart_toStartOf="@+id/pass_leo_satName"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pass_leo_satName" />
|
||||
app:layout_constraintStart_toStartOf="@+id/pass_leo_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pass_leo_name" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/pass_leo_maxEl"
|
||||
android:id="@+id/pass_leo_elev"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pass_maxEl"
|
||||
@@ -64,13 +65,13 @@
|
||||
app:layout_constraintStart_toStartOf="@+id/pass_leo_start" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/pass_leo_losAz"
|
||||
android:id="@+id/pass_leo_los"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pass_losAz"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/pass_leo_aosAz"
|
||||
app:layout_constraintEnd_toEndOf="@+id/pass_leo_satId"
|
||||
app:layout_constraintStart_toEndOf="@+id/pass_leo_aosAz" />
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/pass_leo_aos"
|
||||
app:layout_constraintEnd_toEndOf="@+id/pass_leo_id"
|
||||
app:layout_constraintStart_toEndOf="@+id/pass_leo_aos" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/pass_leo_start"
|
||||
@@ -81,17 +82,17 @@
|
||||
app:layout_constraintEnd_toStartOf="@+id/pass_leo_end"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||
app:layout_constraintStart_toStartOf="@+id/pass_leo_aosAz"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pass_leo_aosAz" />
|
||||
app:layout_constraintStart_toStartOf="@+id/pass_leo_aos"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pass_leo_aos" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/pass_leo_tcaAz"
|
||||
android:id="@+id/pass_leo_tca"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pass_tcaAz"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/pass_leo_aosAz"
|
||||
app:layout_constraintEnd_toEndOf="@+id/pass_leo_losAz"
|
||||
app:layout_constraintStart_toStartOf="@+id/pass_leo_aosAz" />
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/pass_leo_aos"
|
||||
app:layout_constraintEnd_toEndOf="@+id/pass_leo_los"
|
||||
app:layout_constraintStart_toStartOf="@+id/pass_leo_aos" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/pass_leo_end"
|
||||
@@ -99,7 +100,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pass_endTime"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/pass_leo_start"
|
||||
app:layout_constraintEnd_toEndOf="@+id/pass_leo_losAz"
|
||||
app:layout_constraintEnd_toEndOf="@+id/pass_leo_los"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@+id/pass_leo_start" />
|
||||
|
||||
@@ -112,7 +113,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="@+id/pass_leo_bg"
|
||||
app:layout_constraintEnd_toEndOf="@+id/pass_leo_end"
|
||||
app:layout_constraintStart_toStartOf="@+id/pass_leo_start"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pass_leo_maxEl" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/pass_leo_elev" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
+6
-4
@@ -1,14 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/tleSourceItem"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/source_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="4dp">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tleSourceInputLayout"
|
||||
android:id="@+id/source_input"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -22,10 +23,11 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/tleSourceUrl"
|
||||
android:id="@+id/source_url"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="textUri" />
|
||||
android:inputType="textUri"
|
||||
tools:ignore="TextContrastCheck" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,16 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/trans_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="0dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/trans_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/trans_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/description"
|
||||
android:id="@+id/trans_desc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
@@ -21,35 +30,59 @@
|
||||
android:maxLines="1"
|
||||
android:text="@string/trans_description"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintEnd_toStartOf="@+id/img_uplink"
|
||||
app:layout_constraintEnd_toStartOf="@+id/trans_uplink_img"
|
||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||
app:layout_constraintStart_toEndOf="@+id/img_downlink"
|
||||
app:layout_constraintStart_toEndOf="@+id/trans_downlink_img"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/downlink"
|
||||
style="@style/TimerText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/trans_link_low"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline"
|
||||
<ImageView
|
||||
android:id="@+id/trans_downlink_img"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:contentDescription="@string/placeholder"
|
||||
android:rotation="90"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/trans_desc"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/description" />
|
||||
app:layout_constraintTop_toTopOf="@+id/trans_desc"
|
||||
app:srcCompat="@drawable/ic_arrow" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/uplink"
|
||||
android:id="@+id/trans_downlink"
|
||||
style="@style/TimerText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/trans_link_low"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/downlink"
|
||||
app:layout_constraintEnd_toStartOf="@+id/trans_guideline"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/trans_desc" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/trans_uplink_img"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:contentDescription="@string/placeholder"
|
||||
android:rotation="270"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/trans_desc"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline" />
|
||||
app:layout_constraintTop_toTopOf="@+id/trans_desc"
|
||||
app:srcCompat="@drawable/ic_arrow" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/mode"
|
||||
android:id="@+id/trans_uplink"
|
||||
style="@style/TimerText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/trans_link_low"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/trans_downlink"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/trans_guideline" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/trans_mode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
@@ -57,52 +90,21 @@
|
||||
android:text="@string/trans_mode"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/isInverted"
|
||||
app:layout_constraintEnd_toStartOf="@+id/trans_inverted"
|
||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/downlink" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/trans_downlink" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/isInverted"
|
||||
android:id="@+id/trans_inverted"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:text="@string/trans_inverted"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/mode"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/trans_mode"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/mode" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_downlink"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:contentDescription="@string/placeholder"
|
||||
android:rotation="90"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/description"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/description"
|
||||
app:srcCompat="@drawable/ic_arrow" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_uplink"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:contentDescription="@string/placeholder"
|
||||
android:rotation="270"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/description"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/description"
|
||||
app:srcCompat="@drawable/ic_arrow" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
app:layout_constraintStart_toEndOf="@+id/trans_mode" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
@@ -2,22 +2,22 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/nav_entries"
|
||||
android:icon="@drawable/ic_menu_entries"
|
||||
android:icon="@drawable/ic_nav_entries"
|
||||
android:title="@string/menu_entries" />
|
||||
<item
|
||||
android:id="@+id/nav_passes"
|
||||
android:icon="@drawable/ic_menu_passes"
|
||||
android:icon="@drawable/ic_nav_passes"
|
||||
android:title="@string/menu_passes" />
|
||||
<item
|
||||
android:id="@+id/nav_map"
|
||||
android:icon="@drawable/ic_menu_map"
|
||||
android:icon="@drawable/ic_nav_map"
|
||||
android:title="@string/menu_map" />
|
||||
<item
|
||||
android:id="@+id/nav_prefs"
|
||||
android:icon="@drawable/ic_menu_prefs"
|
||||
android:id="@+id/nav_settings"
|
||||
android:icon="@drawable/ic_nav_settings"
|
||||
android:title="@string/menu_prefs" />
|
||||
<item
|
||||
android:id="@+id/nav_info"
|
||||
android:icon="@drawable/ic_menu_info"
|
||||
android:icon="@drawable/ic_nav_info"
|
||||
android:title="@string/menu_about" />
|
||||
</menu>
|
||||
</menu>
|
||||
@@ -2,12 +2,11 @@
|
||||
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/mobile_navigation"
|
||||
android:id="@+id/nav_root"
|
||||
app:startDestination="@id/nav_passes">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_entries"
|
||||
android:name="com.rtbishop.look4sat.presentation.satItemScreen.SatItemFragment"
|
||||
android:name="com.rtbishop.look4sat.presentation.entriesScreen.EntriesFragment"
|
||||
tools:layout="@layout/fragment_entries">
|
||||
<action
|
||||
android:id="@+id/action_entries_to_passes"
|
||||
@@ -18,32 +17,30 @@
|
||||
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
|
||||
<action
|
||||
android:id="@+id/action_entries_to_sources"
|
||||
app:destination="@id/nav_dialog_sources"
|
||||
app:destination="@id/nav_sources"
|
||||
app:enterAnim="@anim/nav_default_enter_anim"
|
||||
app:exitAnim="@anim/nav_default_exit_anim"
|
||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
||||
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_passes"
|
||||
android:name="com.rtbishop.look4sat.presentation.satPassScreen.SatPassFragment"
|
||||
android:name="com.rtbishop.look4sat.presentation.passesScreen.PassesFragment"
|
||||
tools:layout="@layout/fragment_passes">
|
||||
<action
|
||||
android:id="@+id/action_passes_to_polar"
|
||||
app:destination="@id/nav_polar"
|
||||
android:id="@+id/action_passes_to_radar"
|
||||
app:destination="@id/nav_radar"
|
||||
app:enterAnim="@anim/nav_default_enter_anim"
|
||||
app:exitAnim="@anim/nav_default_exit_anim"
|
||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
||||
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_polar"
|
||||
android:name="com.rtbishop.look4sat.presentation.satPassInfoScreen.PassInfoFragment"
|
||||
tools:layout="@layout/fragment_polar">
|
||||
android:id="@+id/nav_radar"
|
||||
android:name="com.rtbishop.look4sat.presentation.radarScreen.RadarFragment"
|
||||
tools:layout="@layout/fragment_radar">
|
||||
<action
|
||||
android:id="@+id/action_polar_to_passes"
|
||||
android:id="@+id/action_radar_to_passes"
|
||||
app:destination="@id/nav_passes"
|
||||
app:enterAnim="@anim/nav_default_enter_anim"
|
||||
app:exitAnim="@anim/nav_default_exit_anim"
|
||||
@@ -52,23 +49,19 @@
|
||||
app:popUpTo="@id/nav_passes"
|
||||
app:popUpToInclusive="true" />
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_map"
|
||||
android:name="com.rtbishop.look4sat.presentation.satMapScreen.SatMapFragment"
|
||||
android:name="com.rtbishop.look4sat.presentation.mapScreen.MapFragment"
|
||||
tools:layout="@layout/fragment_map" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_prefs"
|
||||
android:name="com.rtbishop.look4sat.presentation.appSettingsScreen.AppSettingsFragment" />
|
||||
|
||||
android:id="@+id/nav_settings"
|
||||
android:name="com.rtbishop.look4sat.presentation.settingsScreen.SettingsFragment" />
|
||||
<fragment
|
||||
android:id="@+id/nav_info"
|
||||
android:name="com.rtbishop.look4sat.presentation.appInfoScreen.AppInfoFragment"
|
||||
android:name="com.rtbishop.look4sat.presentation.infoScreen.InfoFragment"
|
||||
tools:layout="@layout/fragment_info" />
|
||||
<dialog
|
||||
android:id="@+id/nav_dialog_sources"
|
||||
android:name="com.rtbishop.look4sat.presentation.satSourcesScreen.SourcesDialog"
|
||||
android:id="@+id/nav_sources"
|
||||
android:name="com.rtbishop.look4sat.presentation.sourcesScreen.SourcesDialog"
|
||||
tools:layout="@layout/dialog_sources" />
|
||||
|
||||
</navigation>
|
||||
Reference in new issue
Block a user