|
|
|
|
@ -6,6 +6,8 @@ import io.realm.annotations.Ignore |
|
|
|
|
import io.realm.annotations.PrimaryKey |
|
|
|
|
import io.realm.kotlin.where |
|
|
|
|
import net.pokeranalytics.android.R |
|
|
|
|
import net.pokeranalytics.android.calculus.Stat |
|
|
|
|
import net.pokeranalytics.android.calculus.TextFormat |
|
|
|
|
import net.pokeranalytics.android.model.filter.Filterable |
|
|
|
|
import net.pokeranalytics.android.model.filter.QueryCondition |
|
|
|
|
import net.pokeranalytics.android.model.interfaces.DatedValue |
|
|
|
|
@ -13,14 +15,17 @@ import net.pokeranalytics.android.model.interfaces.Manageable |
|
|
|
|
import net.pokeranalytics.android.model.interfaces.SaveValidityStatus |
|
|
|
|
import net.pokeranalytics.android.model.interfaces.TimeFilterable |
|
|
|
|
import net.pokeranalytics.android.ui.adapter.StaticRowRepresentableDataSource |
|
|
|
|
import net.pokeranalytics.android.ui.graph.GraphUnderlyingEntry |
|
|
|
|
import net.pokeranalytics.android.ui.view.RowRepresentable |
|
|
|
|
import net.pokeranalytics.android.ui.view.RowViewType |
|
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.TransactionRow |
|
|
|
|
import java.text.DateFormat |
|
|
|
|
import java.util.* |
|
|
|
|
import kotlin.collections.ArrayList |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
open class Transaction : RealmObject(), Manageable, StaticRowRepresentableDataSource, RowRepresentable, TimeFilterable, Filterable, DatedValue { |
|
|
|
|
open class Transaction : RealmObject(), Manageable, StaticRowRepresentableDataSource, RowRepresentable, TimeFilterable, Filterable, DatedValue, |
|
|
|
|
GraphUnderlyingEntry { |
|
|
|
|
|
|
|
|
|
companion object { |
|
|
|
|
|
|
|
|
|
@ -120,4 +125,16 @@ open class Transaction : RealmObject(), Manageable, StaticRowRepresentableDataSo |
|
|
|
|
} |
|
|
|
|
return SaveValidityStatus.VALID |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// GraphUnderlyingEntry |
|
|
|
|
|
|
|
|
|
override val entryTitle: String |
|
|
|
|
get() { |
|
|
|
|
return DateFormat.getDateInstance(DateFormat.SHORT).format(this.date) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun formattedValue(stat: Stat): TextFormat { |
|
|
|
|
return stat.format(this.amount) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|