Here the easiest and performant way to hide title in appbar when your CollapsingToolbarLayout is expanded
First method
First add app:expandedTitleTextColor="@android:color/transparent"
to collapssingToolbar, so our title won't show until collapsed
<com.google.android.material.appbar.CollapsingToolbarLayout
...
app:expandedTitleTextColor="@android:color/transparent"
/>
Second add java code, so we will show this title in appbar
mCollapsingToolbarLayout.setTitleEnabled(true);
You are done.
And don't ever use addOnOffsetChangedListener to setTitle to empty string and title, because you will be flooded with
requestLayout() improperly called by androidx.appcompat.widget.AppCompatTextView{d67976 V.ED..... ........ 252,51-936,144} during second layout pass: posting in next frame
First method can show slightly seen transparent text, so we can make size of text 0.1 to make it hidden
Second method
add style
<style name="CollapsingToolbarLayoutExpandedTextStyle">
<item name="android:textColor">@android:color/transparent</item>
<item name="android:textSize">0.1sp</item>
</style>
add property to xml
<com.google.android.material.appbar.CollapsingToolbarLayout
...
app:expandedTitleTextAppearance="@style/CollapsingToolbarLayoutExpandedTextStyle"
/>
mCollapsingToolbarLayout.setTitleEnabled(true);