+
+ private static final String ARG_FILE = "FILE";
+ private static final String ARG_ACCOUNT = "ACCOUNT";
+
+
+ /**
+ * Public factory method to create new FileDetailFragment instances.
+ *
+ * When 'fileToDetail' or 'ocAccount' are null, creates a dummy layout (to use when a file wasn't tapped before).
+ *
+ * @param fileToDetail An {@link OCFile} to show in the fragment
+ * @param account An ownCloud account; needed to start downloads
+ * @return New fragment with arguments set
+ */
+ public static FileDetailFragment newInstance(OCFile fileToDetail, Account account) {
+ FileDetailFragment frag = new FileDetailFragment();
+ Bundle args = new Bundle();
+ args.putParcelable(ARG_FILE, fileToDetail);
+ args.putParcelable(ARG_ACCOUNT, account);
+ frag.setArguments(args);
+ return frag;
+ }