diff options
author | Isidro Henoch <imhenoch@protonmail.com> | 2021-12-15 01:00:37 -0600 |
---|---|---|
committer | Isidro Henoch <imhenoch@protonmail.com> | 2021-12-15 01:00:37 -0600 |
commit | f08ef2459cfa0f3582db77372b1e534b1291cdc0 (patch) | |
tree | db869eb782a048e216af3fe139f5e01c483d4733 /androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt | |
parent | 64edb0466aae0f920b6a9d6c01c142e1207ae5b1 (diff) | |
download | etbsa-trackermap-mobile-f08ef2459cfa0f3582db77372b1e534b1291cdc0.tar.gz etbsa-trackermap-mobile-f08ef2459cfa0f3582db77372b1e534b1291cdc0.tar.bz2 etbsa-trackermap-mobile-f08ef2459cfa0f3582db77372b1e534b1291cdc0.zip |
Adds the details activity
Diffstat (limited to 'androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt')
-rw-r--r-- | androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt index a3ed7a8..2c11dc2 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt @@ -1,5 +1,6 @@ package mx.trackermap.TrackerMap.android.devices +import android.content.Intent import android.os.Bundle import android.util.Log import android.view.LayoutInflater @@ -9,6 +10,8 @@ import androidx.fragment.app.Fragment import androidx.recyclerview.widget.LinearLayoutManager import kotlinx.coroutines.DelicateCoroutinesApi import mx.trackermap.TrackerMap.android.databinding.DevicesFragmentBinding +import mx.trackermap.TrackerMap.android.details.DetailsActivity +import mx.trackermap.TrackerMap.android.units.UnitsActivity import mx.trackermap.TrackerMap.android.units.UnitsViewModel import mx.trackermap.TrackerMap.client.models.UnitInformation import org.koin.androidx.viewmodel.ext.android.viewModel @@ -62,5 +65,10 @@ class DevicesFragment : Fragment() { private fun itemAction(unit: UnitInformation, action: Action) { Log.d("DevicesFragment", "Action: $action - Unit: $unit") + val activity = requireActivity() + val intent = Intent(activity.applicationContext, DetailsActivity::class.java) + intent.putExtra(DetailsActivity.DEVICE_ID_EXTRA, unit.device.id) + intent.putExtra(DetailsActivity.ACTION_EXTRA, action) + startActivity(intent) } }
\ No newline at end of file |