kopia lustrzana https://github.com/rt-bishop/Look4Sat
rodzic
ae1fbb1687
commit
eb1ac3341f
|
@ -13,8 +13,8 @@ android {
|
|||
applicationId "com.rtbishop.look4sat"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 30
|
||||
versionCode 251
|
||||
versionName "2.5.1"
|
||||
versionCode 252
|
||||
versionName "2.5.2"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
|
|
@ -18,10 +18,8 @@
|
|||
package com.rtbishop.look4sat.presentation.satItemScreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.Patterns
|
||||
import android.view.View
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.navigation.fragment.findNavController
|
||||
|
@ -29,7 +27,6 @@ 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.DialogSourceBinding
|
||||
import com.rtbishop.look4sat.databinding.FragmentEntriesBinding
|
||||
import com.rtbishop.look4sat.domain.model.SatItem
|
||||
import com.rtbishop.look4sat.framework.model.Result
|
||||
|
@ -66,10 +63,8 @@ class SatItemFragment : Fragment(R.layout.fragment_entries) {
|
|||
addItemDecoration(RecyclerDivider(R.drawable.rec_divider_light))
|
||||
}
|
||||
importWeb.setOnClickListener {
|
||||
// viewModel.updateEntriesFromWeb(null)
|
||||
findNavController().navigateSafe(R.id.action_entries_to_sources)
|
||||
}
|
||||
// importSource.setOnClickListener { showSourceDialog() }
|
||||
importFile.setOnClickListener { filePicker.launch("*/*") }
|
||||
selectMode.setOnClickListener { showModesDialog() }
|
||||
selectAll.setOnClickListener { viewModel.selectCurrentItems() }
|
||||
|
@ -93,7 +88,6 @@ class SatItemFragment : Fragment(R.layout.fragment_entries) {
|
|||
satItemAdapter.submitList(result.data)
|
||||
binding.entriesProgress.visibility = View.INVISIBLE
|
||||
binding.entriesRecycler.visibility = View.VISIBLE
|
||||
binding.entriesRecycler.scrollToPosition(0)
|
||||
}
|
||||
is Result.InProgress -> {
|
||||
binding.entriesProgress.visibility = View.VISIBLE
|
||||
|
@ -107,24 +101,6 @@ class SatItemFragment : Fragment(R.layout.fragment_entries) {
|
|||
}
|
||||
}
|
||||
|
||||
private fun showSourceDialog() {
|
||||
val dialogBinding = DialogSourceBinding.inflate(requireActivity().layoutInflater)
|
||||
val dialogBuilder = AlertDialog.Builder(requireContext()).apply {
|
||||
setMessage(getString(R.string.sources_title))
|
||||
setView(dialogBinding.root)
|
||||
setPositiveButton(android.R.string.ok) { _, _ ->
|
||||
val editTextInput = dialogBinding.sourceUrl.text.toString()
|
||||
if (Patterns.WEB_URL.matcher(editTextInput).matches()) {
|
||||
viewModel.updateEntriesFromWeb(listOf(editTextInput))
|
||||
} else {
|
||||
requireView().showSnack(getString(R.string.sources_error))
|
||||
}
|
||||
}
|
||||
setNeutralButton(android.R.string.cancel, null)
|
||||
}
|
||||
dialogBuilder.create().show()
|
||||
}
|
||||
|
||||
private fun showModesDialog() {
|
||||
val modes = arrayOf(
|
||||
"AFSK", "AFSK S-Net", "AFSK SALSAT", "AHRPT", "AM", "APT", "BPSK", "BPSK PMT-A3",
|
||||
|
|
|
@ -22,13 +22,19 @@ import android.graphics.*
|
|||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.rtbishop.look4sat.R
|
||||
import com.rtbishop.look4sat.data.PreferencesSource
|
||||
import com.rtbishop.look4sat.domain.predict4kotlin.SatPass
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import java.util.*
|
||||
import javax.inject.Inject
|
||||
import kotlin.math.cos
|
||||
import kotlin.math.sin
|
||||
|
||||
@AndroidEntryPoint
|
||||
class PassInfoView(context: Context) : View(context) {
|
||||
|
||||
@Inject lateinit var preferencesSource: PreferencesSource
|
||||
|
||||
private lateinit var satPass: SatPass
|
||||
private val scale = resources.displayMetrics.density
|
||||
private val radarWidth = resources.displayMetrics.widthPixels
|
||||
|
@ -93,7 +99,9 @@ class PassInfoView(context: Context) : View(context) {
|
|||
canvas.drawPath(satTrack, arrowPaint)
|
||||
}
|
||||
drawSatellite(canvas, satPass)
|
||||
drawCrosshair(canvas, azimuth, pitch)
|
||||
if (preferencesSource.shouldUseCompass()) {
|
||||
drawCrosshair(canvas, azimuth, pitch)
|
||||
}
|
||||
}
|
||||
|
||||
private fun createPassTrajectory(satPass: SatPass) {
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.textfield.TextInputLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:hint="@string/sources_hint">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/sourceUrl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="textUri" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
|
@ -0,0 +1,10 @@
|
|||
Added immediate initial setup
|
||||
Added pass direction arrow to radar view #52
|
||||
Added orientation pointer to radar view
|
||||
Fixed update triggered crash
|
||||
Fixed radar view update bug #51
|
||||
Fixed tle update issue #53
|
||||
Fixed location update bug #54
|
||||
Removed aiming icon without sensors #57
|
||||
Removed satellite list scroll to the top on selection #59
|
||||
Switched to modular architecture
|
|
@ -1,7 +1,10 @@
|
|||
Added immediate initial setup
|
||||
Added pass direction arrow to radar view #52
|
||||
Added orientation pointer to radar view
|
||||
Fixed update triggered crash
|
||||
Fixed radar view update bug #51
|
||||
Fixed tle update issue #53
|
||||
Fixed location update bug #54
|
||||
Removed aiming icon without sensors #57
|
||||
Removed satellite list scroll to the top on selection #59
|
||||
Switched to modular architecture
|
Ładowanie…
Reference in New Issue