// 표 : 고소인 fun tablePlaintiff(canvas: Canvas) { /** 변수 **/ val cellHeight = 30 // Row Height : 40 val columnWidth = 60f // 내부선 val secondColumn = 260f // 두번쨰 열 val vcOffset = 4f // 세로 중간을 맞추기 위한 오프셋 plaintiffList?.forEach() { // 첫째 행 // Rect canvas.drawRect(currentPOS.X.toFloat(), currentPOS.Y.toFloat(), endOfBody, currentPOS.Y.toFloat() + cellHeight, linePaint) // 첫쨰 줄 canvas.drawRect(currentPOS.X.toFloat(), currentPOS.Y.toFloat(), currentPOS.X.toFloat() + columnWidth, currentPOS.Y.toFloat() + cellHeight, cellFill) // 제목박스 canvas.drawRect(currentPOS.X.toFloat() + secondColumn, currentPOS.Y.toFloat(), currentPOS.X.toFloat() + secondColumn + columnWidth, currentPOS.Y.toFloat() + cellHeight, cellFill) // 두번째 제목박스 // Text canvas.drawText("이 름", currentPOS.X.toFloat() + columnWidth / 2, currentPOS.Y.toFloat() + cellHeight / 2 + vcOffset , cellHeader) canvas.drawText(it.pName, currentPOS.X.toFloat() + columnWidth + (secondColumn - columnWidth) / 2, currentPOS.Y.toFloat() + cellHeight / 2 + vcOffset, cellBody) canvas.drawText("주민번호", currentPOS.X.toFloat() + secondColumn + columnWidth / 2, currentPOS.Y.toFloat() + cellHeight / 2 + vcOffset, cellHeader) // 2번쨰 칸 canvas.drawText(it.socialNumber, currentPOS.X.toFloat() + secondColumn + columnWidth + (endOfBody - (currentPOS.X + secondColumn + columnWidth)) / 2, currentPOS.Y.toFloat() + cellHeight / 2 + vcOffset, cellBody) // 둘재 행 // Rect canvas.drawRect(currentPOS.X.toFloat(), currentPOS.Y.toFloat() + cellHeight, endOfBody, currentPOS.Y.toFloat() + cellHeight * 2, linePaint) // 둘쨰 줄 canvas.drawRect(currentPOS.X.toFloat(), currentPOS.Y.toFloat() + cellHeight, currentPOS.X.toFloat() + columnWidth, currentPOS.Y.toFloat() + cellHeight * 2, cellFill) // 제목박스 // Text canvas.drawText("주 소", currentPOS.X.toFloat() + columnWidth / 2, currentPOS.Y.toFloat() + cellHeight * 1 + cellHeight / 2 + vcOffset, cellHeader) canvas.drawText(it.pAddress, currentPOS.X.toFloat() + columnWidth + (endOfBody - (currentPOS.X + columnWidth)) / 2, currentPOS.Y.toFloat() + cellHeight * 1 + cellHeight / 2 + vcOffset, cellBody) // 셋쨰 행 // Rect canvas.drawRect(currentPOS.X.toFloat(), currentPOS.Y.toFloat() + cellHeight * 2, endOfBody, currentPOS.Y.toFloat() + cellHeight * 3, linePaint) // 셋쨰 줄 canvas.drawRect(currentPOS.X.toFloat(), currentPOS.Y.toFloat() + cellHeight * 2, currentPOS.X.toFloat() + columnWidth, currentPOS.Y.toFloat() + cellHeight * 3, cellFill) // 제목박스 // Text canvas.drawText("연 락 처", currentPOS.X.toFloat() + columnWidth / 2, currentPOS.Y.toFloat() + cellHeight * 2 + cellHeight / 2 + vcOffset, cellHeader) // 제목 canvas.drawText(it.pPhoneNumber, currentPOS.X.toFloat() + columnWidth + (endOfBody - (currentPOS.X + columnWidth)) / 2, currentPOS.Y.toFloat() + cellHeight * 2 + cellHeight / 2 + vcOffset, cellBody) // 내용 // 아래 여백 totalPOS += POS(0, cellHeight * 3 + 20) currentPOS += POS(0, cellHeight * 3 + 20) }?:{ canvas.drawRect(currentPOS.X.toFloat(), currentPOS.Y.toFloat(), endOfBody, currentPOS.Y.toFloat() + cellHeight, linePaint) // 첫쨰 줄 canvas.drawText("당사자 정보가 없습니다. 당사자를 추가했는지 확인하세요!", currentPOS.X.toFloat() + endOfBody / 2, currentPOS.Y.toFloat() + cellHeight / 2 + vcOffset , cellHeader) // 아래 여백 linefeed() } }