I'm working on an Android app and I want to create a custom TicketView with a distinct cutout on the top. I'm using the com.vipulasri:ticketview library, and I have successfully created a basic TicketView. However, I'm struggling to figure out how to add a cutout on the top to give it a unique appearance.
Here's an example of what I'm trying to achieve:
I've checked the library's documentation, but I couldn't find any specific information on how to create a cutout like this.
Could someone guide me on how to achieve this effect? Do I need to create a custom background drawable, or is there a way to modify the TicketView properties to add this cutout?
I would appreciate any code examples or step-by-step instructions to help me implement this in my Android app. Thanks in advance!
What i have tried:
<com.vipulasri.ticketview.TicketView
android:id="@+id/ticketView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:tv_backgroundColor="#FF5733"
app:tv_cornerRadius="4dp"
app:tv_dashHeight="10dp"
app:tv_dashGap="4dp"
app:tv_text="Sample Ticket"
app:tv_textColor="#FFFFFF"
app:tv_textSize="16sp" />

You can use Android TicketView library instead. it has a nice property
app:ticketPunchLocationthat you can cutout a half circle from any side you want. For exampleapp:ticketPunchLocation="top|bottom"will cutout a half circle from top and bottom. For cutting corners useapp:ticketPunchRadius.So in your case use the following (change it according to your goal. play with all feature to reach what you are trying to achieve):
Update: If the above doesn't worked try to add the main classes and its attributes into your project like other classes.
Update 2: You can also use similar TicketView library that is working fine. See this example: (controll top and bottom circles using
boundary_topItemQuantityandboundary_bottomItemQuantity