1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 12:44:42 +00:00

Prevent initial rule scroll

This commit is contained in:
M66B 2019-01-18 20:35:10 +00:00
parent 3c4abf1701
commit 65058dd02d

View file

@ -147,9 +147,13 @@ public class FragmentRule extends FragmentBase {
spAction.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { spAction.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override @Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) { public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
Integer prev = (Integer) adapterView.getTag();
if (prev != null && !prev.equals(position)) {
Action action = (Action) adapterView.getAdapter().getItem(position); Action action = (Action) adapterView.getAdapter().getItem(position);
onActionSelected(action.type); onActionSelected(action.type);
} }
adapterView.setTag(position);
}
@Override @Override
public void onNothingSelected(AdapterView<?> parent) { public void onNothingSelected(AdapterView<?> parent) {
@ -298,6 +302,7 @@ public class FragmentRule extends FragmentBase {
for (int pos = 0; pos < adapterAction.getCount(); pos++) for (int pos = 0; pos < adapterAction.getCount(); pos++)
if (adapterAction.getItem(pos).type == type) { if (adapterAction.getItem(pos).type == type) {
spAction.setTag(pos);
spAction.setSelection(pos); spAction.setSelection(pos);
break; break;
} }