Import Floating View: float your component. [FREE]
Extension.
And Use Itβs OverlapView
Block.
mainComponent
Will Be Your CardView
[Make Sure Elevation Of This Main CardView Is Set To 0]
childComponent
Will Be Your Ribbon Image
In gravity
Set Numbers From 0 To 8.
This Number Will Set Where Your Image Will Overlap On The Main CardView.
In margins
Set A List Of 4 Items, Each Item Will Be A Number, From 0 To β
This Number List Will Set Margins Between The Main CardView And Overlapped Image, In This Order -

Usage Example :
These Are The 2 Components On Screen -
[Surely You Can Do It With Dynamic Components ]
-
Green Card Is The Main Card View
-
Orange Card Is The Ribbon Image
Blocks -
gravity
= 2
= TopRight
Result -