mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Localize swipe target
This commit is contained in:
parent
b8e0f65f0d
commit
1f07643918
1 changed files with 21 additions and 1 deletions
|
@ -490,7 +490,27 @@ public class FragmentAccount extends FragmentBase {
|
|||
spTrash.setAdapter(adapter);
|
||||
spJunk.setAdapter(adapter);
|
||||
|
||||
adapterSwipe = new ArrayAdapter<>(getContext(), R.layout.spinner_item1, android.R.id.text1, new ArrayList<EntityFolder>());
|
||||
adapterSwipe = new ArrayAdapter<EntityFolder>(getContext(), R.layout.spinner_item1, android.R.id.text1, new ArrayList<EntityFolder>()) {
|
||||
@NonNull
|
||||
@Override
|
||||
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
|
||||
return localize(position, super.getView(position, convertView, parent));
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getDropDownView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
|
||||
return localize(position, super.getDropDownView(position, convertView, parent));
|
||||
}
|
||||
|
||||
private View localize(int position, View view) {
|
||||
EntityFolder folder = getItem(position);
|
||||
if (folder != null) {
|
||||
TextView tv = view.findViewById(android.R.id.text1);
|
||||
tv.setText(EntityFolder.localizeName(view.getContext(), folder.name));
|
||||
}
|
||||
return view;
|
||||
}
|
||||
};
|
||||
adapterSwipe.setDropDownViewResource(R.layout.spinner_item1_dropdown);
|
||||
|
||||
spLeft.setAdapter(adapterSwipe);
|
||||
|
|
Loading…
Reference in a new issue