use of ch.hsr.sa.radiotour.presentation.fragments.RaceFragment in project app by TourLive.
the class MainActivity method setTabMenu.
private void setTabMenu() {
viewPageAdapter.addFragment(new RaceFragment(), getString(R.string.header_race));
viewPageAdapter.addFragment(new RiderRaceGroupFragment(), getString(R.string.header_ridergroup));
viewPageAdapter.addFragment(new SpecialFragment(), getString(R.string.header_special_class));
viewPageAdapter.addFragment(new VirtualClassFragment(), getString(R.string.header_virtual_class));
viewPageAdapter.addFragment(new MaillotsFragment(), getString(R.string.header_maillots));
viewPageAdapter.addFragment(new ImportFragment(), getString(R.string.header_import_data));
}
use of ch.hsr.sa.radiotour.presentation.fragments.RaceFragment in project app by TourLive.
the class RiderPresenter method subscribeCallbacks.
@Override
public void subscribeCallbacks() {
onSaveRiderCallback = new IRiderRepository.OnSaveRiderCallback() {
@Override
public void onSuccess() {
for (Fragment frag : fragments) {
if (frag instanceof RaceFragment) {
handler.post(() -> {
RaceFragment rF = (RaceFragment) frag;
rF.addRiderToList();
});
} else if (frag instanceof RiderRaceGroupFragment) {
handler.post(() -> {
RiderRaceGroupFragment riderRaceGroupFragment = (RiderRaceGroupFragment) frag;
riderRaceGroupFragment.addRiderToList();
});
} else {
// Do nothing because a not supported fragment
}
}
}
@Override
public void onError(String message) {
// Not needed and therefore not implemented
}
};
onGetAllRidersCallback = new IRiderRepository.OnGetAllRidersCallback() {
@Override
public void onSuccess(RealmList<Rider> riders) {
for (Fragment frag : fragments) {
if (frag instanceof RaceFragment) {
RaceFragment rF = (RaceFragment) frag;
rF.showRiders(riders);
} else if (frag instanceof RiderRaceGroupFragment) {
RiderRaceGroupFragment riderRaceGroupFragment = (RiderRaceGroupFragment) frag;
riderRaceGroupFragment.showRiders(riders);
} else if (frag instanceof VirtualClassFragment) {
VirtualClassFragment virtualClassFragment = (VirtualClassFragment) frag;
virtualClassFragment.updateRiders(riders);
} else {
// Do nothing because a not supported fragment
}
}
}
@Override
public void onError(String message) {
// Not needed and therefore not implemented
}
};
onUpdateRiderStateCallback = new IRiderRepository.OnUpdateRiderStageCallback() {
@Override
public void onSuccess() {
// Not needed and therefore not implemented
}
@Override
public void onError(String message) {
// Not needed and therefore not implemented
}
};
}
Aggregations