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