diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectDirDialog.java b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectDirDialog.java index d89ba473..58d02f06 100644 --- a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectDirDialog.java +++ b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectDirDialog.java @@ -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();