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:
parent
a10c527956
commit
df5f8c46f7
5 changed files with 34 additions and 2 deletions
|
@ -107,7 +107,7 @@ dependencies {
|
|||
implementation 'org.bitcoinj:bitcoinj-core:0.14.3'
|
||||
implementation 'com.moldedbits.r2d2:r2d2:1.0.1'
|
||||
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
|
||||
debugImplementation 'com.amitshekhar.android:debug-db:1.0.4'
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@ import androidx.fragment.app.FragmentActivity
|
|||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.afollestad.materialdialogs.list.listItemsMultiChoice
|
||||
import com.jakewharton.rxbinding3.appcompat.queryTextChangeEvents
|
||||
import cy.agorise.bitsybitshareswallet.R
|
||||
import cy.agorise.bitsybitshareswallet.adapters.TransfersDetailsAdapter
|
||||
|
@ -118,7 +120,15 @@ class TransactionsFragment : Fragment(), FilterOptionsDialog.OnFilterOptionsSele
|
|||
true
|
||||
}
|
||||
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
|
||||
}
|
||||
else -> super.onOptionsItemSelected(item)
|
||||
|
@ -215,6 +225,11 @@ class TransactionsFragment : Fragment(), FilterOptionsDialog.OnFilterOptionsSele
|
|||
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() {
|
||||
super.onDestroy()
|
||||
|
||||
|
|
|
@ -58,6 +58,11 @@
|
|||
<string name="text__ignore_network_fees">Ignorar cuotas de red</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 -->
|
||||
<string name="title_merchants">Comerciantes</string>
|
||||
<string name="title_tellers">Tellers</string>
|
||||
|
|
7
app/src/main/res/values/arrays.xml
Normal file
7
app/src/main/res/values/arrays.xml
Normal 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>
|
|
@ -58,6 +58,11 @@
|
|||
<string name="text__ignore_network_fees">Ignore Network fees</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 -->
|
||||
<string name="title_merchants">Merchants</string>
|
||||
<string name="title_tellers">Tellers</string>
|
||||
|
|
Loading…
Reference in a new issue