Skip to content

Commit

Permalink
item selection update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimin15 committed Apr 27, 2024
1 parent 587a12d commit 129819f
Showing 1 changed file with 65 additions and 4 deletions.
69 changes: 65 additions & 4 deletions app/src/main/java/com/example/proj2/SecondFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
Button button15 = view.findViewById(R.id.button15);
ImageButton item1button = view.findViewById(R.id.item1);
ImageButton item2button = view.findViewById(R.id.item2);
ImageButton item3 = view.findViewById(R.id.item3);
ImageButton item4 = view.findViewById(R.id.item4);
ImageButton item5 = view.findViewById(R.id.item5);
ImageButton item6 = view.findViewById(R.id.item6);
ImageButton item3button = view.findViewById(R.id.item3);
ImageButton item4button = view.findViewById(R.id.item4);
ImageButton item5button = view.findViewById(R.id.item5);
ImageButton item6button = view.findViewById(R.id.item6);

//Get data from viewmodels
((ChampionViewModel) viewModel).getChampion().observe(getViewLifecycleOwner(), champion -> {
Expand Down Expand Up @@ -169,6 +169,67 @@ public void onClick(View v) {

}
});


item1button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Perform the action to navigate to the item_selection page
NavHostFragment.findNavController(SecondFragment.this)
.navigate(R.id.action_SecondFragment_to_ItemSelectionFragment);

}
});

item2button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Perform the action to navigate to the item_selection page
NavHostFragment.findNavController(SecondFragment.this)
.navigate(R.id.action_SecondFragment_to_ItemSelectionFragment);

}
});

item3button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Perform the action to navigate to the item_selection page
NavHostFragment.findNavController(SecondFragment.this)
.navigate(R.id.action_SecondFragment_to_ItemSelectionFragment);

}
});

item4button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Perform the action to navigate to the item_selection page
NavHostFragment.findNavController(SecondFragment.this)
.navigate(R.id.action_SecondFragment_to_ItemSelectionFragment);

}
});

item5button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Perform the action to navigate to the item_selection page
NavHostFragment.findNavController(SecondFragment.this)
.navigate(R.id.action_SecondFragment_to_ItemSelectionFragment);

}
});

item6button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Perform the action to navigate to the item_selection page
NavHostFragment.findNavController(SecondFragment.this)
.navigate(R.id.action_SecondFragment_to_ItemSelectionFragment);

}
});
}
public void updateItem(View view){
Button button15 = view.findViewById(R.id.button15);
Expand Down

0 comments on commit 129819f

Please sign in to comment.