PowerApps currently doesn't have a way to know the index of the item in a gallery, which is what you would need to be able to implement your logic (something like "Patch the item for the next index"). Feel free to create a new feature request in the PowerApps Ideas board for this scenario.
One possible workaround is to, instead of working with your collection directly in the gallery, to create a new collection that contains the indices itself. For example, if your collection is created as
ClearCollect(
Horarios;
{ HoraInicio: Time(0; 0; 0); HoraTermino: Time(3; 0; 0); Description: "First" };
{ HoraInicio: Time(3; 0; 0); HoraTermino: Time(5; 0; 0); Description: "Second" })
Then you can create a new collection (HorariosWithIndices) using this technique:
ClearCollect(
HorariosWithIndices;
AddColumns(
RenameColumns(
FirstN([1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20]; CountRows(Horarios));
"Value"; "Index");
"HoraInicio"; Last(FirstN(Horarios; Index)).HoraInicio;
"HoraTermino"; Last(FirstN(Horarios; Index)).HoraTermino;
"Description"; Last(FirstN(Horarios; Index)).Description))
What you have now is a new collection with the same columns as the previous one, plus a new one, called "Index". Now you can use that collection as the Items property of the gallery.
Now on the DisplayMode property of the dropdowns for the "HoraInicio", you can use the index to tell whether it needs to be disabled:
If(ThisItem.Index = 1; DisplayMode.Edit; DisplayMode.Disabled)
And on the OnChange property of the "HoraTermino" dropdowns, you can update not only the current record of the new collection, but also the record for the "next" item:
Patch(
HorariosWithIndices;
ThisItem;
{
HoraTermino: Time(Value(ddTerminoHora.Selected.Value); Value(ddTerminoMinuto.Selected.Value); 0)
});;
If(
ThisItem.Index < CountRows(HorariosWithIndices);
Patch(
HorariosWithIndices;
LookUp(HorariosWithIndices; Index = ThisItem.Index + 1);
{
HoraInicio: Time(Value(ddTerminoHora.Selected.Value); Value(ddTerminoMinuto.Selected.Value); 0)
}))
The attached file shows how this logic can be implemented. To open it, save it locally, then go to https://create.powerapps.com, select Open ("Abrir"), Browse ("Procurar arquivos") and find the file that you saved previously.
Hope this helps!