Reputation: 2295
The following code is from the project https://github.com/android/databinding-samples.git
What does ^map mean in Android Studio 4.0 ? It seems that I can't delete it and I can't hide it.
Code Image
Upvotes: 1
Views: 85
Reputation: 8106
That is actually pointing that it is going to be returned to the lambda passed in the map
function.
By default the lambda name is same as the function you are calling (map
in this case), and by default the lambda returns the last expression that is when
in this case. So it will return it to the lambda. you can also explicitly specify that by return@map Popularity.STAR
as well.
You can also change the name of the lambda if that bothers you,
Transformations.map(_likes) myLambdaName@ {
when {
it > 9 -> Popularity.STAR // will show as `^myLambdaName`
it > 4 -> return@myLambdaName Popularity.POPULAR // explicitly specifying return statement
else -> Popularity.NORMAL // will show as `^myLambdaName`
}
}
Upvotes: 0
Reputation: 33441
It's Lambda return expression hints and you can hide them here in the settings:
Or via a quick action:
Upvotes: 1