Fixes crash + visual improvement

hh
Laurent 5 years ago
parent c3f930e339
commit 425d05d436
  1. 2
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/replayer/FrameManager.kt
  2. 4
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/replayer/ReplayerAnimator.kt
  3. 24
      app/src/main/res/layout/fragment_replayer.xml

@ -41,13 +41,11 @@ class FrameManager {
* *
*/ */
fun frameType(frame: Int): FrameType { fun frameType(frame: Int): FrameType {
this.descriptors.forEach { descriptor -> this.descriptors.forEach { descriptor ->
if (frame in descriptor.range) { if (frame in descriptor.range) {
return descriptor.type return descriptor.type
} }
} }
throw PAIllegalStateException("frame $frame asked out of $totalAddedFrames defined frames, descriptor count = ${this.descriptors.size}") throw PAIllegalStateException("frame $frame asked out of $totalAddedFrames defined frames, descriptor count = ${this.descriptors.size}")
} }

@ -188,8 +188,10 @@ class ReplayerAnimator(var handHistory: HandHistory, var export: Boolean) {
* Let the animator know when a frame has been drawn * Let the animator know when a frame has been drawn
*/ */
fun frameDrawn() { fun frameDrawn() {
if (this.currentFrame < this.numberOfFramesForCurrentStep - 1) {
this.currentFrame += 1 this.currentFrame += 1
} }
}
/*** /***
* Reset the step and the frame to the start of the hand * Reset the step and the frame to the start of the hand
@ -301,7 +303,7 @@ class ReplayerAnimator(var handHistory: HandHistory, var export: Boolean) {
this.playerItemsWidth = this.tableHPadding * 2 * this.paddingPercentage this.playerItemsWidth = this.tableHPadding * 2 * this.paddingPercentage
this.chipRadius = this.playerItemsHeight / 4 this.chipRadius = this.playerItemsHeight / 4
val cardWPaddingWidth = this.playerItemsWidth * 1.2f / this.maxCards val cardWPaddingWidth = this.playerItemsWidth * 1.5f / this.maxCards
val cardWidth = cardWPaddingWidth * this.cardsPaddingPercentage val cardWidth = cardWPaddingWidth * this.cardsPaddingPercentage
this.cardSpecs = Size(cardWidth, cardWidth * 1.75f) this.cardSpecs = Size(cardWidth, cardWidth * 1.75f)
this.cardRadius = cardWidth / 4 this.cardRadius = cardWidth / 4

@ -60,8 +60,8 @@
style="@style/PokerAnalyticsTheme.ToolbarButton" style="@style/PokerAnalyticsTheme.ToolbarButton"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginStart="4dp" android:layout_marginStart="2dp"
android:layout_marginEnd="4dp" android:layout_marginEnd="2dp"
/> />
<ImageButton <ImageButton
@ -70,8 +70,8 @@
android:src="@drawable/ic_skip_next_white" android:src="@drawable/ic_skip_next_white"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginStart="4dp" android:layout_marginStart="2dp"
android:layout_marginEnd="4dp"/> android:layout_marginEnd="2dp"/>
<ImageButton <ImageButton
android:id="@+id/play_pause" android:id="@+id/play_pause"
@ -79,16 +79,16 @@
android:src="@drawable/ic_play_arrow" android:src="@drawable/ic_play_arrow"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginStart="4dp" android:layout_marginStart="2dp"
android:layout_marginEnd="4dp"/> android:layout_marginEnd="2dp"/>
<Button <Button
android:id="@+id/speed" android:id="@+id/speed"
style="@style/PokerAnalyticsTheme.ToolbarButton" style="@style/PokerAnalyticsTheme.ToolbarButton"
android:layout_width="68dp" android:layout_width="68dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginStart="4dp" android:layout_marginStart="2dp"
android:layout_marginEnd="4dp"/> android:layout_marginEnd="2dp"/>
<ImageButton <ImageButton
android:id="@+id/previous_action" android:id="@+id/previous_action"
@ -96,8 +96,8 @@
android:src="@drawable/ic_fast_rewind_white" android:src="@drawable/ic_fast_rewind_white"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginStart="4dp" android:layout_marginStart="2dp"
android:layout_marginEnd="4dp"/> android:layout_marginEnd="2dp"/>
<ImageButton <ImageButton
android:id="@+id/next_action" android:id="@+id/next_action"
@ -105,8 +105,8 @@
android:src="@drawable/ic_fast_forward_white" android:src="@drawable/ic_fast_forward_white"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginStart="4dp" android:layout_marginStart="2dp"
android:layout_marginEnd="4dp"/> android:layout_marginEnd="2dp"/>
</LinearLayout> </LinearLayout>

Loading…
Cancel
Save