Factoryメソッド実装

This commit is contained in:
r-ca 2024-01-28 12:39:10 +09:00
parent e6cdba337e
commit 2812b02ba2
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -36,13 +36,30 @@ public class ViewerBodyFragment extends Fragment {
@Inject @Inject
LacertaVcsFactory lacertaVcsFactory; LacertaVcsFactory lacertaVcsFactory;
// Variables
private String documentId;
private String documentName;
private String revisionId;
public ViewerBodyFragment() { public ViewerBodyFragment() {
// Required empty public constructor // Required empty public constructor
} }
public static ViewerBodyFragment newInstance() { public static ViewerBodyFragment newInstance(String documentId, String documentName) {
ViewerBodyFragment fragment = new ViewerBodyFragment(); ViewerBodyFragment fragment = new ViewerBodyFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putString("documentId", documentId);
args.putString("documentName", documentName);
fragment.setArguments(args);
return fragment;
}
public static ViewerBodyFragment newInstance(String documentId, String documentName, String revisionId) {
ViewerBodyFragment fragment = new ViewerBodyFragment();
Bundle args = new Bundle();
args.putString("documentId", documentId);
args.putString("documentName", documentName);
args.putString("revisionId", revisionId);
fragment.setArguments(args); fragment.setArguments(args);
return fragment; return fragment;
} }