Show folder name in resolve conflict dialog

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2020-11-17 14:55:49 +01:00 committed by Andy Scherzinger
parent e7fccdfe29
commit cc6be5f2f0
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
8 changed files with 30 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -87,6 +87,9 @@ public class ConflictsResolveActivityIT extends AbstractIT {
getInstrumentation().waitForIdleSync();
shortSleep();
shortSleep();
shortSleep();
shortSleep();
screenshot(Objects.requireNonNull(dialog.requireDialog().getWindow()).getDecorView());

View file

@ -176,7 +176,14 @@ public class ConflictsResolveDialog extends DialogFragment {
listener.conflictDecisionMade(Decision.CANCEL);
}
})
.setTitle(R.string.conflict_message_headline);
.setTitle(String.format(getString(R.string.conflict_file_headline), existingFile.getFileName()));
File parentFile = new File(existingFile.getRemotePath()).getParentFile();
if (parentFile != null) {
binding.in.setText(String.format(getString(R.string.in_folder), parentFile.getAbsolutePath()));
} else {
binding.in.setVisibility(View.GONE);
}
// set info for new file
binding.newSize.setText(DisplayUtils.bytesToHumanReadable(newFile.length()));

View file

@ -25,7 +25,22 @@
android:layout_height="match_parent"
android:gravity="clip_horizontal"
android:orientation="vertical"
android:padding="@dimen/standard_padding">
android:paddingStart="26dp"
android:paddingEnd="@dimen/standard_padding"
android:paddingBottom="@dimen/standard_padding">
<TextView
android:id="@+id/in"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/in_folder"
android:paddingBottom="@dimen/standard_padding" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/choose_which_file"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"

View file

@ -898,7 +898,7 @@
<string name="sync_not_enough_space_dialog_action_free_space">Free up space</string>
<string name="sync_not_enough_space_dialog_placeholder">%1$s is %2$s, but there is only %3$s available on device.</string>
<string name="sync_not_enough_space_dialog_title">Not enough space</string>
<string name="conflict_message_headline">Which files do you want to keep?</string>
<string name="conflict_file_headline">Conflicting file %1$s</string>
<string name="conflict_message_description">If you select both versions, the local file will have a number appended to its name.</string>
<string name="conflict_new_file">New file</string>
<string name="conflict_already_existing_file">Already existing file</string>
@ -947,4 +947,6 @@
<string name="drawer_item_gallery">Media</string>
<string name="player_stop">stop</string>
<string name="player_toggle">toggle</string>
<string name="in_folder">in folder %1$s</string>
<string name="choose_which_file">Choose which file to keep!</string>
</resources>