Create basic eReceipt screen, which is opened when a transaction is touched in the TransactionsFragment using the Navigation component.
This commit is contained in:
parent
d4a8da0730
commit
d8f1ad7216
6 changed files with 70 additions and 1 deletions
|
@ -9,10 +9,12 @@ import android.widget.ImageView
|
|||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.SortedList
|
||||
import cy.agorise.bitsybitshareswallet.R
|
||||
import cy.agorise.bitsybitshareswallet.database.joins.TransferDetail
|
||||
import cy.agorise.bitsybitshareswallet.fragments.TransactionsFragmentDirections
|
||||
import cy.agorise.bitsybitshareswallet.utils.Constants
|
||||
import java.math.RoundingMode
|
||||
import java.text.DecimalFormat
|
||||
|
@ -133,6 +135,12 @@ class TransfersDetailsAdapter(private val context: Context) :
|
|||
viewHolder.ivDirectionArrow.setImageDrawable(context.getDrawable(
|
||||
if(transferDetail.direction) R.drawable.ic_arrow_receive else R.drawable.ic_arrow_send
|
||||
))
|
||||
|
||||
viewHolder.rootView.setOnClickListener { v ->
|
||||
val action = TransactionsFragmentDirections.EReceiptAction()
|
||||
// action.openCamera = true
|
||||
v.findNavController().navigate(action)
|
||||
}
|
||||
}
|
||||
|
||||
fun add(transferDetail: TransferDetail) {
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package cy.agorise.bitsybitshareswallet.fragments
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import cy.agorise.bitsybitshareswallet.R
|
||||
|
||||
class EReceiptFragment : Fragment() {
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
setHasOptionsMenu(true)
|
||||
|
||||
return inflater.inflate(R.layout.fragment_e_receipt, container, false)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
}
|
||||
}
|
13
app/src/main/res/layout/fragment_e_receipt.xml
Normal file
13
app/src/main/res/layout/fragment_e_receipt.xml
Normal file
|
@ -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">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/title_e_receipt"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -52,7 +52,28 @@
|
|||
android:id="@+id/transactions_dest"
|
||||
android:name="cy.agorise.bitsybitshareswallet.fragments.TransactionsFragment"
|
||||
android:label="@string/title_transactions"
|
||||
tools:layout="@layout/fragment_transactions"/>
|
||||
tools:layout="@layout/fragment_transactions">
|
||||
|
||||
<action
|
||||
android:id="@+id/e_receipt_action"
|
||||
app:destination="@id/e_receipt_dest"
|
||||
app:enterAnim="@anim/slide_in_right"
|
||||
app:exitAnim="@anim/slide_out_left"
|
||||
app:popEnterAnim="@anim/slide_in_left"
|
||||
app:popExitAnim="@anim/slide_out_right"/>
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/e_receipt_dest"
|
||||
android:name="cy.agorise.bitsybitshareswallet.fragments.EReceiptFragment"
|
||||
android:label="@string/title_e_receipt"
|
||||
tools:layout="@layout/fragment_e_receipt">
|
||||
|
||||
<!--<argument-->
|
||||
<!--android:name="openCamera"-->
|
||||
<!--app:argType="boolean"-->
|
||||
<!--android:defaultValue="false" />-->
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/settings_dest"
|
||||
|
|
|
@ -71,6 +71,9 @@
|
|||
<string name="title_asset_amount">Cantidad de activo</string>
|
||||
<string name="title_fiat_equivalent">Equivalente fiat</string>
|
||||
|
||||
<!-- eReceipt -->
|
||||
<string name="title_e_receipt">Recibo electrónico</string>
|
||||
|
||||
<!-- Merchants & Tellers -->
|
||||
<string name="title_merchants">Comerciantes</string>
|
||||
<string name="title_tellers">Tellers</string>
|
||||
|
|
|
@ -71,6 +71,9 @@
|
|||
<string name="title_asset_amount">Asset Amount</string>
|
||||
<string name="title_fiat_equivalent">Fiat Equivalent</string>
|
||||
|
||||
<!-- eReceipt -->
|
||||
<string name="title_e_receipt">eReceipt</string>
|
||||
|
||||
<!-- Merchants & Tellers -->
|
||||
<string name="title_merchants">Merchants</string>
|
||||
<string name="title_tellers">Tellers</string>
|
||||
|
|
Loading…
Reference in a new issue