From 232967c9055be11394cfedb5774a7fa21c2f6edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 14:12:10 +0900 Subject: [PATCH] =?UTF-8?q?=E5=87=A6=E7=90=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/common/LacertaSelectDirDialog.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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();