dev_raz_wip
Razmig Sarkissian 7 years ago
commit f5aa689b50
  1. 4
      app/build.gradle
  2. 2
      app/src/main/AndroidManifest.xml
  3. 8
      app/src/main/java/net/pokeranalytics/android/PokerAnalyticsApplication.kt
  4. 118
      app/src/main/java/net/pokeranalytics/android/calculus/Calculator.kt
  5. 4
      app/src/main/java/net/pokeranalytics/android/calculus/Computable.kt
  6. 35
      app/src/main/java/net/pokeranalytics/android/calculus/Stat.kt
  7. 9
      app/src/main/java/net/pokeranalytics/android/model/realm/Bankroll.kt
  8. 2
      app/src/main/java/net/pokeranalytics/android/model/realm/Result.kt
  9. 274
      app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt
  10. 61
      app/src/main/java/net/pokeranalytics/android/model/realm/TimeFrame.kt
  11. 15
      app/src/main/java/net/pokeranalytics/android/model/realm/TimeFrameGroup.kt
  12. 52
      app/src/main/java/net/pokeranalytics/android/ui/activity/DataListActivity.kt
  13. 18
      app/src/main/java/net/pokeranalytics/android/ui/activity/HomeActivity.kt
  14. 3
      app/src/main/java/net/pokeranalytics/android/ui/adapter/HistoryAdapter.kt
  15. 79
      app/src/main/java/net/pokeranalytics/android/ui/adapter/SettingsAdapter.kt
  16. 51
      app/src/main/java/net/pokeranalytics/android/ui/adapter/components/DataListAdapter.kt
  17. 62
      app/src/main/java/net/pokeranalytics/android/ui/adapter/components/DynamicListAdapter.kt
  18. 107
      app/src/main/java/net/pokeranalytics/android/ui/adapter/components/DynamicRowInterface.kt
  19. 56
      app/src/main/java/net/pokeranalytics/android/ui/adapter/components/RowViewType.kt
  20. 83
      app/src/main/java/net/pokeranalytics/android/ui/fragment/DataListFragment.kt
  21. 2
      app/src/main/java/net/pokeranalytics/android/ui/fragment/HistoryFragment.kt
  22. 29
      app/src/main/java/net/pokeranalytics/android/ui/fragment/NewSessionFragment.kt
  23. 103
      app/src/main/java/net/pokeranalytics/android/ui/fragment/SettingsFragment.kt
  24. 57
      app/src/main/java/net/pokeranalytics/android/ui/fragment/components/BottomSheetBlindsFragment.kt
  25. 61
      app/src/main/java/net/pokeranalytics/android/ui/fragment/components/BottomSheetDateFragment.kt
  26. 143
      app/src/main/java/net/pokeranalytics/android/ui/fragment/components/BottomSheetFragment.kt
  27. 77
      app/src/main/java/net/pokeranalytics/android/ui/fragment/components/BottomSheetGameFragment.kt
  28. 55
      app/src/main/java/net/pokeranalytics/android/ui/view/DataRowView.kt
  29. 5
      app/src/main/java/net/pokeranalytics/android/ui/view/SessionRowView.kt
  30. 26
      app/src/main/java/net/pokeranalytics/android/util/DatePickerFragment.kt
  31. 1
      app/src/main/java/net/pokeranalytics/android/util/PokerAnalyticsFragment.kt
  32. 9
      app/src/main/java/net/pokeranalytics/android/util/PokerAnalyticsLogs.kt
  33. 26
      app/src/main/java/net/pokeranalytics/android/util/TimePickerFragment.kt
  34. BIN
      app/src/main/res/drawable-xxhdpi/add_button_background.png
  35. BIN
      app/src/main/res/drawable-xxhdpi/add_cash_game.png
  36. BIN
      app/src/main/res/drawable-xxhdpi/add_hand.png
  37. BIN
      app/src/main/res/drawable-xxhdpi/add_tournoi.png
  38. BIN
      app/src/main/res/drawable-xxhdpi/add_transaction.png
  39. BIN
      app/src/main/res/drawable-xxhdpi/back_disclosure.png
  40. BIN
      app/src/main/res/drawable-xxhdpi/big_export.png
  41. BIN
      app/src/main/res/drawable-xxhdpi/blog.png
  42. BIN
      app/src/main/res/drawable-xxhdpi/blog_black.png
  43. BIN
      app/src/main/res/drawable-xxhdpi/bottom_disclosure.png
  44. BIN
      app/src/main/res/drawable-xxhdpi/chip.png
  45. BIN
      app/src/main/res/drawable-xxhdpi/clock.png
  46. BIN
      app/src/main/res/drawable-xxhdpi/cross.png
  47. BIN
      app/src/main/res/drawable-xxhdpi/disclosure.png
  48. BIN
      app/src/main/res/drawable-xxhdpi/facebook.png
  49. BIN
      app/src/main/res/drawable-xxhdpi/facebook_black.png
  50. BIN
      app/src/main/res/drawable-xxhdpi/fullscreen.png
  51. BIN
      app/src/main/res/drawable-xxhdpi/icon_poker_chip.png
  52. BIN
      app/src/main/res/drawable-xxhdpi/info.png
  53. BIN
      app/src/main/res/drawable-xxhdpi/insta.png
  54. BIN
      app/src/main/res/drawable-xxhdpi/insta_black.png
  55. BIN
      app/src/main/res/drawable-xxhdpi/logo_pa.png
  56. BIN
      app/src/main/res/drawable-xxhdpi/pause.png
  57. BIN
      app/src/main/res/drawable-xxhdpi/picto_allin.png
  58. BIN
      app/src/main/res/drawable-xxhdpi/picto_arrow_down.png
  59. BIN
      app/src/main/res/drawable-xxhdpi/picto_arrow_raise.png
  60. BIN
      app/src/main/res/drawable-xxhdpi/picto_arrow_right.png
  61. BIN
      app/src/main/res/drawable-xxhdpi/picto_arrow_up.png
  62. BIN
      app/src/main/res/drawable-xxhdpi/picto_bankroll.png
  63. BIN
      app/src/main/res/drawable-xxhdpi/picto_call_allin.png
  64. BIN
      app/src/main/res/drawable-xxhdpi/picto_cards.png
  65. BIN
      app/src/main/res/drawable-xxhdpi/picto_check.png
  66. BIN
      app/src/main/res/drawable-xxhdpi/picto_comment.png
  67. BIN
      app/src/main/res/drawable-xxhdpi/picto_engrenage.png
  68. BIN
      app/src/main/res/drawable-xxhdpi/picto_gear.png
  69. BIN
      app/src/main/res/drawable-xxhdpi/picto_gear_selected.png
  70. BIN
      app/src/main/res/drawable-xxhdpi/picto_m.png
  71. BIN
      app/src/main/res/drawable-xxhdpi/picto_reports.png
  72. BIN
      app/src/main/res/drawable-xxhdpi/picto_reports_selected.png
  73. BIN
      app/src/main/res/drawable-xxhdpi/picto_stars.png
  74. BIN
      app/src/main/res/drawable-xxhdpi/picto_stars_selected.png
  75. BIN
      app/src/main/res/drawable-xxhdpi/picto_stats.png
  76. BIN
      app/src/main/res/drawable-xxhdpi/picto_table.png
  77. BIN
      app/src/main/res/drawable-xxhdpi/picto_user.png
  78. BIN
      app/src/main/res/drawable-xxhdpi/picto_user_empty.png
  79. BIN
      app/src/main/res/drawable-xxhdpi/pin.png
  80. BIN
      app/src/main/res/drawable-xxhdpi/pro_subscriber.png
  81. BIN
      app/src/main/res/drawable-xxhdpi/release_note_icon.png
  82. BIN
      app/src/main/res/drawable-xxhdpi/round_free.png
  83. BIN
      app/src/main/res/drawable-xxhdpi/star_pro.png
  84. BIN
      app/src/main/res/drawable-xxhdpi/star_semipro.png
  85. BIN
      app/src/main/res/drawable-xxhdpi/tab_calendar.png
  86. BIN
      app/src/main/res/drawable-xxhdpi/three_lines.png
  87. BIN
      app/src/main/res/drawable-xxhdpi/top_disclosure.png
  88. BIN
      app/src/main/res/drawable-xxhdpi/twitter.png
  89. BIN
      app/src/main/res/drawable-xxhdpi/twitter_black.png
  90. 5
      app/src/main/res/drawable/ic_add_white_24dp.xml
  91. 5
      app/src/main/res/drawable/ic_check_white_24dp.xml
  92. 9
      app/src/main/res/drawable/ic_close_24dp.xml
  93. 5
      app/src/main/res/drawable/ic_close_white_24dp.xml
  94. 5
      app/src/main/res/drawable/ic_delete_white_24dp.xml
  95. 16
      app/src/main/res/drawable/rectangle_rounded_green.xml
  96. 14
      app/src/main/res/drawable/rectangle_rounded_green_ripple.xml
  97. 13
      app/src/main/res/layout/activity_data_list.xml
  98. 47
      app/src/main/res/layout/activity_home.xml
  99. 13
      app/src/main/res/layout/bottom_sheet_bankroll.xml
  100. 59
      app/src/main/res/layout/bottom_sheet_blinds.xml
  101. Some files were not shown because too many files have changed in this diff Show More

@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: 'realm-android' apply plugin: 'realm-android'
apply plugin: 'io.fabric' //apply plugin: 'io.fabric'
repositories { repositories {
maven { url 'https://maven.fabric.io/public' } maven { url 'https://maven.fabric.io/public' }
@ -51,7 +51,7 @@ dependencies {
implementation 'com.google.firebase:firebase-core:16.0.7' implementation 'com.google.firebase:firebase-core:16.0.7'
// Crashlytics // Crashlytics
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9' //implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
// Kotlin // Kotlin
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1'

@ -20,7 +20,7 @@
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".ui.activity.DataListActivity" />
<activity <activity
android:name=".ui.activity.NewSessionActivity" android:name=".ui.activity.NewSessionActivity"
android:launchMode="singleTop"/> android:launchMode="singleTop"/>

@ -1,11 +1,9 @@
package net.pokeranalytics.android package net.pokeranalytics.android
import android.app.Application import android.app.Application
import com.crashlytics.android.Crashlytics
import io.fabric.sdk.android.Fabric
import io.realm.Realm import io.realm.Realm
import io.realm.Realm.setDefaultConfiguration
import io.realm.RealmConfiguration import io.realm.RealmConfiguration
import net.pokeranalytics.android.util.PokerAnalyticsLogs
import timber.log.Timber import timber.log.Timber
@ -24,9 +22,9 @@ class PokerAnalyticsApplication: Application() {
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
// Logs // Logs
Timber.plant(Timber.DebugTree()) Timber.plant(PokerAnalyticsLogs())
} else { } else {
Fabric.with(this, Crashlytics()) //Fabric.with(this, Crashlytics())
} }
} }

@ -1,5 +1,6 @@
package net.pokeranalytics.android.calculus package net.pokeranalytics.android.calculus
import net.pokeranalytics.android.calculus.Stat.*
import net.pokeranalytics.android.model.realm.TimeFrameGroup import net.pokeranalytics.android.model.realm.TimeFrameGroup
@ -25,6 +26,15 @@ class Calculator {
var evolutionValues: EvolutionValues = EvolutionValues.NONE var evolutionValues: EvolutionValues = EvolutionValues.NONE
var displayedStats: List<Stat> = listOf() var displayedStats: List<Stat> = listOf()
fun shouldComputeStandardDeviation() : Boolean {
this.displayedStats.forEach { stat ->
when (stat) {
STANDARD_DEVIATION, STANDARD_DEVIATION_HOURLY, STANDARD_DEVIATION_BB_PER_100_HANDS -> return true
}
}
return false
}
// var aggregation: Aggregation? = null // var aggregation: Aggregation? = null
} }
@ -62,43 +72,113 @@ class Calculator {
fun compute(group: SessionGroup, options: Options) : ComputedResults { fun compute(group: SessionGroup, options: Options) : ComputedResults {
val sessions: List<SessionInterface> = group.sessionGroup val sessions: List<SessionInterface> = group.sessionGroup
val series: Set<TimeFrameGroup> = setOf() // @todo get unique list of serie val sessionGroups: Set<TimeFrameGroup> = setOf() // @todo get unique list of serie
var results: ComputedResults = ComputedResults() var results: ComputedResults = ComputedResults()
var sum: Double = 0.0 var sum: Double = 0.0
var duration: Double = 0.0 var totalHands: Double = 0.0
var bbSum: Double = 0.0
var bbSessionCount: Int = 0
var winningSessionCount: Int = 0
var totalBuyin: Double = 0.0
// @todo add all stats // @todo add all stats
// Compute for each session // Compute for each session
sessions.forEach { item -> var index: Int = 0
sum += item.value sessions.forEach { s ->
index++;
when (options.evolutionValues) {
Options.EvolutionValues.STANDARD -> { bbSessionCount += s.bigBlindSessionCount
results.addEvolutionValue(sum, Stat.NETRESULT) if (s.value >= 0) {
} winningSessionCount++
Options.EvolutionValues.DATED -> { }
results.addEvolutionValue(sum, duration, Stat.NETRESULT) totalBuyin += s.buyin
}
if (options.evolutionValues != Options.EvolutionValues.NONE) {
sum += s.value
totalHands += s.estimatedHands
bbSum += s.bbNetResult
results.addEvolutionValue(sum / index, AVERAGE)
results.addEvolutionValue(index.toDouble(), NUMBER_OF_GAMES)
results.addEvolutionValue(bbSum / bbSessionCount, AVERAGE_NET_BB)
results.addEvolutionValue((winningSessionCount / index).toDouble(), WIN_RATIO)
results.addEvolutionValue(totalBuyin / index, AVERAGE_BUYIN)
results.addEvolutionValue(Stat.returnOnInvestment(sum, totalBuyin), ROI)
} }
} }
// Compute for each serie // Compute for each serie
series.forEach { serie -> var duration: Double = 0.0
duration += serie.duration var hourlyRate: Double = 0.0; var hourlyRateBB: Double = 0.0
index = 0; sum = 0.0; totalHands = 0.0; bbSum = 0.0;
sessionGroups.forEach { group ->
index++
duration += group.duration
sum += group.netResult
totalHands += group.estimatedHands
bbSum += group.bbNetResult
hourlyRate = sum / duration * 3600.0
hourlyRateBB = bbSum / duration * 3600.0
if (options.evolutionValues != Options.EvolutionValues.NONE) { if (options.evolutionValues != Options.EvolutionValues.NONE) {
results.addEvolutionValue(duration, Stat.DURATION) results.addEvolutionValue(sum, duration, NETRESULT)
results.addEvolutionValue(sum / duration * 3600.0, duration, HOURLY_RATE)
results.addEvolutionValue(Stat.netBBPer100Hands(bbSum, totalHands), duration, NET_BB_PER_100_HANDS)
results.addEvolutionValue(hourlyRate, duration, HOURLY_RATE)
results.addEvolutionValue(index.toDouble(), duration, NUMBER_OF_GROUPS)
results.addEvolutionValue(group.duration, duration, DURATION)
results.addEvolutionValue(duration / index, duration, AVERAGE_DURATION)
results.addEvolutionValue(hourlyRateBB, duration, HOURLY_RATE_BB)
} }
} }
val average: Double = sum / sessions.size
// Create stats // Create stats
results.addStats(setOf( results.addStats(setOf(
ComputedStat(Stat.NETRESULT, sum), ComputedStat(NETRESULT, sum),
ComputedStat(Stat.AVERAGE,sum / sessions.size), ComputedStat(HOURLY_RATE, hourlyRate),
ComputedStat(Stat.DURATION, duration) ComputedStat(AVERAGE, average),
)) ComputedStat(DURATION, duration),
ComputedStat(NUMBER_OF_GROUPS, sessionGroups.size.toDouble()),
ComputedStat(NUMBER_OF_GAMES, sessions.size.toDouble()),
ComputedStat(AVERAGE_DURATION, (duration / 3600.0) / sessions.size),
ComputedStat(NET_BB_PER_100_HANDS, Stat.netBBPer100Hands(bbSum, totalHands)),
ComputedStat(HOURLY_RATE_BB, bbSum / duration * 3600.0),
ComputedStat(AVERAGE_NET_BB, bbSum / bbSessionCount),
ComputedStat(WIN_RATIO, (winningSessionCount / sessions.size).toDouble()),
ComputedStat(AVERAGE_BUYIN, totalBuyin / sessions.size),
ComputedStat(ROI, Stat.returnOnInvestment(sum, totalBuyin))
))
// Standard Deviation
if (options.shouldComputeStandardDeviation()) {
var stdSum: Double = 0.0
sessions.forEach { s ->
stdSum += Math.pow(s.value - average, 2.0)
}
val standardDeviation: Double = Math.sqrt(stdSum / sessions.size)
var hourlyStdSum: Double = 0.0
sessionGroups.forEach { sg ->
hourlyStdSum += Math.pow(sg.hourlyRate - hourlyRate, 2.0)
}
val hourlyStandardDeviation: Double = Math.sqrt(hourlyStdSum / sessionGroups.size)
results.addStats(setOf(
ComputedStat(STANDARD_DEVIATION, standardDeviation),
ComputedStat(Stat.STANDARD_DEVIATION_HOURLY, hourlyStandardDeviation)
))
}
return results return results
} }

@ -10,6 +10,10 @@ interface Summable {
// An interface describing some class that can be computed // An interface describing some class that can be computed
interface SessionInterface : Summable { interface SessionInterface : Summable {
var serie: TimeFrameGroup var serie: TimeFrameGroup
var estimatedHands: Double
var bbNetResult: Double
var bigBlindSessionCount: Int // 0 or 1
var buyin: Double
} }
/** /**

@ -7,25 +7,48 @@ interface AnyStat {
enum class Stat : AnyStat { enum class Stat : AnyStat {
NETRESULT, NETRESULT,
HOURLYRATE, HOURLY_RATE,
DURATION,
AVERAGE, AVERAGE,
STANDARDDEVIATION, NUMBER_OF_GROUPS,
HOURLYSTANDARDDEVIATION; NUMBER_OF_GAMES,
DURATION,
AVERAGE_DURATION,
NET_BB_PER_100_HANDS,
HOURLY_RATE_BB,
AVERAGE_NET_BB,
WIN_RATIO,
AVERAGE_BUYIN,
ROI,
STANDARD_DEVIATION,
STANDARD_DEVIATION_HOURLY,
STANDARD_DEVIATION_BB_PER_100_HANDS;
fun label() : String = when (this) { fun label() : String = when (this) {
NETRESULT -> "" NETRESULT -> ""
HOURLYRATE -> "" HOURLY_RATE -> ""
else -> throw IllegalArgumentException("Label not defined") else -> throw IllegalArgumentException("Label not defined")
} }
fun hasDistributionSorting() : Boolean { fun hasDistributionSorting() : Boolean {
when (this) { when (this) {
STANDARDDEVIATION, HOURLYSTANDARDDEVIATION -> return true STANDARD_DEVIATION, STANDARD_DEVIATION_HOURLY, STANDARD_DEVIATION_BB_PER_100_HANDS -> return true
else -> return false else -> return false
} }
} }
companion object {
fun returnOnInvestment(netResult: Double, buyin: Double) : Double {
return netResult / buyin
}
fun netBBPer100Hands(netBB: Double, numberOfHands: Double) : Double {
return netBB / numberOfHands * 100
}
}
} }
enum class CashSessionStat : AnyStat { enum class CashSessionStat : AnyStat {

@ -1,12 +1,17 @@
package net.pokeranalytics.android.model.realm package net.pokeranalytics.android.model.realm
import android.content.Context
import io.realm.RealmList import io.realm.RealmList
import io.realm.RealmObject import io.realm.RealmObject
import io.realm.annotations.PrimaryKey import io.realm.annotations.PrimaryKey
import net.pokeranalytics.android.ui.adapter.components.DisplayableData
import net.pokeranalytics.android.ui.adapter.components.DynamicRowInterface
import net.pokeranalytics.android.ui.adapter.components.RowViewType
import net.pokeranalytics.android.ui.fragment.components.BottomSheetType
import java.util.* import java.util.*
open class Bankroll(name: String = "") : RealmObject() { open class Bankroll(name: String = "") : RealmObject(), DisplayableData {
@PrimaryKey @PrimaryKey
var id = UUID.randomUUID().toString() var id = UUID.randomUUID().toString()
@ -24,4 +29,6 @@ open class Bankroll(name: String = "") : RealmObject() {
var currency: Currency? = null var currency: Currency? = null
// @todo rate management // @todo rate management
override var title: String = this.name
} }

@ -36,7 +36,7 @@ open class Result : RealmObject() {
} }
// The net (readonly) // The net (readonly)
var net: Double? = null var net: Double = 0.0
// The transactions associated with the Result, impacting the result // The transactions associated with the Result, impacting the result
var transactions: RealmList<Transaction> = RealmList() var transactions: RealmList<Transaction> = RealmList()

@ -1,92 +1,150 @@
package net.pokeranalytics.android.model.realm package net.pokeranalytics.android.model.realm
import io.realm.RealmList import io.realm.*
import io.realm.Realm import io.realm.annotations.Ignore
import io.realm.RealmObject
import io.realm.RealmResults
import io.realm.Sort
import io.realm.annotations.PrimaryKey import io.realm.annotations.PrimaryKey
import net.pokeranalytics.android.* import net.pokeranalytics.android.ui.adapter.components.DynamicRowDelegate
import net.pokeranalytics.android.ui.adapter.components.DynamicRowInterface
import net.pokeranalytics.android.ui.adapter.components.SessionRow
import net.pokeranalytics.android.util.data.sessionDao import net.pokeranalytics.android.util.data.sessionDao
import java.util.* import java.util.*
import java.util.UUID.randomUUID import kotlin.collections.ArrayList
open class Session(comment: String = "") : RealmObject(), DynamicRowDelegate {
open class Session(comment: String = "") : RealmObject() { @PrimaryKey
var id = UUID.randomUUID().toString()
@PrimaryKey // The result of the main user
var id = UUID.randomUUID().toString() var result: Result? = null
// The time frame of the Session, i.e. the start & end date // The time frame of the Session, i.e. the start & end date
var timeFrame: TimeFrame? = null var timeFrame: TimeFrame? = null
// The time frame group, which can contain multiple sessions // The time frame group, which can contain multiple sessions
var timeFrameGroup: TimeFrameGroup? = null var timeFrameGroup: TimeFrameGroup? = null
// the date of creation of the app // the date of creation of the app
var creationDate: Date = Date() var creationDate: Date = Date()
// The limit type: NL, PL... // The bankroll hosting the results
var bankroll: Bankroll? = null
// The limit type: NL, PL...
var limit: Int? = null var limit: Int? = null
// The number of tables played at the same time // The game played during the Session
var numberOfTables: Int = 1 var game: Game? = null
// The number of players at the table // The number of players at the table
var tableSize: Int? = null var tableSize: Int? = null
// The game played during the Session // the location where the session is played
var game: Game? = null var location: Location? = null
// The bankroll hosting the results // The number of tables played at the same time
var bankroll: Bankroll? = null var numberOfTables: Int = 1
// The hands list associated with the Session // The hands list associated with the Session
var hands: RealmList<HandHistory> = RealmList() var hands: RealmList<HandHistory> = RealmList()
// the location where the session is played // The list of opponents who participated to the session
var location: Location? = null
// The result of the main user
var result: Result? = null
// The list of opponents who participated to the session
var opponents: RealmList<Player> = RealmList() var opponents: RealmList<Player> = RealmList()
// A comment written by the user // A comment written by the user
var comment: String = "" var comment: String = ""
// Cash Game // Cash Game
// The small blind value // The small blind value
var cgSmallBlind: Double? = null var cgSmallBlind: Double? = null
// The big blind value // The big blind value
var cgBigBlind: Double? = null var cgBigBlind: Double? = null
// Tournament // Tournament
// The entry fee of the tournament // The entry fee of the tournament
var tournamentEntryFee: Double? = null var tournamentEntryFee: Double? = null
// The total number of players who participated in the tournament // The total number of players who participated in the tournament
var tournamentNumberOfPlayers: Int? = null var tournamentNumberOfPlayers: Int? = null
// The name of the tournament // The name of the tournament
var tournamentType: TournamentName? = null var tournamentType: TournamentName? = null
// The kind of the tournament, MTT or SnG // The kind of the tournament, MTT or SnG
var tournamentKind: Int? = null var tournamentKind: Int? = null
// The features of the tournament, like Knockout, Shootout, Turbo... // The features of the tournament, like Knockout, Shootout, Turbo...
var tournamentFeatures: RealmList<TournamentFeature> = RealmList() var tournamentFeatures: RealmList<TournamentFeature> = RealmList()
companion object {
fun newInstance() : Session {
var session: Session = Session()
session.result = Result()
session.timeFrame = TimeFrame()
return session
}
}
@Ignore
var estimatedHands: Double = 0.0
@Ignore
var bbNetResult: Double = 0.0
get() {
this.cgBigBlind?.let { bb ->
this.result?.let { result ->
return result.net / bb
}
}
return 0.0
}
@Ignore
var bigBlindSessionCount: Int = if (this.cgBigBlind != null) 1 else 0
// get() = if (this.cgBigBlind != null) 1 else 0
@Ignore
var buyin: Double = 0.0
get() {
this.result?.let {
it.buyin?.let {
return it
}
}
return 0.0
}
override fun adapterRows(): ArrayList<DynamicRowInterface> {
val rows = ArrayList<DynamicRowInterface>()
rows.addAll(SessionRow.values())
return rows
}
override fun boolForRow(row: DynamicRowInterface): Boolean {
return false
}
override fun stringForRow(row: DynamicRowInterface): String {
return when (row) {
SessionRow.BLINDS -> "Blinds"
SessionRow.GAME -> "Game"
SessionRow.DATE -> "Date"
else -> "--"
}
}
} }
enum class TournamentKind { enum class TournamentKind {
MTT, MTT,
SNG SNG
} }
@ -95,63 +153,63 @@ enum class TournamentKind {
*/ */
class SessionDao(realmDb: Realm) { class SessionDao(realmDb: Realm) {
var realm: Realm = realmDb var realm: Realm = realmDb
/** /**
* Create or update session * Create or update session
*/ */
fun createOrUpdateSession(session: Session): Session { fun createOrUpdateSession(session: Session): Session {
realm.beginTransaction() realm.beginTransaction()
val sessionToSave = realm.copyToRealmOrUpdate(session) val sessionToSave = realm.copyToRealmOrUpdate(session)
realm.commitTransaction() realm.commitTransaction()
return realm.copyFromRealm(sessionToSave) return realm.copyFromRealm(sessionToSave)
} }
/** /**
* Create or update sessions * Create or update sessions
*/ */
fun createOrUpdateSessions(sessions: List<Session>): List<Session> { fun createOrUpdateSessions(sessions: List<Session>): List<Session> {
realm.beginTransaction() realm.beginTransaction()
// Update // Update
val sessionsToSave = realm.copyToRealmOrUpdate(sessions) val sessionsToSave = realm.copyToRealmOrUpdate(sessions)
realm.commitTransaction() realm.commitTransaction()
return realm.copyFromRealm(sessionsToSave) return realm.copyFromRealm(sessionsToSave)
} }
/** /**
* Find all sessions * Find all sessions
*/ */
fun findAllSessions(): RealmResults<Session> { fun findAllSessions(): RealmResults<Session> {
return realm.where(Session::class.java).findAll().sort("creationDate", Sort.DESCENDING) return realm.where(Session::class.java).findAll().sort("creationDate", Sort.DESCENDING)
} }
/** /**
* Find session by id * Find session by id
*/ */
fun findSessionById(sessionId: Int): Session? { fun findSessionById(sessionId: Int): Session? {
return realm.copyFromRealm(realm.where(Session::class.java).equalTo("id", sessionId).findFirst()) return realm.copyFromRealm(realm.where(Session::class.java).equalTo("id", sessionId).findFirst())
} }
/** /**
* Delete session * Delete session
*/ */
fun deleteSession(sessionId: Int) { fun deleteSession(sessionId: Int) {
realm.beginTransaction() realm.beginTransaction()
realm.sessionDao().findSessionById(sessionId)?.deleteFromRealm() realm.sessionDao().findSessionById(sessionId)?.deleteFromRealm()
realm.commitTransaction() realm.commitTransaction()
} }
/** /**
* Delete all sessions * Delete all sessions
*/ */
fun deleteAllSessions() { fun deleteAllSessions() {
realm.beginTransaction() realm.beginTransaction()
realm.sessionDao().findAllSessions().deleteAllFromRealm() realm.sessionDao().findAllSessions().deleteAllFromRealm()
realm.commitTransaction() realm.commitTransaction()
} }
} }

@ -1,24 +1,79 @@
package net.pokeranalytics.android.model.realm package net.pokeranalytics.android.model.realm
import io.realm.RealmObject import io.realm.RealmObject
import io.realm.annotations.PrimaryKey import io.realm.RealmResults
import io.realm.annotations.LinkingObjects
import java.util.* import java.util.*
open class TimeFrame : RealmObject() { open class TimeFrame : RealmObject() {
// A start date // A start date
var startDate: Date = Date() var startDate: Date = Date()
set(value) {
field = value
this.computeDuration()
if (this.session != null) {
this.notifyDateChange()
}
}
// An end date // An end date
var endDate: Date? = null var endDate: Date? = null
set(value) {
field = value
this.computeDuration()
if (this.session != null) {
this.notifyDateChange()
}
}
// The break duration // The break duration
var breakDuration: Double = 0.0 var breakDuration: Long = 0L
set(value) {
field = value
this.computeDuration()
}
// the total duration // the total duration
var duration: Double = 0.0 var duration: Long = 0L
private set
// indicates a state of pause // indicates a state of pause
var paused: Boolean = false var paused: Boolean = false
@LinkingObjects("timeFrame")
private val session: RealmResults<Session>? = null
@LinkingObjects("timeFrame")
private val group: RealmResults<TimeFrameGroup>? = null
private fun computeDuration() {
var endDate: Date
if (this.endDate != null) {
endDate = this.endDate!!
} else {
endDate = Date()
}
this.duration = endDate.time - startDate.time - this.breakDuration
}
private fun notifyDateChange() {
// val realm = Realm.getDefaultInstance()
//
// var query: RealmQuery<TimeFrame> = realm.where(TimeFrame::class.java)
// query.greaterThan("startDate", this.startDate.time)
//
// this.endDate?.let { endDate ->
// query.or()
// .greaterThan("startDate", endDate.time)
// .lessThan("endDate", endDate.time)
// }
//
//
// realm.close()
}
} }

@ -3,8 +3,6 @@ package net.pokeranalytics.android.model.realm
import io.realm.RealmList import io.realm.RealmList
import io.realm.RealmObject import io.realm.RealmObject
import io.realm.annotations.Ignore import io.realm.annotations.Ignore
import io.realm.annotations.PrimaryKey
import java.util.*
open class TimeFrameGroup() : RealmObject() { open class TimeFrameGroup() : RealmObject() {
@ -13,10 +11,21 @@ open class TimeFrameGroup() : RealmObject() {
var timeFrame: TimeFrame? = null var timeFrame: TimeFrame? = null
// The list of Session played within the group, i.e. played within the same time frame // The list of Session played within the group, i.e. played within the same time frame
var timeFrames: RealmList<Session> = RealmList() var sessions: RealmList<Session> = RealmList()
@Ignore // a duration shortcut @Ignore // a duration shortcut
var duration: Double = 0.0 var duration: Double = 0.0
@Ignore // a netResult shortcut
var netResult: Double = 0.0
@Ignore // a duration shortcut
var hourlyRate: Double = 0.0
@Ignore
var estimatedHands: Double = 0.0
@Ignore
var bbNetResult: Double = 0.0
} }

@ -0,0 +1,52 @@
package net.pokeranalytics.android.ui.activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import io.realm.Realm
import io.realm.kotlin.where
import kotlinx.android.synthetic.main.activity_data_list.*
import net.pokeranalytics.android.R
import net.pokeranalytics.android.model.realm.Session
import net.pokeranalytics.android.ui.fragment.DataListFragment
import net.pokeranalytics.android.util.PokerAnalyticsActivity
import net.pokeranalytics.android.util.data.sessionDao
import java.util.*
class DataListActivity : PokerAnalyticsActivity() {
companion object {
fun newInstance(context: Context, dataType: Int) {
val intent = Intent(context, DataListActivity::class.java)
intent.putExtra("dataType", dataType)
context.startActivity(intent)
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_data_list)
initUI()
}
/**
* Init UI
*/
private fun initUI() {
val dataType = intent.getIntExtra("dataType", 0)
val fragment = dataListFragment as DataListFragment
fragment.setData(dataType)
}
/**
* Init data
*/
private fun initData() {
}
}

@ -66,16 +66,16 @@ class HomeActivity : PokerAnalyticsActivity() {
private fun createDefaultSessions() { private fun createDefaultSessions() {
val realm = Realm.getDefaultInstance() val realm = Realm.getDefaultInstance()
realm.sessionDao().deleteAllSessions() if (realm.where(Session::class.java).findAll().isEmpty()) {
realm.sessionDao().deleteAllSessions()
val data = ArrayList<Session>() val data = ArrayList<Session>()
for (i in 0..100) {
for (i in 0..100) { val session = Session()
val session = Session() session.creationDate = Date()
session.creationDate = Date() data.add(session)
data.add(session) }
realm.sessionDao().createOrUpdateSessions(data)
} }
realm.sessionDao().createOrUpdateSessions(data)
realm.close() realm.close()
} }

@ -8,7 +8,6 @@ import io.realm.RealmResults
import kotlinx.android.synthetic.main.row_history_session.view.* import kotlinx.android.synthetic.main.row_history_session.view.*
import net.pokeranalytics.android.R import net.pokeranalytics.android.R
import net.pokeranalytics.android.model.realm.Session import net.pokeranalytics.android.model.realm.Session
import net.pokeranalytics.android.ui.view.SessionRowView
import timber.log.Timber import timber.log.Timber
class HistoryAdapter(private var sessions: RealmResults<Session>) : RecyclerView.Adapter<RecyclerView.ViewHolder>() { class HistoryAdapter(private var sessions: RealmResults<Session>) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
@ -25,8 +24,6 @@ class HistoryAdapter(private var sessions: RealmResults<Session>) : RecyclerView
inner class RowSessionViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { inner class RowSessionViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
fun bind(session: Session?) { fun bind(session: Session?) {
Timber.d("Bind session")
session?.let { session?.let {
itemView.sessionRow.setData(session) itemView.sessionRow.setData(session)
itemView.sessionRow.setOnClickListener { itemView.sessionRow.setOnClickListener {

@ -1,79 +0,0 @@
package net.pokeranalytics.android.ui.adapter
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.row_data_cell.view.*
import kotlinx.android.synthetic.main.row_history_session.view.*
import net.pokeranalytics.android.R
class SettingsAdapter() : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
companion object {
const val ROW_DATA: Int = 100
enum class DataType {
BANKROLL {
override fun localizedName(): String {
return "Bankroll"
}
},
GAME {
override fun localizedName(): String {
return "Game"
}
},
LOCATION {
override fun localizedName(): String {
return "Location"
}
},
TOURNAMENT_TYPE {
override fun localizedName(): String {
return "Tournament Type"
}
},
TRANSACTION_TYPE {
override fun localizedName(): String {
return "Transaction"
}
};
abstract fun localizedName(): String
}
}
var onClickOnData: ((position: Int, dataType: Int) -> Unit)? = null
inner class RowDataViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
fun bind(dataType: DataType) {
itemView.dataRow.setData(dataType.localizedName())
itemView.dataRow.setOnClickListener {
onClickOnData?.invoke(adapterPosition, dataType.ordinal)
}
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
when (viewType) {
ROW_DATA -> return RowDataViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.row_data_cell, parent, false))
else -> throw IllegalStateException("Need to implement type $viewType in Settings Adapter")
}
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
when (getItemViewType(position)) {
ROW_DATA -> (holder as SettingsAdapter.RowDataViewHolder).bind(enumValues<DataType>()[position])
}
}
override fun getItemCount(): Int {
return enumValues<DataType>().count()
}
override fun getItemViewType(position: Int): Int {
return ROW_DATA
}
}

@ -0,0 +1,51 @@
package net.pokeranalytics.android.ui.adapter.components
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.row_session.view.*
import net.pokeranalytics.android.R
interface DataRowDelegate {
fun data(position: Int) : DisplayableData
fun size() : Int
}
interface DataRowCallback {
fun onRowSelected(position: Int)
}
interface DisplayableData {
var title: String
}
class DataListAdapter(var delegate: DataRowDelegate, var callBackDelegate: DataRowCallback? = null) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
inner class DataViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
fun bind(row: DisplayableData, listener: View.OnClickListener) {
itemView.title.text = row.title
itemView.container.setOnClickListener(listener)
}
}
override fun getItemViewType(position: Int): Int {
return RowViewType.TITLE.ordinal
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
return DataViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.row_title, parent, false))
}
override fun getItemCount(): Int {
return delegate.size()
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
val listener = View.OnClickListener {
callBackDelegate?.onRowSelected(position)
}
(holder as DataViewHolder).bind(this.delegate.data(position), listener)
}
}

@ -1,39 +1,45 @@
package net.pokeranalytics.android.ui.adapter.components package net.pokeranalytics.android.ui.adapter.components
import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
enum class RowType { interface EditableDataDelegate {
fun setValue(value: Any, row: DynamicRowInterface)
}
interface DynamicRowDelegate {
fun adapterRows() : ArrayList<DynamicRowInterface>
fun boolForRow(row: DynamicRowInterface) : Boolean { return false }
fun stringForRow(row: DynamicRowInterface) : String { return "" }
/**
* Manages:
* - label (string)
* - segmented control (live/online)
* - textfield (string)
* - switch (bool)
* - static content
* */
} }
//interface RowDelegate { interface DynamicRowCallback {
// fun onRowSelected(row: DynamicRowInterface)
// fun groupedRow() : ArrayList<RowGroup>() }
// fun (row: DynamicRowInterface) : String
//}
class DynamicListAdapter(var delegate: DynamicRowDelegate, var callBackDelegate: DynamicRowCallback? = null) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
class DynamicListAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>() { private var rows: ArrayList<DynamicRowInterface> = ArrayList()
var groupedRows = ArrayList<RowGroup>() init {
this.rows = delegate.adapterRows()
}
override fun getItemViewType(position: Int): Int { override fun getItemViewType(position: Int): Int {
return this.rows[position].viewType
var sectionIndex: Int = 0
var rowIndex: Int = position
while (rowIndex >= this.groupedRows[sectionIndex].size + 1) {
rowIndex -= (groupedRows[sectionIndex].size + 1)
sectionIndex++
}
if (rowIndex == 0) {
return this.groupedRows[sectionIndex].viewType
} else {
return this.groupedRows[sectionIndex].rows[rowIndex - 1].viewType
}
} }
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
@ -42,17 +48,15 @@ class DynamicListAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
} }
override fun getItemCount(): Int { override fun getItemCount(): Int {
return this.rows.size
return this.groupedRows.size + this.groupedRows.fold(0) { acc: Int, group: RowGroup ->
return acc + group.size
}
} }
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates. val dynamicRow = this.rows[position]
val listener = View.OnClickListener {
callBackDelegate?.onRowSelected(dynamicRow)
}
(holder as DynamicHolder).bind(dynamicRow, this.delegate, listener)
} }
} }

@ -2,66 +2,77 @@ package net.pokeranalytics.android.ui.adapter.components
import android.content.Context import android.content.Context
import net.pokeranalytics.android.R import net.pokeranalytics.android.R
import net.pokeranalytics.android.ui.fragment.components.BottomSheetType
class RowGroup(stringRes: Int?, rows: ArrayList<DynamicRowInterface>) : DynamicRowInterface { interface DynamicRowInterface {
fun localizedTitle(context: Context): String
var stringRes: Int? = stringRes var viewType: Int
var rows: ArrayList<DynamicRowInterface> = rows var bottomSheetType: BottomSheetType
var size: Int = 0
get() {
return this.rows.size
}
override fun localizedTitle(context: Context): String? {
stringRes?.let {
return context.getString(it)
}
return null
}
override var viewType: Int = 0
} }
interface DynamicRowInterface { class SectionRow(stringRes: Int) : DynamicRowInterface {
var stringRes: Int = stringRes
fun localizedTitle(context: Context): String? override fun localizedTitle(context: Context): String {
var viewType: Int return context.getString(this.stringRes)
}
override var viewType: Int = 0
override var bottomSheetType: BottomSheetType = BottomSheetType.NONE
} }
enum class SessionRow(val resId: Int) : DynamicRowInterface { enum class SessionRow(val resId: Int) : DynamicRowInterface {
BLINDS(R.string.app_name), BLINDS(R.string.app_name),
GAME(R.string.app_name), GAME(R.string.title_history),
DATE(R.string.app_name); DATE(R.string.title_settings);
override fun localizedTitle(context: Context): String? { override fun localizedTitle(context: Context): String {
return context.getString(this.resId) return context.getString(this.resId)
} }
override var viewType: Int = RowViewType.HEADER.ordinal override var viewType: Int = RowViewType.HEADER.ordinal
get() { get() {
return when (this) { return when (this) {
BLINDS -> 1 BLINDS, GAME, DATE -> RowViewType.TITLE_VALUE.ordinal
GAME -> 2 }
DATE -> 1 }
}
} override var bottomSheetType: BottomSheetType = BottomSheetType.NONE
get() {
return when (this) {
BLINDS -> BottomSheetType.BLINDS
GAME -> BottomSheetType.GAME
DATE -> BottomSheetType.DATE
}
}
} }
enum class BankrollRow(val resId: Int) : DynamicRowInterface { enum class BankrollRow(val resId: Int) : DynamicRowInterface {
NAME(R.string.app_name), NAME(R.string.app_name),
LIVE(R.string.app_name), LIVE(R.string.app_name),
CURRENCY(R.string.app_name); CURRENCY(R.string.app_name);
override fun localizedTitle(context: Context): String? { override fun localizedTitle(context: Context): String {
return context.getString(this.resId) return context.getString(this.resId)
} }
override var viewType: Int = 1 override var viewType: Int = 1
override var bottomSheetType: BottomSheetType = BottomSheetType.NONE
}
} enum class DataObjectRowType(val resId: Int) : DynamicRowInterface {
BANKROLL(R.string.bankroll),
GAME(R.string.game),
LOCATION(R.string.location),
TOURNAMENT_TYPE(R.string.tournament_type),
TRANSACTION_TYPE(R.string.transaction_type);
override fun localizedTitle(context: Context): String {
return context.getString(this.resId)
}
override var viewType: Int = RowViewType.TITLE.ordinal
override var bottomSheetType: BottomSheetType = BottomSheetType.NONE
}

@ -1,19 +1,67 @@
package net.pokeranalytics.android.ui.adapter.components package net.pokeranalytics.android.ui.adapter.components
import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.Toast
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.row_session.view.*
import net.pokeranalytics.android.R
interface DynamicHolder {
fun bind(row: DynamicRowInterface, delegate: DynamicRowDelegate? = null, listener: View.OnClickListener)
}
enum class RowViewType { enum class RowViewType {
HEADER, HEADER,
TEXTFIELD; EDIT_TEXT,
TITLE,
TITLE_VALUE;
inner class FakeViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView), DynamicHolder {
override fun bind(row: DynamicRowInterface, delegate: DynamicRowDelegate?, listener: View.OnClickListener) {
}
}
inner class PlaceholderViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { inner class TitleValueViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView), DynamicHolder {
override fun bind(row: DynamicRowInterface, delegate: DynamicRowDelegate?, listener: View.OnClickListener) {
itemView.title.text = row.localizedTitle(itemView.context)
delegate?.let {
itemView.value.text = it.stringForRow(row)
}
itemView.container.setOnClickListener(listener)
}
}
inner class TitleViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView), DynamicHolder {
override fun bind(row: DynamicRowInterface, delegate: DynamicRowDelegate?, listener: View.OnClickListener) {
itemView.title.text = row.localizedTitle(itemView.context)
itemView.container.setOnClickListener(listener)
}
} }
fun viewHolder(parent: ViewGroup) : RecyclerView.ViewHolder {
return PlaceholderViewHolder(parent) fun viewHolder(parent: ViewGroup): RecyclerView.ViewHolder {
return when (this) {
TITLE_VALUE -> TitleValueViewHolder(
LayoutInflater.from(parent.context).inflate(
R.layout.row_session,
parent,
false
)
)
TITLE -> TitleViewHolder(
LayoutInflater.from(parent.context).inflate(
R.layout.row_title,
parent,
false
)
)
else -> FakeViewHolder(parent)
}
} }
} }

@ -0,0 +1,83 @@
package net.pokeranalytics.android.ui.fragment
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import io.realm.Realm
import io.realm.RealmObject
import io.realm.RealmResults
import io.realm.Sort
import kotlinx.android.synthetic.main.fragment_new_session.*
import net.pokeranalytics.android.R
import net.pokeranalytics.android.model.realm.*
import net.pokeranalytics.android.ui.adapter.components.*
import net.pokeranalytics.android.util.PokerAnalyticsFragment
import net.pokeranalytics.android.util.data.sessionDao
import java.util.*
import kotlin.collections.ArrayList
class DataListFragment : PokerAnalyticsFragment(), DataRowDelegate, DataRowCallback {
private lateinit var dataType: DataObjectRowType
private lateinit var realmObjects: ArrayList<RealmObject>
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.fragment_data_list, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initData()
initUI()
}
override fun data(position: Int): DisplayableData {
return (realmObjects[position] as DisplayableData)
}
override fun onRowSelected(position: Int) {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun size(): Int {
return realmObjects.size
}
private fun initData() {
}
/**
* Init UI
*/
private fun initUI() {
val viewManager = LinearLayoutManager(requireContext())
val dataListAdapter = DataListAdapter(this, this)
recyclerView.apply {
setHasFixedSize(true)
layoutManager = viewManager
adapter = dataListAdapter
}
}
/**
* Set fragment data
*/
fun setData(dataType: Int) {
this.dataType = DataObjectRowType.values()[dataType]
val realm = Realm.getDefaultInstance()
realmObjects = ArrayList( when (DataObjectRowType.values()[dataType]) {
DataObjectRowType.BANKROLL -> realm.where(Bankroll::class.java).findAll().sort("name", Sort.DESCENDING)
DataObjectRowType.GAME-> realm.where(Game::class.java).findAll().sort("name", Sort.DESCENDING)
DataObjectRowType.LOCATION -> realm.where(Location::class.java).findAll().sort("name", Sort.DESCENDING)
DataObjectRowType.TOURNAMENT_TYPE -> realm.where(TournamentFeature::class.java).findAll().sort("name", Sort.DESCENDING)
DataObjectRowType.TRANSACTION_TYPE -> realm.where(TransactionType::class.java).findAll().sort("name", Sort.DESCENDING)
})
}
}

@ -91,8 +91,6 @@ class HistoryFragment : PokerAnalyticsFragment() {
} }
it.addChangeListener { newSessions -> it.addChangeListener { newSessions ->
Toast.makeText(requireContext(), "Change listener: ${newSessions.size}", Toast.LENGTH_SHORT).show()
historyAdapter.notifyDataSetChanged() historyAdapter.notifyDataSetChanged()
} }

@ -4,14 +4,20 @@ import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.Toast
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import kotlinx.android.synthetic.main.fragment_new_session.* import kotlinx.android.synthetic.main.fragment_new_session.*
import net.pokeranalytics.android.R import net.pokeranalytics.android.R
import net.pokeranalytics.android.model.realm.Session import net.pokeranalytics.android.model.realm.Session
import net.pokeranalytics.android.ui.adapter.NewSessionAdapter import net.pokeranalytics.android.ui.adapter.components.DynamicListAdapter
import net.pokeranalytics.android.ui.adapter.components.DynamicRowCallback
import net.pokeranalytics.android.ui.adapter.components.DynamicRowInterface
import net.pokeranalytics.android.ui.adapter.components.EditableDataDelegate
import net.pokeranalytics.android.ui.fragment.components.BottomSheetFragment
import net.pokeranalytics.android.ui.fragment.components.BottomSheetType
import net.pokeranalytics.android.util.PokerAnalyticsFragment import net.pokeranalytics.android.util.PokerAnalyticsFragment
class NewSessionFragment: PokerAnalyticsFragment() { class NewSessionFragment : PokerAnalyticsFragment(), DynamicRowCallback, EditableDataDelegate {
private lateinit var newSession: Session private lateinit var newSession: Session
@ -21,11 +27,26 @@ class NewSessionFragment: PokerAnalyticsFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
initData() initData()
initUI() initUI()
} }
override fun onRowSelected(row: DynamicRowInterface) {
val data = when (row.bottomSheetType) {
BottomSheetType.BLINDS -> newSession
BottomSheetType.DATE -> newSession.timeFrame
BottomSheetType.GAME -> newSession.game
else -> Any()
}
BottomSheetFragment.create(fragmentManager, row, this, data)
}
override fun setValue(value: Any, row: DynamicRowInterface) {
Toast.makeText(requireContext(), "Callback for ${row.localizedTitle(requireContext())} ($value)", Toast.LENGTH_SHORT).show()
}
private fun initData() { private fun initData() {
newSession = Session() newSession = Session()
} }
@ -36,7 +57,7 @@ class NewSessionFragment: PokerAnalyticsFragment() {
private fun initUI() { private fun initUI() {
val viewManager = LinearLayoutManager(requireContext()) val viewManager = LinearLayoutManager(requireContext())
val newSessionAdapter = NewSessionAdapter(newSession) val newSessionAdapter = DynamicListAdapter(newSession, this)
recyclerView.apply { recyclerView.apply {
setHasFixedSize(true) setHasFixedSize(true)

@ -4,55 +4,66 @@ import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.Toast
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import kotlinx.android.synthetic.main.fragment_settings.* import kotlinx.android.synthetic.main.fragment_settings.*
import net.pokeranalytics.android.R import net.pokeranalytics.android.R
import net.pokeranalytics.android.ui.activity.DataManagementActivity import net.pokeranalytics.android.ui.activity.DataListActivity
import net.pokeranalytics.android.ui.adapter.SettingsAdapter import net.pokeranalytics.android.ui.activity.NewSessionActivity
import net.pokeranalytics.android.ui.adapter.components.*
import net.pokeranalytics.android.util.PokerAnalyticsFragment import net.pokeranalytics.android.util.PokerAnalyticsFragment
class SettingsFragment : PokerAnalyticsFragment() { class SettingsFragment : PokerAnalyticsFragment(), DynamicRowDelegate, DynamicRowCallback {
companion object { companion object {
/** /**
* Create new instance * Create new instance
*/ */
fun newInstance(): SettingsFragment { fun newInstance(): SettingsFragment {
val fragment = SettingsFragment() val fragment = SettingsFragment()
val bundle = Bundle() val bundle = Bundle()
fragment.arguments = bundle fragment.arguments = bundle
return fragment return fragment
} }
} }
private lateinit var settingsAdapter: SettingsAdapter private lateinit var settingsAdapter: DynamicListAdapter
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.fragment_settings, container, false) return inflater.inflate(R.layout.fragment_settings, container, false)
} }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
initData() initData()
} }
/** override fun adapterRows(): ArrayList<DynamicRowInterface> {
* Init data val rows = ArrayList<DynamicRowInterface>()
*/ rows.addAll(DataObjectRowType.values())
private fun initData() { return rows
}
val viewManager = LinearLayoutManager(requireContext())
settingsAdapter = SettingsAdapter() override fun onRowSelected(row: DynamicRowInterface) {
settingsAdapter.onClickOnData = { position, dataType -> DataListActivity.newInstance(requireContext(), (row as DataObjectRowType).ordinal)
DataManagementActivity.newInstance(requireContext(), 0) }
}
/**
recyclerView.apply { * Init data
setHasFixedSize(true) */
layoutManager = viewManager private fun initData() {
adapter = settingsAdapter
} val viewManager = LinearLayoutManager(requireContext())
} settingsAdapter = DynamicListAdapter(
this, this
)
recyclerView.apply {
setHasFixedSize(true)
layoutManager = viewManager
adapter = settingsAdapter
}
}
} }

@ -0,0 +1,57 @@
package net.pokeranalytics.android.ui.fragment.components
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.inputmethod.EditorInfo
import kotlinx.android.synthetic.main.bottom_sheet_blinds.*
import kotlinx.android.synthetic.main.fragment_bottom_sheet.view.*
import net.pokeranalytics.android.R
import net.pokeranalytics.android.model.realm.Session
class BottomSheetBlindsFragment : BottomSheetFragment() {
private var session: Session = Session()
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initData()
initUI()
}
override fun clickOnCheck() {
super.clickOnCheck()
valueDelegate.setValue(session, row)
dismiss()
}
override fun onStart() {
super.onStart()
smallBlind.requestFocus()
}
/**
* Init data
*/
private fun initData() {
val data = getData()
session = if (data is Session) data else Session()
}
/**
* Init UI
*/
private fun initUI() {
LayoutInflater.from(requireContext()).inflate(R.layout.bottom_sheet_blinds, view?.bottomSheetContainer, true)
bigBlind.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_DONE) {
clickOnCheck()
}
true
}
}
}

@ -0,0 +1,61 @@
package net.pokeranalytics.android.ui.fragment.components
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import kotlinx.android.synthetic.main.bottom_sheet_date.*
import kotlinx.android.synthetic.main.fragment_bottom_sheet.view.*
import net.pokeranalytics.android.R
import net.pokeranalytics.android.model.realm.TimeFrame
import net.pokeranalytics.android.ui.fragment.components.BottomSheetFragment
import net.pokeranalytics.android.util.DatePickerFragment
import net.pokeranalytics.android.util.TimePickerFragment
class BottomSheetDateFragment : BottomSheetFragment() {
private var timeFrame: TimeFrame = TimeFrame()
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initData()
initUI()
}
override fun clickOnCheck() {
super.clickOnCheck()
valueDelegate.setValue(timeFrame, row)
dismiss()
}
/**
* Init data
*/
private fun initData() {
val data = getData()
timeFrame = if (data is TimeFrame) data else TimeFrame()
}
/**
* Init UI
*/
private fun initUI() {
LayoutInflater.from(requireContext()).inflate(R.layout.bottom_sheet_date, view?.bottomSheetContainer, true)
setAddButtonVisible(false)
startDate.setOnClickListener {
val dateFragment = DatePickerFragment()
dateFragment.show(fragmentManager, "datePicker")
}
endDate.setOnClickListener {
val timeFragment = TimePickerFragment()
timeFragment.show(fragmentManager, "timePicker")
}
//data.startDate = Date()
//data.endDate = Date()
}
}

@ -0,0 +1,143 @@
package net.pokeranalytics.android.ui.fragment.components
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.fragment.app.FragmentManager
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import kotlinx.android.synthetic.main.fragment_bottom_sheet.*
import net.pokeranalytics.android.R
import net.pokeranalytics.android.ui.adapter.components.DynamicRowInterface
import net.pokeranalytics.android.ui.adapter.components.EditableDataDelegate
enum class BottomSheetType {
NONE,
GAME,
BLINDS,
LOCATION,
BANKROLL,
TABLE_SIZE,
DATE
}
interface BottomSheetInterface {
fun clickOnClear()
fun clickOnCheck()
fun clickOnAdd()
}
open class BottomSheetFragment : BottomSheetDialogFragment(), BottomSheetInterface {
lateinit var row: DynamicRowInterface
lateinit var valueDelegate: EditableDataDelegate
private var data: Any? = null
companion object {
fun create( fragmentManager: FragmentManager?, row: DynamicRowInterface, valueDelegate: EditableDataDelegate, data: Any?): BottomSheetFragment {
val bottomSheetFragment = when (row.bottomSheetType) {
BottomSheetType.BLINDS -> BottomSheetBlindsFragment()
BottomSheetType.DATE -> BottomSheetDateFragment()
BottomSheetType.GAME -> BottomSheetGameFragment()
else -> BottomSheetFragment()
}
bottomSheetFragment.show(fragmentManager, "bottomSheet")
bottomSheetFragment.row = row
bottomSheetFragment.valueDelegate = valueDelegate
bottomSheetFragment.data = data
return bottomSheetFragment
}
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view = inflater.inflate(
net.pokeranalytics.android.R.layout.fragment_bottom_sheet,
container,
false
) as ConstraintLayout
return view
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initUI()
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
// To display correctly the keyboard
dialog?.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
}
override fun clickOnClear() {
}
override fun clickOnCheck() {
}
override fun clickOnAdd() {
}
/**
* Init UI
*/
private fun initUI() {
row.let {
bottomSheetToolbar.title = row.localizedTitle(requireContext())
bottomSheetToolbar.inflateMenu(net.pokeranalytics.android.R.menu.bottom_sheet_menu)
bottomSheetToolbar.setOnMenuItemClickListener {
false
}
}
// Menu
bottomSheetToolbar.menu.findItem(R.id.actionClear).setOnMenuItemClickListener {
clickOnClear()
true
}
bottomSheetToolbar.menu.findItem(R.id.actionAdd).setOnMenuItemClickListener {
clickOnAdd()
true
}
bottomSheetToolbar.menu.findItem(R.id.actionCheck).setOnMenuItemClickListener {
clickOnCheck()
true
}
}
/**
* Return the data object
*/
fun getData() : Any? {
return data
}
/**
* Set clear button visibility
*/
fun setClearButtonVisibile(visible: Boolean) {
bottomSheetToolbar.menu.findItem(R.id.actionClear).isVisible = visible
}
/**
* Set check button visibility
*/
fun setCheckButtonVisibile(visible: Boolean) {
bottomSheetToolbar.menu.findItem(R.id.actionCheck).isVisible = visible
}
/**
* Set add button visibility
*/
fun setAddButtonVisible(visible: Boolean) {
bottomSheetToolbar.menu.findItem(R.id.actionAdd).isVisible = visible
}
}

@ -0,0 +1,77 @@
package net.pokeranalytics.android.ui.fragment.components
import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import kotlinx.android.synthetic.main.bottom_sheet_game.*
import kotlinx.android.synthetic.main.fragment_bottom_sheet.view.*
import net.pokeranalytics.android.R
import net.pokeranalytics.android.model.realm.Game
import net.pokeranalytics.android.ui.adapter.components.DynamicListAdapter
import net.pokeranalytics.android.ui.adapter.components.DynamicRowDelegate
import net.pokeranalytics.android.ui.adapter.components.DynamicRowInterface
class BottomSheetGameFragment : BottomSheetFragment(), DynamicRowDelegate {
private var game: Game = Game()
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initData()
initUI()
}
override fun clickOnCheck() {
super.clickOnCheck()
valueDelegate.setValue(game, row)
dismiss()
}
override fun adapterRows(): ArrayList<DynamicRowInterface> {
val array = ArrayList<DynamicRowInterface>()
array.add(TitleObject("Game 1"))
array.add(TitleObject("Game 2"))
array.add(TitleObject("Game 3"))
return array
}
/**
* Init data
*/
private fun initData() {
val data = getData()
game = if (data is Game) data else Game()
}
/**
* Init UI
*/
private fun initUI() {
LayoutInflater.from(requireContext()).inflate(R.layout.bottom_sheet_game, view?.bottomSheetContainer, true)
val viewManager = LinearLayoutManager(requireContext())
val dataAdapter = DynamicListAdapter(this)
gameNameRecyclerView.apply {
setHasFixedSize(true)
layoutManager = viewManager
//adapter = dataAdapter
}
}
inner class TitleObject(var title: String) : DynamicRowInterface {
override fun localizedTitle(context: Context): String {
return title
}
override var viewType: Int = 0
override var bottomSheetType: BottomSheetType = BottomSheetType.NONE
}
}

@ -1,55 +0,0 @@
package net.pokeranalytics.android.ui.view
import android.widget.FrameLayout
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import kotlinx.android.synthetic.main.row_data_cell.view.*
import kotlinx.android.synthetic.main.row_data_content_view.view.*
import net.pokeranalytics.android.R
class DataRowView : FrameLayout {
private lateinit var rowDataCell: ConstraintLayout
/**
* Constructors
*/
constructor(context: Context) : super(context) {
init()
}
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
init()
}
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init()
}
/**
* Init
*
* @param attrs
*/
private fun init() {
val layoutInflater = LayoutInflater.from(context)
rowDataCell = layoutInflater.inflate(R.layout.row_data_content_view, this, false) as ConstraintLayout
val layoutParams = FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.WRAP_CONTENT
)
addView(rowDataCell, layoutParams)
}
/**
* Set the session data to the view
*/
fun setData(title: String) {
rowDataCell.rowTitle.text = title
}
}

@ -6,7 +6,7 @@ import android.graphics.Color
import android.util.AttributeSet import android.util.AttributeSet
import android.view.LayoutInflater import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import kotlinx.android.synthetic.main.row_session.view.* import kotlinx.android.synthetic.main.row_session_view.view.*
import net.pokeranalytics.android.R import net.pokeranalytics.android.R
import net.pokeranalytics.android.model.realm.Session import net.pokeranalytics.android.model.realm.Session
import timber.log.Timber import timber.log.Timber
@ -38,7 +38,7 @@ class SessionRowView : FrameLayout {
*/ */
private fun init() { private fun init() {
val layoutInflater = LayoutInflater.from(context) val layoutInflater = LayoutInflater.from(context)
rowHistorySession = layoutInflater.inflate(R.layout.row_session, this, false) as ConstraintLayout rowHistorySession = layoutInflater.inflate(R.layout.row_session_view, this, false) as ConstraintLayout
val layoutParams = FrameLayout.LayoutParams( val layoutParams = FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.WRAP_CONTENT FrameLayout.LayoutParams.WRAP_CONTENT
@ -51,7 +51,6 @@ class SessionRowView : FrameLayout {
* Set the session data to the view * Set the session data to the view
*/ */
fun setData(session: Session) { fun setData(session: Session) {
Timber.d("Set data: ${session.creationDate}")
rowHistorySession.date.text = session.creationDate.toString() rowHistorySession.date.text = session.creationDate.toString()
} }

@ -0,0 +1,26 @@
package net.pokeranalytics.android.util
import android.app.DatePickerDialog
import android.app.Dialog
import android.os.Bundle
import android.widget.DatePicker
import androidx.fragment.app.DialogFragment
import java.util.*
class DatePickerFragment : DialogFragment(), DatePickerDialog.OnDateSetListener {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
// Use the current date as the default date in the picker
val c = Calendar.getInstance()
val year = c.get(Calendar.YEAR)
val month = c.get(Calendar.MONTH)
val day = c.get(Calendar.DAY_OF_MONTH)
// Create a new instance of DatePickerDialog and return it
return DatePickerDialog(activity, this, year, month, day)
}
override fun onDateSet(view: DatePicker, year: Int, month: Int, day: Int) {
// Do something with the date chosen by the user
}
}

@ -1,7 +1,6 @@
package net.pokeranalytics.android.util package net.pokeranalytics.android.util
import android.os.Bundle import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import io.realm.Realm import io.realm.Realm

@ -0,0 +1,9 @@
package net.pokeranalytics.android.util
import timber.log.Timber
class PokerAnalyticsLogs : Timber.DebugTree() {
override fun log(priority: Int, tag: String?, message: String, throwable: Throwable?) {
super.log(priority, "PokerAnalytics:$tag", message, throwable)
}
}

@ -0,0 +1,26 @@
package net.pokeranalytics.android.util
import android.app.Dialog
import android.app.TimePickerDialog
import android.os.Bundle
import android.text.format.DateFormat
import android.widget.TimePicker
import androidx.fragment.app.DialogFragment
import java.util.*
class TimePickerFragment : DialogFragment(), TimePickerDialog.OnTimeSetListener {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
// Use the current time as the default values for the picker
val c = Calendar.getInstance()
val hour = c.get(Calendar.HOUR_OF_DAY)
val minute = c.get(Calendar.MINUTE)
// Create a new instance of TimePickerDialog and return it
return TimePickerDialog(activity, this, hour, minute, DateFormat.is24HourFormat(activity))
}
override fun onTimeSet(view: TimePicker, hourOfDay: Int, minute: Int) {
// Do something with the time chosen by the user
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1016 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
</vector>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="@color/green"/>
<corners
android:radius="8dp" />
<size
android:width="32dp"
android:height="32dp"/>
</shape>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:attr/colorControlHighlight">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="#000000" />
<corners android:radius="8dp" />
<size
android:width="32dp"
android:height="32dp" />
</shape>
</item>
<item android:drawable="@drawable/rectangle_rounded_green" />
</ripple>

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="@+id/dataListFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="net.pokeranalytics.android.ui.fragment.DataListFragment" />
</LinearLayout>

@ -1,31 +1,30 @@
<?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" tools:context=".ui.activity.HomeActivity">
tools:context=".ui.activity.HomeActivity">
<FrameLayout <FrameLayout
android:id="@+id/container" android:id="@+id/container"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toTopOf="@+id/navigation"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@+id/navigation" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/> app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.bottomnavigation.BottomNavigationView <com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/navigation" android:id="@+id/navigation"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="0dp" android:layout_marginStart="0dp"
android:layout_marginStart="0dp" android:layout_marginEnd="0dp"
android:background="?android:attr/windowBackground" android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/navigation"/> app:menu="@menu/navigation" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,13 @@
<?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"
android:orientation="horizontal">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/bankrollRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="200dp" />
</LinearLayout>

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:background="@color/gray_dark_1">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/appCompatTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="16dp"
android:text="Blinds"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/smallBlind"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/smallBlind"
android:layout_width="96dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:gravity="end|center_vertical"
android:imeOptions="actionNext"
android:inputType="numberDecimal"
android:lines="1"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/bigBlind"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/bigBlind"
android:layout_width="96dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:gravity="end|center_vertical"
android:imeOptions="actionDone"
android:inputType="numberDecimal"
android:lines="1"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save