Adds Tag for Player button + stuff

hh
Laurent 6 years ago
parent bc21a39e9a
commit 88ebaba62f
  1. 45
      app/src/main/java/net/pokeranalytics/android/ui/fragment/FeedFragment.kt
  2. 2
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt
  3. 49
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryFragment.kt
  4. 1
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/PlayerSetupRow.kt

@ -463,51 +463,6 @@ class FeedFragment : FilterableFragment(), RowRepresentableDelegate {
HandHistoryActivity.newInstance(this)
// Timber.d("**** Start video test")
//
// val width = 480
// val height = 480
//
// val bitmap = Bitmap.createBitmap(480, 480, Bitmap.Config.ARGB_8888)
// val canvas = Canvas(bitmap)
//
// val paint = Paint()
// paint.isAntiAlias = true
// paint.style = Paint.Style.STROKE
// paint.strokeWidth = 20.0.toFloat()
// paint.color = requireContext().getColor(R.color.blue)
//
// canvas.drawRect(Rect(0,0, width, height), paint)
//
// bitmap.let {
//
// val muxer = MMediaMuxer()
//
// Timber.d("width = ${it.width}, height = ${it.height}")
//
// val width = (it.width / 2) * 2
// val height= (it.height / 2) * 2
//
// muxer.Init(requireActivity(), width, height, "hhVideo", "YES!")
//
// Timber.d("**** Adds frames")
// for (i in 0..50) {
//
// try {
// val byteArray = it.toByteArray()
// muxer.AddFrame(byteArray)
// } catch (e: Exception) {
// Timber.e("error = ${e.message}")
// }
// }
// Timber.d("**** Create video")
// muxer.CreateVideo()
//
// val path = muxer.GetPath()
// Timber.d("**** Video path = $path")
// }
}
/**

@ -465,6 +465,8 @@ class HandHistoryAdapter(
init {
itemView.ps_player_button.tag = PlayerSetupRow.Tag.PLAYER.ordinal
setOnClickListener(itemView.ps_player_button)
itemView.stack_edit_text.tag = PlayerSetupRow.Tag.STACK.ordinal

@ -119,6 +119,8 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL
val row = this.model.rowRepresentableForPosition(it.index) as HandHistoryRow
// row.performActionForTag(it.tag)
row.keyboardForTag(it.tag)?.let { keyboard ->
when (keyboard) {
@ -549,6 +551,9 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL
this.findNextActionToEdit(0)
}
/***
* Shows a popup with the various export options
*/
private fun exportHand() {
val builder: AlertDialog.Builder = AlertDialog.Builder(context)
@ -572,6 +577,50 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL
private fun videoExport() {
// Timber.d("**** Start video test")
//
// val width = 480
// val height = 480
//
// val bitmap = Bitmap.createBitmap(480, 480, Bitmap.Config.ARGB_8888)
// val canvas = Canvas(bitmap)
//
// val paint = Paint()
// paint.isAntiAlias = true
// paint.style = Paint.Style.STROKE
// paint.strokeWidth = 20.0.toFloat()
// paint.color = requireContext().getColor(R.color.blue)
//
// canvas.drawRect(Rect(0,0, width, height), paint)
//
// bitmap.let {
//
// val muxer = MMediaMuxer()
//
// Timber.d("width = ${it.width}, height = ${it.height}")
//
// val width = (it.width / 2) * 2
// val height= (it.height / 2) * 2
//
// muxer.Init(requireActivity(), width, height, "hhVideo", "YES!")
//
// Timber.d("**** Adds frames")
// for (i in 0..50) {
//
// try {
// val byteArray = it.toByteArray()
// muxer.AddFrame(byteArray)
// } catch (e: Exception) {
// Timber.e("error = ${e.message}")
// }
// }
// Timber.d("**** Create video")
// muxer.CreateVideo()
//
// val path = muxer.GetPath()
// Timber.d("**** Video path = $path")
// }
}
private fun gifExport() {

@ -24,6 +24,7 @@ class PlayerSetupRow(var hero: Boolean = false,
}
enum class Tag {
PLAYER,
POSITION,
HAND,
STACK

Loading…
Cancel
Save