From 49b8ce1cb57a874ca243ed4e7284b31cce00ac94 Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Tue, 5 Feb 2019 16:36:55 -0600 Subject: [PATCH] Create eReceipts dynamic layout. --- .../utils/CSVGenerationTask.kt | 2 +- .../utils/PDFGeneratorTask.kt | 2 +- .../main/res/layout/fragment_e_receipt.xml | 193 +++++++++++++++++- app/src/main/res/values-es/strings.xml | 5 +- app/src/main/res/values/strings.xml | 5 +- 5 files changed, 195 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/utils/CSVGenerationTask.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/utils/CSVGenerationTask.kt index a5dd0ec..50afdd7 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/utils/CSVGenerationTask.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/utils/CSVGenerationTask.kt @@ -43,7 +43,7 @@ class CSVGenerationTask(context: Context) : AsyncTask, Int, // Add the table header val row = Array(7) {""} // Array initialized with empty strings val columnNames = arrayOf(R.string.title_from, R.string.title_to, R.string.title_memo, R.string.title_date, - R.string.title_time, R.string.title_asset_amount, R.string.title_fiat_equivalent) + R.string.title_time, R.string.title_amount, R.string.title_equivalent_value) for ((i, columnName) in columnNames.withIndex()) { row[i] = mContext.get()?.getString(columnName) ?: "" } diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/utils/PDFGeneratorTask.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/utils/PDFGeneratorTask.kt index d61271d..8567693 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/utils/PDFGeneratorTask.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/utils/PDFGeneratorTask.kt @@ -55,7 +55,7 @@ class PDFGeneratorTask(context: Context) : AsyncTask, Int, // Add the table header val columnNames = arrayOf(R.string.title_from, R.string.title_to, R.string.title_memo, R.string.title_date, - R.string.title_time, R.string.title_asset_amount, R.string.title_fiat_equivalent) + R.string.title_time, R.string.title_amount, R.string.title_equivalent_value) for (columnName in columnNames) { val cell = PdfPCell(Paragraph(mContext.get()?.getString(columnName))) table.addCell(cell) diff --git a/app/src/main/res/layout/fragment_e_receipt.xml b/app/src/main/res/layout/fragment_e_receipt.xml index 29d9f51..257ad92 100644 --- a/app/src/main/res/layout/fragment_e_receipt.xml +++ b/app/src/main/res/layout/fragment_e_receipt.xml @@ -1,13 +1,194 @@ - + - + android:layout_centerInParent="true" + android:maxWidth="350dp" + android:layout_marginTop="@dimen/activity_vertical_margin" + android:layout_marginBottom="@dimen/activity_vertical_margin" + android:layout_marginStart="@dimen/activity_horizontal_margin" + android:layout_marginEnd="@dimen/activity_horizontal_margin" + android:elevation="8dp" + android:layout_gravity="center_horizontal" + android:background="@android:color/white"> - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index d54abff..149148f 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -68,11 +68,12 @@ Memo Fecha Hora - Cantidad de activo - Equivalente fiat + Cantidad + Valor Equivalente Recibo electrónico + Memo: %1$d Comerciantes diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a4336a8..c171ae0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -68,11 +68,12 @@ Memo Date Time - Asset Amount - Fiat Equivalent + Amount + Equivalent Value eReceipt + Memo: %1$d Merchants