Changeset View
Changeset View
Standalone View
Standalone View
app/src/main/java/it/reyboz/bustorino/fragments/MapLibreFragment.kt
| Show First 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | ): View? { | ||||
| // Init the MapView | // Init the MapView | ||||
| mapView = rootView.findViewById(R.id.libreMapView) | mapView = rootView.findViewById(R.id.libreMapView) | ||||
| mapView!!.onCreate(savedInstanceState) | mapView!!.onCreate(savedInstanceState) | ||||
| mapView!!.getMapAsync(this) | mapView!!.getMapAsync(this) | ||||
| //init bottom sheet | //init bottom sheet | ||||
| val bottomSheet = rootView.findViewById<RelativeLayout>(R.id.bottom_sheet) | initBottomSheet(rootView) | ||||
| bottomLayout = bottomSheet | |||||
| stopTitleTextView = bottomSheet.findViewById(R.id.stopTitleTextView) | |||||
| stopNumberTextView = bottomSheet.findViewById(R.id.stopNumberTextView) | |||||
| linesPassingTextView = bottomSheet.findViewById(R.id.linesPassingTextView) | |||||
| arrivalsCard = bottomSheet.findViewById(R.id.arrivalsCardButton) | |||||
| directionsCard = bottomSheet.findViewById(R.id.directionsCardButton) | |||||
| userLocationButton = rootView.findViewById(R.id.locationEnableIcon) | userLocationButton = rootView.findViewById(R.id.locationEnableIcon) | ||||
| userLocationButton.setOnClickListener(this::switchUserLocationStatus) | userLocationButton.setOnClickListener(this::switchUserLocationStatus) | ||||
| followUserButton = rootView.findViewById(R.id.followUserImageButton) | followUserButton = rootView.findViewById(R.id.followUserImageButton) | ||||
| centerUserButton = rootView.findViewById(R.id.centerMapImageButton) | centerUserButton = rootView.findViewById(R.id.centerMapImageButton) | ||||
| busPositionsIconButton = rootView.findViewById(R.id.busPositionsImageButton) | busPositionsIconButton = rootView.findViewById(R.id.busPositionsImageButton) | ||||
| busPositionsIconButton.setOnClickListener { | busPositionsIconButton.setOnClickListener { | ||||
| LivePositionsDialogFragment().show(parentFragmentManager, "LivePositionsDialog") | LivePositionsDialogFragment().show(parentFragmentManager, "LivePositionsDialog") | ||||
| } | } | ||||
| bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet) | |||||
| bottomSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN | |||||
| arrivalsCard.setOnClickListener { | arrivalsCard.setOnClickListener { | ||||
| if(context!=null){ | if(context!=null){ | ||||
| Toast.makeText(context,"ARRIVALS", Toast.LENGTH_SHORT).show() | Toast.makeText(context,"ARRIVALS", Toast.LENGTH_SHORT).show() | ||||
| } | } | ||||
| } | } | ||||
| centerUserButton.setOnClickListener { | centerUserButton.setOnClickListener { | ||||
| if(context!=null && locationComponent.isLocationComponentEnabled) { | if(context!=null && locationComponent.isLocationComponentEnabled) { | ||||
| ▲ Show 20 Lines • Show All 583 Lines • ▼ Show 20 Lines | companion object { | ||||
| // Cannot use Parcelable as it requires higher version of Android | // Cannot use Parcelable as it requires higher version of Android | ||||
| //stop?.let{putParcelable(STOP_TO_SHOW, it)} | //stop?.let{putParcelable(STOP_TO_SHOW, it)} | ||||
| stop?.toBundle(it) | stop?.toBundle(it) | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| 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