Changeset View
Changeset View
Standalone View
Standalone View
app/src/main/java/it/reyboz/bustorino/fragments/LinesDetailFragment.kt
| Show First 20 Lines • Show All 277 Lines • ▼ Show 20 Lines | ): View? { | ||||
| view.setOnClickListener(this::switchUserLocationStatus) | view.setOnClickListener(this::switchUserLocationStatus) | ||||
| } | } | ||||
| busPositionsIconButton.setOnClickListener { | busPositionsIconButton.setOnClickListener { | ||||
| LivePositionsDialogFragment().show(parentFragmentManager, "LivePositionsDialog") | LivePositionsDialogFragment().show(parentFragmentManager, "LivePositionsDialog") | ||||
| } | } | ||||
| //set | //set | ||||
| lineInfoButton.setOnClickListener { | lineInfoButton.setOnClickListener { | ||||
| AlertsDialogFragment(lineID).show(parentFragmentManager, "Alerts-Line$lineID") | AlertsDialogFragment.newInstanceForLine(lineID).show(parentFragmentManager, "Alerts-Line$lineID") | ||||
| } | } | ||||
| /* | /* | ||||
| */ | */ | ||||
| Log.d(DEBUG_TAG,"Data ${viewModel.stopsForPatternLiveData.value}") | Log.d(DEBUG_TAG,"Data ${viewModel.stopsForPatternLiveData.value}") | ||||
| //listeners | //listeners | ||||
| ▲ Show 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||||
| Log.d(DEBUG_TAG, "alerts for line $lineID: ${list.size}") | Log.d(DEBUG_TAG, "alerts for line $lineID: ${list.size}") | ||||
| if(list.isNotEmpty()){ | if(list.isNotEmpty()){ | ||||
| lineInfoButton.visibility = View.VISIBLE | lineInfoButton.visibility = View.VISIBLE | ||||
| //Log.d(DEBUG_TAG, "First alert is:\n ${list[0].longPrint()}") | //Log.d(DEBUG_TAG, "First alert is:\n ${list[0].longPrint()}") | ||||
| } else | } else | ||||
| lineInfoButton.visibility = View.GONE | lineInfoButton.visibility = View.GONE | ||||
| } | } | ||||
| lineInfoButton.setOnClickListener { | |||||
| AlertsDialogFragment.newInstanceForLine(lineID).show(parentFragmentManager, "Alerts-Line$lineID") | |||||
| } | |||||
| } | } | ||||
| // ------------- UI switch stuff --------- | // ------------- UI switch stuff --------- | ||||
| private fun hideMapAndShowStopList(){ | private fun hideMapAndShowStopList(){ | ||||
| mapView?.visibility = View.GONE | mapView?.visibility = View.GONE | ||||
| stopsRecyclerView.visibility = View.VISIBLE | stopsRecyclerView.visibility = View.VISIBLE | ||||
| locationIcon?.visibility = View.GONE | locationIcon?.visibility = View.GONE | ||||
| busPositionsIconButton?.visibility = View.GONE | busPositionsIconButton?.visibility = View.GONE | ||||
| ▲ Show 20 Lines • Show All 740 Lines • ▼ Show 20 Lines | companion object { | ||||
| //Log.d(DEBUG_TAG,"Stop ${stop.ID} old pos: ($sLat, $sLong), new pos ($latNew,$longNew)") | //Log.d(DEBUG_TAG,"Stop ${stop.ID} old pos: ($sLat, $sLong), new pos ($latNew,$longNew)") | ||||
| return LatLng(latNew,longNew) | return LatLng(latNew,longNew) | ||||
| } | } | ||||
| private const val DEFAULT_CENTER_LAT = 45.12 | private const val DEFAULT_CENTER_LAT = 45.12 | ||||
| private const val DEFAULT_CENTER_LON = 7.6858 | private const val DEFAULT_CENTER_LON = 7.6858 | ||||
| } | } | ||||
| } | } | ||||
| No newline at end of file | No newline at end of file | ||||
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register