From 3e1f0345e725c576821dcfdb1faa79a944a4c2ce Mon Sep 17 00:00:00 2001 From: Laurent Date: Mon, 22 Jun 2020 16:15:44 +0200 Subject: [PATCH] Makes folds faster and the end longer --- .../handhistory/replayer/ReplayerAnimator.kt | 28 ++++--------------- 1 file changed, 6 insertions(+), 22 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 7744e04a..0410828b 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 @@ -85,19 +85,20 @@ class ReplayerAnimator(var handHistory: HandHistory, var export: Boolean) { } /*** - * Returns the number of visual occurrences for the current frame - * This function returns a longer value for the last frame of the last step - * because some player auto-replay videos because we want the viewer to have a pause. + * Returns the number of visual occurrences for the current frame with some specific cases: + * 1/ Preflop folds are faster due to their "useless-ivity" + * 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 get() { val step = this.currentStep return when { step is ComputedAction && step.street == Street.PREFLOP && step.action.type == Action.Type.FOLD -> { - FrameType.STATE.visualOccurences / 3 + FrameType.STATE.visualOccurences / 4 } this.currentStepIndex == this.steps.size - 1 && this.currentFrameIndex == this.numberOfFramesForCurrentStep - 1 -> { - FrameType.STATE.visualOccurences * 3 + FrameType.STATE.visualOccurences * 4 } else -> this.frameType.visualOccurences } @@ -659,23 +660,6 @@ class ReplayerAnimator(var handHistory: HandHistory, var export: Boolean) { } -// do { -// -// do { -// -// val bitmap = Bitmap.createBitmap(this.width.toInt(), this.height.toInt(), Bitmap.Config.ARGB_8888) -// val canvas = Canvas(bitmap) -// TableDrawer.drawTable(this, canvas, context) -// -// Timber.d("frame drawn at step: $currentStepIndex, frame: $currentFrame") -// frameHandler(bitmap, this.visualOccurences) -// -// } while (this.shouldShowAdditionalFrame) -// -// nextStep() -// -// } while (this.hasMoreSteps) - } /***