diff --git a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryXFragment.java b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryXFragment.java index 2205efa9..ebdc0a3e 100644 --- a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryXFragment.java +++ b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryXFragment.java @@ -1,11 +1,26 @@ package one.nem.lacerta.feature.library; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + import androidx.fragment.app.Fragment; public class LibraryXFragment extends Fragment { - // フラグメントが作成された際に呼ばれるメソッド + private TextView textView; // フィールドとして TextView を定義 + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + View view = inflater.inflate(R.layout.fragment_library_file, container, false); + + textView = view.findViewById(R.id.textView); + + return view; + } + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -14,7 +29,10 @@ public class LibraryXFragment extends Fragment { if (getArguments() != null) { String receivedData = getArguments().getString("key_name"); - // ここで receivedData を使って何か処理を行う + // onCreateView メソッドで取得した TextView にデータをセットする + if (textView != null) { + textView.setText(receivedData); + } } } diff --git a/feature/library/src/main/res/layout/fragment_library_file.xml b/feature/library/src/main/res/layout/fragment_library_file.xml new file mode 100644 index 00000000..973a133e --- /dev/null +++ b/feature/library/src/main/res/layout/fragment_library_file.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file