データの挿入を通知するように

This commit is contained in:
ろむねこ 2024-06-11 16:16:20 +09:00
parent 539cd4487d
commit 42978a4746
Signed by: Fujimatsu
GPG Key ID: FA1F39A1BA37D168

View File

@ -25,6 +25,7 @@ import one.nem.kidshift.feature.debug.model.DebugCommandItemModel;
public class DebugDebugConsoleFragment extends Fragment { public class DebugDebugConsoleFragment extends Fragment {
private final List<DebugCommandItemModel> debugCommandItemModels = new ArrayList<>(); private final List<DebugCommandItemModel> debugCommandItemModels = new ArrayList<>();
DebugCommandListItemAdapter debugCommandItemAdapter;
// TODO: Rename parameter arguments, choose names that match // TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
@ -76,7 +77,7 @@ public class DebugDebugConsoleFragment extends Fragment {
debugCommandItemModels.add(new DebugCommandItemModel("---", "Initialized Debug Console")); debugCommandItemModels.add(new DebugCommandItemModel("---", "Initialized Debug Console"));
DebugCommandListItemAdapter debugCommandItemAdapter = new DebugCommandListItemAdapter(debugCommandItemModels); debugCommandItemAdapter = new DebugCommandListItemAdapter(debugCommandItemModels);
recyclerView.setAdapter(debugCommandItemAdapter); recyclerView.setAdapter(debugCommandItemAdapter);
return view; return view;
@ -95,6 +96,8 @@ public class DebugDebugConsoleFragment extends Fragment {
debugCommandProcessor.execute(debugCommandInput.getText().toString()))); debugCommandProcessor.execute(debugCommandInput.getText().toString())));
debugCommandInput.setText(""); // Clear the input field debugCommandInput.setText(""); // Clear the input field
debugCommandItemAdapter.notifyItemInserted(debugCommandItemModels.size() - 1);
}); });
} }
} }