diff --git a/app/src/main/java/eu/faircode/email/FragmentRule.java b/app/src/main/java/eu/faircode/email/FragmentRule.java
index 9bd97e7764..ad9a884fd2 100644
--- a/app/src/main/java/eu/faircode/email/FragmentRule.java
+++ b/app/src/main/java/eu/faircode/email/FragmentRule.java
@@ -533,15 +533,6 @@ public class FragmentRule extends FragmentBase {
adapterAction.setDropDownViewResource(R.layout.spinner_item1_dropdown);
spAction.setAdapter(adapterAction);
- spAction.setFocusableInTouchMode(true);
- spAction.setOnFocusChangeListener(new View.OnFocusChangeListener() {
- @Override
- public void onFocusChange(View v, boolean hasFocus) {
- if (hasFocus && spAction.getWindowToken() != null)
- spAction.performClick();
- }
- });
-
btnFolder.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
diff --git a/app/src/main/java/eu/faircode/email/SpinnerEx.java b/app/src/main/java/eu/faircode/email/SpinnerEx.java
new file mode 100644
index 0000000000..c240935cf4
--- /dev/null
+++ b/app/src/main/java/eu/faircode/email/SpinnerEx.java
@@ -0,0 +1,76 @@
+package eu.faircode.email;
+
+/*
+ This file is part of FairEmail.
+
+ FairEmail is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ FairEmail is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with FairEmail. If not, see .
+
+ Copyright 2018-2024 by Marcel Bokhorst (M66B)
+*/
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Rect;
+import android.util.AttributeSet;
+import android.widget.Spinner;
+
+import androidx.annotation.Nullable;
+
+public class SpinnerEx extends Spinner {
+ public SpinnerEx(Context context) {
+ super(context);
+ init(context);
+ }
+
+ public SpinnerEx(Context context, int mode) {
+ super(context, mode);
+ init(context);
+ }
+
+ public SpinnerEx(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ init(context);
+ }
+
+ public SpinnerEx(Context context, AttributeSet attrs, int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ init(context);
+ }
+
+ public SpinnerEx(Context context, AttributeSet attrs, int defStyleAttr, int mode) {
+ super(context, attrs, defStyleAttr, mode);
+ init(context);
+ }
+
+ public SpinnerEx(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes, int mode) {
+ super(context, attrs, defStyleAttr, defStyleRes, mode);
+ init(context);
+ }
+
+ public SpinnerEx(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes, int mode, Resources.Theme popupTheme) {
+ super(context, attrs, defStyleAttr, defStyleRes, mode, popupTheme);
+ init(context);
+ }
+
+ private void init(Context context) {
+ this.setFocusableInTouchMode(true);
+ }
+
+ @Override
+ protected void onFocusChanged(boolean gainFocus, int direction, @Nullable Rect previouslyFocusedRect) {
+ super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
+ if (gainFocus && getWindowToken() != null)
+ performClick();
+ }
+}
diff --git a/app/src/main/res/layout/activity_widget.xml b/app/src/main/res/layout/activity_widget.xml
index 5f846febe0..95b3da81ed 100644
--- a/app/src/main/res/layout/activity_widget.xml
+++ b/app/src/main/res/layout/activity_widget.xml
@@ -22,7 +22,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-