mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 17:53:14 +00:00
処理修正
This commit is contained in:
parent
20ecbeea5c
commit
232967c905
|
@ -4,6 +4,7 @@ import android.app.Dialog;
|
|||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
@ -13,10 +14,13 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.w3c.dom.Text;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import dagger.hilt.android.AndroidEntryPoint;
|
||||
import one.nem.lacerta.data.LacertaLibrary;
|
||||
import one.nem.lacerta.model.ListItemType;
|
||||
|
||||
@AndroidEntryPoint
|
||||
public class LacertaSelectDirDialog extends DialogFragment {
|
||||
|
@ -28,6 +32,8 @@ public class LacertaSelectDirDialog extends DialogFragment {
|
|||
|
||||
private RecyclerView recyclerView;
|
||||
|
||||
private TextView current_dir_text_view;
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
|
||||
|
@ -38,6 +44,7 @@ public class LacertaSelectDirDialog extends DialogFragment {
|
|||
View view = inflater.inflate(R.layout.lacerta_dialog_select_dir, null);
|
||||
|
||||
this.recyclerView = view.findViewById(R.id.select_dir_recycler_view);
|
||||
this.current_dir_text_view = view.findViewById(R.id.current_dir_text_view);
|
||||
|
||||
this.adapter = new SelectDirDialogItemAdapter((name, itemId) -> {
|
||||
Toast.makeText(getContext(), "Called:" + name, Toast.LENGTH_SHORT).show();
|
||||
|
@ -57,6 +64,15 @@ public class LacertaSelectDirDialog extends DialogFragment {
|
|||
}
|
||||
|
||||
private void showRecyclerViewItem(String parent) {
|
||||
lacertaLibrary.getPublicPath(parent, ListItemType.ITEM_TYPE_FOLDER).thenAccept(publicPath -> {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (publicPath != null) {
|
||||
current_dir_text_view.setText("/" + publicPath.getStringPath()); // TODO-rca: PublicPathの実装を修正する
|
||||
} else {
|
||||
current_dir_text_view.setText("/");
|
||||
}
|
||||
});
|
||||
});
|
||||
lacertaLibrary.getFolderList(parent).thenAccept(listItems -> {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
int currentCount = adapter.getItemCount();
|
||||
|
|
Loading…
Reference in New Issue
Block a user