Q:

Connect 4 right to left diagonal check

There's probably a very simple solution to this but I can't figure out where I'm doing something wrong. I'm making a small game with android studio that is connect 4. There is a 5x7 matrix of single cells, and 5 imageviews above that when clicked on put a fiche in the right place. Up to this point it's all working fine. When I however have to check if someone won, I thought I could break up the process in 4 main functions: one that check horizontally, one vertically, one diagonally left to right and one diagonally right to left. Now they all work perfectly except the right to left one. I'll post the code below:
private void checkRightLeftDiagonally() {
    int winCondition = 0;
    boolean goingRight = true;
    int y = 1;
    int i = 4;
    int j = 0;
    while (y < 6 && won == false) {
        while (i > 0 && j < 7 && won == false) {
            if (cells[j][i].getFull() == true && players[playerTurn].getFicheColor() == cells[j][i].getFicheColor()) {
                winCondition++;
                winningCells.add(cells[j][i]);
            } else {
                winCondition = 0;
                winningCells.clear();
            }

            if (winCondition == 4) {
                won = true;
                for (int x = 0; x < 4; x++) {
                    winningCells.get(x).won();
                }
            }
            i--;
            j++;
        }

        if(goingRight == true)
        {
            if(y<=4)
            {
                i=4-y;
                j=0;
                y++;
            }
            else
            {
                goingRight = false;
                y=0;
                i=0;
                j=0+y;
            }
        }

        if(goingRight == false)
        {
            i=0;
            j=0+y;
            y++;
        }

        if(won == false)
        {
            winCondition = 0;
            winningCells.clear();
        }

    }
    if(won == false) {
        winCondition = 0;
        winningCells.clear();
    }

    }

And here is one of the arrow imageview code:
imgArrows[0].setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if(cells[0][0].getFull() == false && won == false)
            {
                int i = 0;
                while(cells[i][0].getFull() == false)
                {
                    i++;
        if(i>6) break;
                }

        i--;

                cells[i][0].ficheDown(players[playerTurn]);

                checkVertically();
                checkHorizantally();
                checkLeftRightDiagonally();
                checkRightLeftDiagonally();

                playerTurn++;
                if(playerTurn==2)
                {
                    playerTurn = 0;
                }

            }
        }
    });

I've also made the cell class, which is here if it could help you
public class Cell {
private boolean full;
private Player.FicheColor ficheColor;
private ImageView fiche;

public Cell(Player currentPlayer, ImageView img)
{
    full = false;
    ficheColor = currentPlayer.getFicheColor();
    fiche = img;
    img.setAlpha(0f);
}

public void ficheDown(Player currentPlayer)
{
    full = true;
    ficheColor = currentPlayer.getFicheColor();
    switch(ficheColor)
    {
        case red:
            fiche.setImageResource(R.drawable.redfiche);
            break;

        case blue:
            fiche.setImageResource(R.drawable.bluefiche);
            break;

        case green:
            fiche.setImageResource(R.drawable.greenfiche);
            break;

        case white:
            fiche.setImageResource(R.drawable.whitefiche);
            break;

        case black:
            fiche.setImageResource(R.drawable.whitefiche);
            break;
    }
    fiche.setAlpha(1f);

}

public Player.FicheColor getFicheColor()
{
    return ficheColor;
}

public boolean getFull()
{
    return full;
}

public void won(){
    fiche.setColorFilter(Color.GREEN);
}

public void reset()
{
    fiche.clearColorFilter();
}

}
Thank a lot, even just for reading

A:

In the end the problem was that in the first paragraph of code the int i needed to be set to 4 and that solved it. Thanks to everyone that tried to help me

