Beispiel #1
0
    public Map<String, Construct> evaluate(BindableEvent e) throws EventException {
      Map<String, Construct> retn = new HashMap<String, Construct>();

      if (e instanceof Welcome) {
        Welcome msg = (Welcome) e;
        retn.put("id", new CString(msg.getBot().getID(), Target.UNKNOWN));
      }

      return retn;
    }
  /**
   * ****************************************************************************************************************************************
   * Populate List
   *
   * <p>Populates the individual species the user clicked on
   * *****************************************************************************************************************************************
   *
   * @param mView The view the user clicked
   * @param mImage The image the user clicked
   *     ****************************************************************************************************************************************
   */
  private void populateList(View mView, ImageView mImage) {

    // Next 5 lines give a short fade-in animation for the single photo
    Welcome welcome = Welcome.getInstance();
    int mShortAnimationDuration = getResources().getInteger(android.R.integer.config_longAnimTime);
    mShortAnimationDuration *= 2;
    welcome.fadeIn(mView, mShortAnimationDuration);
    mView.findViewById(R.id.single_photo).setVisibility(View.VISIBLE);

    ImageView singleImage = (ImageView) mView.findViewById(R.id.single_img);
    Picasso.with(getActivity()).load(photosList.get(mImage.getId())).into(singleImage);

    /** ********************************** 1.) Species Name ********************************** */
    TextView text = (TextView) mView.findViewById(R.id.species_name);
    Typeface font = Typeface.createFromAsset(getActivity().getAssets(), "fonts/Walkway_Bold.ttf");
    String jsonText = (jsonArray.get(mImage.getId()).getName());
    // text.setText(Html.fromHtml(singleText));
    text.setText(jsonText);
    text.setTypeface(font);
    /** ********************************** 2.) Scientific Name ********************************** */
    text = (TextView) mView.findViewById(R.id.scientific);
    jsonText = ("Scientific Name: " + jsonArray.get(mImage.getId()).getScientificName());
    text.setText(jsonText);
    /** ********************************** 3.) Common Name ********************************** */
    text = (TextView) mView.findViewById(R.id.common);
    jsonText = ("Common Name: " + jsonArray.get(mImage.getId()).getCommonName());
    text.setText(jsonText);
    /**
     * ********************************** 4.) Individual Limits **********************************
     */
    text = (TextView) mView.findViewById(R.id.individual);
    jsonText = ("Individual Limit: \n" + jsonArray.get(mImage.getId()).getIndividualLimit());
    text.setText(jsonText);
    /**
     * ********************************** 5.) Aggregate Limits **********************************
     */
    text = (TextView) mView.findViewById(R.id.aggregate);
    jsonText = ("Aggregate Limit: \n" + jsonArray.get(mImage.getId()).getAggregateLimit());
    text.setText(jsonText);
    /** ********************************** 6.) Minimum ********************************** */
    text = (TextView) mView.findViewById(R.id.minimum);
    jsonText = ("Size Limits: \n" + jsonArray.get(mImage.getId()).getSizeLimit());
    text.setText(jsonText);
    /** ********************************** 7.) Season ********************************** */
    text = (TextView) mView.findViewById(R.id.season);
    jsonText = ("Season: \n" + jsonArray.get(mImage.getId()).getSeason());
    text.setText(jsonText);
    /** ********************************** 8.) Records ********************************** */
    text = (TextView) mView.findViewById(R.id.record);
    jsonText = ("Records: \n" + jsonArray.get(mImage.getId()).getRecords());
    text.setText(jsonText);
  }
 private void makeBreadcrumbs() {
   BreadcrumbTrail trail = new BreadcrumbTrail(l10n());
   Welcome.addBreadcrumb(trail);
   BoardsPage.addBreadcrumb(trail);
   SelectBoardsPage.addBreadcrumb(trail);
   mContentNode.addChild(trail.getHTMLNode());
 }
 public static void logout() {
   session.clear();
   Welcome.index();
 }