From 102353db1eb874e9ee1215d554f1b642f6efad24 Mon Sep 17 00:00:00 2001 From: Laurent Date: Wed, 15 Feb 2023 10:12:01 +0100 Subject: [PATCH] cleanup --- .../ui/modules/handhistory/replayer/ReplayerAnimator.kt | 6 +++--- .../android/ui/modules/handhistory/replayer/TableDrawer.kt | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/replayer/ReplayerAnimator.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/replayer/ReplayerAnimator.kt index 695faa5b..0a35800c 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/replayer/ReplayerAnimator.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/replayer/ReplayerAnimator.kt @@ -97,7 +97,7 @@ class ReplayerAnimator(var handHistory: HandHistory, var export: Boolean) { * 2/ The last frame of the last step is longer because some video players * auto-replay videos, and we want viewers to visualize the end. */ - private val visualOccurences: Int + private val visualOccurrences: Int get() { val step = this.currentStep return when { @@ -536,7 +536,7 @@ class ReplayerAnimator(var handHistory: HandHistory, var export: Boolean) { val bitmap = Bitmap.createBitmap(this.width.toInt(), this.height.toInt(), Bitmap.Config.ARGB_8888) val canvas = Canvas(bitmap) - vo = this.visualOccurences / 90.0 // this is needed before the call to drawTable which pass to the next frame + vo = this.visualOccurrences / 90.0 // this is needed before the call to drawTable which pass to the next frame this.drawer.drawTable(canvas, context) @@ -588,7 +588,7 @@ class ReplayerAnimator(var handHistory: HandHistory, var export: Boolean) { // Timber.d("FRAME [$f] >> step: $currentStepIndex, frame: $currentFrameIndex, vo: ${this.visualOccurences}, type: ${this.frameType}") val bitmap = Bitmap.createBitmap(this.width.toInt(), this.height.toInt(), Bitmap.Config.ARGB_8888) val canvas = Canvas(bitmap) - val vo = this.visualOccurences // this is needed before the call to drawTable which pass to the next frame + val vo = this.visualOccurrences // this is needed before the call to drawTable which pass to the next frame this.drawer.drawTable(canvas, context) diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/replayer/TableDrawer.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/replayer/TableDrawer.kt index 4972c2ab..f98020d4 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/replayer/TableDrawer.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/replayer/TableDrawer.kt @@ -1,7 +1,10 @@ package net.pokeranalytics.android.ui.modules.handhistory.replayer import android.content.Context -import android.graphics.* +import android.graphics.Canvas +import android.graphics.DashPathEffect +import android.graphics.Paint +import android.graphics.RectF import androidx.core.content.res.ResourcesCompat import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory import net.pokeranalytics.android.R @@ -250,7 +253,7 @@ class TableDrawer { cardRects.forEachIndexed { j, cardRect -> val showVillainHands = Preferences.getShowVillainCards(context) - if (j < cards?.size ?: 0 && (showVillainHands || isHero)) { // show card + if (j < (cards?.size ?: 0) && (showVillainHands || isHero)) { // show card val card = cards?.get(j)!! // tested line before drawCard(card, cardRect, canvas, context) } else { // show hidden cards