mirror of
https://github.com/rt-bishop/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Added PassesPrefsDialog.kt with extra, will cleanup later
This commit is contained in:
1 parent
be26b3e1dc
commit
f58f851151
15 files changed
+349
-66
No files matched your search
@@ -46,6 +46,9 @@ android {
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
}
|
||||
hilt {
|
||||
enableAggregatingTask true
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
|
||||
+28
-2
@@ -29,9 +29,10 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator
|
||||
import com.rtbishop.look4sat.R
|
||||
import com.rtbishop.look4sat.databinding.FragmentPassesBinding
|
||||
import com.rtbishop.look4sat.domain.predict.SatPass
|
||||
import com.rtbishop.look4sat.domain.model.DataState
|
||||
import com.rtbishop.look4sat.domain.predict.SatPass
|
||||
import com.rtbishop.look4sat.presentation.ItemDivider
|
||||
import com.rtbishop.look4sat.presentation.getNavResult
|
||||
import com.rtbishop.look4sat.presentation.navigateSafe
|
||||
import com.rtbishop.look4sat.presentation.toTimerString
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
@@ -66,15 +67,37 @@ class PassesFragment : Fragment(R.layout.fragment_passes), PassesAdapter.PassesC
|
||||
layoutManager = LinearLayoutManager(context)
|
||||
(itemAnimator as SimpleItemAnimator).supportsChangeAnimations = false
|
||||
addItemDecoration(ItemDivider(R.drawable.rec_divider_dark))
|
||||
// addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
||||
// override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||
// if (dy > 0 && passesFab.visibility == View.VISIBLE) passesFab.hide()
|
||||
// else if (dy < 0 && passesFab.visibility != View.VISIBLE) passesFab.show()
|
||||
// }
|
||||
// })
|
||||
}
|
||||
passesRefresh.setOnClickListener { passesViewModel.forceCalculation() }
|
||||
passesRefresh.setOnClickListener { findNavController().navigate(R.id.nav_pass_prefs) }
|
||||
// passesSwipe.apply {
|
||||
// setColorSchemeResources(R.color.greySurface)
|
||||
// setProgressBackgroundColorSchemeResource(R.color.themeLight)
|
||||
// setOnRefreshListener { passesViewModel.forceCalculation() }
|
||||
// }
|
||||
}
|
||||
// val appBarConfiguration = AppBarConfiguration(setOf(R.id.nav_passes))
|
||||
// binding.passesToolbar.setupWithNavController(findNavController(), appBarConfiguration)
|
||||
// binding.passesToolbar.navigationIcon =
|
||||
// ResourcesCompat.getDrawable(resources, R.drawable.ic_add, requireActivity().theme)
|
||||
// binding.passesToolbar.inflateMenu(R.menu.passes_menu)
|
||||
// binding.passesFab.setOnClickListener {
|
||||
// findNavController().navigate(R.id.nav_entries)
|
||||
// }
|
||||
passesViewModel.passes.observe(viewLifecycleOwner, { passesResult ->
|
||||
handleNewPasses(passesResult, passesAdapter, binding)
|
||||
})
|
||||
passesViewModel.isFirstLaunchDone.observe(viewLifecycleOwner, { setupDone ->
|
||||
if (!setupDone) locPermReq.launch(arrayOf(locPermFine, locPermCoarse))
|
||||
})
|
||||
getNavResult<Pair<Int, Double>>(R.id.nav_passes, "prefs") { prefs ->
|
||||
passesViewModel.forceCalculation(prefs.first, prefs.second)
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleNewPasses(
|
||||
@@ -86,6 +109,7 @@ class PassesFragment : Fragment(R.layout.fragment_passes), PassesAdapter.PassesC
|
||||
is DataState.Success -> {
|
||||
passesAdapter.submitList(dataState.data)
|
||||
binding.apply {
|
||||
// passesSwipe.isRefreshing = false
|
||||
passesError.visibility = View.INVISIBLE
|
||||
passesProgress.visibility = View.INVISIBLE
|
||||
passesRecycler.visibility = View.VISIBLE
|
||||
@@ -94,6 +118,7 @@ class PassesFragment : Fragment(R.layout.fragment_passes), PassesAdapter.PassesC
|
||||
}
|
||||
is DataState.Loading -> {
|
||||
binding.apply {
|
||||
// passesSwipe.isRefreshing = true
|
||||
passesTimer.text = 0L.toTimerString()
|
||||
passesError.visibility = View.INVISIBLE
|
||||
passesRecycler.visibility = View.INVISIBLE
|
||||
@@ -102,6 +127,7 @@ class PassesFragment : Fragment(R.layout.fragment_passes), PassesAdapter.PassesC
|
||||
}
|
||||
else -> {
|
||||
binding.apply {
|
||||
// passesSwipe.isRefreshing = false
|
||||
passesTimer.text = 0L.toTimerString()
|
||||
passesProgress.visibility = View.INVISIBLE
|
||||
passesRecycler.visibility = View.INVISIBLE
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package com.rtbishop.look4sat.presentation.passesScreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import androidx.appcompat.app.AppCompatDialogFragment
|
||||
import com.rtbishop.look4sat.R
|
||||
import com.rtbishop.look4sat.databinding.DialogPassesBinding
|
||||
import com.rtbishop.look4sat.framework.PreferencesSource
|
||||
import com.rtbishop.look4sat.presentation.setNavResult
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class PassesPrefsDialog : AppCompatDialogFragment() {
|
||||
|
||||
@Inject
|
||||
lateinit var preferences: PreferencesSource
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, group: ViewGroup?, state: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.dialog_passes, group, false)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, state: Bundle?) {
|
||||
super.onViewCreated(view, state)
|
||||
DialogPassesBinding.bind(view).apply {
|
||||
dialog?.window?.setLayout(
|
||||
WindowManager.LayoutParams.MATCH_PARENT,
|
||||
WindowManager.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
hoursAheadEdit.setText(preferences.getHoursAhead().toString())
|
||||
minElevEdit.setText(preferences.getMinElevation().toString())
|
||||
passPrefBtnPos.setOnClickListener {
|
||||
val hoursAheadText = hoursAheadEdit.text.toString()
|
||||
val hoursAhead = if (hoursAheadText.isNotEmpty()) hoursAheadText.toInt() else 8
|
||||
val minElevText = minElevEdit.text.toString()
|
||||
val minElev = if (minElevText.isNotEmpty()) minElevText.toDouble() else 16.0
|
||||
setNavResult("prefs", Pair(hoursAhead, minElev))
|
||||
dismiss()
|
||||
}
|
||||
passPrefBtnNeg.setOnClickListener { dismiss() }
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
-8
@@ -21,10 +21,10 @@ import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.rtbishop.look4sat.domain.DataRepository
|
||||
import com.rtbishop.look4sat.domain.model.DataState
|
||||
import com.rtbishop.look4sat.domain.predict.Predictor
|
||||
import com.rtbishop.look4sat.domain.predict.SatPass
|
||||
import com.rtbishop.look4sat.domain.model.DataState
|
||||
import com.rtbishop.look4sat.domain.DataRepository
|
||||
import com.rtbishop.look4sat.framework.PreferencesSource
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.*
|
||||
@@ -82,16 +82,17 @@ class PassesViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun forceCalculation() {
|
||||
fun forceCalculation(
|
||||
hoursAhead: Int = preferences.getHoursAhead(),
|
||||
minElevation: Double = preferences.getMinElevation(),
|
||||
timeRef: Long = System.currentTimeMillis()
|
||||
) {
|
||||
viewModelScope.launch {
|
||||
_passes.postValue(DataState.Loading)
|
||||
passesProcessing?.cancelAndJoin()
|
||||
val timeNow = System.currentTimeMillis()
|
||||
val satellites = dataRepository.getSelectedSatellites()
|
||||
val stationPos = preferences.loadStationPosition()
|
||||
val hoursAhead = preferences.getHoursAhead()
|
||||
val minElev = preferences.getMinElevation()
|
||||
predictor.forceCalculation(satellites, stationPos, timeNow, hoursAhead, minElev)
|
||||
predictor.forceCalculation(satellites, stationPos, timeRef, hoursAhead, minElevation)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +115,9 @@ class PassesViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
currentPasses = currentPasses.filter { it.progress < 100 }
|
||||
_passes.postValue(DataState.Success(currentPasses.map { it.copy() }))
|
||||
val passesCopy = currentPasses.map { it.copy() }
|
||||
if (passesCopy.isEmpty()) _passes.postValue(DataState.Empty)
|
||||
else _passes.postValue(DataState.Success(passesCopy))
|
||||
delay(1000)
|
||||
}
|
||||
}
|
||||
|
||||
+36
-8
@@ -23,18 +23,22 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import androidx.appcompat.app.AppCompatDialogFragment
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.rtbishop.look4sat.R
|
||||
import com.rtbishop.look4sat.databinding.DialogSourcesBinding
|
||||
import com.rtbishop.look4sat.domain.DataRepository
|
||||
import com.rtbishop.look4sat.framework.model.Source
|
||||
import com.rtbishop.look4sat.presentation.setNavResult
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import kotlinx.coroutines.launch
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class SourcesDialog : AppCompatDialogFragment() {
|
||||
|
||||
private val viewModel: SourcesViewModel by viewModels()
|
||||
@Inject
|
||||
lateinit var dataRepository: DataRepository
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, group: ViewGroup?, state: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.dialog_sources, group, false)
|
||||
@@ -42,26 +46,50 @@ class SourcesDialog : AppCompatDialogFragment() {
|
||||
|
||||
override fun onViewCreated(view: View, state: Bundle?) {
|
||||
super.onViewCreated(view, state)
|
||||
viewModel.sources.observe(viewLifecycleOwner, { sources ->
|
||||
val adapter = SourcesAdapter().apply { setSources(sources.map { Source(it) }) }
|
||||
// liveData { emit(dataRepository.getWebSources()) }.observe(viewLifecycleOwner, { sources ->
|
||||
// val sourcesAdapter = SourcesAdapter().apply { setSources(sources.map { Source(it) }) }
|
||||
// DialogSourcesBinding.bind(view).apply {
|
||||
// dialog?.window?.setLayout(
|
||||
// WindowManager.LayoutParams.MATCH_PARENT,
|
||||
// WindowManager.LayoutParams.WRAP_CONTENT
|
||||
// )
|
||||
// sourcesRecycler.apply {
|
||||
// adapter = sourcesAdapter
|
||||
// layoutManager = LinearLayoutManager(requireContext())
|
||||
// }
|
||||
// sourcesBtnAdd.setOnClickListener {
|
||||
// sourcesAdapter.addSource()
|
||||
// }
|
||||
// sourcesBtnPos.setOnClickListener {
|
||||
// setNavResult("sources", sourcesAdapter.getSources().map { it.sourceUrl })
|
||||
// dismiss()
|
||||
// }
|
||||
// sourcesBtnNeg.setOnClickListener { dismiss() }
|
||||
// }
|
||||
// })
|
||||
lifecycleScope.launch {
|
||||
val sources = dataRepository.getWebSources()
|
||||
val sourcesAdapter = SourcesAdapter()
|
||||
DialogSourcesBinding.bind(view).apply {
|
||||
dialog?.window?.setLayout(
|
||||
WindowManager.LayoutParams.MATCH_PARENT,
|
||||
WindowManager.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
sourcesRecycler.apply {
|
||||
this.adapter = adapter
|
||||
sourcesAdapter.apply { setSources(sources.map { Source(it) }) }
|
||||
adapter = sourcesAdapter
|
||||
layoutManager = LinearLayoutManager(requireContext())
|
||||
}
|
||||
sourcesBtnAdd.setOnClickListener {
|
||||
adapter.addSource()
|
||||
sourcesAdapter.addSource()
|
||||
}
|
||||
sourcesBtnPos.setOnClickListener {
|
||||
setNavResult("sources", adapter.getSources().map { it.sourceUrl })
|
||||
setNavResult("sources", sourcesAdapter.getSources().map { it.sourceUrl })
|
||||
dismiss()
|
||||
}
|
||||
sourcesBtnNeg.setOnClickListener { dismiss() }
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package com.rtbishop.look4sat.presentation.sourcesScreen
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.liveData
|
||||
import com.rtbishop.look4sat.domain.DataRepository
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltViewModel
|
||||
class SourcesViewModel @Inject constructor(dataRepository: DataRepository) : ViewModel() {
|
||||
|
||||
val sources = liveData {
|
||||
emit(dataRepository.getWebSources())
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/themeLight"
|
||||
android:pathData="M10,18h4v-2h-4v2zM3,6v2h18L21,6L3,6zM6,13h12v-2L6,11v2z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,14 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="128"
|
||||
android:viewportHeight="128">
|
||||
<path
|
||||
android:fillColor="@color/greyDark"
|
||||
android:pathData="m96.642,31.504c7.911,7.997 17.143,13.584 25.365,15.581l1.754,-3.997C123.78,43.048 123.786,43.005 123.802,42.965 125.834,38.995 127,34.495 127,29.715 127,13.881 114.379,1 98.867,1c-5.125,0 -9.92,1.429 -14.064,3.884l-3.398,1.598c0.08,0.306 0.133,0.599 0.221,0.91 2.32,8.104 7.652,16.667 15.016,24.112z" />
|
||||
<path
|
||||
android:fillColor="@color/greyDark"
|
||||
android:pathData="M93.876,34.3C86.053,26.391 80.369,17.225 77.87,8.49 77.84,8.385 77.818,8.285 77.788,8.181L2.629,43.513c-1.404,0.66 -2.019,2.358 -1.372,3.791 0.472,1.046 1.485,1.663 2.545,1.663 0.392,0 0.79,-0.084 1.169,-0.263L74.045,16.235c-1.873,3.578 -2.997,7.611 -3.228,11.885L35.566,51.732c-1.294,0.866 -1.653,2.638 -0.805,3.957 0.538,0.836 1.431,1.29 2.344,1.29 0.526,0 1.06,-0.151 1.533,-0.469L71.189,34.707c1.4,8.11 6.135,15.044 12.715,19.285l-54.945,68.337c-0.981,1.22 -0.808,3.021 0.388,4.023 0.521,0.437 1.149,0.649 1.775,0.649 0.809,0 1.611,-0.357 2.166,-1.045L89.056,56.595c3.06,1.168 6.357,1.838 9.811,1.838 4.932,0 9.566,-1.312 13.601,-3.597L84.602,118.323c-0.633,1.44 0,3.131 1.41,3.777 0.372,0.17 0.76,0.25 1.144,0.25 1.07,0 2.092,-0.629 2.556,-1.691L120.402,50.739C111.642,48.416 102.042,42.555 93.876,34.3Z"
|
||||
tools:ignore="VectorPath" />
|
||||
</vector>
|
||||
@@ -0,0 +1,97 @@
|
||||
<?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:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/greyDark">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pass_pref_title"
|
||||
style="@style/DialogText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/dialog_filter_passes"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/hours_ahead_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="@string/pref_hours_ahead_summary"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pass_pref_title" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/hours_ahead_edit"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/pref_hours_ahead_hint"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="number"
|
||||
android:minHeight="48dp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/hours_ahead_text"
|
||||
app:layout_constraintStart_toStartOf="@+id/hours_ahead_text"
|
||||
app:layout_constraintTop_toBottomOf="@+id/hours_ahead_text" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/min_elev_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/pref_min_el_summary"
|
||||
app:layout_constraintEnd_toEndOf="@+id/hours_ahead_edit"
|
||||
app:layout_constraintStart_toStartOf="@+id/hours_ahead_edit"
|
||||
app:layout_constraintTop_toBottomOf="@+id/hours_ahead_edit" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/min_elev_edit"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/pref_min_el_hint"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="number|numberDecimal"
|
||||
android:minHeight="48dp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/min_elev_text"
|
||||
app:layout_constraintStart_toStartOf="@+id/min_elev_text"
|
||||
app:layout_constraintTop_toBottomOf="@+id/min_elev_text" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/pass_pref_btn_neg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:backgroundTint="@color/greySurface"
|
||||
android:text="@string/btn_cancel"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/themeLight"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/pass_pref_btn_pos"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/min_elev_edit" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/pass_pref_btn_pos"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:backgroundTint="@color/greySurface"
|
||||
android:text="@string/btn_update"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/themeLight"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/pass_pref_btn_neg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@+id/pass_pref_btn_neg" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -28,13 +28,14 @@
|
||||
<ImageButton
|
||||
android:id="@+id/passes_refresh"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:backgroundTint="@color/greyDark"
|
||||
android:contentDescription="@string/placeholder"
|
||||
android:elevation="4dp"
|
||||
android:src="@drawable/ic_refresh"
|
||||
app:layout_constraintEnd_toEndOf="@+id/passes_bar"
|
||||
android:src="@drawable/ic_filter"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/passes_bar"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/passes_bar" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/passes_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/greySurface"
|
||||
app:navigationIcon="?attr/homeAsUpIndicator">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/passes_timer"
|
||||
style="@style/TimerText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/timer_zero"
|
||||
android:textSize="42sp" />
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/passes_swipe"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/passes_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="2dp" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/passes_error"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/passes_error"
|
||||
android:textSize="20sp"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/passes_fab"
|
||||
style="@style/Widget.MaterialComponents.FloatingActionButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="16dp"
|
||||
android:contentDescription="@string/placeholder"
|
||||
android:src="@drawable/ic_sputnik_dark" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -10,18 +10,10 @@
|
||||
tools:layout="@layout/fragment_entries">
|
||||
<action
|
||||
android:id="@+id/action_entries_to_passes"
|
||||
app:destination="@id/nav_passes"
|
||||
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" />
|
||||
app:destination="@id/nav_passes" />
|
||||
<action
|
||||
android:id="@+id/action_entries_to_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" />
|
||||
app:destination="@id/nav_sources" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/nav_passes"
|
||||
@@ -29,11 +21,7 @@
|
||||
tools:layout="@layout/fragment_passes">
|
||||
<action
|
||||
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" />
|
||||
app:destination="@id/nav_radar" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/nav_radar"
|
||||
@@ -42,19 +30,11 @@
|
||||
<action
|
||||
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"
|
||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
||||
app:popExitAnim="@anim/nav_default_pop_exit_anim"
|
||||
app:popUpTo="@id/nav_passes"
|
||||
app:popUpToInclusive="true" />
|
||||
<action
|
||||
android:id="@+id/action_radar_to_map"
|
||||
app:destination="@id/nav_map"
|
||||
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" />
|
||||
app:destination="@id/nav_map" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/nav_map"
|
||||
@@ -66,12 +46,12 @@
|
||||
tools:layout="@layout/fragment_prefs">
|
||||
<action
|
||||
android:id="@+id/action_prefs_to_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" />
|
||||
app:destination="@id/nav_sources" />
|
||||
</fragment>
|
||||
<dialog
|
||||
android:id="@+id/nav_pass_prefs"
|
||||
android:name="com.rtbishop.look4sat.presentation.passesScreen.PassesPrefsDialog"
|
||||
tools:layout="@layout/dialog_passes" />
|
||||
<dialog
|
||||
android:id="@+id/nav_sources"
|
||||
android:name="com.rtbishop.look4sat.presentation.sourcesScreen.SourcesDialog"
|
||||
|
||||
@@ -62,6 +62,15 @@
|
||||
<string name="pref_radar_sweep">Показывать анимацию радара</string>
|
||||
<string name="pref_time_utc_title">Показывать время пролета по UTC</string>
|
||||
|
||||
<string name="dialog_filter_passes">Фильтровать пролеты</string>
|
||||
|
||||
<string name="pref_hours_ahead_hint">Количество часов</string>
|
||||
<string name="pref_hours_ahead_summary">Показать пролеты за след. Х часов</string>
|
||||
<string name="pref_hours_ahead_input_error">Введите значение между 1ч и 168ч</string>
|
||||
<string name="pref_min_el_hint">Минимальная элевация</string>
|
||||
<string name="pref_min_el_summary">Показать пролеты с элевацией более</string>
|
||||
<string name="pref_min_el_input_error">Введите значение между 0° и 90°</string>
|
||||
|
||||
<string name="about_version">Версия: %s</string>
|
||||
<string name="about_subtitle">Трекер спутников для Android</string>
|
||||
<string name="about_support">Поддержать</string>
|
||||
|
||||
@@ -84,6 +84,17 @@
|
||||
<string name="pref_radar_sweep">Enable radar sweep animation</string>
|
||||
<string name="pref_compass_title">Use sensors to rotate radar view</string>
|
||||
|
||||
<string name="dialog_filter_passes">Filter passes</string>
|
||||
|
||||
<string name="pref_hours_ahead_key" translatable="false">hoursAhead</string>
|
||||
<string name="pref_hours_ahead_hint">Hours ahead</string>
|
||||
<string name="pref_hours_ahead_summary">Show passes that occur within X hours</string>
|
||||
<string name="pref_hours_ahead_input_error">Set the value between 1h and 168h</string>
|
||||
<string name="pref_min_el_key" translatable="false">minEl</string>
|
||||
<string name="pref_min_el_hint">Minimum elevation</string>
|
||||
<string name="pref_min_el_summary">Show passes with max elevation above</string>
|
||||
<string name="pref_min_el_input_error">Set the value between 0° and 90°</string>
|
||||
|
||||
<string name="about_version">Version: %s</string>
|
||||
<string name="about_subtitle">Satellite tracker and pass predictor</string>
|
||||
<string name="about_github" translatable="false">GitHub</string>
|
||||
|
||||
@@ -25,6 +25,13 @@
|
||||
<item name="cardCornerRadius">0dp</item>
|
||||
</style>
|
||||
|
||||
<style name="DialogText">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:textColor">@color/themeLight</item>
|
||||
<item name="android:textSize">17sp</item>
|
||||
</style>
|
||||
|
||||
<style name="InfoButton">
|
||||
<item name="android:backgroundTint">@color/bgDark</item>
|
||||
<item name="android:textColor">@color/themeLight</item>
|
||||
|
||||
Reference in new issue
Block a user