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,18 +91,19 @@ public class PassMenuOptions {
}
private void exportInFormat(final int which) {
final int passFormat;
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:
passFormat = PassExporter.FORMAT_PKPASS;
break;
return PassExporter.FORMAT_PKPASS;
default:
passFormat = PassExporter.FORMAT_OPENPASS;
return PassExporter.FORMAT_OPENPASS;
}
new PassExportTask(activity, pass.getPath(), App.getShareDir(), "share", true, passFormat).execute();
}