You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I followed the template code provided in the readme file and added the xml in a fragment. Apparently the code works just fine when I run it in an activity but when I run it in a fragment the view com.ventura.bracketslib.BracketsView does not inflate. @Emil333
`public class FragmentTournamentTree extends Fragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view= inflater.inflate(R.layout.fragment_tournament_tree, container, false);
BracketsView bracketsView = view.findViewById(R.id.bracket_view);
CompetitorData player1 = new CompetitorData("Player 1", "3");
CompetitorData player2 = new CompetitorData("Player 2", "1");
CompetitorData player3 = new CompetitorData("Player 3", "3");
CompetitorData player4 = new CompetitorData("Player 4", "2");
CompetitorData player5 = new CompetitorData("Player 5", "4");
CompetitorData player6 = new CompetitorData("Player 6", "2");
CompetitorData player7 = new CompetitorData("Player 7", "2");
CompetitorData player8 = new CompetitorData("Player 8", "2");
CompetitorData player9 = new CompetitorData("Player 9", "2");
CompetitorData player10= new CompetitorData("Player 10", "2");
MatchData matchQuarterFinal1 = new MatchData(player1,player2);
MatchData matchQuarterFinal2 = new MatchData(player3,player4);
MatchData matchQuarterFinal3 = new MatchData(player5,player6);
MatchData matchQuarterFinal4 = new MatchData(player7,player8);
MatchData match1SemiFinal = new MatchData(player2,player4);
MatchData match2SemiFinal = new MatchData(player5,player7);
MatchData match3Final = new MatchData(player2,player7);
ColomnData quarterFinalColomn = new ColomnData(Arrays.asList(matchQuarterFinal1,matchQuarterFinal2,matchQuarterFinal3,matchQuarterFinal4));
ColomnData semiFinalColomn = new ColomnData(Arrays.asList(match1SemiFinal, match2SemiFinal));
ColomnData finalColomn = new ColomnData(Arrays.asList(match3Final));
bracketsView.setBracketsData(Arrays.asList(quarterFinalColomn,semiFinalColomn, finalColomn));
return view;
}
}`
The text was updated successfully, but these errors were encountered:
I followed the template code provided in the readme file and added the xml in a fragment. Apparently the code works just fine when I run it in an activity but when I run it in a fragment the view com.ventura.bracketslib.BracketsView does not inflate.
@Emil333
`public class FragmentTournamentTree extends Fragment {
}`
The text was updated successfully, but these errors were encountered: