Skip to content

Commit a0f8790

Browse files
authored
Copy place name on long click (#3609)
* Copy place name on long click * Remove hard coded string
1 parent e859c71 commit a0f8790

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,9 +578,13 @@ private void decideButtonVisibilities() {
578578
*
579579
*/
580580
private void addActionToTitle() {
581+
title.setOnLongClickListener(view -> {
582+
Utils.copy("place", title.getText().toString(), getContext());
583+
Toast.makeText(getContext(), R.string.text_copy, Toast.LENGTH_SHORT).show();
584+
return true;
585+
});
586+
581587
title.setOnClickListener(view -> {
582-
Utils.copy("place", title.getText().toString(), getContext());
583-
Toast.makeText(getContext(), "Text copied to clipboard", Toast.LENGTH_SHORT).show();
584588
bottomSheetListBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
585589
if (bottomSheetDetailsBehavior.getState() == BottomSheetBehavior.STATE_COLLAPSED) {
586590
bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);

0 commit comments

Comments
 (0)