mirror of
https://github.com/rt-bishop/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Removed safeargs plugin as it's not being used
This commit is contained in:
1 parent
0a124a36e6
commit
8b1901fd48
5 files changed
+17
-17
No files matched your search
@@ -22,7 +22,6 @@ apply plugin: "kotlin-android"
|
||||
apply plugin: "kotlin-kapt"
|
||||
apply plugin: "kotlin-android-extensions"
|
||||
apply plugin: "dagger.hilt.android.plugin"
|
||||
apply plugin: "androidx.navigation.safeargs.kotlin"
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
|
||||
@@ -23,13 +23,13 @@ import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.rtbishop.look4sat.R
|
||||
import com.rtbishop.look4sat.data.SatPass
|
||||
import com.rtbishop.look4sat.databinding.ItemPassGeoBinding
|
||||
import com.rtbishop.look4sat.databinding.ItemPassLeoBinding
|
||||
import com.rtbishop.look4sat.ui.fragments.PassesFragmentDirections
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
@@ -123,9 +123,8 @@ class PassesAdapter(context: Context, private val shouldUseUTC: Boolean = false)
|
||||
|
||||
itemView.setOnClickListener {
|
||||
if (satPass.progress < 100) {
|
||||
val passIndex = satPassList.indexOf(satPass)
|
||||
val action = PassesFragmentDirections.actionPassToPolar(passIndex)
|
||||
itemView.findNavController().navigate(action)
|
||||
val bundle = bundleOf("index" to satPassList.indexOf(satPass))
|
||||
itemView.findNavController().navigate(R.id.action_passes_to_polar, bundle)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -146,9 +145,8 @@ class PassesAdapter(context: Context, private val shouldUseUTC: Boolean = false)
|
||||
}
|
||||
|
||||
itemView.setOnClickListener {
|
||||
val passIndex = satPassList.indexOf(satPass)
|
||||
val action = PassesFragmentDirections.actionPassToPolar(passIndex)
|
||||
itemView.findNavController().navigate(action)
|
||||
val bundle = bundleOf("index" to satPassList.indexOf(satPass))
|
||||
itemView.findNavController().navigate(R.id.action_passes_to_polar, bundle)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.navigation.fragment.navArgs
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.rtbishop.look4sat.R
|
||||
import com.rtbishop.look4sat.SharedViewModel
|
||||
@@ -57,7 +56,6 @@ class PolarFragment : Fragment(R.layout.fragment_polar), SensorEventListener {
|
||||
private lateinit var satPass: SatPass
|
||||
private lateinit var sensorManager: SensorManager
|
||||
private val viewModel: SharedViewModel by activityViewModels()
|
||||
private val args: PolarFragmentArgs by navArgs()
|
||||
private var magneticDeclination = 0f
|
||||
private var polarView: PolarView? = null
|
||||
|
||||
@@ -112,7 +110,7 @@ class PolarFragment : Fragment(R.layout.fragment_polar), SensorEventListener {
|
||||
private fun observePasses() {
|
||||
viewModel.getPasses().observe(viewLifecycleOwner, { result ->
|
||||
if (result is Result.Success) {
|
||||
satPass = result.data[args.satPassIndex]
|
||||
satPass = result.data[requireArguments().getInt("index")]
|
||||
polarView = PolarView(requireContext(), satPass)
|
||||
binding.frame.addView(polarView)
|
||||
observeTransmitters()
|
||||
@@ -163,7 +161,7 @@ class PolarFragment : Fragment(R.layout.fragment_polar), SensorEventListener {
|
||||
binding.polarTimer.text = Utilities.formatForTimer(millisBeforeEnd)
|
||||
if (dateNow.after(satPass.pass.endTime)) {
|
||||
binding.polarTimer.text = Utilities.formatForTimer(0L)
|
||||
findNavController().navigateUp()
|
||||
findNavController().navigate(R.id.action_polar_to_passes)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
android:name="com.rtbishop.look4sat.ui.fragments.PassesFragment"
|
||||
tools:layout="@layout/fragment_passes">
|
||||
<action
|
||||
android:id="@+id/action_pass_to_polar"
|
||||
android:id="@+id/action_passes_to_polar"
|
||||
app:destination="@id/nav_polar"
|
||||
app:enterAnim="@anim/nav_default_enter_anim"
|
||||
app:exitAnim="@anim/nav_default_exit_anim"
|
||||
@@ -53,9 +53,15 @@
|
||||
android:id="@+id/nav_polar"
|
||||
android:name="com.rtbishop.look4sat.ui.fragments.PolarFragment"
|
||||
tools:layout="@layout/fragment_polar">
|
||||
<argument
|
||||
android:name="satPassIndex"
|
||||
app:argType="integer" />
|
||||
<action
|
||||
android:id="@+id/action_polar_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" />
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
|
||||
@@ -40,7 +40,6 @@ buildscript {
|
||||
classpath "com.android.tools.build:gradle:$gradle_version"
|
||||
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$gradle_plugin_version"
|
||||
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigation_version"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user