The code is executed when the keyboard is closed. I do believe, however, that I have found a solution that seems to be working (I don't know if it would be appropriate for all people's scenarios, but it solved it for me). In the GlobalLayout handler, after doing the other stuff I needed to do, l temporarily stored the height (which would be either 0 for a row weight of 1 or a fixed height) of my RecyclerView as follows:
int prevheight = this.rvPlayerNamesInput.LayoutParameters.Height;
Then, after changing the RecyclerView's height back to either 0 (for a row weight of 1) or a fixed height, I compared the previous value to 0 before setting a View's Visibility (which could probably be almost any View, in my case I used a TextView which should be hidden at this point in my app) to Visible and then back to Gone as follows:
if (prevheight == 0)
{
this.tvPlayerNames.Visibility = ViewStates.Visible;
this.tvPlayerNames.Visibility = ViewStates.Gone;
}
I use this condition to avoid repetitive calling of GlobalLayout. I include this code for both opening & closing the keyboard, the only difference between the two is whether to use prevheight==0 or prevheight!=0. My app is not 100% finished, so it is always possible to find some scenario that needs a few extra tweaks (things always do, right?), but hopefully this can help everyone else, and me as well.