On a button click, I am attempting to inflate an EditText
above a RecyclerView
. But instead of the EditText being added to the top of the layout, t
Is this TextView related to items in RecyclerView such that you want to treat it as an item? If so, add EditText as a new view type to your adapter (to index 0) and call notifyItemInserted(0). In response, RecyclerView will call onBind where you can return your EditText. This way, RecyclerView can nicely animate Views down while fading in EditText. If you can post your adapter, I'm happy to post an example comde.
If you don't want to add it inside the RecyclerView, you have two options: - Set top margin on the RecyclerView or top padding when you add the edit text. - Use a linear layout instead of a frame layout and use TransitionManager to animate.
I still think you should consider adding it as an item to your adapter so that LayoutManager can handle focus changes etc. (and it also moves w/ the rest of the list)