Nicer access of PassFormat

This commit is contained in:
ligi 2015-11-09 19:34:58 +01:00
parent de2ec23ac2
commit 3efed3e588

View file

@ -91,19 +91,20 @@ public class PassMenuOptions {
}
private void exportInFormat(final int which) {
final int passFormat;
switch (which) {
case 1:
passFormat = PassExporter.FORMAT_PKPASS;
break;
default:
passFormat = PassExporter.FORMAT_OPENPASS;
}
final int passFormat = getPassFormat(which);
new PassExportTask(activity, pass.getPath(), App.getShareDir(), "share", true, passFormat).execute();
}
@PassExporter.PassFormat
private int getPassFormat(int which) {
switch (which) {
case 1:
return PassExporter.FORMAT_PKPASS;
default:
return PassExporter.FORMAT_OPENPASS;
}
}
}