Skip to content

Commit

Permalink
Bind export form date.
Browse files Browse the repository at this point in the history
  • Loading branch information
pnemonic78 committed Jan 2, 2025
1 parent 2d2ed83 commit 4fc6d60
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ public void onNothingSelected(AdapterView<?> parent) {
final long date = timestamp.getTime() - DateUtils.WEEK_IN_MILLIS;
mExportStartCalendar.setTimeInMillis(date);
mBinding.exportStartDate.setText(TransactionFormFragment.DATE_FORMATTER.print(date));
mBinding.exportStartDate.setText(TransactionFormFragment.TIME_FORMATTER.print(date));
mBinding.exportStartTime.setText(TransactionFormFragment.TIME_FORMATTER.print(date));

mBinding.exportStartDate.setOnClickListener(new View.OnClickListener() {

Expand Down Expand Up @@ -484,9 +484,6 @@ public void onClick(View v) {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mBinding.exportStartDate.setEnabled(!isChecked);
mBinding.exportStartTime.setEnabled(!isChecked);
int color = isChecked ? android.R.color.darker_gray : android.R.color.black;
mBinding.exportStartDate.setTextColor(ContextCompat.getColor(getContext(), color));
mBinding.exportStartTime.setTextColor(ContextCompat.getColor(getContext(), color));
}
});

Expand Down
33 changes: 19 additions & 14 deletions app/src/main/res/layout/fragment_export_form.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:fillViewport="true"
tools:context=".ui.common.FormActivity">

<LinearLayout
Expand All @@ -39,7 +40,7 @@
<TextView
style="@style/TextAppearance.EditTransaction_Small"
android:layout_width="wrap_content"
android:layout_height="?android:attr/listPreferredItemHeight"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:gravity="center_vertical"
android:text="@string/label_export_destination" />
Expand All @@ -54,8 +55,9 @@
<TextView
android:id="@+id/target_uri"
style="@style/TextAppearance.Hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="100dp"
android:layout_marginBottom="@dimen/dialog_padding"
android:textColor="@color/title_green"
tools:text="/path/to/export/file" />

Expand All @@ -70,7 +72,7 @@
android:id="@+id/label_export_format"
style="@style/TextAppearance.EditTransaction_Small"
android:layout_width="wrap_content"
android:layout_height="?android:attr/listPreferredItemHeight"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:gravity="center_vertical"
android:text="@string/label_export_format" />
Expand Down Expand Up @@ -111,6 +113,8 @@
<TextView
android:id="@+id/export_warning"
style="@style/TextAppearance.Hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="100dp"
android:textColor="@color/title_green"
tools:text="Some format-based export warning" />
Expand All @@ -128,7 +132,7 @@
android:id="@+id/label_separator_format"
style="@style/TextAppearance.EditTransaction_Small"
android:layout_width="wrap_content"
android:layout_height="?android:attr/listPreferredItemHeight"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:gravity="center_vertical"
android:text="@string/label_csv_separator" />
Expand Down Expand Up @@ -167,9 +171,10 @@
<LinearLayout
android:id="@+id/export_date_layout"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:layout_marginTop="@dimen/dialog_padding"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="@dimen/dialog_padding"
android:gravity="center_vertical"
android:orientation="horizontal">

<TextView
Expand All @@ -183,26 +188,26 @@

<TextView
android:id="@+id/export_start_date"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_weight="2"
android:clickable="true"
android:gravity="center"
android:padding="8dp"
android:textColor="?android:textColorPrimary"
android:textSize="15sp"
tools:text="@tools:sample/date/ddmmyy" />

<TextView
android:id="@+id/export_start_time"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:clickable="true"
android:gravity="center"
android:padding="8dp"
android:textColor="?android:textColorPrimary"
android:textSize="15sp"
tools:text="@tools:sample/date/hhmm" />
tools:text="@tools:sample/date/hhmmss" />

<Switch
android:id="@+id/switch_export_all"
Expand All @@ -220,7 +225,7 @@
android:id="@+id/checkbox_post_export_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginTop="12dp"
android:text="@string/option_delete_after_export"
android:textAppearance="?android:attr/textAppearanceMedium" />

Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@
</style>

<style name="TextAppearance.Hint">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:paddingRight">@dimen/dialog_padding</item>
<item name="android:paddingBottom">@dimen/dialog_padding</item>
<item name="android:layout_marginTop">@dimen/hint_margin</item>
Expand Down

0 comments on commit 4fc6d60

Please sign in to comment.