@Override
  public View getView(int position, View convertView, ViewGroup parent) {

    if (convertView == null) {
      convertView = context.getLayoutInflater().inflate(R.layout.custom_listview, parent, false);
    }

    noticeTitle = (TextView) convertView.findViewById(R.id.notice_title);
    mNetworkImageView = (NetworkImageView) convertView.findViewById(R.id.networkImageView);

    createdAt = (TextView) convertView.findViewById(R.id.created_at);
    department = (TextView) convertView.findViewById(R.id.department);

    mImageLoader = CustomVolleyRequestQueue.getInstance(context).getImageLoader();
    // Image URL - This can point to any image file supported by Android
    final String url = data.get(position).getImage();
    mImageLoader.get(
        url,
        ImageLoader.getImageListener(
            mNetworkImageView, R.mipmap.ic_launcher, android.R.drawable.ic_dialog_alert));
    mNetworkImageView.setImageUrl(url, mImageLoader);
    noticeTitle.setText(data.get(position).getNotice());
    noticPostDate = formateStringDate(data.get(position).getCreatedAt());
    createdAt.setText(noticPostDate);
    department.setText("Notice From - " + data.get(position).getDepartment());
    Log.d("simul", noticPostDate);

    return convertView;
  }
    @Override
    public Object instantiateItem(ViewGroup container, int position) {
      Context context = ImageShowActivity.this;

      int padding = context.getResources().getDimensionPixelSize(R.dimen.padding_medium);
      ImageLocation imageLocation = imageLocations.get(position);
      if (imageLocation.isLocal()) {
        ImageView imageView = new ImageView(context);
        imageView.setPadding(padding, padding, padding, padding);
        imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
        imageView.setImageURI(imageLocation.getUri());
        container.addView(imageView, 0);
        return imageView;
      } else {

        NetworkImageView imageView = new NetworkImageView(context);

        imageView.setPadding(padding, padding, padding, padding);
        imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
        imageView.setImageUrl(
            API_IMAGE_GET + imageLocation.getId(), BaseApplication.baseApplication.mImageLoader);

        container.addView(imageView, 0);
        return imageView;
      }
    }
  @SuppressLint("NewApi")
  private void resue() {
    String url = Config.SERVICEURL;
    url = url.substring(0, url.length() - 1);
    for (int i = 0; i < pictureTypes.size(); i++) {
      NetworkImageView niv = new NetworkImageView(this);

      niv.setImageUrl(
          url + pictureTypes.get(i).getTp_pic(),
          new VolleyUtils()
              .getImageLoader(
                  PictureTypeActivity.this,
                  new HttpCallback() {

                    @Override
                    public void httpCallback(Object oj) {
                      // TODO Auto-generated method stub
                      if (wd.isShowing()) {
                        wd.dismiss();
                      }
                    }
                  }));

      niv.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
      niv.setScaleType(ScaleType.FIT_XY);
      ims.addView(niv);
    }
    Log.i("sys", "图片添加完成");
  }
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {

    if (inflater == null)
      inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    if (convertView == null) convertView = inflater.inflate(R.layout.list_row, null);

    if (imageLoader == null) imageLoader = AppController.getInstance().getImageLoader();
    NetworkImageView thumbNail = (NetworkImageView) convertView.findViewById(R.id.thumbnail);
    TextView username = (TextView) convertView.findViewById(R.id.username);
    TextView phone = (TextView) convertView.findViewById(R.id.phone);

    // getting user data for the row
    User user = userItems.get(position);

    // thumbnail image
    thumbNail.setImageUrl(user.getThumbnailUrl(), imageLoader);

    // username
    username.setText(user.getUsername());

    // phone
    phone.setText(user.getPhone());

    return convertView;
  }
 /**
  * 프로필 이미지에 대해 view를 update한다.
  *
  * @param profileImageURL 화면에 반영할 프로필 이미지
  */
 public void setProfileURL(final String profileImageURL) {
   this.profileImageURL = profileImageURL;
   if (profile != null && profileImageURL != null) {
     Application app = GlobalApplication.getGlobalApplicationContext();
     if (app == null)
       throw new UnsupportedOperationException(
           "needs com.kakao.GlobalApplication in order to use ImageLoader");
     profile.setImageUrl(profileImageURL, ((GlobalApplication) app).getImageLoader());
   }
 }
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {

    if (inflater == null)
      inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    if (convertView == null) convertView = inflater.inflate(R.layout.list_row, null);

    if (imageLoader == null) imageLoader = AppController.getInstance().getImageLoader();
    NetworkImageView thumbNail = (NetworkImageView) convertView.findViewById(R.id.thumbnail);
    thumbNail.startAnimation(imageFadeInAnimation);

    TextView headline = (TextView) convertView.findViewById(R.id.headline);
    TextView category = (TextView) convertView.findViewById(R.id.category);
    TextView pubTime = (TextView) convertView.findViewById(R.id.pub_time);
    TextView upVotes = (TextView) convertView.findViewById(R.id.upvotes);
    TextView downVotes = (TextView) convertView.findViewById(R.id.downvotes);

    // getting NewsObject data for the row
    NewsObject newsObject = newsObjectItems.get(position);

    // thumbnail image
    thumbNail.setImageUrl(newsObject.thumbnailUrl, imageLoader);

    // headline
    headline.setText(newsObject.headline);

    // category
    category.setTextColor(activity.getResources().getColor(getCategoryColor(newsObject.category)));
    category.setText(newsObject.getCategory());

    // publishDate/Time
    pubTime.setText(timeAgo(newsObject.publicationDateTime));

    // upvotes
    upVotes.setText("" + newsObject.upvotes);

    // downvotes
    downVotes.setText("" + newsObject.downvotes);

    // genre
    /*String genreStr = "";
    for (String str : m.getGenre()) {
    	genreStr += str + ", ";
    }
    genreStr = genreStr.length() > 0 ? genreStr.substring(0,
    		genreStr.length() - 2) : genreStr;
    genre.setText(genreStr);

    // release year
    year.setText(String.valueOf(m.getYear()));*/

    return convertView;
  }
Exemple #7
0
 public void bind(EventoDto evento) {
   this.evento = evento;
   thumbnail.setImageUrl(Constants.PATH_IMAGE + evento.getImagemUrl(), imageLoader);
   nomeEvento.setText(evento.getNomeEvento());
   localEvento.setText(evento.getNomeInstituicao());
   dataEvento.setText(
       TreatDate.formatTime(TreatDate.parseDateTime(evento.getDataInicio()))
           + " - "
           + TreatDate.formatTime(TreatDate.parseDateTime(evento.getDataInicio())));
   likeView.setLikeViewStyle(LikeView.Style.BOX_COUNT);
   likeView.setObjectIdAndType(evento.getUrlFacebookEvento(), LikeView.ObjectType.DEFAULT);
 }
  public void setValue() {

    txt_challengename.setText(getChallengeDetailsItems.getTitle());
    txt_challengeDescription.setText(getChallengeDetailsItems.getDescription());
    etxt_days.setText(getChallengeDetailsItems.getC_day());
    etxt_hours.setText(getChallengeDetailsItems.getC_hrs());
    etxt_minutes.setText(getChallengeDetailsItems.getC_min());
    txt_challengetime.setText(getChallengeDetailsItems.getDate_added());
    txt_pize.setText(getChallengeDetailsItems.getCustom_prize());
    txt_coins.setText(getChallengeDetailsItems.getC_coin());

    for (int i = 0; i < getChallengeDetailsItems.getParticipantItemsArrayList().size(); i++) {

      LayoutInflater mInflater =
          (LayoutInflater) getActivity().getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
      View rowView = mInflater.inflate(R.layout.row_members, null);
      ImageView imv_cross = (ImageView) rowView.findViewById(R.id.imv_cross);
      ImageView imv_circle = (ImageView) rowView.findViewById(R.id.imv_circle);
      TextView txt_name = (TextView) rowView.findViewById(R.id.txt_name);
      TextView txt_challengee_witness =
          (TextView) rowView.findViewById(R.id.txt_challengee_witness);

      txt_name.setText(getChallengeDetailsItems.getParticipantItemsArrayList().get(i).getName());
      txt_challengee_witness.setText(
          getChallengeDetailsItems.getParticipantItemsArrayList().get(i).getUser_type());

      if (getChallengeDetailsItems
          .getParticipantItemsArrayList()
          .get(i)
          .getC_status()
          .equalsIgnoreCase("0")) {
        imv_circle.setImageResource(R.drawable.yallow_circle);
      } else {
        imv_circle.setImageResource(R.drawable.green_circle);
      }

      NetworkImageView imv_icon = (NetworkImageView) rowView.findViewById(R.id.imv_icon);
      ImageLoader mImageLoader = null;
      mImageLoader = AppController.getInstance().getImageLoader();

      imv_icon.setImageUrl(
          getChallengeDetailsItems.getParticipantItemsArrayList().get(i).getProfile_img(),
          mImageLoader);
      imv_cross.setTag(getChallengeDetailsItems.getParticipantItemsArrayList().get(i).getUser_id());

      imv_cross.setOnClickListener(this);

      layout_lv_members.addView(rowView);
    }
  }
  private void setViewsValues() {
    try {
      carImageView.setImageUrl(
          objCarInfo.getImage(), ApplicationQuicker.getInstance().getImageLoader());
      nameTextView.setText(objCarInfo.getName());
      ratingTextView.setText(objCarInfo.getRating());
      ccTextView.setText(objCarInfo.getEngine_cc());
      typeTextView.setText(objCarInfo.getType());
      absTextView.setText(objCarInfo.getAbs_exist());
      mileageTextView.setText(objCarInfo.getMileage());
      descriptionTextView.setText(objCarInfo.getDescription());

      colorView.setBackgroundColor(Color.parseColor(objCarInfo.getColor()));
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  public View getView(int position, View convertView, ViewGroup parent) {
    FrameLayout fl = (FrameLayout) convertView;
    NetworkImageView niv;
    if (fl == null) {
      LayoutInflater inflater =
          (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      fl = (FrameLayout) inflater.inflate(R.layout.grid_image, parent, false);
      niv = (NetworkImageView) fl.findViewById(R.id.niv_grid);

      niv.setDefaultImageResId(R.drawable.ic_icon);
      niv.setErrorImageResId(android.R.drawable.ic_dialog_alert);
    }
    niv = (NetworkImageView) fl.findViewById(R.id.niv_grid);

    GApplication appState = (GApplication) mActivity.getApplication();
    niv.setImageUrl(getItem(position), appState.mImageLoader);
    return fl;
  }
    @Override
    public View execute(final FakkuManga fakkuManga) {
      Context c = mViewGroup.getContext();

      if (mConvertView == null) {
        mConvertView = View.inflate(c, R.layout.dummy_gallery_item, null);
      }

      ((TextView) mConvertView.findViewById(R.id.manga_title)).setText(fakkuManga.getTitle());

      // set all gallery item values
      if (fakkuManga.getCoverUrl() != null) {
        NetworkImageView networkImageView =
            (NetworkImageView) mConvertView.findViewById(R.id.manga_thumb);
        networkImageView.setImageUrl(fakkuManga.getCoverUrl(), VolleySingleton.getImageLoader());
      }

      setupFavoriteButton((ImageView) mConvertView.findViewById(R.id.manga_favorite), fakkuManga);

      mConvertView.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View view) {
              getGalleryItemClickListener().galleryItemClicked(fakkuManga);
            }
          });

      mConvertView
          .findViewById(R.id.manga_overflow)
          .setOnClickListener(
              new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                  showOverflowView(view, fakkuManga);
                }
              });

      return mConvertView;
    }
  /** 优点: 被父控件dispatch的时候会自动取消掉网络请求 */
  private void NetWorkImageViewVolley() {
    String imageUrl = "http://file.bmob.cn/M02/42/CB/oYYBAFaTXjyAaiKEABJh2CKNhlI556.png";
    RequestQueue requestQueue = Volley.newRequestQueue(this);
    final android.support.v4.util.LruCache<String, Bitmap> lruCache =
        new android.support.v4.util.LruCache<String, Bitmap>(20);
    ImageLoader.ImageCache imageCache =
        new ImageLoader.ImageCache() {

          @Override
          public void putBitmap(String key, Bitmap value) {
            lruCache.put(key, value);
          }

          @Override
          public Bitmap getBitmap(String key) {
            return lruCache.get(key);
          }
        };
    ImageLoader imageLoader = new ImageLoader(requestQueue, imageCache);
    NetworkImageViewVolley.setTag("url");
    NetworkImageViewVolley.setImageUrl(imageUrl, imageLoader);
  }
Exemple #13
0
 /**
  * 为 NetworkImageView 加载图片.
  *
  * @param niv
  * @param url
  */
 public static void loadImage4NetImageView(@NonNull NetworkImageView niv, @NonNull String url) {
   ImageLoader loader = ApplicationUtils.getGlobalImageLoader();
   niv.setDefaultImageResId(defaultResId);
   niv.setErrorImageResId(errorImageResId);
   niv.setImageUrl(url, loader);
 }
Exemple #14
0
  public void setPost(final Post post, final ThreadManager manager) {
    this.post = post;
    this.manager = manager;

    highlightQuotesNo = -1;

    boolean boardCatalogMode =
        manager.getLoadable().isBoardMode() || manager.getLoadable().isCatalogMode();

    TypedArray ta =
        context.obtainStyledAttributes(null, R.styleable.PostView, R.attr.post_style, 0);

    if (!isBuild) {
      buildView(context, ta);
      isBuild = true;
    }

    int dateColor = ta.getColor(R.styleable.PostView_date_color, 0);
    int savedReplyColor = ta.getColor(R.styleable.PostView_saved_reply_color, 0);
    int highlightedColor = ta.getColor(R.styleable.PostView_highlighted_color, 0);
    int detailSize = ta.getDimensionPixelSize(R.styleable.PostView_detail_size, 0);

    ta.recycle();

    if (post.hasImage) {
      imageView.setVisibility(View.VISIBLE);
      imageView.setImageUrl(post.thumbnailUrl, ChanApplication.getVolleyImageLoader());
    } else {
      imageView.setVisibility(View.GONE);
      imageView.setImageUrl(null, null);
    }

    CharSequence total = new SpannableString("");

    if (post.subjectSpan != null) {
      total = TextUtils.concat(total, post.subjectSpan);
    }

    if (isList()) {
      CharSequence relativeTime =
          DateUtils.getRelativeTimeSpanString(
              post.time * 1000L, Time.get(), DateUtils.SECOND_IN_MILLIS, 0);
      SpannableString date = new SpannableString("No." + post.no + " " + relativeTime);
      date.setSpan(new ForegroundColorSpan(dateColor), 0, date.length(), 0);
      date.setSpan(new AbsoluteSizeSpan(detailSize), 0, date.length(), 0);

      total =
          TextUtils.concat(
              total,
              post.subjectSpan == null ? "" : "\n",
              post.nameTripcodeIdCapcodeSpan,
              date,
              " ");
    }

    if (!TextUtils.isEmpty(total)) {
      titleView.setText(total);
      titleView.setVisibility(View.VISIBLE);
    } else {
      titleView.setVisibility(View.GONE);
    }

    commentView.setText(post.comment);

    if (manager.getLoadable().isThreadMode()) {
      post.setLinkableListener(this);
      commentView.setMovementMethod(new PostViewMovementMethod());
      commentView.setOnClickListener(this);
    } else {
      post.setLinkableListener(null);
      commentView.setOnClickListener(null);
      commentView.setClickable(false);
      commentView.setMovementMethod(null);
    }

    if (isGrid()
        || ((post.isOP && boardCatalogMode && post.replies > 0) || (post.repliesFrom.size() > 0))) {
      repliesCountView.setVisibility(View.VISIBLE);

      String text = "";

      int count = boardCatalogMode ? post.replies : post.repliesFrom.size();

      if (count != 1) {
        text = count + " " + context.getString(R.string.multiple_replies);
      } else if (count == 1) {
        text = count + " " + context.getString(R.string.one_reply);
      }

      if (boardCatalogMode && post.images > 0) {
        if (post.images != 1) {
          text += ", " + post.images + " " + context.getString(R.string.multiple_images);
        } else {
          text += ", " + post.images + " " + context.getString(R.string.one_image);
        }
      }

      if (manager.getLoadable().isThreadMode()) {
        repliesCountView.setOnClickListener(
            new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                manager.showPostReplies(post);
              }
            });
      }

      repliesCountView.setText(text);
    } else {
      repliesCountView.setVisibility(View.GONE);
      repliesCountView.setOnClickListener(null);
    }

    boolean showCountryFlag =
        isList() && !TextUtils.isEmpty(post.country) && !TextUtils.isEmpty(post.countryUrl);
    boolean showStickyIcon = isList() && post.sticky;
    boolean showDeletedIcon = isList() && post.deleted;
    boolean showArchivedIcon = isList() && post.archived;
    boolean showClosedIcon = isList() && post.closed && !showArchivedIcon;

    iconsView.setVisibility(
        (showCountryFlag || showStickyIcon || showClosedIcon || showDeletedIcon || showArchivedIcon)
            ? View.VISIBLE
            : View.GONE);

    stickyView.setVisibility(showStickyIcon ? View.VISIBLE : View.GONE);
    closedView.setVisibility(showClosedIcon ? View.VISIBLE : View.GONE);
    deletedView.setVisibility(showDeletedIcon ? View.VISIBLE : View.GONE);
    archivedView.setVisibility(showArchivedIcon ? View.VISIBLE : View.GONE);
    if (showCountryFlag) {
      countryView.setVisibility(View.VISIBLE);
      countryView.setImageUrl(post.countryUrl, ChanApplication.getVolleyImageLoader());
    } else {
      countryView.setVisibility(View.GONE);
      countryView.setImageUrl(null, null);
    }

    if (post.isSavedReply) {
      full.setBackgroundColor(savedReplyColor);
    } else if (manager.isPostHightlighted(post)) {
      full.setBackgroundColor(highlightedColor);
    } else {
      full.setBackgroundColor(0x00000000);
    }

    if (manager.isPostLastSeen(post)) {
      lastSeen.setVisibility(View.VISIBLE);
    } else {
      lastSeen.setVisibility(View.GONE);
    }
  }
 private void loadNetworkImageView() {
   String url = "http://dev.classmethod.jp/wp-content/uploads/2013/04/android_eyecatch.png";
   NetworkImageView view = (NetworkImageView) findViewById(R.id.network_image_view);
   view.setImageUrl(null, null);
   view.setImageUrl(url, new ImageLoader(mQueue, new BitmapCache()));
 }
  private void refreshViews(Cursor cursor) {
    if (!cursor.moveToFirst()) return;

    // check whether or not to show the edit button
    String state = cursor.getString(cursor.getColumnIndex("uploadState"));
    mIsLocal = MediaUtils.isLocalFile(state);
    if (mIsLocal && getActivity() != null) {
      getActivity().invalidateOptionsMenu();
    }

    // title
    mTitleView.setText(cursor.getString(cursor.getColumnIndex("title")));

    // caption
    String caption = cursor.getString(cursor.getColumnIndex("caption"));
    if (caption == null || caption.length() == 0) {
      mCaptionView.setVisibility(View.GONE);
    } else {
      mCaptionView.setText(caption);
      mCaptionView.setVisibility(View.VISIBLE);
    }

    // description
    String desc = cursor.getString(cursor.getColumnIndex("description"));
    if (desc == null || desc.length() == 0) {
      mDescriptionView.setVisibility(View.GONE);
    } else {
      mDescriptionView.setText(desc);
      mDescriptionView.setVisibility(View.VISIBLE);
    }

    // added / upload date
    String date = MediaUtils.getDate(cursor.getLong(cursor.getColumnIndex("date_created_gmt")));
    if (mIsLocal) {
      mDateView.setText("Added on: " + date);
    } else {
      mDateView.setText("Uploaded on: " + date);
    }

    // file name
    String fileName = cursor.getString(cursor.getColumnIndex("fileName"));
    mFileNameView.setText("File name: " + fileName);

    // get the file extension from the fileURL
    String fileURL = cursor.getString(cursor.getColumnIndex("fileURL"));
    if (fileURL != null) {
      String fileType = fileURL.replaceAll(".*\\.(\\w+)$", "$1").toUpperCase();
      mFileTypeView.setText("File type: " + fileType);
      mFileTypeView.setVisibility(View.VISIBLE);
    } else {
      mFileTypeView.setVisibility(View.GONE);
    }

    String imageUri = cursor.getString(cursor.getColumnIndex("fileURL"));
    if (imageUri == null) imageUri = cursor.getString(cursor.getColumnIndex("filePath"));

    inflateImageView();

    // image and dimensions
    if (MediaUtils.isValidImage(imageUri)) {
      int width = cursor.getInt(cursor.getColumnIndex("width"));
      int height = cursor.getInt(cursor.getColumnIndex("height"));

      float screenWidth;

      View parentView = (View) mImageView.getParent();

      // differentiating between tablet and phone
      if (this.isInLayout()) {
        screenWidth = parentView.getMeasuredWidth();
      } else {
        screenWidth = getActivity().getResources().getDisplayMetrics().widthPixels;
      }
      float screenHeight = getActivity().getResources().getDisplayMetrics().heightPixels;

      if (width > 0 && height > 0) {
        String dimensions = width + "x" + height;
        mDimensionsView.setText("Dimensions: " + dimensions);
        mDimensionsView.setVisibility(View.VISIBLE);
      } else {
        mDimensionsView.setVisibility(View.GONE);
      }

      if (width > screenWidth) {
        height = (int) (height / (width / screenWidth));
        width = (int) screenWidth;
      } else if (height > screenHeight) {
        width = (int) (width / (height / screenHeight));
        height = (int) screenHeight;
      }

      if (mIsLocal) {
        final String filePath = cursor.getString(cursor.getColumnIndex("filePath"));
        loadLocalImage(mImageView, filePath, width, height);
      } else {
        // Allow non-private wp.com and Jetpack blogs to use photon to get a higher res thumbnail
        if (WordPress.getCurrentBlog() != null && WordPress.getCurrentBlog().isPhotonCapable()) {
          String thumbnailURL = StringUtils.getPhotonUrl(imageUri, (int) screenWidth);
          ((NetworkImageView) mImageView).setImageUrl(thumbnailURL, mImageLoader);
        } else {
          ((NetworkImageView) mImageView).setImageUrl(imageUri + "?w=" + screenWidth, mImageLoader);
        }
      }
      mImageView.setVisibility(View.VISIBLE);

      mImageView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, height));

    } else {
      mImageView.setVisibility(View.GONE);
      mDimensionsView.setVisibility(View.GONE);
    }
  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_pointdinteret_detail, container, false);
    final TextView adresse = (TextView) rootView.findViewById(R.id.adresseTexte);
    final ImageView house = (ImageView) rootView.findViewById(R.id.adresseMarker);
    final TextView phoneNumber = (TextView) rootView.findViewById(R.id.phoneTexte);
    final ImageView phoneIcon = (ImageView) rootView.findViewById(R.id.phoneIcon);

    View.OnClickListener clickListener =
        new View.OnClickListener() {
          @Override
          public void onClick(final View v) {
            Uri uri = Uri.parse("https://www.google.fr/maps/");
            Intent intent = new Intent(Intent.ACTION_VIEW, uri);
            startActivity(intent);
          }
        };

    adresse.setOnClickListener(clickListener);
    house.setOnClickListener(clickListener);

    View.OnClickListener call =
        new View.OnClickListener() {
          @Override
          public void onClick(final View v) {
            String numero = phoneNumber.getText().toString();
            Intent keypad = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + numero));
            startActivity(keypad);
          }
        };

    phoneNumber.setOnClickListener(call);
    phoneIcon.setOnClickListener(call);

    // Show the dummy content as text in a TextView.
    if (mItem != null) {
      ((TextView) rootView.findViewById(R.id.attraction_detail_title)).setText(mItem.getTitle());
      getActivity().setTitle(mItem.getTitle());
      ((TextView) rootView.findViewById(R.id.attraction_detail_description))
          .setText(
              mItem.getDescription().isEmpty()
                  ? getActivity().getResources().getString(R.string.pas_de_description)
                  : mItem.getDescription());
      NetworkImageView image =
          (NetworkImageView) rootView.findViewById(R.id.attraction_detail_image);
      image.setImageUrl(
          mItem.getImageURL(), RestHelper.getInstance(getActivity()).getImageLoader());
    }

    LatLng latLng = new LatLng(mItem.getLatitude(), mItem.getLongitude());
    MapView mv = (MapView) rootView.findViewById(R.id.mapview);
    mv.setAccessToken("sk.eyJ1Ijoic29uaWFoNDMxMiIsImEiOiJDbGVzMmZJIn0.2Nj61Rz4inJyKYD6MXUsnQ");
    mv.setTileSource(new MapboxTileLayer("soniah4312.7c398ef3"));
    mv.setMinZoomLevel(mv.getTileProvider().getMinimumZoomLevel());
    mv.setMaxZoomLevel(mv.getTileProvider().getMaximumZoomLevel());
    mv.setCenter(latLng);
    mv.setZoom(16);

    Marker marker = new Marker("titre", "decription", latLng);
    mv.addMarker(marker);
    return rootView;
  }
Exemple #18
0
 private void makeImageRequest(NetworkImageView imgView, String Str_Url) {
   ImageLoader imageLoader = AppController.getInstance().getImageLoader();
   if (imageLoader != null) imgView.setImageUrl(Str_Url, imageLoader);
 }