<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:layout_alignTop="@+id/iv_security_code"
android:layout_alignBottom="@+id/iv_security_code"
app:drawableLeftCompat="@drawable/ic_refresh_black_24dp"
android:gravity="center" />
This issue comes in android 20 version (KitKat) and working fine for Lolipop version devices.
Issue is, the tag android:gravity="center" is not working as expected. Check this image :

Got the hack to fix this issue: After changing android:layout_height="wrap_content" to some particular height and then it works. But still, this issue needs to be fixed.