use of ch.hsr.sa.radiotour.dataaccess.models.RaceGroup in project app by TourLive.
the class RiderListAdapter method updateAnimateRiderInGroup.
public void updateAnimateRiderInGroup(String raceGroupId) {
RaceGroup raceGroup = RaceGroupPresenter.getInstance().getRaceGroupById(raceGroupId);
if (!holderHashMap.isEmpty()) {
for (Rider r : raceGroup.getRiders()) {
if (holderHashMap.get(r.getStartNr()) != null) {
TextView tvNumber = holderHashMap.get(r.getStartNr()).tvNummer;
handler.post(() -> animateRiderInGroup(tvNumber, r.getStartNr()));
}
}
}
}
use of ch.hsr.sa.radiotour.dataaccess.models.RaceGroup in project app by TourLive.
the class UnknownRiderTransferDialogFramgent method onCreateDialog.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = LayoutInflater.from(getContext());
View dialogView = inflater.inflate(R.layout.dialog_unknowntransfer, null);
alertDialogBuilder.setView(dialogView);
spinner = dialogView.findViewById(R.id.riderSpinner);
addItemsToSpinner();
alertDialogBuilder.setTitle(R.string.race_unknownrider_transfer_title);
alertDialogBuilder.setMessage(R.string.race_unknownrider_transfer_description);
alertDialogBuilder.setPositiveButton(R.string.race_unknownrider_transfer_button, (DialogInterface dialog, int which) -> {
String[] parts = spinner.getItemAtPosition(spinner.getSelectedItemPosition()).toString().split("\\-");
String startNr = parts[0];
Log.d("", "" + selectedUnknownRider.toString());
final int unknownRiderStartNr = selectedUnknownRider.getStartNr();
new Thread(() -> {
Rider unknownRider = RiderPresenter.getInstance().getRiderByStartNr(unknownRiderStartNr);
RaceGroup raceGroup = unknownRider.getRaceGroups();
RealmList<Rider> rider = new RealmList<>();
rider.add(getRider(startNr));
RaceGroupPresenter.getInstance().updateRaceGroupRiders(raceGroup, rider);
RaceGroupPresenter.getInstance().deleteRiderInRaceGroup(raceGroup, unknownRider);
RiderPresenter.getInstance().removeRiderWithoutCallback(unknownRider);
}).start();
});
alertDialogBuilder.setNegativeButton(R.string.dismiss, (DialogInterface dialog, int which) -> dialog.dismiss());
return alertDialogBuilder.create();
}
Aggregations