Extract string resources from TransactionsFragment's FilterOptionsDialog, so they can be easily translated.

This commit is contained in:
Severiano Jaramillo 2019-01-10 12:44:56 -06:00
parent bd0b74eeaf
commit 7c1a3577e9
3 changed files with 22 additions and 13 deletions

View file

@ -165,9 +165,9 @@ class FilterOptionsDialog : DialogFragment() {
mDatePickerHandler = DatePickerHandler()
val builder = AlertDialog.Builder(context!!)
.setTitle("Filter options")
.setPositiveButton("Filter") { _, _ -> validateFields() }
.setNegativeButton("Cancel") { _, _ -> dismiss() }
.setTitle(getString(R.string.title_filter_options))
.setPositiveButton(getString(R.string.button__filter)) { _, _ -> validateFields() }
.setNegativeButton(getString(android.R.string.cancel)) { _, _ -> dismiss() }
// Inflate layout
val inflater = activity!!.layoutInflater

View file

@ -14,7 +14,7 @@
android:id="@+id/tvTransactionDirection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Transactions"
android:text="@string/title_transactions"
android:textSize="16sp"
app:layout_constraintTop_toTopOf="parent"/>
@ -31,21 +31,21 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="All"/>
android:text="@string/text__all"/>
<RadioButton
android:id="@+id/rbTransactionSent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Sent"/>
android:text="@string/text__sent"/>
<RadioButton
android:id="@+id/rbTransactionReceived"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Received"/>
android:text="@string/text__received"/>
</RadioGroup>
@ -55,7 +55,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="Date Range"
android:text="@string/text__date_range"
android:textSize="16sp"
app:layout_constraintTop_toTopOf="@id/cbDateRange"
app:layout_constraintStart_toStartOf="parent"/>
@ -65,7 +65,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_different_topic"
android:text="All"
android:text="@string/text__all"
app:layout_constraintTop_toBottomOf="@id/rgTransactionDirection"
app:layout_constraintEnd_toEndOf="parent"/>
@ -106,7 +106,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="Asset"
android:text="@string/text__asset"
android:textSize="16sp"
app:layout_constraintTop_toTopOf="@id/cbAsset"
app:layout_constraintStart_toStartOf="parent"/>
@ -116,7 +116,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_different_topic"
android:text="All"
android:text="@string/text__all"
app:layout_constraintTop_toBottomOf="@+id/llDateRange"
app:layout_constraintEnd_toEndOf="parent"/>
@ -133,7 +133,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="Fiat Amount"
android:text="@string/text__fiat_amount"
android:textSize="16sp"
app:layout_constraintTop_toTopOf="@id/cbFiatAmount"
app:layout_constraintStart_toStartOf="parent"/>
@ -143,7 +143,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_same_topic"
android:text="All"
android:text="@string/text__all"
android:enabled="false"
app:layout_constraintTop_toBottomOf="@id/sAsset"
app:layout_constraintEnd_toEndOf="parent"/>

View file

@ -51,6 +51,15 @@
<string name="title_filter">Filter</string>
<string name="title_export">Export</string>
<!-- Transactions filter options -->
<string name="title_filter_options">Filter options</string>
<string name="text__all">All</string>
<string name="text__sent">Sent</string>
<string name="text__received">Received</string>
<string name="text__date_range">Date Range</string>
<string name="text__fiat_amount">Fiat Amount</string>
<string name="button__filter">Filter</string>
<!-- Send Transaction -->
<string name="title_info">Info</string>
<string name="text__to">To</string>