Adds hands count management

blinds
Laurent 5 years ago
parent 6b7eb38fc9
commit e663e55f1f
  1. 2
      app/src/main/AndroidManifest.xml
  2. 2
      app/src/main/java/net/pokeranalytics/android/calculus/Stat.kt
  3. 9
      app/src/main/java/net/pokeranalytics/android/model/migrations/PokerAnalyticsMigration.kt
  4. 23
      app/src/main/java/net/pokeranalytics/android/model/realm/Configuration.kt
  5. 3
      app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt
  6. 28
      app/src/main/java/net/pokeranalytics/android/model/realm/UserConfig.kt
  7. 2
      app/src/main/java/net/pokeranalytics/android/ui/fragment/SettingsFragment.kt
  8. 7
      app/src/main/java/net/pokeranalytics/android/ui/fragment/StatisticsFragment.kt
  9. 20
      app/src/main/java/net/pokeranalytics/android/ui/fragment/components/RealmFragment.kt
  10. 4
      app/src/main/java/net/pokeranalytics/android/ui/modules/calendar/CalendarFragment.kt
  11. 2
      app/src/main/java/net/pokeranalytics/android/ui/modules/feed/FeedFragment.kt
  12. 5
      app/src/main/java/net/pokeranalytics/android/ui/modules/session/SessionFragment.kt
  13. 27
      app/src/main/java/net/pokeranalytics/android/ui/modules/settings/DealtHandsPerHourActivity.kt
  14. 82
      app/src/main/java/net/pokeranalytics/android/ui/modules/settings/DealtHandsPerHourFragment.kt
  15. 14
      app/src/main/java/net/pokeranalytics/android/ui/view/rows/SessionPropertiesRow.kt
  16. 4
      app/src/main/java/net/pokeranalytics/android/ui/view/rows/SettingsRow.kt
  17. 5
      app/src/main/java/net/pokeranalytics/android/ui/viewmodel/BottomSheetViewModel.kt
  18. 15
      app/src/main/res/layout/activity_dealt_hands_config.xml
  19. 173
      app/src/main/res/layout/fragment_dealt_hands_config.xml
  20. 11
      app/src/main/res/menu/toolbar_dealt_hands_per_hour.xml
  21. 2
      app/src/main/res/values/strings.xml

@ -179,7 +179,7 @@
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity <activity
android:name="net.pokeranalytics.android.ui.modules.blogposts.BlogPostActivity" android:name="net.pokeranalytics.android.ui.modules.settings.DealtHandsPerHourActivity"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />

@ -242,7 +242,7 @@ enum class Stat(override var uniqueIdentifier: Int) : IntIdentifiable, RowRepres
get() { get() {
return when (this) { return when (this) {
HOURLY_DURATION, AVERAGE_HOURLY_DURATION, STANDARD_DEVIATION_BB, HOURLY_DURATION, AVERAGE_HOURLY_DURATION, STANDARD_DEVIATION_BB,
STANDARD_DEVIATION, STANDARD_DEVIATION_HOURLY, STANDARD_DEVIATION, STANDARD_DEVIATION_HOURLY, HANDS_PLAYED,
STANDARD_DEVIATION_BB_PER_100_HANDS -> false STANDARD_DEVIATION_BB_PER_100_HANDS -> false
else -> true else -> true
} }

@ -231,8 +231,15 @@ class PokerAnalyticsMigration : RealmMigration {
// Migrate to version 10 // Migrate to version 10
if (currentVersion == 9) { if (currentVersion == 9) {
schema.get("Session")?.addField("handsCount", Int::class.java) schema.get("Session")?.addField("handsCount", Int::class.java)
?.setRequired("handsCount", false)
val configSchema = schema.create("Configuration") schema.get("Session")?.transform { obj -> // otherwise we get a 0 default value
obj.setNull("handsCount")
}
val configSchema = schema.create("UserConfig")
configSchema.addField("id", String::class.java).setRequired("id", true)
configSchema.addPrimaryKey("id")
configSchema.addField("liveDealtHandsPerHour", Int::class.java) configSchema.addField("liveDealtHandsPerHour", Int::class.java)
configSchema.addField("onlineDealtHandsPerHour", Int::class.java) configSchema.addField("onlineDealtHandsPerHour", Int::class.java)

@ -1,23 +0,0 @@
package net.pokeranalytics.android.model.realm
import io.realm.Realm
import io.realm.RealmObject
class Configuration : RealmObject() {
companion object {
fun getConfiguration(realm: Realm): Configuration {
realm.where(Configuration::class.java).findFirst()?.let {
return it
}
return Configuration()
}
}
var liveDealtHandsPerHour: Int = 250
var onlineDealtHandsPerHour: Int = 500
}

@ -459,7 +459,7 @@ open class Session : RealmObject(), Savable, RowUpdatable, RowRepresentable, Tim
val numberOfHandsPerHour: Double val numberOfHandsPerHour: Double
get() { get() {
val tableSize = this.tableSize ?: 9 // 9 is the default table size if null val tableSize = this.tableSize ?: 9 // 9 is the default table size if null
val config = Configuration.getConfiguration(this.realm) val config = UserConfig.getConfiguration(this.realm)
val playerHandsPerHour = if (this.isLive) config.liveDealtHandsPerHour else config.onlineDealtHandsPerHour val playerHandsPerHour = if (this.isLive) config.liveDealtHandsPerHour else config.onlineDealtHandsPerHour
return playerHandsPerHour / tableSize.toDouble() return playerHandsPerHour / tableSize.toDouble()
} }
@ -813,6 +813,7 @@ open class Session : RealmObject(), Savable, RowUpdatable, RowRepresentable, Tim
tournamentFeatures.removeAll(this.tournamentFeatures) tournamentFeatures.removeAll(this.tournamentFeatures)
} }
} }
SessionPropertiesRow.HANDS_COUNT -> handsCount = (value as Double?)?.toInt()
is CustomField -> { is CustomField -> {
customFieldEntries.filter { it.customField?.id == row.id }.let { customFieldEntries.filter { it.customField?.id == row.id }.let {
customFieldEntries.removeAll(it) customFieldEntries.removeAll(it)

@ -0,0 +1,28 @@
package net.pokeranalytics.android.model.realm
import io.realm.Realm
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import java.util.*
open class UserConfig : RealmObject() {
companion object {
fun getConfiguration(realm: Realm): UserConfig {
realm.where(UserConfig::class.java).findFirst()?.let { config ->
return config
}
return UserConfig()
}
}
@PrimaryKey
var id = UUID.randomUUID().toString()
var liveDealtHandsPerHour: Int = 250
var onlineDealtHandsPerHour: Int = 500
}

@ -33,6 +33,7 @@ import net.pokeranalytics.android.ui.extensions.openUrl
import net.pokeranalytics.android.ui.fragment.components.RealmFragment import net.pokeranalytics.android.ui.fragment.components.RealmFragment
import net.pokeranalytics.android.ui.modules.bankroll.BankrollActivity import net.pokeranalytics.android.ui.modules.bankroll.BankrollActivity
import net.pokeranalytics.android.ui.modules.datalist.DataListActivity import net.pokeranalytics.android.ui.modules.datalist.DataListActivity
import net.pokeranalytics.android.ui.modules.settings.DealtHandsPerHourActivity
import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowRepresentable
import net.pokeranalytics.android.ui.view.rows.SettingsRow import net.pokeranalytics.android.ui.view.rows.SettingsRow
import net.pokeranalytics.android.util.* import net.pokeranalytics.android.util.*
@ -174,6 +175,7 @@ class SettingsFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRep
SettingsRow.CONTACT_US -> parentActivity?.openContactMail(R.string.contact) SettingsRow.CONTACT_US -> parentActivity?.openContactMail(R.string.contact)
SettingsRow.BUG_REPORT -> parentActivity?.openContactMail(R.string.bug_report_subject, Realm.getDefaultInstance().path) SettingsRow.BUG_REPORT -> parentActivity?.openContactMail(R.string.bug_report_subject, Realm.getDefaultInstance().path)
SettingsRow.CURRENCY -> CurrenciesActivity.newInstanceForResult(this@SettingsFragment, RequestCode.CURRENCY.value) SettingsRow.CURRENCY -> CurrenciesActivity.newInstanceForResult(this@SettingsFragment, RequestCode.CURRENCY.value)
SettingsRow.DEALT_HANDS_PER_HOUR -> DealtHandsPerHourActivity.newInstance(requireContext())
SettingsRow.EXPORT_CSV_SESSIONS -> this.sessionsCSVExport() SettingsRow.EXPORT_CSV_SESSIONS -> this.sessionsCSVExport()
SettingsRow.EXPORT_CSV_TRANSACTIONS -> this.transactionsCSVExport() SettingsRow.EXPORT_CSV_TRANSACTIONS -> this.transactionsCSVExport()
SettingsRow.FOLLOW_US -> { SettingsRow.FOLLOW_US -> {

@ -20,7 +20,7 @@ import net.pokeranalytics.android.exceptions.PAIllegalStateException
import net.pokeranalytics.android.model.filter.Query import net.pokeranalytics.android.model.filter.Query
import net.pokeranalytics.android.model.filter.QueryCondition import net.pokeranalytics.android.model.filter.QueryCondition
import net.pokeranalytics.android.model.realm.ComputableResult import net.pokeranalytics.android.model.realm.ComputableResult
import net.pokeranalytics.android.model.realm.Configuration import net.pokeranalytics.android.model.realm.UserConfig
import net.pokeranalytics.android.model.realm.Filter import net.pokeranalytics.android.model.realm.Filter
import net.pokeranalytics.android.ui.fragment.components.FilterableFragment import net.pokeranalytics.android.ui.fragment.components.FilterableFragment
import net.pokeranalytics.android.ui.fragment.components.RealmAsyncListener import net.pokeranalytics.android.ui.fragment.components.RealmAsyncListener
@ -70,7 +70,7 @@ class StatisticsFragment : FilterableFragment(), RealmAsyncListener {
this.currentFilterable = FilterableType.SESSION this.currentFilterable = FilterableType.SESSION
applyFilter() applyFilter()
addRealmChangeListener(this, Configuration::class.java) addRealmChangeListener(this, UserConfig::class.java)
addRealmChangeListener(this, ComputableResult::class.java) addRealmChangeListener(this, ComputableResult::class.java)
} }
@ -190,7 +190,8 @@ class StatisticsFragment : FilterableFragment(), RealmAsyncListener {
Stat.AVERAGE, Stat.AVERAGE,
Stat.NUMBER_OF_SETS, Stat.NUMBER_OF_SETS,
Stat.AVERAGE_HOURLY_DURATION, Stat.AVERAGE_HOURLY_DURATION,
Stat.HOURLY_DURATION Stat.HOURLY_DURATION,
Stat.HANDS_PLAYED
) )
val query = filter?.query ?: Query() val query = filter?.query ?: Query()

@ -41,15 +41,15 @@ open class RealmFragment : BaseFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
realm = Realm.getDefaultInstance() realm = Realm.getDefaultInstance()
// this.observedEntities.forEach { this.observedEntities.forEach {
// val realmResults = realm.where(it).findAll() val realmResults = realm.where(it).findAll()
//
// realmResults.addChangeListener { t, _ -> realmResults.addChangeListener { t, _ ->
// this.entitiesChanged(it, t) this.entitiesChanged(it, t)
// } }
//
// this.observedRealmResults.add(realmResults) this.observedRealmResults.add(realmResults)
// } }
return super.onCreateView(inflater, container, savedInstanceState) return super.onCreateView(inflater, container, savedInstanceState)
} }
@ -102,7 +102,7 @@ open class RealmFragment : BaseFragment() {
/** /**
* A list of RealmModel classes to observe * A list of RealmModel classes to observe
*/ */
// open val observedEntities: List<Class<out RealmModel>> = listOf() open val observedEntities: List<Class<out RealmModel>> = listOf()
/** /**
* The method called when a change happened in any RealmResults * The method called when a change happened in any RealmResults

@ -19,7 +19,7 @@ import net.pokeranalytics.android.model.Criteria
import net.pokeranalytics.android.model.combined import net.pokeranalytics.android.model.combined
import net.pokeranalytics.android.model.filter.QueryCondition import net.pokeranalytics.android.model.filter.QueryCondition
import net.pokeranalytics.android.model.realm.ComputableResult import net.pokeranalytics.android.model.realm.ComputableResult
import net.pokeranalytics.android.model.realm.Configuration import net.pokeranalytics.android.model.realm.UserConfig
import net.pokeranalytics.android.ui.adapter.RowRepresentableAdapter import net.pokeranalytics.android.ui.adapter.RowRepresentableAdapter
import net.pokeranalytics.android.ui.adapter.RowRepresentableDelegate import net.pokeranalytics.android.ui.adapter.RowRepresentableDelegate
import net.pokeranalytics.android.ui.adapter.StaticRowRepresentableDataSource import net.pokeranalytics.android.ui.adapter.StaticRowRepresentableDataSource
@ -88,7 +88,7 @@ class CalendarFragment : RealmFragment(), CoroutineScope, StaticRowRepresentable
initData() initData()
initUI() initUI()
addRealmChangeListener(this, Configuration::class.java) addRealmChangeListener(this, UserConfig::class.java)
addRealmChangeListener(this, ComputableResult::class.java) addRealmChangeListener(this, ComputableResult::class.java)
} }

@ -271,7 +271,7 @@ class FeedFragment : FilterableFragment(), RowRepresentableDelegate, PurchaseLis
} }
this.view?.viewTreeObserver?.addOnGlobalLayoutListener { this.view?.viewTreeObserver?.addOnGlobalLayoutListener {
Timber.d(">>> addOnGlobalLayoutListener called") // Timber.d(">>> addOnGlobalLayoutListener called")
retrieveLatestBlogPosts() // attempt to retrieve blog tips on display retrieveLatestBlogPosts() // attempt to retrieve blog tips on display
} }

@ -621,6 +621,11 @@ class SessionFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRepr
"defaultValue" to session.result?.tournamentFinalPosition "defaultValue" to session.result?.tournamentFinalPosition
) )
) )
SessionPropertiesRow.HANDS_COUNT -> row.editingDescriptors(
mapOf(
"defaultValue" to session.handsCount
)
)
SessionPropertiesRow.TIPS -> row.editingDescriptors( SessionPropertiesRow.TIPS -> row.editingDescriptors(
mapOf( mapOf(
"sb" to session.cgSmallBlind?.round(), "sb" to session.cgSmallBlind?.round(),

@ -0,0 +1,27 @@
package net.pokeranalytics.android.ui.modules.settings
import android.content.Context
import android.content.Intent
import android.os.Bundle
import net.pokeranalytics.android.R
import net.pokeranalytics.android.ui.activity.CurrenciesActivity
import net.pokeranalytics.android.ui.activity.components.BaseActivity
class DealtHandsPerHourActivity : BaseActivity() {
companion object {
fun newInstance(context: Context) {
val intent = Intent(context, DealtHandsPerHourActivity::class.java)
context.startActivity(intent)
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_dealt_hands_config)
}
}

@ -1,11 +1,89 @@
package net.pokeranalytics.android.ui.modules.settings package net.pokeranalytics.android.ui.modules.settings
import net.pokeranalytics.android.ui.fragment.components.BaseFragment import android.app.Activity
import android.os.Bundle
import android.view.*
import android.view.inputmethod.InputMethodManager
import kotlinx.android.synthetic.main.fragment_dealt_hands_config.*
import net.pokeranalytics.android.R
import net.pokeranalytics.android.databinding.FragmentDealtHandsConfigBinding
import net.pokeranalytics.android.model.realm.ComputableResult
import net.pokeranalytics.android.model.realm.Session
import net.pokeranalytics.android.model.realm.UserConfig
import net.pokeranalytics.android.ui.fragment.components.RealmFragment
class DealtHandsPerHourFragment : BaseFragment() {
class DealtHandsPerHourFragment : RealmFragment() {
private var _binding: FragmentDealtHandsConfigBinding? = null
private val binding get() = _binding!!
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
super.onCreateView(inflater, container, savedInstanceState)
_binding = FragmentDealtHandsConfigBinding.inflate(inflater, container, false)
return binding.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initUI()
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
menu.clear()
inflater.inflate(R.menu.toolbar_dealt_hands_per_hour, menu)
super.onCreateOptionsMenu(menu, inflater)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.save -> save()
}
return true
}
private fun initUI() {
setDisplayHomeAsUpEnabled(true)
val userConfig = UserConfig.getConfiguration(this.getRealm())
this.liveValue.hint = "${userConfig.liveDealtHandsPerHour}"
this.onlineValue.hint = "${userConfig.onlineDealtHandsPerHour}"
}
private fun save() {
getRealm().executeTransaction { realm ->
val userConfig = UserConfig.getConfiguration(realm)
this.liveValue.text.toString().toIntOrNull()?.let { liveDealtHandsPerHour ->
userConfig.liveDealtHandsPerHour = liveDealtHandsPerHour
}
this.onlineValue.text.toString().toIntOrNull()?.let { onlineDealtHandsPerHour ->
userConfig.onlineDealtHandsPerHour = onlineDealtHandsPerHour
}
realm.copyToRealmOrUpdate(userConfig)
// update all precomputed hand counts
realm.where(ComputableResult::class.java).findAll().forEach { cr ->
cr.session?.let { session ->
cr.estimatedHands = session.estimatedHands
}
}
}
this.liveValue.clearFocus()
this.onlineValue.clearFocus()
// Hides keyboard
val imm: InputMethodManager =
requireContext().getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(view!!.windowToken, 0)
}
} }

@ -48,9 +48,10 @@ enum class SessionPropertiesRow : RowRepresentable {
* Return the rows to display for the current session state * Return the rows to display for the current session state
*/ */
fun getRows(session: Session, resultCaptureType: ResultCaptureType?, context: Context): List<RowRepresentable> { fun getRows(session: Session, resultCaptureType: ResultCaptureType?, context: Context): List<RowRepresentable> {
val state = session.getState()
when (session.type) { when (session.type) {
Session.Type.TOURNAMENT.ordinal -> { Session.Type.TOURNAMENT.ordinal -> {
return when (session.getState()) { return when (state) {
SessionState.PENDING, SessionState.PLANNED -> { SessionState.PENDING, SessionState.PLANNED -> {
arrayListOf( arrayListOf(
GAME, GAME,
@ -93,12 +94,15 @@ enum class SessionPropertiesRow : RowRepresentable {
END_DATE, END_DATE,
BREAK_TIME BREAK_TIME
)) ))
if (state == SessionState.FINISHED) {
fields.add(HANDS_COUNT)
}
fields fields
} }
} }
} }
Session.Type.CASH_GAME.ordinal -> { Session.Type.CASH_GAME.ordinal -> {
when (session.getState()) { when (state) {
SessionState.PENDING, SessionState.PLANNED -> { SessionState.PENDING, SessionState.PLANNED -> {
return arrayListOf(GAME, BLINDS, LOCATION, BANKROLL, TABLE_SIZE, START_DATE, END_DATE) return arrayListOf(GAME, BLINDS, LOCATION, BANKROLL, TABLE_SIZE, START_DATE, END_DATE)
} }
@ -140,6 +144,9 @@ enum class SessionPropertiesRow : RowRepresentable {
BREAK_TIME BREAK_TIME
) )
) )
if (state == SessionState.FINISHED) {
fields.add(HANDS_COUNT)
}
return fields return fields
} }
} }
@ -274,7 +281,8 @@ enum class SessionPropertiesRow : RowRepresentable {
} }
HANDS_COUNT -> { HANDS_COUNT -> {
arrayListOf( arrayListOf(
RowRepresentableEditDescriptor(inputType = InputType.TYPE_CLASS_NUMBER) RowRepresentableEditDescriptor(inputType = InputType.TYPE_CLASS_NUMBER
or InputType.TYPE_NUMBER_FLAG_SIGNED)
) )
} }
GAME -> { GAME -> {

@ -35,6 +35,7 @@ enum class SettingsRow : RowRepresentable {
// Preferences // Preferences
LANGUAGE, LANGUAGE,
CURRENCY, CURRENCY,
DEALT_HANDS_PER_HOUR,
// Export // Export
EXPORT_CSV_SESSIONS, EXPORT_CSV_SESSIONS,
@ -78,7 +79,7 @@ enum class SettingsRow : RowRepresentable {
rows.addAll(arrayListOf(FOLLOW_US, DISCORD, BLOG_TIPS, SHOULD_SHOW_BLOG_TIPS)) rows.addAll(arrayListOf(FOLLOW_US, DISCORD, BLOG_TIPS, SHOULD_SHOW_BLOG_TIPS))
rows.add(CustomizableRowRepresentable(customViewType = RowViewType.HEADER_TITLE, resId = R.string.preferences)) rows.add(CustomizableRowRepresentable(customViewType = RowViewType.HEADER_TITLE, resId = R.string.preferences))
rows.addAll(arrayListOf(CURRENCY)) rows.addAll(arrayListOf(CURRENCY, DEALT_HANDS_PER_HOUR))
rows.add(CustomizableRowRepresentable(customViewType = RowViewType.HEADER_TITLE, resId = R.string.export)) rows.add(CustomizableRowRepresentable(customViewType = RowViewType.HEADER_TITLE, resId = R.string.export))
rows.addAll(arrayListOf(EXPORT_CSV_SESSIONS, EXPORT_CSV_TRANSACTIONS)) rows.addAll(arrayListOf(EXPORT_CSV_SESSIONS, EXPORT_CSV_TRANSACTIONS))
@ -127,6 +128,7 @@ enum class SettingsRow : RowRepresentable {
GDPR -> R.string.gdpr GDPR -> R.string.gdpr
POKER_RUMBLE -> R.string.poker_rumble POKER_RUMBLE -> R.string.poker_rumble
DISCORD -> R.string.join_discord DISCORD -> R.string.join_discord
DEALT_HANDS_PER_HOUR -> R.string.dealt_hands_per_hour
else -> null else -> null
} }
} }

@ -24,8 +24,6 @@ class BottomSheetViewModelFactory(var row: RowRepresentable, var delegate: RowRe
class BottomSheetViewModel(var row: RowRepresentable) : ViewModel() { class BottomSheetViewModel(var row: RowRepresentable) : ViewModel() {
// lateinit var row: RowRepresentable
var currentCurrency: Currency? = null var currentCurrency: Currency? = null
var valueAsHint: Boolean = false var valueAsHint: Boolean = false
var isClearable: Boolean = true var isClearable: Boolean = true
@ -49,7 +47,6 @@ class BottomSheetViewModel(var row: RowRepresentable) : ViewModel() {
this.limit = 0 this.limit = 0
} }
/** /**
* Storage for a data that has been newly created * Storage for a data that has been newly created
*/ */
@ -164,7 +161,7 @@ class BottomSheetViewModel(var row: RowRepresentable) : ViewModel() {
BottomSheetType.NUMERIC_TEXT -> { BottomSheetType.NUMERIC_TEXT -> {
val bottomSheetData = val bottomSheetData =
this.rowRepresentableEditDescriptors this.rowRepresentableEditDescriptors
?: throw RowRepresentableEditDescriptorException("RowRepresentableEditDescriptor not found") ?: throw RowRepresentableEditDescriptorException("RowRepresentableEditDescriptor not found: $row")
bottomSheetData[0].defaultValue?.let { bottomSheetData[0].defaultValue?.let {
this.doubleValue = it.toString().toDoubleOrNull() this.doubleValue = it.toString().toDoubleOrNull()
} }

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/currenciesFragment"
android:name="net.pokeranalytics.android.ui.modules.settings.DealtHandsPerHourFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_currencies" />
</LinearLayout>

@ -1,76 +1,123 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<androidx.appcompat.widget.AppCompatTextView <com.google.android.material.appbar.AppBarLayout
android:id="@+id/liveTitle" android:id="@+id/appBar"
style="@style/PokerAnalyticsTheme.TextView.RowTitle" android:layout_width="match_parent"
android:layout_width="wrap_content" android:layout_height="128dp"
android:layout_height="wrap_content" android:theme="@style/PokerAnalyticsTheme.Toolbar.Session"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Title" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/liveValue"
style="@style/PokerAnalyticsTheme.TextView.RowValue"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:ellipsize="end"
android:gravity="end"
android:maxLines="1"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Value" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/onlineTitle"
style="@style/PokerAnalyticsTheme.TextView.RowTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toBottomOf="@id/liveTitle"
tools:text="Title" /> <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsingToolbar"
<androidx.appcompat.widget.AppCompatTextView android:layout_width="match_parent"
android:id="@+id/onlineValue" android:layout_height="match_parent"
style="@style/PokerAnalyticsTheme.TextView.RowValue" app:collapsedTitleTextAppearance="@style/PokerAnalyticsTheme.Toolbar.CollapsedTitleAppearance"
android:layout_width="0dp" app:contentScrim="?attr/colorPrimary"
android:layout_height="wrap_content" app:expandedTitleGravity="bottom"
android:layout_marginStart="16dp" app:expandedTitleMarginStart="72dp"
android:ellipsize="end" app:expandedTitleTextAppearance="@style/PokerAnalyticsTheme.Toolbar.ExpandedTitleAppearance"
android:gravity="end" app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">
android:maxLines="1"
app:layout_constraintEnd_toEndOf="parent" <androidx.appcompat.widget.Toolbar
app:layout_constraintBottom_toBottomOf="parent" android:id="@+id/toolbar"
app:layout_constraintTop_toBottomOf="@id/liveValue" android:layout_width="match_parent"
tools:text="Value" /> android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
<androidx.appcompat.widget.AppCompatTextView app:title="@string/dealt_hands_per_hour"
android:id="@+id/explanation" app:titleTextColor="@color/white" />
style="@style/PokerAnalyticsTheme.TextView.RowValue"
android:layout_width="0dp" </com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:orientation="vertical"
android:ellipsize="end" android:padding="16dp"
android:gravity="end"
android:maxLines="10"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/onlineValue" app:layout_constraintTop_toBottomOf="@id/appBar">
tools:text="Value" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="50dp">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/liveTitle"
style="@style/PokerAnalyticsTheme.TextView.RowTitle"
android:layout_width="wrap_content"
android:layout_height="22dp"
android:layout_gravity="center_vertical"
android:text="@string/live"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/liveValue"
style="@style/PokerAnalyticsTheme.TextView.RowValue"
android:textAlignment="textEnd"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:textColorHint="@color/kaki_lighter"
android:inputType="number"
android:maxLines="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Value" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="center_vertical">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/onlineTitle"
style="@style/PokerAnalyticsTheme.TextView.RowTitle"
android:layout_width="wrap_content"
android:layout_height="22dp"
android:layout_gravity="center_vertical"
android:text="@string/online"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/onlineValue"
style="@style/PokerAnalyticsTheme.TextView.RowValue"
android:textAlignment="textEnd"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:textColorHint="@color/kaki_lighter"
android:inputType="number"
android:maxLines="1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
tools:text="Value" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.AppCompatTextView
style="@style/PokerAnalyticsTheme.TextView.RowValue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:textSize="14sp"
android:maxLines="8"
android:text="@string/dhph_explanation" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/save"
android:title="@string/save"
android:icon="@drawable/ic_check"
app:showAsAction="ifRoom" />
</menu>

@ -814,5 +814,7 @@
<string name="itm_ratio">ITM ratio</string> <string name="itm_ratio">ITM ratio</string>
<string name="hands_count">Hands count</string> <string name="hands_count">Hands count</string>
<string name="estimated">estimated</string> <string name="estimated">estimated</string>
<string name="dhph_explanation">You can change the DHPH (Dealt Hands Per Hour) values here. It corresponds to the total number of hands all players receives at a table in one hour. Example: Your local 10-max game deals 25 hands per hour, enter 10 x 25 = 250.</string>
<string name="dealt_hands_per_hour">Dealt hands per hour</string>
</resources> </resources>

Loading…
Cancel
Save