|
|
|
|
@ -6,6 +6,7 @@ import android.graphics.Canvas |
|
|
|
|
import android.graphics.RectF |
|
|
|
|
import net.pokeranalytics.android.exceptions.PAIllegalStateException |
|
|
|
|
import net.pokeranalytics.android.model.handhistory.Street |
|
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.Action |
|
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.HandHistory |
|
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.model.ActionList |
|
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.model.ComputedAction |
|
|
|
|
@ -90,11 +91,17 @@ class ReplayerAnimator(var handHistory: HandHistory, var export: Boolean) { |
|
|
|
|
*/ |
|
|
|
|
private val visualOccurences: Int |
|
|
|
|
get() { |
|
|
|
|
return if (this.currentStepIndex == this.steps.size - 1 && this.currentFrameIndex == this.numberOfFramesForCurrentStep - 1) { |
|
|
|
|
FrameType.STATE.visualOccurences * 3 |
|
|
|
|
} else { |
|
|
|
|
this.frameType.visualOccurences |
|
|
|
|
val step = this.currentStep |
|
|
|
|
return when { |
|
|
|
|
step is ComputedAction && step.street == Street.PREFLOP && step.action.type == Action.Type.FOLD -> { |
|
|
|
|
FrameType.STATE.visualOccurences / 3 |
|
|
|
|
} |
|
|
|
|
this.currentStepIndex == this.steps.size - 1 && this.currentFrameIndex == this.numberOfFramesForCurrentStep - 1 -> { |
|
|
|
|
FrameType.STATE.visualOccurences * 3 |
|
|
|
|
} |
|
|
|
|
else -> this.frameType.visualOccurences |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
|
@ -153,6 +160,7 @@ class ReplayerAnimator(var handHistory: HandHistory, var export: Boolean) { |
|
|
|
|
this.actionList.load(handHistory) |
|
|
|
|
this.steps = HandStep.createSteps(handHistory) |
|
|
|
|
defineFramesForCurrentStep() |
|
|
|
|
this.frameManager.defineFrameDescriptor(this.currentFrameIndex) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
|
@ -636,12 +644,14 @@ class ReplayerAnimator(var handHistory: HandHistory, var export: Boolean) { |
|
|
|
|
|
|
|
|
|
(0 until this.frameManager.totalFrames).forEach { f -> |
|
|
|
|
|
|
|
|
|
Timber.d("FRAME [$f] >> step: $currentStepIndex, frame: $currentFrameIndex") |
|
|
|
|
// 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 |
|
|
|
|
|
|
|
|
|
TableDrawer.drawTable(this, canvas, context) |
|
|
|
|
|
|
|
|
|
frameHandler(bitmap, this.visualOccurences) |
|
|
|
|
frameHandler(bitmap, vo) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|