From dbe41f19e6cf8aa5bec1ec47464adf978a65c907 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Tue, 21 Mar 2017 15:04:31 +0300 Subject: [PATCH] Edit quick action on long tap --- .../osmand/plus/quickaction/QuickActionsWidget.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/quickaction/QuickActionsWidget.java b/OsmAnd/src/net/osmand/plus/quickaction/QuickActionsWidget.java index bd772d0d2c..487fd605e9 100644 --- a/OsmAnd/src/net/osmand/plus/quickaction/QuickActionsWidget.java +++ b/OsmAnd/src/net/osmand/plus/quickaction/QuickActionsWidget.java @@ -10,6 +10,7 @@ import android.support.annotation.StyleRes; import android.support.v4.content.ContextCompat; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; +import android.support.v7.app.AppCompatActivity; import android.support.v7.view.ContextThemeWrapper; import android.support.v7.widget.GridLayout; import android.util.AttributeSet; @@ -242,6 +243,16 @@ public class QuickActionsWidget extends LinearLayout { if (selectionListener != null) selectionListener.onActionSelected(action); } }); + if (action.isActionEditable()) { + view.setOnLongClickListener(new OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + CreateEditActionDialog dialog = CreateEditActionDialog.newInstance(action.id); + dialog.show(((AppCompatActivity) getContext()).getSupportFragmentManager(), AddQuickActionDialog.TAG); + return true; + } + }); + } } if (land) {