commit
cfcd4eeeda
@ -1,5 +1,28 @@ |
|||||||
package net.pokeranalytics.android.model.filter |
package net.pokeranalytics.android.model.filter |
||||||
|
|
||||||
|
import io.realm.Realm |
||||||
|
import io.realm.RealmObject |
||||||
|
import io.realm.RealmQuery |
||||||
|
import io.realm.RealmResults |
||||||
|
import net.pokeranalytics.android.model.realm.Session |
||||||
|
|
||||||
enum class FilterComponent { |
enum class FilterComponent { |
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
|
enum class SessionFilterable(var fieldName:String? = null) : Filterable { |
||||||
|
LIVE("bankroll.live"), |
||||||
|
CASH("type"), |
||||||
|
ONLINE, |
||||||
|
TOURNAMENT |
||||||
|
; |
||||||
|
|
||||||
|
override fun filter(realmQuery: RealmQuery<*>): RealmQuery<out RealmObject> { |
||||||
|
return when (this) { |
||||||
|
LIVE -> realmQuery.equalTo(this.fieldName, true) as RealmQuery<out RealmObject> |
||||||
|
CASH -> realmQuery.equalTo(this.fieldName, Session.Type.CASH_GAME.ordinal) as RealmQuery<out RealmObject> |
||||||
|
ONLINE -> LIVE.filter(realmQuery.not()) |
||||||
|
TOURNAMENT -> CASH.filter(realmQuery.not()) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,190 @@ |
|||||||
|
package net.pokeranalytics.android.ui.fragment |
||||||
|
|
||||||
|
import android.app.Activity.RESULT_OK |
||||||
|
import android.content.Intent |
||||||
|
import android.os.Bundle |
||||||
|
import android.view.View |
||||||
|
import kotlinx.coroutines.Dispatchers |
||||||
|
import kotlinx.coroutines.GlobalScope |
||||||
|
import kotlinx.coroutines.delay |
||||||
|
import kotlinx.coroutines.launch |
||||||
|
import net.pokeranalytics.android.R |
||||||
|
import net.pokeranalytics.android.model.realm.Bankroll |
||||||
|
import net.pokeranalytics.android.ui.activity.CurrenciesActivity |
||||||
|
import net.pokeranalytics.android.ui.adapter.RowRepresentableDataSource |
||||||
|
import net.pokeranalytics.android.ui.adapter.StaticRowRepresentableDataSource |
||||||
|
import net.pokeranalytics.android.ui.view.RowRepresentable |
||||||
|
import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor |
||||||
|
import net.pokeranalytics.android.ui.view.RowViewType |
||||||
|
import net.pokeranalytics.android.ui.view.rowrepresentable.BankrollRow |
||||||
|
import net.pokeranalytics.android.ui.view.rowrepresentable.CustomizableRowRepresentable |
||||||
|
import net.pokeranalytics.android.ui.view.rowrepresentable.SimpleRow |
||||||
|
import net.pokeranalytics.android.util.NULL_TEXT |
||||||
|
import net.pokeranalytics.android.util.Preferences |
||||||
|
import net.pokeranalytics.android.util.extensions.round |
||||||
|
import java.util.* |
||||||
|
|
||||||
|
/** |
||||||
|
* Custom EditableDataFragment to manage the Bankroll data |
||||||
|
*/ |
||||||
|
class BankrollDataFragment : EditableDataFragment(), StaticRowRepresentableDataSource { |
||||||
|
|
||||||
|
companion object { |
||||||
|
const val REQUEST_CODE_CURRENCY: Int = 100 |
||||||
|
} |
||||||
|
|
||||||
|
// Return the item as a Bankroll object |
||||||
|
private val bankroll: Bankroll |
||||||
|
get() { |
||||||
|
return this.item as Bankroll |
||||||
|
} |
||||||
|
|
||||||
|
private lateinit var defaultCurrency: Currency |
||||||
|
private val rows = ArrayList<RowRepresentable>() |
||||||
|
private var isRefreshingRate = false |
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
||||||
|
super.onViewCreated(view, savedInstanceState) |
||||||
|
|
||||||
|
shouldOpenKeyboard = false |
||||||
|
|
||||||
|
initData() |
||||||
|
refreshRows() |
||||||
|
updateAdapterUI() |
||||||
|
} |
||||||
|
|
||||||
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
||||||
|
super.onActivityResult(requestCode, resultCode, data) |
||||||
|
if (requestCode == REQUEST_CODE_CURRENCY && resultCode == RESULT_OK) { |
||||||
|
data?.let { |
||||||
|
val currencyCode = it.getStringExtra(CurrenciesFragment.INTENT_CURRENCY_CODE) |
||||||
|
onRowValueChanged(currencyCode, BankrollRow.CURRENCY) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
override fun getDataSource(): RowRepresentableDataSource { |
||||||
|
return this |
||||||
|
} |
||||||
|
|
||||||
|
override fun adapterRows(): List<RowRepresentable>? { |
||||||
|
return rows |
||||||
|
} |
||||||
|
|
||||||
|
override fun stringForRow(row: RowRepresentable): String { |
||||||
|
return when (row) { |
||||||
|
SimpleRow.NAME -> if (bankroll.name.isNotEmpty()) bankroll.name else NULL_TEXT |
||||||
|
BankrollRow.CURRENCY -> { |
||||||
|
bankroll.currency?.let { |
||||||
|
Currency.getInstance(it.code).currencyCode |
||||||
|
} ?: run { |
||||||
|
NULL_TEXT |
||||||
|
} |
||||||
|
} |
||||||
|
BankrollRow.RATE -> { |
||||||
|
bankroll.currency?.let { |
||||||
|
(it.rate ?: 1.0).round() |
||||||
|
} ?: run { |
||||||
|
1.0.round() |
||||||
|
} |
||||||
|
} |
||||||
|
else -> super.stringForRow(row) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
override fun boolForRow(row: RowRepresentable): Boolean { |
||||||
|
return when(row) { |
||||||
|
BankrollRow.LIVE -> !bankroll.live |
||||||
|
BankrollRow.REFRESH_RATE -> isRefreshingRate |
||||||
|
else -> super.boolForRow(row) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
override fun editDescriptors(row: RowRepresentable): ArrayList<RowRepresentableEditDescriptor>? { |
||||||
|
return when (row) { |
||||||
|
SimpleRow.NAME -> row.editingDescriptors(mapOf("defaultValue" to this.bankroll.name)) |
||||||
|
BankrollRow.RATE -> row.editingDescriptors(mapOf("defaultValue" to (this.bankroll.currency?.rate ?: 1.0).round())) |
||||||
|
else -> null |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
override fun onRowSelected(position: Int, row: RowRepresentable, fromAction: Boolean) { |
||||||
|
when (row) { |
||||||
|
BankrollRow.CURRENCY -> CurrenciesActivity.newInstanceForResult(this@BankrollDataFragment, BankrollDataFragment.REQUEST_CODE_CURRENCY) |
||||||
|
BankrollRow.REFRESH_RATE -> { |
||||||
|
isRefreshingRate = true |
||||||
|
|
||||||
|
//TODO: Call web-service to get the currency rate |
||||||
|
GlobalScope.launch(Dispatchers.Main) { |
||||||
|
delay(1500) |
||||||
|
isRefreshingRate = false |
||||||
|
rowRepresentableAdapter.refreshRow(BankrollRow.REFRESH_RATE) |
||||||
|
} |
||||||
|
rowRepresentableAdapter.refreshRow(BankrollRow.REFRESH_RATE) |
||||||
|
} |
||||||
|
else -> super.onRowSelected(position, row, fromAction) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
override fun onRowValueChanged(value: Any?, row: RowRepresentable) { |
||||||
|
super.onRowValueChanged(value, row) |
||||||
|
updateAdapterUI() |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Init data |
||||||
|
*/ |
||||||
|
private fun initData() { |
||||||
|
|
||||||
|
defaultCurrency = Currency.getInstance(Preferences.getCurrencyLocale(this.parentActivity)) |
||||||
|
|
||||||
|
if (!isUpdating) { |
||||||
|
bankroll.currency = net.pokeranalytics.android.model.realm.Currency() |
||||||
|
bankroll.currency?.code = defaultCurrency.currencyCode |
||||||
|
bankroll.currency?.rate = 1.0 |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Refresh rows |
||||||
|
*/ |
||||||
|
private fun refreshRows() { |
||||||
|
|
||||||
|
rows.clear() |
||||||
|
rows.add(SimpleRow.NAME) |
||||||
|
rows.add(BankrollRow.LIVE) |
||||||
|
rows.add(CustomizableRowRepresentable(customViewType = RowViewType.HEADER_TITLE, resId = R.string.currency)) |
||||||
|
rows.add(BankrollRow.CURRENCY) |
||||||
|
|
||||||
|
val defaultCurrency = Currency.getInstance(Preferences.getCurrencyLocale(this.parentActivity)) |
||||||
|
|
||||||
|
var differentCurrency = false |
||||||
|
bankroll.currency?.let { bankrollCurrency -> |
||||||
|
differentCurrency = bankrollCurrency.code != defaultCurrency.currencyCode |
||||||
|
} |
||||||
|
|
||||||
|
if (differentCurrency) { |
||||||
|
rows.add(BankrollRow.RATE) |
||||||
|
rows.add(BankrollRow.REFRESH_RATE) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Update UI adapter |
||||||
|
*/ |
||||||
|
private fun updateAdapterUI() { |
||||||
|
|
||||||
|
val currentRowsSize = rows.size |
||||||
|
refreshRows() |
||||||
|
val newRowsSize = rows.size |
||||||
|
|
||||||
|
if (currentRowsSize < newRowsSize) { |
||||||
|
rowRepresentableAdapter.notifyItemRangeInserted(currentRowsSize, newRowsSize - currentRowsSize) |
||||||
|
} else { |
||||||
|
rowRepresentableAdapter.notifyItemRangeRemoved(newRowsSize, currentRowsSize - newRowsSize) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,89 @@ |
|||||||
|
package net.pokeranalytics.android.ui.fragment |
||||||
|
|
||||||
|
import android.os.Bundle |
||||||
|
import android.view.View |
||||||
|
import kotlinx.coroutines.Dispatchers |
||||||
|
import kotlinx.coroutines.GlobalScope |
||||||
|
import kotlinx.coroutines.delay |
||||||
|
import kotlinx.coroutines.launch |
||||||
|
import net.pokeranalytics.android.model.LiveData |
||||||
|
import net.pokeranalytics.android.model.realm.Transaction |
||||||
|
import net.pokeranalytics.android.ui.adapter.RowRepresentableDataSource |
||||||
|
import net.pokeranalytics.android.ui.adapter.StaticRowRepresentableDataSource |
||||||
|
import net.pokeranalytics.android.ui.helpers.DateTimePickerManager |
||||||
|
import net.pokeranalytics.android.ui.view.RowRepresentable |
||||||
|
import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor |
||||||
|
import net.pokeranalytics.android.ui.view.rowrepresentable.TransactionRow |
||||||
|
import net.pokeranalytics.android.util.NULL_TEXT |
||||||
|
import net.pokeranalytics.android.util.extensions.round |
||||||
|
import net.pokeranalytics.android.util.extensions.shortDate |
||||||
|
import java.util.* |
||||||
|
|
||||||
|
/** |
||||||
|
* Custom EditableDataFragment to manage the Transaction data |
||||||
|
*/ |
||||||
|
class TransactionDataFragment : EditableDataFragment(), StaticRowRepresentableDataSource { |
||||||
|
|
||||||
|
// Return the item as a Transaction object |
||||||
|
private val transaction: Transaction |
||||||
|
get() { |
||||||
|
return this.item as Transaction |
||||||
|
} |
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
||||||
|
super.onViewCreated(view, savedInstanceState) |
||||||
|
shouldOpenKeyboard = false |
||||||
|
} |
||||||
|
|
||||||
|
override fun getDataSource(): RowRepresentableDataSource { |
||||||
|
return this |
||||||
|
} |
||||||
|
|
||||||
|
override fun adapterRows(): List<RowRepresentable>? { |
||||||
|
return transaction.adapterRows() |
||||||
|
} |
||||||
|
|
||||||
|
override fun stringForRow(row: RowRepresentable): String { |
||||||
|
return when (row) { |
||||||
|
TransactionRow.BANKROLL -> this.transaction.bankroll?.name ?: NULL_TEXT |
||||||
|
TransactionRow.TYPE -> this.transaction.type?.name ?: NULL_TEXT |
||||||
|
TransactionRow.AMOUNT -> if (this.transaction.amount != 0.0) this.transaction.amount.round() else NULL_TEXT |
||||||
|
TransactionRow.COMMENT -> if (this.transaction.comment.isNotEmpty()) this.transaction.comment else NULL_TEXT |
||||||
|
TransactionRow.DATE -> this.transaction.date.shortDate() |
||||||
|
else -> super.stringForRow(row) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
override fun editDescriptors(row: RowRepresentable): ArrayList<RowRepresentableEditDescriptor>? { |
||||||
|
return when (row) { |
||||||
|
TransactionRow.BANKROLL -> row.editingDescriptors(mapOf("defaultValue" to this.transaction.bankroll, "data" to LiveData.BANKROLL.items(getRealm()))) |
||||||
|
TransactionRow.TYPE -> row.editingDescriptors(mapOf("defaultValue" to this.transaction.type, "data" to LiveData.TRANSACTION_TYPE.items(getRealm()))) |
||||||
|
TransactionRow.AMOUNT -> row.editingDescriptors(mapOf("defaultValue" to (if (this.transaction.amount != 0.0) this.transaction.amount.round() else ""))) |
||||||
|
TransactionRow.COMMENT -> row.editingDescriptors(mapOf("defaultValue" to this.transaction.comment)) |
||||||
|
else -> super.editDescriptors(row) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
override fun onRowSelected(position: Int, row: RowRepresentable, fromAction: Boolean) { |
||||||
|
when (row) { |
||||||
|
TransactionRow.DATE -> DateTimePickerManager.create(requireContext(), row, this, this.transaction.date, onlyDate = true, isClearable = false) |
||||||
|
else -> super.onRowSelected(position, row, fromAction) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
override fun onRowValueChanged(value: Any?, row: RowRepresentable) { |
||||||
|
super.onRowValueChanged(value, row) |
||||||
|
rowRepresentableAdapter.refreshRow(row) |
||||||
|
|
||||||
|
GlobalScope.launch(Dispatchers.Main) { |
||||||
|
delay(200) |
||||||
|
when(row) { |
||||||
|
TransactionRow.BANKROLL -> onRowSelected(0, TransactionRow.TYPE) |
||||||
|
TransactionRow.TYPE -> onRowSelected(0, TransactionRow.AMOUNT) |
||||||
|
TransactionRow.AMOUNT -> onRowSelected(0, TransactionRow.COMMENT) |
||||||
|
TransactionRow.COMMENT -> onRowSelected(0, TransactionRow.DATE) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,71 @@ |
|||||||
|
package net.pokeranalytics.android.ui.view |
||||||
|
|
||||||
|
import android.content.Context |
||||||
|
import android.util.AttributeSet |
||||||
|
import android.view.LayoutInflater |
||||||
|
import android.widget.FrameLayout |
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout |
||||||
|
import kotlinx.android.synthetic.main.row_transaction_view.view.* |
||||||
|
import net.pokeranalytics.android.R |
||||||
|
import net.pokeranalytics.android.calculus.ComputedStat |
||||||
|
import net.pokeranalytics.android.calculus.Stat |
||||||
|
import net.pokeranalytics.android.model.realm.Transaction |
||||||
|
import net.pokeranalytics.android.util.extensions.getDayNumber |
||||||
|
import net.pokeranalytics.android.util.extensions.getShortDayName |
||||||
|
|
||||||
|
/** |
||||||
|
* Display a transaction row |
||||||
|
*/ |
||||||
|
class TransactionRowView : FrameLayout { |
||||||
|
|
||||||
|
private lateinit var rowTransaction: 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 |
||||||
|
*/ |
||||||
|
private fun init() { |
||||||
|
val layoutInflater = LayoutInflater.from(context) |
||||||
|
rowTransaction = layoutInflater.inflate(R.layout.row_transaction_view, this, false) as ConstraintLayout |
||||||
|
val layoutParams = FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT) |
||||||
|
addView(rowTransaction, layoutParams) |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Set the session data to the view |
||||||
|
*/ |
||||||
|
fun setData(transaction: Transaction) { |
||||||
|
|
||||||
|
// Date |
||||||
|
rowTransaction.transactionDateDay.text = transaction.date.getShortDayName() |
||||||
|
rowTransaction.transactionDateNumber.text = transaction.date.getDayNumber() |
||||||
|
|
||||||
|
// Title / Game type |
||||||
|
var title = transaction.type?.name ?: "" + " " + transaction.comment |
||||||
|
var subtitle = transaction.bankroll?.name |
||||||
|
|
||||||
|
rowTransaction.transactionTitle.text = title |
||||||
|
rowTransaction.transactionSubtitle.text = subtitle |
||||||
|
|
||||||
|
// Amount |
||||||
|
val formattedStat = ComputedStat(Stat.NETRESULT, transaction.amount).format(context) |
||||||
|
rowTransaction.transactionAmount.setTextColor(formattedStat.getColor(context)) |
||||||
|
rowTransaction.transactionAmount.text = formattedStat.text |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,86 @@ |
|||||||
|
package net.pokeranalytics.android.ui.view.rowrepresentable |
||||||
|
|
||||||
|
import android.text.InputType |
||||||
|
import io.realm.RealmResults |
||||||
|
import net.pokeranalytics.android.R |
||||||
|
import net.pokeranalytics.android.ui.fragment.components.bottomsheet.BottomSheetType |
||||||
|
import net.pokeranalytics.android.ui.view.DefaultEditable |
||||||
|
import net.pokeranalytics.android.ui.view.RowRepresentable |
||||||
|
import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor |
||||||
|
import net.pokeranalytics.android.ui.view.RowViewType |
||||||
|
|
||||||
|
|
||||||
|
enum class TransactionRow : RowRepresentable, DefaultEditable { |
||||||
|
BANKROLL, |
||||||
|
TYPE, |
||||||
|
AMOUNT, |
||||||
|
COMMENT, |
||||||
|
DATE; |
||||||
|
|
||||||
|
override val resId: Int? |
||||||
|
get() { |
||||||
|
return when (this) { |
||||||
|
BANKROLL -> R.string.bankroll |
||||||
|
TYPE -> R.string.type |
||||||
|
AMOUNT -> R.string.amount |
||||||
|
COMMENT -> R.string.comment |
||||||
|
DATE -> R.string.date |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
override val viewType: Int |
||||||
|
get() { |
||||||
|
return when (this) { |
||||||
|
BANKROLL -> RowViewType.TITLE_VALUE.ordinal |
||||||
|
TYPE -> RowViewType.TITLE_VALUE.ordinal |
||||||
|
AMOUNT -> RowViewType.TITLE_VALUE.ordinal |
||||||
|
COMMENT -> RowViewType.TITLE_VALUE.ordinal |
||||||
|
DATE -> RowViewType.TITLE_VALUE.ordinal |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
override val bottomSheetType: BottomSheetType |
||||||
|
get() { |
||||||
|
return when (this) { |
||||||
|
BANKROLL -> BottomSheetType.LIST |
||||||
|
TYPE -> BottomSheetType.LIST |
||||||
|
AMOUNT -> BottomSheetType.EDIT_TEXT |
||||||
|
COMMENT -> BottomSheetType.EDIT_TEXT_MULTI_LINES |
||||||
|
DATE -> BottomSheetType.NONE |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
override fun editingDescriptors(map: Map<String, Any?>): ArrayList<RowRepresentableEditDescriptor>? { |
||||||
|
return when (this) { |
||||||
|
BANKROLL -> { |
||||||
|
val defaultValue : Any? by map |
||||||
|
val data : RealmResults<*>? by map |
||||||
|
arrayListOf( |
||||||
|
RowRepresentableEditDescriptor(defaultValue, data = data) |
||||||
|
) |
||||||
|
} |
||||||
|
TYPE -> { |
||||||
|
val defaultValue : Any? by map |
||||||
|
val data : RealmResults<*>? by map |
||||||
|
arrayListOf( |
||||||
|
RowRepresentableEditDescriptor(defaultValue, data = data) |
||||||
|
) |
||||||
|
} |
||||||
|
AMOUNT -> { |
||||||
|
val defaultValue: String? by map |
||||||
|
arrayListOf( |
||||||
|
RowRepresentableEditDescriptor( |
||||||
|
defaultValue, |
||||||
|
inputType = InputType.TYPE_CLASS_NUMBER |
||||||
|
or InputType.TYPE_NUMBER_FLAG_DECIMAL |
||||||
|
or InputType.TYPE_NUMBER_FLAG_SIGNED |
||||||
|
)) |
||||||
|
} |
||||||
|
COMMENT -> { |
||||||
|
val defaultValue : String? by map |
||||||
|
arrayListOf(RowRepresentableEditDescriptor(defaultValue, R.string.comment)) |
||||||
|
} |
||||||
|
else -> super<RowRepresentable>.editingDescriptors(map) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,12 @@ |
|||||||
|
<?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="wrap_content" |
||||||
|
android:orientation="vertical"> |
||||||
|
|
||||||
|
<net.pokeranalytics.android.ui.view.TransactionRowView |
||||||
|
android:id="@+id/transactionRow" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="wrap_content" /> |
||||||
|
|
||||||
|
</LinearLayout> |
||||||
@ -0,0 +1,108 @@ |
|||||||
|
<?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="56dp" |
||||||
|
android:background="?selectableItemBackground"> |
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView |
||||||
|
android:id="@+id/transactionDateDay" |
||||||
|
style="@style/PokerAnalyticsTheme.TextView.SessionRow.Date" |
||||||
|
android:layout_width="32dp" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:layout_marginTop="8dp" |
||||||
|
android:gravity="center" |
||||||
|
android:textAllCaps="true" |
||||||
|
app:fontFamily="@font/roboto_mono_medium" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/transactionDateNumber" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/guidelineStart" |
||||||
|
app:layout_constraintTop_toTopOf="parent" |
||||||
|
app:layout_constraintVertical_chainStyle="packed" |
||||||
|
tools:text="THU" /> |
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView |
||||||
|
android:id="@+id/transactionDateNumber" |
||||||
|
style="@style/PokerAnalyticsTheme.TextView.SessionRow.DateNumber" |
||||||
|
android:layout_width="32dp" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:layout_marginBottom="8dp" |
||||||
|
android:gravity="center" |
||||||
|
app:layout_constraintBottom_toBottomOf="parent" |
||||||
|
app:layout_constraintEnd_toEndOf="@+id/transactionDateDay" |
||||||
|
app:layout_constraintHorizontal_bias="0.5" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/transactionDateDay" |
||||||
|
app:layout_constraintTop_toBottomOf="@+id/transactionDateDay" |
||||||
|
tools:text="21" /> |
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView |
||||||
|
android:id="@+id/transactionTitle" |
||||||
|
style="@style/PokerAnalyticsTheme.TextView.SessionRow.Title" |
||||||
|
android:layout_width="0dp" |
||||||
|
android:layout_height="24dp" |
||||||
|
android:layout_marginStart="8dp" |
||||||
|
android:layout_marginEnd="8dp" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/transactionSubtitle" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/transactionAmount" |
||||||
|
app:layout_constraintHorizontal_bias="0.5" |
||||||
|
app:layout_constraintStart_toEndOf="@+id/transactionDateDay" |
||||||
|
app:layout_constraintTop_toTopOf="parent" |
||||||
|
app:layout_constraintVertical_chainStyle="packed" |
||||||
|
tools:text="Deposit: Live" /> |
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView |
||||||
|
android:id="@+id/transactionSubtitle" |
||||||
|
android:layout_width="0dp" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:layout_marginEnd="8dp" |
||||||
|
android:layout_marginBottom="2dp" |
||||||
|
android:ellipsize="end" |
||||||
|
android:fontFamily="@font/roboto" |
||||||
|
android:maxLines="1" |
||||||
|
android:textColor="@color/kaki_lighter" |
||||||
|
android:textSize="12sp" |
||||||
|
app:layout_constraintBottom_toBottomOf="parent" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/transactionAmount" |
||||||
|
app:layout_constraintStart_toStartOf="@+id/transactionTitle" |
||||||
|
app:layout_constraintTop_toBottomOf="@+id/transactionTitle" |
||||||
|
tools:text="Live" |
||||||
|
tools:visibility="visible" /> |
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView |
||||||
|
android:id="@+id/transactionAmount" |
||||||
|
style="@style/PokerAnalyticsTheme.TextView.SessionRow.Result" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:layout_marginEnd="8dp" |
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/transactionSubtitle" |
||||||
|
app:layout_constraintEnd_toStartOf="@+id/nextArrow" |
||||||
|
app:layout_constraintTop_toTopOf="@+id/transactionTitle" |
||||||
|
tools:text="$ 1000" /> |
||||||
|
|
||||||
|
<ImageView |
||||||
|
android:id="@+id/nextArrow" |
||||||
|
android:layout_width="24dp" |
||||||
|
android:layout_height="24dp" |
||||||
|
android:src="@drawable/ic_arrow_right" |
||||||
|
android:tint="@color/gray_light" |
||||||
|
app:layout_constraintBottom_toBottomOf="parent" |
||||||
|
app:layout_constraintEnd_toEndOf="@+id/guidelineEnd" |
||||||
|
app:layout_constraintTop_toTopOf="parent" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guidelineStart" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
app:layout_constraintGuide_begin="16dp" /> |
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline |
||||||
|
android:id="@+id/guidelineEnd" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
app:layout_constraintGuide_end="8dp" /> |
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout> |
||||||
Loading…
Reference in new issue