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