ソースを参照

fix long click in ChooseAccountDialogFragment

otherwise the list in the ConversationListActivity would handle it which results in unexpected user actions dialog popup

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Marcel Hibbe 2 年 前
コミット
e69a03a7ce

+ 6 - 0
app/src/main/java/com/nextcloud/talk/ui/dialog/ChooseAccountDialogFragment.java

@@ -176,6 +176,7 @@ public class ChooseAccountDialogFragment extends DialogFragment {
             }
 
             adapter.addListener(onSwitchItemClickListener);
+            adapter.addListener(onSwitchItemLongClickListener);
             adapter.updateDataSet(userItems, false);
         }
     }
@@ -320,6 +321,11 @@ public class ChooseAccountDialogFragment extends DialogFragment {
             }
         };
 
+        private final FlexibleAdapter.OnItemLongClickListener onSwitchItemLongClickListener =
+            position -> {
+                // do nothing. OnItemLongClickListener is necessary anyway so the activity won't handle the event
+            };
+
     private void drawStatus() {
         float size = DisplayUtils.convertDpToPixel(STATUS_SIZE_IN_DP, getContext());
         binding.currentAccount.ticker.setBackground(null);