mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 09:43:15 +00:00
正常にタイトルが表示されるように
This commit is contained in:
parent
9865790a98
commit
9f50696b39
|
@ -63,7 +63,7 @@ public class ComponentViewerTopFragment extends Fragment {
|
|||
super.onCreate(savedInstanceState);
|
||||
if (getArguments() != null) {
|
||||
documentId = getArguments().getString("documentId");
|
||||
String documentName = getArguments().getString("documentName");
|
||||
documentName = getArguments().getString("documentName");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package one.nem.lacerta.feature.home;
|
||||
|
||||
public interface DocumentSelectListener {
|
||||
void onDocumentSelect(String documentId);
|
||||
void onDocumentSelect(String documentId, String documentName);
|
||||
}
|
||||
|
|
|
@ -85,11 +85,15 @@ public class HomeTopFragment extends Fragment {
|
|||
Toolbar toolbar = view.findViewById(R.id.home_toolbar);
|
||||
toolbarSetup(toolbar, false, "ホーム");
|
||||
|
||||
ListItemAdapter listItemAdapter = new ListItemAdapter(documentId -> {
|
||||
Log.d("HomeTopFragment", "onViewCreated: " + documentId);
|
||||
ListItemAdapter listItemAdapter = new ListItemAdapter(new DocumentSelectListener() {
|
||||
@Override
|
||||
public void onDocumentSelect(String documentId, String documentName) {
|
||||
Intent intent = new Intent(getContext(), ViewerMainActivity.class);
|
||||
Log.d("HomeTopFragment", "onDocumentSelect: " + documentId + " " + documentName);
|
||||
intent.putExtra("documentId", documentId);
|
||||
intent.putExtra("documentName", documentName);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
recyclerView.setAdapter(listItemAdapter);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
|
|
@ -46,9 +46,7 @@ public class ListItemAdapter extends RecyclerView.Adapter<ListItemAdapter.ListIt
|
|||
holder.description.setText(listItem.getDescription());
|
||||
|
||||
holder.itemView.setOnClickListener( v -> {
|
||||
Intent intent = new Intent(v.getContext(), ViewerMainActivity.class);
|
||||
intent.putExtra("documentId", listItem.getItemId());
|
||||
v.getContext().startActivity(intent);
|
||||
listener.onDocumentSelect(listItem.getItemId(), listItem.getTitle());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user