Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error inflating class com.ventura.bracketslib.BracketsView #8

Closed
hassam-ullah opened this issue Sep 23, 2021 · 2 comments
Closed

Error inflating class com.ventura.bracketslib.BracketsView #8

hassam-ullah opened this issue Sep 23, 2021 · 2 comments

Comments

@hassam-ullah
Copy link

hassam-ullah commented Sep 23, 2021

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;
}

}`

@emil-ep
Copy link
Owner

emil-ep commented Jan 9, 2022

@hassam-ullah This is fixed in the version 1.0.4
Please update the version by
implementation 'com.github.emil-ep:TournamentBracketLib:1.0.4'

@hassam-ullah
Copy link
Author

@emil-ep yes it works fine now...thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants