(view) -> b.templateIsFallbackSwitch.toggle();
b.templateIsFallbackLabel.setOnClickListener(fallbackLabelClickListener);
b.templateIsFallbackText.setOnClickListener(fallbackLabelClickListener);
- b.templateDetailsTemplateParamsHelpButton.setOnClickListener(v -> HelpDialog.show(
- b.getRoot()
- .getContext(), R.string.template_details_template_params_label,
- R.array.template_params_help));
+ b.templateParamsHelpButton.setOnClickListener(v -> HelpDialog.show(b.getRoot()
+ .getContext(),
+ R.string.template_details_template_params_label, R.array.template_params_help));
}
@NotNull
private TemplateDetailsItem.Header getItem() {
b.testText.setText(header.getTestText());
if (header.hasLiteralDateYear()) {
- b.templateDetailsYearSource.setText(R.string.template_details_source_literal);
+ b.yearSource.setText(R.string.template_details_source_literal);
final Integer dateYear = header.getDateYear();
b.templateDetailsDateYear.setText(
(dateYear == null) ? null : String.valueOf(dateYear));
- b.templateDetailsDateYearLayout.setVisibility(View.VISIBLE);
+ b.yearLayout.setVisibility(View.VISIBLE);
}
else {
- b.templateDetailsDateYearLayout.setVisibility(View.GONE);
- b.templateDetailsYearSource.setText(
+ b.yearLayout.setVisibility(View.GONE);
+ b.yearSource.setText(
String.format(Locale.US, groupNoText, header.getDateYearMatchGroup(),
getMatchGroupText(header.getDateYearMatchGroup())));
}
- b.templateDetailsYearSourceLabel.setOnClickListener(
+ b.yearSourceLabel.setOnClickListener(
v -> selectHeaderDetailSource(v, HeaderDetail.DATE_YEAR));
- b.templateDetailsYearSource.setOnClickListener(
+ b.yearSource.setOnClickListener(
v -> selectHeaderDetailSource(v, HeaderDetail.DATE_YEAR));
if (header.hasLiteralDateMonth()) {
- b.templateDetailsMonthSource.setText(R.string.template_details_source_literal);
+ b.monthSource.setText(R.string.template_details_source_literal);
final Integer dateMonth = header.getDateMonth();
b.templateDetailsDateMonth.setText(
(dateMonth == null) ? null : String.valueOf(dateMonth));
- b.templateDetailsDateMonthLayout.setVisibility(View.VISIBLE);
+ b.monthLayout.setVisibility(View.VISIBLE);
}
else {
- b.templateDetailsDateMonthLayout.setVisibility(View.GONE);
- b.templateDetailsMonthSource.setText(
+ b.monthLayout.setVisibility(View.GONE);
+ b.monthSource.setText(
String.format(Locale.US, groupNoText, header.getDateMonthMatchGroup(),
getMatchGroupText(header.getDateMonthMatchGroup())));
}
- b.templateDetailsMonthSourceLabel.setOnClickListener(
+ b.monthSourceLabel.setOnClickListener(
v -> selectHeaderDetailSource(v, HeaderDetail.DATE_MONTH));
- b.templateDetailsMonthSource.setOnClickListener(
+ b.monthSource.setOnClickListener(
v -> selectHeaderDetailSource(v, HeaderDetail.DATE_MONTH));
if (header.hasLiteralDateDay()) {
- b.templateDetailsDaySource.setText(R.string.template_details_source_literal);
+ b.daySource.setText(R.string.template_details_source_literal);
final Integer dateDay = header.getDateDay();
b.templateDetailsDateDay.setText(
(dateDay == null) ? null : String.valueOf(dateDay));
- b.templateDetailsDateDayLayout.setVisibility(View.VISIBLE);
+ b.dayLayout.setVisibility(View.VISIBLE);
}
else {
- b.templateDetailsDateDayLayout.setVisibility(View.GONE);
- b.templateDetailsDaySource.setText(
+ b.dayLayout.setVisibility(View.GONE);
+ b.daySource.setText(
String.format(Locale.US, groupNoText, header.getDateDayMatchGroup(),
getMatchGroupText(header.getDateDayMatchGroup())));
}
- b.templateDetailsDaySourceLabel.setOnClickListener(
+ b.daySourceLabel.setOnClickListener(
v -> selectHeaderDetailSource(v, HeaderDetail.DATE_DAY));
- b.templateDetailsDaySource.setOnClickListener(
+ b.daySource.setOnClickListener(
v -> selectHeaderDetailSource(v, HeaderDetail.DATE_DAY));
if (header.hasLiteralTransactionDescription()) {
android:padding="@dimen/text_margin"
>
<ImageButton
- android:id="@+id/template_details_template_params_help_button"
+ android:id="@+id/template_params_help_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
- android:contentDescription="@string/template_details_template_params_help_description"
+ android:contentDescription="@string/template_params_help_description"
android:minWidth="@dimen/thumb_row_height"
android:src="@drawable/ic_baseline_help_outline_24_primary"
- app:layout_constraintBottom_toBottomOf="@id/template_details_template_params_label"
+ app:layout_constraintBottom_toBottomOf="@id/template_params_label"
app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintTop_toTopOf="@id/template_details_template_params_label"
+ app:layout_constraintTop_toTopOf="@id/template_params_label"
/>
<TextView
- android:id="@+id/template_details_template_params_label"
+ android:id="@+id/template_params_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/text_margin"
android:text="@string/template_details_template_params_label"
android:textAppearance="@android:style/TextAppearance.Material.Medium"
app:layout_constraintBottom_toTopOf="@id/pattern_name_layout"
- app:layout_constraintEnd_toStartOf="@id/template_details_template_params_help_button"
+ app:layout_constraintEnd_toStartOf="@id/template_params_help_button"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>
app:layout_constraintBottom_toTopOf="@id/pattern_layout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/template_details_template_params_label"
+ app:layout_constraintTop_toBottomOf="@id/template_params_label"
>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/template_name"
<TextView
android:id="@+id/pattern_hint_text"
android:layout_width="0dp"
- android:layout_height="match_parent"
+ android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/text_margin"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
app:layout_constraintBottom_toTopOf="@+id/test_text_layout"
android:gravity="end"
android:text="@string/template_transaction_parameters_label"
android:textAppearance="@android:style/TextAppearance.Material.Medium"
- app:layout_constraintBottom_toTopOf="@+id/pattern_transaction_date_label"
+ app:layout_constraintBottom_toTopOf="@+id/transaction_date_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/test_text_layout"
/>
<TextView
- android:id="@+id/pattern_transaction_date_label"
+ android:id="@+id/transaction_date_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/template_details_date_label"
android:textAppearance="?attr/textAppearanceListItem"
- app:layout_constraintBottom_toTopOf="@id/template_details_year_source_label"
+ app:layout_constraintBottom_toTopOf="@id/year_source_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/transaction_parameters_label"
/>
<TextView
- android:id="@+id/template_details_year_source_label"
+ android:id="@+id/year_source_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/template_details_date_year_source_label"
android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.Material.Body1"
- app:layout_constraintBottom_toTopOf="@+id/template_details_year_source"
- app:layout_constraintEnd_toStartOf="@id/template_details_month_source_label"
+ app:layout_constraintBottom_toTopOf="@+id/year_source"
+ app:layout_constraintEnd_toStartOf="@id/month_source_label"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/pattern_transaction_date_label"
+ app:layout_constraintTop_toBottomOf="@id/transaction_date_label"
/>
<TextView
- android:id="@+id/template_details_month_source_label"
+ android:id="@+id/month_source_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:text="@string/template_details_date_month_source_label"
+ android:text="@string/month_source_label"
android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.Material.Body1"
- app:layout_constraintBottom_toTopOf="@+id/template_details_month_source"
- app:layout_constraintEnd_toStartOf="@id/template_details_day_source_label"
- app:layout_constraintStart_toEndOf="@id/template_details_year_source_label"
- app:layout_constraintTop_toBottomOf="@id/pattern_transaction_date_label"
+ app:layout_constraintBottom_toTopOf="@+id/month_source"
+ app:layout_constraintEnd_toStartOf="@id/day_source_label"
+ app:layout_constraintStart_toEndOf="@id/year_source_label"
+ app:layout_constraintTop_toBottomOf="@id/transaction_date_label"
/>
<TextView
- android:id="@+id/template_details_day_source_label"
+ android:id="@+id/day_source_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/template_details_date_day_source_label"
android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.Material.Body1"
- app:layout_constraintBottom_toTopOf="@+id/template_details_day_source"
+ app:layout_constraintBottom_toTopOf="@+id/day_source"
app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toEndOf="@id/template_details_month_source_label"
- app:layout_constraintTop_toBottomOf="@id/pattern_transaction_date_label"
+ app:layout_constraintStart_toEndOf="@id/month_source_label"
+ app:layout_constraintTop_toBottomOf="@id/transaction_date_label"
/>
<TextView
- android:id="@+id/template_details_year_source"
+ android:id="@+id/year_source"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/template_details_source_literal"
android:textAlignment="center"
android:textAppearance="?attr/textAppearanceListItemSecondary"
- app:layout_constraintBottom_toTopOf="@+id/template_details_date_year_layout"
- app:layout_constraintEnd_toStartOf="@id/template_details_month_source"
+ android:layout_marginHorizontal="@dimen/half_text_margin"
+ app:layout_constraintBottom_toTopOf="@+id/year_layout"
+ app:layout_constraintEnd_toStartOf="@id/month_source"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/template_details_day_source_label"
+ app:layout_constraintTop_toBottomOf="@id/day_source_label"
/>
<TextView
- android:id="@+id/template_details_month_source"
+ android:id="@+id/month_source"
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:text=""
+ android:layout_marginHorizontal="@dimen/half_text_margin"
+ android:text="@string/template_details_source_literal"
android:textAlignment="center"
android:textAppearance="?attr/textAppearanceListItemSecondary"
- app:layout_constraintBottom_toTopOf="@+id/template_details_date_month_layout"
- app:layout_constraintEnd_toStartOf="@id/template_details_day_source"
- app:layout_constraintStart_toEndOf="@id/template_details_year_source"
- app:layout_constraintTop_toBottomOf="@id/template_details_month_source_label"
+ app:layout_constraintBottom_toTopOf="@+id/month_layout"
+ app:layout_constraintEnd_toStartOf="@id/day_source"
+ app:layout_constraintStart_toEndOf="@id/year_source"
+ app:layout_constraintTop_toBottomOf="@id/month_source_label"
/>
<TextView
- android:id="@+id/template_details_day_source"
+ android:id="@+id/day_source"
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:text=""
+ android:layout_marginHorizontal="@dimen/half_text_margin"
+ android:text="@string/template_details_source_literal"
android:textAlignment="center"
android:textAppearance="?attr/textAppearanceListItemSecondary"
- app:layout_constraintBottom_toTopOf="@+id/template_details_date_day_layout"
+ app:layout_constraintBottom_toTopOf="@+id/day_layout"
app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toEndOf="@id/template_details_month_source"
- app:layout_constraintTop_toBottomOf="@id/template_details_day_source_label"
+ app:layout_constraintStart_toEndOf="@id/month_source"
+ app:layout_constraintTop_toBottomOf="@id/day_source_label"
/>
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_before_date_inputs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
- app:constraint_referenced_ids="template_details_year_source,template_details_month_source,template_details_day_source"
+ app:constraint_referenced_ids="year_source,month_source,day_source"
/>
<com.google.android.material.textfield.TextInputLayout
- android:id="@+id/template_details_date_year_layout"
+ android:id="@+id/year_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/text_margin"
- app:layout_constraintEnd_toEndOf="@id/template_details_year_source"
+ app:layout_constraintEnd_toStartOf="@+id/month_layout"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/barrier_before_date_inputs"
>
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
- android:id="@+id/template_details_date_month_layout"
+ android:id="@+id/month_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/text_margin"
- app:layout_constraintEnd_toEndOf="@id/template_details_month_source"
- app:layout_constraintStart_toStartOf="@id/template_details_month_source"
+ app:layout_constraintEnd_toStartOf="@+id/day_layout"
+ app:layout_constraintStart_toEndOf="@id/year_layout"
app:layout_constraintTop_toBottomOf="@id/barrier_before_date_inputs"
>
<com.google.android.material.textfield.TextInputEditText
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
- android:id="@+id/template_details_date_day_layout"
+ android:id="@+id/day_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/text_margin"
- app:layout_constraintBottom_toTopOf="@id/barrier_before_description"
app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="@id/template_details_day_source"
+ app:layout_constraintStart_toEndOf="@id/month_layout"
app:layout_constraintTop_toBottomOf="@id/barrier_before_date_inputs"
>
<com.google.android.material.textfield.TextInputEditText
android:layout_height="wrap_content"
android:orientation="horizontal"
app:barrierDirection="bottom"
- app:constraint_referenced_ids="template_details_date_day_layout,template_details_date_month_layout,template_details_date_year_layout"
+ app:constraint_referenced_ids="day_layout,month_layout,year_layout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
/>
android:id="@+id/template_transaction_description_source_label"
android:layout_width="0dp"
android:layout_height="match_parent"
+ android:layout_marginTop="@dimen/text_margin"
android:text="@string/transaction_description_source_label"
android:textAppearance="?attr/textAppearanceListItem"
app:layout_constraintBottom_toTopOf="@+id/template_transaction_description_source"
android:layout_height="wrap_content"
android:minWidth="100dp"
android:textAppearance="?attr/textAppearanceListItemSecondary"
+ android:text="@string/template_details_source_literal"
app:layout_constraintBottom_toTopOf="@+id/transaction_description_layout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_height="wrap_content"
android:minWidth="100dp"
android:textAppearance="?attr/textAppearanceListItemSecondary"
+ android:text="@string/template_details_source_literal"
app:layout_constraintBottom_toTopOf="@+id/transaction_comment_layout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textAppearance="?attr/textAppearanceListItemSecondary"
+ android:text="@string/template_is_fallback_no"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/template_is_fallback_switch"
app:layout_constraintStart_toStartOf="parent"