mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-05 20:17:29 +00:00
Switched to SafeArgs plugin. Libraries update.
This commit is contained in:
1 parent
807b5a0d67
commit
37a567b47f
5 files changed
+14
-7
No files matched your search
@@ -21,6 +21,7 @@ apply plugin: 'com.android.application'
|
|||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlin-android-extensions'
|
apply plugin: 'kotlin-android-extensions'
|
||||||
apply plugin: 'kotlin-kapt'
|
apply plugin: 'kotlin-kapt'
|
||||||
|
apply plugin: "androidx.navigation.safeargs.kotlin"
|
||||||
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
|
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import android.widget.TextView
|
|||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import androidx.navigation.fragment.navArgs
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.github.amsacode.predict4java.SatPos
|
import com.github.amsacode.predict4java.SatPos
|
||||||
@@ -48,6 +49,7 @@ import kotlin.math.sin
|
|||||||
class RadarFragment : Fragment() {
|
class RadarFragment : Fragment() {
|
||||||
|
|
||||||
private val service = Executors.newSingleThreadScheduledExecutor()
|
private val service = Executors.newSingleThreadScheduledExecutor()
|
||||||
|
private val args: RadarFragmentArgs by navArgs()
|
||||||
|
|
||||||
private lateinit var viewModel: MainViewModel
|
private lateinit var viewModel: MainViewModel
|
||||||
private lateinit var satPass: SatPass
|
private lateinit var satPass: SatPass
|
||||||
@@ -79,7 +81,7 @@ class RadarFragment : Fragment() {
|
|||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
val delay = viewModel.delay
|
val delay = viewModel.delay
|
||||||
satPass = arguments?.get("satPass") as SatPass
|
satPass = args.satPass
|
||||||
mainActivity.supportActionBar?.title = satPass.tle.name
|
mainActivity.supportActionBar?.title = satPass.tle.name
|
||||||
|
|
||||||
radarSkyFrame = view.findViewById(R.id.radar_sky_frame)
|
radarSkyFrame = view.findViewById(R.id.radar_sky_frame)
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import android.view.View
|
|||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.ProgressBar
|
import android.widget.ProgressBar
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.core.os.bundleOf
|
|
||||||
import androidx.navigation.findNavController
|
import androidx.navigation.findNavController
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.rtbishop.look4sat.R
|
import com.rtbishop.look4sat.R
|
||||||
@@ -77,8 +76,8 @@ class SatPassAdapter : RecyclerView.Adapter<SatPassAdapter.PassHolder>() {
|
|||||||
passEnd.text = String.format("LOS - %s", losTime)
|
passEnd.text = String.format("LOS - %s", losTime)
|
||||||
|
|
||||||
holder.itemView.setOnClickListener {
|
holder.itemView.setOnClickListener {
|
||||||
val bundle = bundleOf("satPass" to satPass)
|
val action = SkyFragmentDirections.actionNavSkyToNavRadar(satPass)
|
||||||
holder.itemView.findNavController().navigate(R.id.action_nav_sky_to_nav_radar, bundle)
|
holder.itemView.findNavController().navigate(action)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,11 @@
|
|||||||
android:id="@+id/nav_radar"
|
android:id="@+id/nav_radar"
|
||||||
android:name="com.rtbishop.look4sat.ui.RadarFragment"
|
android:name="com.rtbishop.look4sat.ui.RadarFragment"
|
||||||
android:label="@string/menu_radar"
|
android:label="@string/menu_radar"
|
||||||
tools:layout="@layout/fragment_radar" />
|
tools:layout="@layout/fragment_radar">
|
||||||
|
<argument
|
||||||
|
android:name="satPass"
|
||||||
|
app:argType="com.rtbishop.look4sat.repo.SatPass" />
|
||||||
|
</fragment>
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/nav_map"
|
android:id="@+id/nav_map"
|
||||||
|
|||||||
+3
-2
@@ -29,6 +29,7 @@ buildscript {
|
|||||||
classpath "com.android.tools.build:gradle:3.5.3"
|
classpath "com.android.tools.build:gradle:3.5.3"
|
||||||
classpath "com.google.android.gms:oss-licenses-plugin:0.10.0"
|
classpath "com.google.android.gms:oss-licenses-plugin:0.10.0"
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61"
|
||||||
|
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,7 +45,7 @@ task clean(type: Delete) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
material = '1.2.0-alpha02'
|
material = '1.2.0-alpha03'
|
||||||
supportLib = '1.0.0'
|
supportLib = '1.0.0'
|
||||||
constraintLayout = '1.1.3'
|
constraintLayout = '1.1.3'
|
||||||
|
|
||||||
@@ -54,7 +55,7 @@ ext {
|
|||||||
navigation = '2.1.0'
|
navigation = '2.1.0'
|
||||||
lifecycle = '2.2.0-rc03'
|
lifecycle = '2.2.0-rc03'
|
||||||
|
|
||||||
room = '2.2.2'
|
room = '2.2.3'
|
||||||
|
|
||||||
retrofit = '2.6.2'
|
retrofit = '2.6.2'
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user