示例#1
0
  @Override
  protected void populateContent(ViewGroup content) {
    activity.findViewById(R.id.wonder).setEnabled(false);
    activity.findViewById(R.id.summary).setEnabled(true);
    activity.findViewById(R.id.hand).setEnabled(true);

    activity
        .findViewById(R.id.help)
        .setOnClickListener(
            view -> {
              DialogFragment helpDialog = new HelpDialog();
              Bundle bundle = new Bundle();
              bundle.putString(HelpDialog.TITLE, activity.getString(R.string.help_wonder_title));
              bundle.putString(HelpDialog.MESSAGE, activity.getString(R.string.help_wonder));
              helpDialog.setArguments(bundle);
              helpDialog.show(activity.getFragmentManager(), "helpDialog");
            });

    for (Card card : playerViewing.getWonder().getStages()) {
      CardView cv = new CardView(card, activity, playerViewing, false, false);
      if (!playerViewing.getPlayedCards().contains(card)) {
        cv.setText(activity.getString(R.string.not_built, cv.getText()));
      }
      content.addView(cv);
    }

    for (Card card : playerViewing.getPlayedCards()) {
      if (card.getType() == Card.Type.STAGE) continue;
      CardView cv = new CardView(card, activity, playerViewing, false, false);
      content.addView(cv);
    }
  }