This commit is contained in:
r-ca 2024-01-29 05:05:13 +09:00
parent 65b87ef346
commit e1c79e44ae
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
3 changed files with 16 additions and 3 deletions

View File

@ -41,7 +41,7 @@ public class LacertaFilePickerSelectDocumentAdapter extends RecyclerView.Adapter
@NonNull @NonNull
@Override @Override
public LacertaFilePickerSelectDocumentAdapter.LacertaFilePickerSelectDocumentViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public LacertaFilePickerSelectDocumentAdapter.LacertaFilePickerSelectDocumentViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(one.nem.lacerta.shared.ui.R.layout.common_list_item, null); View view = LayoutInflater.from(parent.getContext()).inflate(one.nem.lacerta.shared.ui.R.layout.common_list_item, parent, false);
return new LacertaFilePickerSelectDocumentViewHolder(view); return new LacertaFilePickerSelectDocumentViewHolder(view);
} }
@ -49,7 +49,6 @@ public class LacertaFilePickerSelectDocumentAdapter extends RecyclerView.Adapter
public void onBindViewHolder(@NonNull LacertaFilePickerSelectDocumentAdapter.LacertaFilePickerSelectDocumentViewHolder holder, int position) { public void onBindViewHolder(@NonNull LacertaFilePickerSelectDocumentAdapter.LacertaFilePickerSelectDocumentViewHolder holder, int position) {
ListItem listItem = listItems.get(position); ListItem listItem = listItems.get(position);
holder.title.setText(listItem.getTitle()); holder.title.setText(listItem.getTitle());
holder.description.setVisibility(View.GONE);
holder.icon.setImageResource(listItem.getItemType().getIconId()); holder.icon.setImageResource(listItem.getItemType().getIconId());
holder.itemView.setOnClickListener(v -> listener.onDocumentSelected(listItem.getItemId())); holder.itemView.setOnClickListener(v -> listener.onDocumentSelected(listItem.getItemId()));
} }

View File

@ -68,6 +68,9 @@ public class LacertaFilePickerSelectDocumentDialog extends DialogFragment {
recyclerView.setAdapter(adapter); recyclerView.setAdapter(adapter);
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
builder.setTitle("Test");
builder.setView(view);
lacertaLibrary.getCombinedDocumentToxiList(this.documentId).thenAccept(toxiDocumentModels -> { lacertaLibrary.getCombinedDocumentToxiList(this.documentId).thenAccept(toxiDocumentModels -> {
ArrayList<ListItem> listItems = new ArrayList<>(); ArrayList<ListItem> listItems = new ArrayList<>();
@ -78,7 +81,6 @@ public class LacertaFilePickerSelectDocumentDialog extends DialogFragment {
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
}); });
builder.setView(view);
return builder.create(); return builder.create();
} }

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/document_list_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
</FrameLayout>