fix incorrect error display and file name change;

This commit is contained in:
Skalii 2021-02-19 05:35:29 +02:00
parent 8cc7ca3a39
commit c445e45b60

View file

@ -129,6 +129,8 @@ public class SaveAsNewTrackBottomSheetDialogFragment extends MenuBottomSheetDial
.create(); .create();
this.items.add(editFileName); this.items.add(editFileName);
updateFileNameFromEditText(fileName);
int contentPaddingSmall = app.getResources().getDimensionPixelSize(R.dimen.content_padding_small); int contentPaddingSmall = app.getResources().getDimensionPixelSize(R.dimen.content_padding_small);
int contentPaddingHalf = app.getResources().getDimensionPixelSize(R.dimen.content_padding_half); int contentPaddingHalf = app.getResources().getDimensionPixelSize(R.dimen.content_padding_half);
@ -360,9 +362,9 @@ public class SaveAsNewTrackBottomSheetDialogFragment extends MenuBottomSheetDial
} else { } else {
nameTextBox.setError(null); nameTextBox.setError(null);
nameTextBox.setErrorEnabled(false); nameTextBox.setErrorEnabled(false);
fileName = text;
rightButtonEnabled = true; rightButtonEnabled = true;
} }
fileName = text;
updateBottomButtons(); updateBottomButtons();
} }
@ -404,6 +406,7 @@ public class SaveAsNewTrackBottomSheetDialogFragment extends MenuBottomSheetDial
if (position != -1) { if (position != -1) {
recyclerView.scrollToPosition(position); recyclerView.scrollToPosition(position);
} }
updateFileNameFromEditText(Algorithms.getFileNameWithoutExtension(dest.getName()));
} }
} }