mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-22 16:03:15 +00:00
WIP
This commit is contained in:
parent
5639117e0e
commit
615d58f3ca
|
@ -98,7 +98,7 @@ public class ViewerListFragment extends Fragment {
|
|||
});
|
||||
recyclerView.setAdapter(viewerBodyAdapter);
|
||||
|
||||
if (revisionId.isEmpty()) {
|
||||
if (revisionId == null) {
|
||||
logger.debug(TAG, "revisionId is empty, loading latest revision");
|
||||
if (FeatureSwitch.Viewer.showProgressBarWhenLoading) view.findViewById(R.id.loading_progress_bar).setVisibility(View.VISIBLE);
|
||||
document.getDocument(documentId).thenAccept(documentDetail -> {
|
||||
|
@ -154,7 +154,7 @@ public class ViewerListFragment extends Fragment {
|
|||
if (item.getItemId() == R.id.action_open_vcs_rev_list) {
|
||||
// Open vcs rev list
|
||||
getParentFragmentManager().beginTransaction()
|
||||
.replace(R.id.nav_host_fragment, ViewerVcsRevListFragment.newInstance(documentId))
|
||||
.replace(R.id.nav_host_fragment, ViewerVcsRevListFragment.newInstance(documentId, documentName))
|
||||
.commit();
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.action_rename) {
|
||||
|
|
|
@ -34,15 +34,17 @@ public class ViewerVcsRevListFragment extends Fragment {
|
|||
LacertaVcs lacertaVcs;
|
||||
|
||||
private String documentId;
|
||||
private String documentName;
|
||||
|
||||
public ViewerVcsRevListFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static ViewerVcsRevListFragment newInstance(String documentId) {
|
||||
public static ViewerVcsRevListFragment newInstance(String documentId, String documentName) {
|
||||
ViewerVcsRevListFragment fragment = new ViewerVcsRevListFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putString("documentId", documentId);
|
||||
args.putString("documentName", documentName);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
@ -66,17 +68,22 @@ public class ViewerVcsRevListFragment extends Fragment {
|
|||
// Init arg
|
||||
if (getArguments() != null) {
|
||||
this.documentId = getArguments().getString("documentId");
|
||||
logger.debug("ViewerVcsRevListFragment", "documentId: " + documentId);
|
||||
logger.debug("ViewerVcsRevListFragment", "documentId: " + this.documentId);
|
||||
}
|
||||
|
||||
// Init vcs
|
||||
lacertaVcs = lacertaVcsFactory.create(documentId);
|
||||
lacertaVcs = lacertaVcsFactory.create(this.documentId);
|
||||
|
||||
// Init view
|
||||
RecyclerView recyclerView = view.findViewById(R.id.rev_list);
|
||||
|
||||
// Init adapter
|
||||
RevAdapter revAdapter = new RevAdapter();
|
||||
RevAdapter revAdapter = new RevAdapter(revisionId -> {
|
||||
logger.debug("ViewerVcsRevListFragment", "Selected revisionId: " + revisionId);
|
||||
getParentFragmentManager().beginTransaction()
|
||||
.replace(R.id.nav_host_fragment, ViewerListFragment.newInstance(this.documentId, this.documentName, revisionId))
|
||||
.commit();
|
||||
});
|
||||
|
||||
// Set adapter
|
||||
recyclerView.setAdapter(revAdapter);
|
||||
|
|
Loading…
Reference in New Issue
Block a user