Refactoring

This commit is contained in:
M66B
2019-01-21 18:54:33 +00:00
parent 05a03e11ea
commit f0b465f12b
2 changed files with 14 additions and 14 deletions

View File

@@ -597,7 +597,7 @@ public class FragmentMessages extends FragmentBase {
if (dX > margin) {
// Right swipe
Drawable d = getResources().getDrawable(getIcon(swipes.right_type), getContext().getTheme());
Drawable d = getResources().getDrawable(EntityFolder.getIcon(swipes.right_type), getContext().getTheme());
int padding = (rect.height() - size);
d.setBounds(
rect.left + margin,
@@ -607,7 +607,7 @@ public class FragmentMessages extends FragmentBase {
d.draw(canvas);
} else if (dX < -margin) {
// Left swipe
Drawable d = getResources().getDrawable(getIcon(swipes.left_type), getContext().getTheme());
Drawable d = getResources().getDrawable(EntityFolder.getIcon(swipes.left_type), getContext().getTheme());
int padding = (rect.height() - size);
d.setBounds(
rect.left + rect.width() - size - margin,
@@ -701,18 +701,6 @@ public class FragmentMessages extends FragmentBase {
return message;
}
int getIcon(String type) {
if (EntityFolder.INBOX.equals(type))
return R.drawable.baseline_move_to_inbox_24;
if (EntityFolder.ARCHIVE.equals(type))
return R.drawable.baseline_archive_24;
if (EntityFolder.TRASH.equals(type))
return R.drawable.baseline_delete_24;
if (EntityFolder.JUNK.equals(type))
return R.drawable.baseline_flag_24;
return R.drawable.baseline_folder_24;
}
};
private void onActionMove(String folderType) {