private void showNextEntry(@Nonnull final Iterator<CreditsList> iterator) { if (!iterator.hasNext()) { gotoNextScreen(); return; } final CreditsList list = iterator.next(); if (Lang.getInstance().isGerman()) { titleLabel.setText(list.getNameGerman()); } else { titleLabel.setText(list.getNameEnglish()); } final List<String> names = new ArrayList<String>(); for (final CreditsPerson person : list) { names.add(person.getName()); } final StringBuilder builder = new StringBuilder(); final int nameCount = names.size(); for (int i = 0; i < nameCount; i++) { builder.append(names.get(i)); if (i < (nameCount - 2)) { builder.append(", "); } else if (i < (nameCount - 1)) { if (Lang.getInstance().isGerman()) { builder.append(" und "); } else { builder.append(" and "); } } } nameLabel.setText(builder.toString()); displayParent.layoutElements(); displayParent.show( new EndNotify() { @Override public void perform() { displayParent.hide( new EndNotify() { @Override public void perform() { showNextEntry(iterator); } }); } }); }
private void changeDialogTo(final String id) { if (!id.equals(currentMenuButtonId)) { int currentIndex = buttonIdList.indexOf(currentMenuButtonId); int nextIndex = buttonIdList.indexOf(id); Element nextElement = screen.findElementByName(buttonToDialogMap.get(id)); modifyMoveEffect( EffectEventId.onShow, nextElement, currentIndex < nextIndex ? "right" : "left"); nextElement.show(); Element currentElement = screen.findElementByName(buttonToDialogMap.get(currentMenuButtonId)); modifyMoveEffect( EffectEventId.onHide, currentElement, currentIndex < nextIndex ? "left" : "right"); currentElement.hide(); screen.findElementByName(currentMenuButtonId).stopEffect(EffectEventId.onCustom); screen.findElementByName(id).startEffect(EffectEventId.onCustom, null, "selected"); currentMenuButtonId = id; } }