Skip to content

Commit

Permalink
Update DirectionsFragment.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
Altonss committed Jan 7, 2024
1 parent b45882e commit 5767e76
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ class DirectionsFragment : TransportrFragment() {
private fun onLocationsChanged() {
val fromNotEmpty = this.viewModel.fromLocation.value != null
val toNotEmpty = this.viewModel.toLocation.value != null
swapIcon.visibility = if (fromNotEmpty || toNotEmpty) VISIBLE else GONE
swapIcon.isEnabled = fromNotEmpty || toNotEmpty
// If icon disabled, grey it out
swapIcon.alpha = if (swapIcon.isEnabled) 1.0f else 0.5f
}

override fun onSaveInstanceState(outState: Bundle) {
Expand Down

0 comments on commit 5767e76

Please sign in to comment.