diff options
author | Torsten Grote <t@grobox.de> | 2020-04-03 15:12:29 -0300 |
---|---|---|
committer | Torsten Grote <t@grobox.de> | 2020-04-03 15:12:29 -0300 |
commit | d72548e82e6993486180f5528ae8073ab2a99a25 (patch) | |
tree | 4abe23b58340fb8fcc238ad5bd9bc7fda6bb13e2 /wallet/src | |
parent | bee652834f90fd8abd46b5adcf30adcc587984c2 (diff) | |
download | taler-android-d72548e82e6993486180f5528ae8073ab2a99a25.tar.gz taler-android-d72548e82e6993486180f5528ae8073ab2a99a25.tar.bz2 taler-android-d72548e82e6993486180f5528ae8073ab2a99a25.zip |
[wallet] add detail page for payment sent event in history
Diffstat (limited to 'wallet/src')
10 files changed, 355 insertions, 188 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/history/HistoryAdapter.kt b/wallet/src/main/java/net/taler/wallet/history/HistoryAdapter.kt index 881ada5..1c7f15e 100644 --- a/wallet/src/main/java/net/taler/wallet/history/HistoryAdapter.kt +++ b/wallet/src/main/java/net/taler/wallet/history/HistoryAdapter.kt @@ -33,6 +33,7 @@ import net.taler.wallet.history.HistoryAdapter.HistoryEventViewHolder internal class HistoryAdapter( + private val devMode: Boolean, private val listener: OnEventClickListener, private var history: History = History() ) : Adapter<HistoryEventViewHolder>() { @@ -73,7 +74,11 @@ internal class HistoryAdapter( @CallSuper open fun bind(event: HistoryEvent) { - v.setOnClickListener { listener.onEventClicked(event) } + if (devMode || event.detailPageLayout != 0) { + v.setOnClickListener { listener.onEventClicked(event) } + } else { + v.background = null + } icon.setImageResource(event.icon) if (event.title == 0) title.text = event::class.java.simpleName else title.setText(event.title) diff --git a/wallet/src/main/java/net/taler/wallet/history/HistoryEvent.kt b/wallet/src/main/java/net/taler/wallet/history/HistoryEvent.kt index 86a7ac0..57bf6a3 100644 --- a/wallet/src/main/java/net/taler/wallet/history/HistoryEvent.kt +++ b/wallet/src/main/java/net/taler/wallet/history/HistoryEvent.kt @@ -138,6 +138,8 @@ abstract class HistoryEvent( val timestamp: Timestamp, @get:LayoutRes open val layout: Int = R.layout.history_row, + @get:LayoutRes + open val detailPageLayout: Int = 0, @get:StringRes open val title: Int = 0, @get:DrawableRes @@ -215,6 +217,7 @@ class HistoryWithdrawnEvent( val amountWithdrawnEffective: Amount ) : HistoryEvent(timestamp) { override val layout = R.layout.history_receive + override val detailPageLayout = R.layout.fragment_event_withdraw override val title = R.string.history_event_withdrawn override val icon = R.drawable.history_withdrawn override val showToUser = true @@ -270,6 +273,7 @@ class HistoryPaymentSentEvent( val sessionId: String? ) : HistoryEvent(timestamp) { override val layout = R.layout.history_payment + override val detailPageLayout = R.layout.fragment_event_paid override val title = R.string.history_event_payment_sent override val icon = R.drawable.ic_cash_usd_outline override val showToUser = true diff --git a/wallet/src/main/java/net/taler/wallet/history/HistoryEventFragment.kt b/wallet/src/main/java/net/taler/wallet/history/HistoryEventFragment.kt index f0dec75..6a07625 100644 --- a/wallet/src/main/java/net/taler/wallet/history/HistoryEventFragment.kt +++ b/wallet/src/main/java/net/taler/wallet/history/HistoryEventFragment.kt @@ -23,9 +23,14 @@ import android.view.MenuInflater import android.view.MenuItem import android.view.View import android.view.ViewGroup +import android.widget.Toast +import android.widget.Toast.LENGTH_LONG import androidx.fragment.app.Fragment import androidx.fragment.app.activityViewModels -import kotlinx.android.synthetic.main.fragment_history_event.* +import kotlinx.android.synthetic.main.fragment_event_paid.* +import kotlinx.android.synthetic.main.fragment_event_withdraw.* +import kotlinx.android.synthetic.main.fragment_event_withdraw.feeView +import kotlinx.android.synthetic.main.fragment_event_withdraw.timeView import net.taler.common.toAbsoluteTime import net.taler.wallet.R import net.taler.wallet.WalletViewModel @@ -39,28 +44,29 @@ class HistoryEventFragment : Fragment() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - if (model.devMode.value == true) setHasOptionsMenu(true) + setHasOptionsMenu(model.devMode.value == true) } override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View? { - return inflater.inflate(R.layout.fragment_history_event, container, false) + return inflater.inflate(event.detailPageLayout, container, false) } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - val event = event as HistoryWithdrawnEvent + override fun onActivityCreated(savedInstanceState: Bundle?) { + super.onActivityCreated(savedInstanceState) + requireActivity().title = + getString(if (event.title != 0) event.title else R.string.history_detail_title) + } + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { timeView.text = event.timestamp.ms.toAbsoluteTime(requireContext()) - effectiveAmountLabel.text = getString(R.string.withdraw_total) - effectiveAmountView.text = event.amountWithdrawnEffective.toString() - chosenAmountLabel.text = getString(R.string.amount_chosen) - chosenAmountView.text = - getString(R.string.amount_positive, event.amountWithdrawnRaw.toString()) - val fee = event.amountWithdrawnRaw - event.amountWithdrawnEffective - feeView.text = getString(R.string.amount_negative, fee.toString()) - exchangeView.text = cleanExchange(event.exchangeBaseUrl) + when (val e = event) { + is HistoryWithdrawnEvent -> bind(e) + is HistoryPaymentSentEvent -> bind(e) + else -> Toast.makeText(requireContext(), "event not implement", LENGTH_LONG).show() + } } override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { @@ -77,4 +83,25 @@ class HistoryEventFragment : Fragment() { } } + private fun bind(event: HistoryWithdrawnEvent) { + effectiveAmountLabel.text = getString(R.string.withdraw_total) + effectiveAmountView.text = event.amountWithdrawnEffective.toString() + chosenAmountLabel.text = getString(R.string.amount_chosen) + chosenAmountView.text = + getString(R.string.amount_positive, event.amountWithdrawnRaw.toString()) + val fee = event.amountWithdrawnRaw - event.amountWithdrawnEffective + feeView.text = getString(R.string.amount_negative, fee.toString()) + exchangeView.text = cleanExchange(event.exchangeBaseUrl) + } + + private fun bind(event: HistoryPaymentSentEvent) { + amountPaidWithFeesView.text = event.amountPaidWithFees.toString() + orderAmountView.text = event.orderShortInfo.amount.toString() + val fee = event.amountPaidWithFees - event.orderShortInfo.amount + feeView.text = getString(R.string.amount_negative, fee.toString()) + orderSummaryView.text = event.orderShortInfo.summary + orderIdView.text = + getString(R.string.history_event_payment_sent_order_id, event.orderShortInfo.orderId) + } + } diff --git a/wallet/src/main/java/net/taler/wallet/history/HistoryFragment.kt b/wallet/src/main/java/net/taler/wallet/history/HistoryFragment.kt index b0f6728..73dbae0 100644 --- a/wallet/src/main/java/net/taler/wallet/history/HistoryFragment.kt +++ b/wallet/src/main/java/net/taler/wallet/history/HistoryFragment.kt @@ -33,7 +33,6 @@ import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager.VERTICAL import kotlinx.android.synthetic.main.fragment_show_history.* -import net.taler.common.exhaustive import net.taler.common.fadeIn import net.taler.common.fadeOut import net.taler.wallet.R @@ -49,7 +48,7 @@ class HistoryFragment : Fragment(), OnEventClickListener { private val historyManager by lazy { model.historyManager } private lateinit var showAllItem: MenuItem private var reloadHistoryItem: MenuItem? = null - private val historyAdapter = HistoryAdapter(this) + private val historyAdapter by lazy { HistoryAdapter(model.devMode.value == true, this) } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -109,17 +108,13 @@ class HistoryFragment : Fragment(), OnEventClickListener { } override fun onEventClicked(event: HistoryEvent) { - when (event) { - is HistoryWithdrawnEvent -> { - historyManager.selectedEvent = event - findNavController().navigate(R.id.action_walletHistory_to_historyEventFragment) - } - else -> { - if (model.devMode.value != true) return - JsonDialogFragment.new(event.json.toString(2)) - .show(parentFragmentManager, null) - } - }.exhaustive + if (event.detailPageLayout != 0) { + historyManager.selectedEvent = event + findNavController().navigate(R.id.action_walletHistory_to_historyEventFragment) + } else if (model.devMode.value == true) { + JsonDialogFragment.new(event.json.toString(2)) + .show(parentFragmentManager, null) + } } private fun onHistoryResult(result: HistoryResult) = when (result) { diff --git a/wallet/src/main/res/layout/fragment_event_paid.xml b/wallet/src/main/res/layout/fragment_event_paid.xml new file mode 100644 index 0000000..4485744 --- /dev/null +++ b/wallet/src/main/res/layout/fragment_event_paid.xml @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + ~ This file is part of GNU Taler + ~ (C) 2020 Taler Systems S.A. + ~ + ~ GNU Taler is free software; you can redistribute it and/or modify it under the + ~ terms of the GNU General Public License as published by the Free Software + ~ Foundation; either version 3, or (at your option) any later version. + ~ + ~ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + ~ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + ~ A PARTICULAR PURPOSE. See the GNU General Public License for more details. + ~ + ~ You should have received a copy of the GNU General Public License along with + ~ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + --> + +<ScrollView 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="match_parent" + android:fillViewport="true" + tools:context=".history.HistoryEventFragment"> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <TextView + android:id="@+id/timeView" + style="@style/HistoryEventLabel.Time" + app:layout_constraintBottom_toTopOf="@+id/amountPaidWithFeesLabel" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_chainStyle="packed" + tools:text="23 March 2020 23:42pm" /> + + <TextView + android:id="@+id/amountPaidWithFeesLabel" + style="@style/HistoryEventLabel" + android:text="@string/history_event_payment_sent_paid" + app:layout_constraintBottom_toTopOf="@+id/amountPaidWithFeesView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/timeView" /> + + <TextView + android:id="@+id/amountPaidWithFeesView" + style="@style/HistoryEventContent" + android:textColor="@color/red" + app:layout_constraintBottom_toTopOf="@+id/orderAmountLabel" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/amountPaidWithFeesLabel" + tools:text="-23.42 TESTKUDOS" /> + + <TextView + android:id="@+id/orderAmountLabel" + style="@style/HistoryEventLabel" + android:text="@string/history_event_payment_sent_amount" + app:layout_constraintBottom_toTopOf="@+id/orderAmountView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/amountPaidWithFeesView" /> + + <TextView + android:id="@+id/orderAmountView" + style="@style/HistoryEventContent" + app:layout_constraintBottom_toTopOf="@+id/feeLabel" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/orderAmountLabel" + tools:text="23 TESTKUDOS" /> + + <TextView + android:id="@+id/feeLabel" + style="@style/HistoryEventLabel" + android:text="@string/withdraw_fees" + app:layout_constraintBottom_toTopOf="@+id/feeView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/orderAmountView" /> + + <TextView + android:id="@+id/feeView" + style="@style/HistoryEventContent" + android:textColor="@color/red" + app:layout_constraintBottom_toTopOf="@+id/orderSummaryLabel" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/feeLabel" + tools:text="-0.42 TESTKUDOS" /> + + <TextView + android:id="@+id/orderSummaryLabel" + style="@style/HistoryEventLabel" + android:text="@string/history_event_payment_sent_order" + app:layout_constraintBottom_toTopOf="@+id/orderSummaryView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/feeView" /> + + <TextView + android:id="@+id/orderSummaryView" + style="@style/HistoryEventContent" + app:layout_constraintBottom_toTopOf="@+id/orderIdView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/orderSummaryLabel" + tools:text="Some Product that was bought and can have quite a long label" /> + + <TextView + android:id="@+id/orderIdView" + style="@style/HistoryEventLabel" + android:text="@string/history_event_payment_sent_order_id" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/orderSummaryView" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + +</ScrollView> diff --git a/wallet/src/main/res/layout/fragment_event_withdraw.xml b/wallet/src/main/res/layout/fragment_event_withdraw.xml new file mode 100644 index 0000000..9c5d818 --- /dev/null +++ b/wallet/src/main/res/layout/fragment_event_withdraw.xml @@ -0,0 +1,143 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + ~ This file is part of GNU Taler + ~ (C) 2020 Taler Systems S.A. + ~ + ~ GNU Taler is free software; you can redistribute it and/or modify it under the + ~ terms of the GNU General Public License as published by the Free Software + ~ Foundation; either version 3, or (at your option) any later version. + ~ + ~ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + ~ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + ~ A PARTICULAR PURPOSE. See the GNU General Public License for more details. + ~ + ~ You should have received a copy of the GNU General Public License along with + ~ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + --> + +<ScrollView 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="match_parent" + android:fillViewport="true" + tools:context=".history.HistoryEventFragment"> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <TextView + android:id="@+id/timeView" + style="@style/HistoryEventLabel.Time" + app:layout_constraintBottom_toTopOf="@+id/effectiveAmountLabel" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_chainStyle="packed" + tools:text="23 March 2020 23:42pm" /> + + <TextView + android:id="@+id/effectiveAmountLabel" + style="@style/HistoryEventLabel" + app:layout_constraintBottom_toTopOf="@+id/effectiveAmountView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/timeView" + tools:text="@string/withdraw_total" /> + + <TextView + android:id="@+id/effectiveAmountView" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginTop="8dp" + android:layout_marginEnd="16dp" + android:layout_marginBottom="16dp" + android:gravity="center" + android:textColor="@color/green" + android:textSize="24sp" + app:layout_constraintBottom_toTopOf="@+id/chosenAmountLabel" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/effectiveAmountLabel" + tools:text="23.42 TESTKUDOS" /> + + <TextView + android:id="@+id/chosenAmountLabel" + style="@style/HistoryEventLabel" + app:layout_constraintBottom_toTopOf="@+id/chosenAmountView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/effectiveAmountView" + tools:text="@string/amount_chosen" /> + + <TextView + android:id="@+id/chosenAmountView" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginTop="8dp" + android:layout_marginEnd="16dp" + android:layout_marginBottom="16dp" + android:gravity="center" + android:textSize="24sp" + app:layout_constraintBottom_toTopOf="@+id/feeLabel" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/chosenAmountLabel" + tools:text="24 TESTKUDOS" /> + + <TextView + android:id="@+id/feeLabel" + style="@style/HistoryEventLabel" + android:text="@string/withdraw_fees" + app:layout_constraintBottom_toTopOf="@+id/feeView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/chosenAmountView" /> + + <TextView + android:id="@+id/feeView" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginTop="8dp" + android:layout_marginEnd="16dp" + android:layout_marginBottom="16dp" + android:gravity="center" + android:textColor="@color/red" + android:textSize="24sp" + app:layout_constraintBottom_toTopOf="@+id/exchangeLabel" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/feeLabel" + tools:text="-0.38 TESTKUDOS" /> + + <TextView + android:id="@+id/exchangeLabel" + style="@style/HistoryEventLabel" + android:text="@string/withdraw_exchange" + app:layout_constraintBottom_toTopOf="@+id/exchangeView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/feeView" /> + + <TextView + android:id="@+id/exchangeView" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginTop="8dp" + android:layout_marginEnd="16dp" + android:gravity="center" + android:textSize="24sp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/exchangeLabel" + tools:text="exchange.demo.taler.net" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + +</ScrollView> diff --git a/wallet/src/main/res/layout/fragment_history_event.xml b/wallet/src/main/res/layout/fragment_history_event.xml deleted file mode 100644 index 4224093..0000000 --- a/wallet/src/main/res/layout/fragment_history_event.xml +++ /dev/null @@ -1,160 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?><!-- - ~ This file is part of GNU Taler - ~ (C) 2020 Taler Systems S.A. - ~ - ~ GNU Taler is free software; you can redistribute it and/or modify it under the - ~ terms of the GNU General Public License as published by the Free Software - ~ Foundation; either version 3, or (at your option) any later version. - ~ - ~ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY - ~ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - ~ A PARTICULAR PURPOSE. See the GNU General Public License for more details. - ~ - ~ You should have received a copy of the GNU General Public License along with - ~ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - --> - -<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="match_parent" - tools:context=".history.HistoryEventFragment"> - - <TextView - android:id="@+id/timeView" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_margin="16dp" - android:gravity="center" - android:textAppearance="@style/TextAppearance.AppCompat.Medium" - app:layout_constraintBottom_toTopOf="@+id/effectiveAmountLabel" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_chainStyle="packed" - tools:text="23 March 2020 23:42pm" /> - - <TextView - android:id="@+id/effectiveAmountLabel" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginStart="16dp" - android:layout_marginTop="16dp" - android:layout_marginEnd="16dp" - android:gravity="center" - app:layout_constraintBottom_toTopOf="@+id/effectiveAmountView" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/timeView" - tools:text="@string/withdraw_total" /> - - <TextView - android:id="@+id/effectiveAmountView" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginStart="16dp" - android:layout_marginTop="8dp" - android:layout_marginEnd="16dp" - android:layout_marginBottom="16dp" - android:gravity="center" - android:textColor="@color/green" - android:textSize="24sp" - app:layout_constraintBottom_toTopOf="@+id/chosenAmountLabel" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/effectiveAmountLabel" - tools:text="23.42 TESTKUDOS" /> - - <TextView - android:id="@+id/chosenAmountLabel" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginStart="16dp" - android:layout_marginTop="16dp" - android:layout_marginEnd="16dp" - android:gravity="center" - app:layout_constraintBottom_toTopOf="@+id/chosenAmountView" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/effectiveAmountView" - tools:text="@string/amount_chosen" /> - - <TextView - android:id="@+id/chosenAmountView" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginStart="16dp" - android:layout_marginTop="8dp" - android:layout_marginEnd="16dp" - android:layout_marginBottom="16dp" - android:gravity="center" - android:textSize="24sp" - app:layout_constraintBottom_toTopOf="@+id/feeLabel" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/chosenAmountLabel" - tools:text="24 TESTKUDOS" /> - - <TextView - android:id="@+id/feeLabel" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginStart="16dp" - android:layout_marginTop="16dp" - android:layout_marginEnd="16dp" - android:gravity="center" - android:text="@string/withdraw_fees" - app:layout_constraintBottom_toTopOf="@+id/feeView" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/chosenAmountView" /> - - <TextView - android:id="@+id/feeView" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginStart="16dp" - android:layout_marginTop="8dp" - android:layout_marginEnd="16dp" - android:layout_marginBottom="16dp" - android:gravity="center" - android:textColor="@color/red" - android:textSize="24sp" - app:layout_constraintBottom_toTopOf="@+id/exchangeLabel" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/feeLabel" - tools:text="-0.38 TESTKUDOS" /> - - <TextView - android:id="@+id/exchangeLabel" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginStart="16dp" - android:layout_marginTop="16dp" - android:layout_marginEnd="16dp" - android:gravity="center" - android:text="@string/withdraw_exchange" - app:layout_constraintBottom_toTopOf="@+id/exchangeView" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/feeView" /> - - <TextView - android:id="@+id/exchangeView" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginStart="16dp" - android:layout_marginTop="8dp" - android:layout_marginEnd="16dp" - android:gravity="center" - android:textSize="24sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.5" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/exchangeLabel" - tools:text="exchange.demo.taler.net" /> - -</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/wallet/src/main/res/navigation/nav_graph.xml b/wallet/src/main/res/navigation/nav_graph.xml index 1ab9666..c39df94 100644 --- a/wallet/src/main/res/navigation/nav_graph.xml +++ b/wallet/src/main/res/navigation/nav_graph.xml @@ -72,7 +72,7 @@ android:id="@+id/historyEventFragment" android:name="net.taler.wallet.history.HistoryEventFragment" android:label="@string/history_detail_title" - tools:layout="@layout/fragment_history_event" /> + tools:layout="@layout/fragment_event_withdraw" /> <fragment android:id="@+id/alreadyPaid" diff --git a/wallet/src/main/res/values/strings.xml b/wallet/src/main/res/values/strings.xml index 1f028c2..31aaf14 100644 --- a/wallet/src/main/res/values/strings.xml +++ b/wallet/src/main/res/values/strings.xml @@ -59,6 +59,10 @@ <string name="history_event_exchange_updated">Exchange Updated</string> <string name="history_event_reserve_balance_updated">Reserve Balance Updated</string> <string name="history_event_payment_sent">Payment</string> + <string name="history_event_payment_sent_paid">Paid</string> + <string name="history_event_payment_sent_amount">Order Total</string> + <string name="history_event_payment_sent_order">Order</string> + <string name="history_event_payment_sent_order_id">Order Reference: %1$s</string> <string name="history_event_payment_aborted">Payment Aborted</string> <string name="history_event_withdrawn">Withdraw</string> <string name="history_event_order_accepted">Purchase Confirmed</string> diff --git a/wallet/src/main/res/values/styles.xml b/wallet/src/main/res/values/styles.xml index c3e18a6..9ebcae5 100644 --- a/wallet/src/main/res/values/styles.xml +++ b/wallet/src/main/res/values/styles.xml @@ -38,6 +38,31 @@ <item name="android:textColor">?android:textColorPrimary</item> </style> + <style name="HistoryEventLabel"> + <item name="android:layout_width">0dp</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:layout_marginStart">16dp</item> + <item name="android:layout_marginTop">16dp</item> + <item name="android:layout_marginEnd">16dp</item> + <item name="android:gravity">center</item> + </style> + + <style name="HistoryEventLabel.Time"> + <item name="android:layout_marginBottom">16dp</item> + <item name="android:textAppearance">@style/TextAppearance.AppCompat.Medium</item> + </style> + + <style name="HistoryEventContent"> + <item name="android:layout_width">0dp</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:layout_marginStart">16dp</item> + <item name="android:layout_marginTop">8dp</item> + <item name="android:layout_marginEnd">16dp</item> + <item name="android:layout_marginBottom">16dp</item> + <item name="android:textSize">24sp</item> + <item name="android:gravity">center</item> + </style> + <style name="BottomCard"> <item name="cardCornerRadius">0dp</item> <item name="cardElevation">8dp</item> |