Skip to content

Commit

Permalink
SecondFragment.java javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimin15 committed Apr 27, 2024
1 parent 55188d0 commit 4faf04d
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions app/src/main/java/com/example/proj2/SecondFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,16 @@ public class SecondFragment extends Fragment {
private FragmentSecondBinding binding;
private static final int ITEM_REQUEST = 1;


/**
* Inflates the layout of the fragment and sets up the ViewModel to fetch and display champion data.
*
* @param inflater The LayoutInflater object that can be used to inflate
* any views in the fragment,
* @param container If non-null, this is the parent view that the fragment's UI should be attached to.
* @param savedInstanceState If non-null, this fragment is being re-constructed from a previous saved state
* as given here.
* @return The root view of the inflated layout.
*/
@Override
public View onCreateView(
@NonNull LayoutInflater inflater, ViewGroup container,
Expand Down Expand Up @@ -109,7 +118,13 @@ public View onCreateView(
return binding.getRoot();
}


/**
* Sets up the UI elements and listeners after the view has been created.
*
* @param view The root view of the fragment's layout.
* @param savedInstanceState If non-null, this fragment is being re-constructed from a previous saved state
* as given here.
*/
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
//ViewModels
Expand Down Expand Up @@ -231,6 +246,12 @@ public void onClick(View v) {
}
});
}

/**
* Updates the selected item's image displayed on the UI.
*
* @param view The root view of the fragment's layout.
*/
public void updateItem(View view){
Button button15 = view.findViewById(R.id.button15);
ImageButton item1button = view.findViewById(R.id.item1);
Expand All @@ -256,6 +277,9 @@ public void updateItem(View view){
});
}

/**
* Cleans up any resources when the fragment's view is destroyed.
*/
@Override
public void onDestroyView() {
super.onDestroyView();
Expand Down

0 comments on commit 4faf04d

Please sign in to comment.