parent
4b10acce58
commit
a0baeb61f1
@ -1,12 +1,30 @@ |
|||||||
package net.pokeranalytics.android |
package net.pokeranalytics.android |
||||||
|
|
||||||
import android.app.Application |
import android.app.Application |
||||||
|
import io.realm.Realm |
||||||
|
import io.realm.Realm.setDefaultConfiguration |
||||||
|
import io.realm.RealmConfiguration |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PokerAnalyticsApplication: Application() { |
class PokerAnalyticsApplication: Application() { |
||||||
|
|
||||||
override fun onCreate() { |
override fun onCreate() { |
||||||
super.onCreate() |
super.onCreate() |
||||||
|
|
||||||
|
// Realm |
||||||
|
Realm.init(this) |
||||||
|
val realmConfiguration = RealmConfiguration.Builder() |
||||||
|
.name(Realm.DEFAULT_REALM_NAME) |
||||||
|
.deleteRealmIfMigrationNeeded() |
||||||
|
.build() |
||||||
|
Realm.setDefaultConfiguration(realmConfiguration) |
||||||
|
|
||||||
|
if (!BuildConfig.DEBUG) { |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,53 @@ |
|||||||
|
package net.pokeranalytics.android.model.realm |
||||||
|
|
||||||
|
import io.realm.RealmObject |
||||||
|
import io.realm.annotations.PrimaryKey |
||||||
|
import net.pokeranalytics.android.* |
||||||
|
import java.util.* |
||||||
|
|
||||||
|
open class Session : RealmObject() { |
||||||
|
|
||||||
|
init { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
// A comment written by the user |
||||||
|
var comment: String? = null |
||||||
|
|
||||||
|
// The date of creation of the session |
||||||
|
var creationDate: Date = Date() |
||||||
|
var limit: Int? = null |
||||||
|
var numberOfTables: Int = 1 |
||||||
|
var tableSize: Int? = null |
||||||
|
|
||||||
|
|
||||||
|
/* |
||||||
|
var game: Game? = null |
||||||
|
|
||||||
|
//var bankroll: Bankroll? = bankroll |
||||||
|
var bankroll: Bankroll? = null |
||||||
|
|
||||||
|
var hands: List<HandHistory> = listOf() |
||||||
|
|
||||||
|
//var timeFrame: TimeFrame = timeFrame |
||||||
|
var timeFrame: TimeFrame? = null |
||||||
|
|
||||||
|
var location: Location? = null |
||||||
|
|
||||||
|
var result: Result = Result() |
||||||
|
|
||||||
|
var opponents: List<Player> = listOf() |
||||||
|
|
||||||
|
// @todo serie |
||||||
|
|
||||||
|
// @todo cash game blind: 2/5/10, short deck ante, big bets in fixed limit |
||||||
|
|
||||||
|
// Tournament |
||||||
|
|
||||||
|
var entryFee: Double? = null |
||||||
|
var numberOfPlayers: Int? = null |
||||||
|
|
||||||
|
// @todo tournament type? |
||||||
|
*/ |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,34 @@ |
|||||||
|
package net.pokeranalytics.android.ui.fragment |
||||||
|
|
||||||
|
import android.os.Bundle |
||||||
|
import android.view.LayoutInflater |
||||||
|
import android.view.View |
||||||
|
import android.view.ViewGroup |
||||||
|
import androidx.fragment.app.Fragment |
||||||
|
import net.pokeranalytics.android.R |
||||||
|
import net.pokeranalytics.android.util.PokerAnalyticsFragment |
||||||
|
|
||||||
|
class HistoryFragment : PokerAnalyticsFragment() { |
||||||
|
|
||||||
|
companion object { |
||||||
|
|
||||||
|
/** |
||||||
|
* Create new instance |
||||||
|
*/ |
||||||
|
fun newInstance(): HistoryFragment { |
||||||
|
val fragment = HistoryFragment() |
||||||
|
val bundle = Bundle() |
||||||
|
fragment.arguments = bundle |
||||||
|
return fragment |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
||||||
|
return inflater.inflate(R.layout.fragment_history, container, false) |
||||||
|
} |
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
||||||
|
super.onViewCreated(view, savedInstanceState) |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,34 @@ |
|||||||
|
package net.pokeranalytics.android.ui.fragment |
||||||
|
|
||||||
|
import android.os.Bundle |
||||||
|
import android.view.LayoutInflater |
||||||
|
import android.view.View |
||||||
|
import android.view.ViewGroup |
||||||
|
import androidx.fragment.app.Fragment |
||||||
|
import net.pokeranalytics.android.R |
||||||
|
import net.pokeranalytics.android.util.PokerAnalyticsFragment |
||||||
|
|
||||||
|
class SettingsFragment : PokerAnalyticsFragment() { |
||||||
|
|
||||||
|
companion object { |
||||||
|
|
||||||
|
/** |
||||||
|
* Create new instance |
||||||
|
*/ |
||||||
|
fun newInstance(): SettingsFragment { |
||||||
|
val fragment = SettingsFragment() |
||||||
|
val bundle = Bundle() |
||||||
|
fragment.arguments = bundle |
||||||
|
return fragment |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
||||||
|
return inflater.inflate(R.layout.fragment_settings, container, false) |
||||||
|
} |
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
||||||
|
super.onViewCreated(view, savedInstanceState) |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,34 @@ |
|||||||
|
package net.pokeranalytics.android.ui.fragment |
||||||
|
|
||||||
|
import android.os.Bundle |
||||||
|
import android.view.LayoutInflater |
||||||
|
import android.view.View |
||||||
|
import android.view.ViewGroup |
||||||
|
import androidx.fragment.app.Fragment |
||||||
|
import net.pokeranalytics.android.R |
||||||
|
import net.pokeranalytics.android.util.PokerAnalyticsFragment |
||||||
|
|
||||||
|
class StatsFragment : PokerAnalyticsFragment() { |
||||||
|
|
||||||
|
companion object { |
||||||
|
|
||||||
|
/** |
||||||
|
* Create new instance |
||||||
|
*/ |
||||||
|
fun newInstance(): StatsFragment { |
||||||
|
val fragment = StatsFragment() |
||||||
|
val bundle = Bundle() |
||||||
|
fragment.arguments = bundle |
||||||
|
return fragment |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
||||||
|
return inflater.inflate(R.layout.fragment_stats, container, false) |
||||||
|
} |
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
||||||
|
super.onViewCreated(view, savedInstanceState) |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,13 @@ |
|||||||
|
package net.pokeranalytics.android.util |
||||||
|
|
||||||
|
import android.os.Bundle |
||||||
|
import android.os.PersistableBundle |
||||||
|
import androidx.appcompat.app.AppCompatActivity |
||||||
|
|
||||||
|
open class PokerAnalyticsActivity: AppCompatActivity() { |
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) { |
||||||
|
super.onCreate(savedInstanceState, persistentState) |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,13 @@ |
|||||||
|
package net.pokeranalytics.android.util |
||||||
|
|
||||||
|
import android.os.Bundle |
||||||
|
import androidx.appcompat.app.AppCompatActivity |
||||||
|
import androidx.fragment.app.Fragment |
||||||
|
|
||||||
|
open class PokerAnalyticsFragment: Fragment() { |
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) { |
||||||
|
super.onCreate(savedInstanceState) |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,23 @@ |
|||||||
|
<?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:id="@+id/container" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:background="#999999" |
||||||
|
android:layout_height="match_parent" |
||||||
|
tools:context=".ui.activity.HomeActivity"> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/title" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:layout_marginStart="@dimen/activity_horizontal_margin" |
||||||
|
android:layout_marginLeft="@dimen/activity_horizontal_margin" |
||||||
|
android:layout_marginTop="@dimen/activity_vertical_margin" |
||||||
|
android:text="fragment" |
||||||
|
app:layout_constraintLeft_toLeftOf="parent" |
||||||
|
app:layout_constraintTop_toTopOf="parent"/> |
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout> |
||||||
@ -0,0 +1,23 @@ |
|||||||
|
<?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:id="@+id/container" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:background="#999999" |
||||||
|
android:layout_height="match_parent" |
||||||
|
tools:context=".ui.activity.HomeActivity"> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/title" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:layout_marginStart="@dimen/activity_horizontal_margin" |
||||||
|
android:layout_marginLeft="@dimen/activity_horizontal_margin" |
||||||
|
android:layout_marginTop="@dimen/activity_vertical_margin" |
||||||
|
android:text="fragment" |
||||||
|
app:layout_constraintLeft_toLeftOf="parent" |
||||||
|
app:layout_constraintTop_toTopOf="parent"/> |
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout> |
||||||
@ -0,0 +1,23 @@ |
|||||||
|
<?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:id="@+id/container" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:background="#999999" |
||||||
|
android:layout_height="match_parent" |
||||||
|
tools:context=".ui.activity.HomeActivity"> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/title" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:layout_marginStart="@dimen/activity_horizontal_margin" |
||||||
|
android:layout_marginLeft="@dimen/activity_horizontal_margin" |
||||||
|
android:layout_marginTop="@dimen/activity_vertical_margin" |
||||||
|
android:text="fragment" |
||||||
|
app:layout_constraintLeft_toLeftOf="parent" |
||||||
|
app:layout_constraintTop_toTopOf="parent"/> |
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout> |
||||||
@ -1,6 +1,8 @@ |
|||||||
<resources> |
<resources> |
||||||
<string name="app_name">Poker Analytics</string> |
<string name="app_name">Poker Analytics</string> |
||||||
<string name="title_home">Home</string> |
|
||||||
<string name="title_dashboard">Dashboard</string> |
<string name="title_history">History</string> |
||||||
<string name="title_notifications">Notifications</string> |
<string name="title_stats">Stats</string> |
||||||
|
<string name="title_settings">Settings</string> |
||||||
|
|
||||||
</resources> |
</resources> |
||||||
|
|||||||
Loading…
Reference in new issue