Copy place name on long click (#3609)

* Copy place name on long click

* Remove hard coded string
This commit is contained in:
Anmol Gupta 2020-04-14 15:24:49 +05:30 committed by GitHub
parent e859c71905
commit a0f8790d8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -578,9 +578,13 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
*
*/
private void addActionToTitle() {
title.setOnLongClickListener(view -> {
Utils.copy("place", title.getText().toString(), getContext());
Toast.makeText(getContext(), R.string.text_copy, Toast.LENGTH_SHORT).show();
return true;
});
title.setOnClickListener(view -> {
Utils.copy("place", title.getText().toString(), getContext());
Toast.makeText(getContext(), "Text copied to clipboard", Toast.LENGTH_SHORT).show();
bottomSheetListBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
if (bottomSheetDetailsBehavior.getState() == BottomSheetBehavior.STATE_COLLAPSED) {
bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);