From 87f4f8b668a5bdf90ca7cb45ca0e17dd31e58eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ug=CC=86ur=20Bug=CC=86a?= <> Date: Sat, 10 Jul 2021 17:22:03 +0300 Subject: [PATCH] fix border and divider visibility if you set ticketBackgroundBeforeDivider and ticketBackgroundAfterDivider then border and divider don't visible. Border and divider stays behind. First you draw border and divider, then you draw background. --- .../java/com/vipulasri/ticketview/TicketView.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ticketview/src/main/java/com/vipulasri/ticketview/TicketView.java b/ticketview/src/main/java/com/vipulasri/ticketview/TicketView.java index 79812c9..c43a5e6 100644 --- a/ticketview/src/main/java/com/vipulasri/ticketview/TicketView.java +++ b/ticketview/src/main/java/com/vipulasri/ticketview/TicketView.java @@ -115,18 +115,19 @@ protected void onDraw(Canvas canvas) { } canvas.drawPath(mPath, mBackgroundPaint); canvas.clipPath(mPath); - if (mShowBorder) { - canvas.drawPath(mPath, mBorderPaint); - } - if (mShowDivider) { - canvas.drawLine(mDividerStartX, mDividerStartY, mDividerStopX, mDividerStopY, mDividerPaint); - } + if (mBackgroundAfterDivider != null) { setTicketBackgroundAfterDivider(canvas); } if (mBackgroundBeforeDivider != null) { setTicketBackgroundBeforeDivider(canvas); } + if (mShowBorder) { + canvas.drawPath(mPath, mBorderPaint); + } + if (mShowDivider) { + canvas.drawLine(mDividerStartX, mDividerStartY, mDividerStopX, mDividerStopY, mDividerPaint); + } } private void doLayout() {