Create Export filtered transactions dialog in TransactionsFragment, which opens when the user clicks on the Toolbar's export button, with the corresponding Spanish translation of the new strings.

This commit is contained in:
Severiano Jaramillo 2019-02-01 15:57:56 -06:00
parent a10c527956
commit df5f8c46f7
5 changed files with 34 additions and 2 deletions

View file

@ -107,7 +107,7 @@ dependencies {
implementation 'org.bitcoinj:bitcoinj-core:0.14.3' implementation 'org.bitcoinj:bitcoinj-core:0.14.3'
implementation 'com.moldedbits.r2d2:r2d2:1.0.1' implementation 'com.moldedbits.r2d2:r2d2:1.0.1'
implementation 'me.dm7.barcodescanner:zxing:1.9.8' implementation 'me.dm7.barcodescanner:zxing:1.9.8'
implementation 'com.afollestad.material-dialogs:core:2.0.0-rc7' implementation 'com.afollestad.material-dialogs:core:2.0.0-rc9'
// Android Debug Database // Android Debug Database
debugImplementation 'com.amitshekhar.android:debug-db:1.0.4' debugImplementation 'com.amitshekhar.android:debug-db:1.0.4'

View file

@ -10,6 +10,8 @@ import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders import androidx.lifecycle.ViewModelProviders
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.list.listItemsMultiChoice
import com.jakewharton.rxbinding3.appcompat.queryTextChangeEvents import com.jakewharton.rxbinding3.appcompat.queryTextChangeEvents
import cy.agorise.bitsybitshareswallet.R import cy.agorise.bitsybitshareswallet.R
import cy.agorise.bitsybitshareswallet.adapters.TransfersDetailsAdapter import cy.agorise.bitsybitshareswallet.adapters.TransfersDetailsAdapter
@ -118,7 +120,15 @@ class TransactionsFragment : Fragment(), FilterOptionsDialog.OnFilterOptionsSele
true true
} }
R.id.menu_export -> { R.id.menu_export -> {
// TODO add export options MaterialDialog(context!!).show {
title(R.string.title_export_transactions)
listItemsMultiChoice(R.array.export_options, initialSelection = intArrayOf(0,1)) { _, indices, _ ->
val exportPDF = indices.contains(0)
val exportCSV = indices.contains(1)
exportFilteredTransactions(exportPDF, exportCSV)
}
positiveButton(R.string.title_export)
}
true true
} }
else -> super.onOptionsItemSelected(item) else -> super.onOptionsItemSelected(item)
@ -215,6 +225,11 @@ class TransactionsFragment : Fragment(), FilterOptionsDialog.OnFilterOptionsSele
applyFilterOptions(true) applyFilterOptions(true)
} }
/** Created the export procedures for PDF and CSV, depending on the user selection. */
private fun exportFilteredTransactions(exportPDF: Boolean, exportCSV: Boolean) {
}
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()

View file

@ -58,6 +58,11 @@
<string name="text__ignore_network_fees">Ignorar cuotas de red</string> <string name="text__ignore_network_fees">Ignorar cuotas de red</string>
<string name="button__filter">Filtrar</string> <string name="button__filter">Filtrar</string>
<!-- Transactions export options -->
<string name="title_export_transactions">Exportar transacciones filtradas</string>
<string name="text__pdf">PDF</string>
<string name="text__csv">CSV</string>
<!-- Merchants & Tellers --> <!-- Merchants & Tellers -->
<string name="title_merchants">Comerciantes</string> <string name="title_merchants">Comerciantes</string>
<string name="title_tellers">Tellers</string> <string name="title_tellers">Tellers</string>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="export_options">
<item>@string/text__pdf</item>
<item>@string/text__csv</item>
</string-array>
</resources>

View file

@ -58,6 +58,11 @@
<string name="text__ignore_network_fees">Ignore Network fees</string> <string name="text__ignore_network_fees">Ignore Network fees</string>
<string name="button__filter">Filter</string> <string name="button__filter">Filter</string>
<!-- Transactions export options -->
<string name="title_export_transactions">Export filtered transactions</string>
<string name="text__pdf">PDF</string>
<string name="text__csv">CSV</string>
<!-- Merchants & Tellers --> <!-- Merchants & Tellers -->
<string name="title_merchants">Merchants</string> <string name="title_merchants">Merchants</string>
<string name="title_tellers">Tellers</string> <string name="title_tellers">Tellers</string>