I have FrameLayout like this:
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="changeColor"
android:text="new button"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="some text"/>
</FrameLayout>
The problem is that the button is displayed on top while FrameLayout class overview tells us this: "Child views are drawn in a stack, with the most recently added child on top".
For API < 21 you cant use android:stateListAnimator="@null" or change the elevation. In my case I used 2 frame layouts embedded in a constraint layout. As the frame layouts can be stacked upon each other there is no need to change the elevation of the textview.