当前位置: 首页>>代码示例>>Java>>正文


Java UrlImageViewHelper.setUrlDrawable方法代码示例

本文整理汇总了Java中com.koushikdutta.urlimageviewhelper.UrlImageViewHelper.setUrlDrawable方法的典型用法代码示例。如果您正苦于以下问题:Java UrlImageViewHelper.setUrlDrawable方法的具体用法?Java UrlImageViewHelper.setUrlDrawable怎么用?Java UrlImageViewHelper.setUrlDrawable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.koushikdutta.urlimageviewhelper.UrlImageViewHelper的用法示例。


在下文中一共展示了UrlImageViewHelper.setUrlDrawable方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getView

import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    PhotoHolder holder;

    if (convertView == null) {
        convertView = mInflater.inflate(R.layout.view_photo_grid_item, parent, false);
        holder = new PhotoHolder();
        holder.photo = (ImageView) convertView.findViewById(R.id.imageView_photo);
        convertView.setTag(holder);
    } else {
        holder = (PhotoHolder) convertView.getTag();
    }

    FBPhoto photo = getItem(position);
    UrlImageViewHelper.setUrlDrawable(holder.photo, photo.getUrl());

    return convertView;
}
 
开发者ID:theblindr,项目名称:blindr,代码行数:19,代码来源:FBPhotoArrayAdapter.java

示例2: getView

import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
    View view = convertView;
    ScheduleItem item = getItem(position);
    if (view == null)
    {
        view = _activity.getLayoutInflater().inflate(R.layout.schedule_item2, parent, false);
    }
    
    ((TextView)view.findViewById(R.id.tvTitle)).setText(item.getTitle());
    ((TextView)view.findViewById(R.id.tvGenre)).setText(item.getGenre());
    ((TextView)view.findViewById(R.id.tvShowTime)).setText(item.getTime());

    ImageView iv = (ImageView)view.findViewById(R.id.showLogo);
    UrlImageViewHelper.setUrlDrawable(iv, item.getLogoURL());
    
    return view;
}
 
开发者ID:jselbie,项目名称:wrekonline,代码行数:20,代码来源:ScheduleListAdapter.java

示例3: displaySafari

import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper; //导入方法依赖的package包/类
private void displaySafari(SafariListItem safari) {
	boolean rowFilled = true;
	Log.d(Constants.LOGGING_TAG, safari.getTileMediaUrl());
	String tileUrl = getString(R.string.base_url) + safari.getTileMediaUrl();
	Log.d(Constants.LOGGING_TAG, tileUrl);
	
	ImageView imageView = new ImageView(getBaseContext());
	imageView.setId(safari.getId());
	imageView.setOnClickListener(safariOnClickListener);
	
	if (currentRowLayout == null) {
		// If currentRowLayout is null, create a new horizontal linear layout.
		currentRowLayout = new LinearLayout(getBaseContext());
		currentRowLayout.setOrientation(LinearLayout.HORIZONTAL);
		((LinearLayout) this.findViewById(R.id.main_content)).addView(currentRowLayout);
		rowFilled = false;
	} 
	
	currentRowLayout.addView(imageView);
	
	if (rowFilled) {
		currentRowLayout = null;
	}
	
	UrlImageViewHelper.setUrlDrawable(imageView, tileUrl);
}
 
开发者ID:rpkelly,项目名称:tanapa-safari-android,代码行数:27,代码来源:MainActivity.java

示例4: getView

import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper; //导入方法依赖的package包/类
@Override
public View getView(int arg0, View convertView, ViewGroup parent) {
	// Get the view when we're provided a pod ID
	if (convertView == null) {
           convertView = LayoutInflater.from(mContext).inflate(R.layout.activity_results, parent);
       }
	LinearLayout linearLayout = (LinearLayout)convertView.findViewById(R.id.resultsLinearLayout);
	// Get and set the title of the current page
	TextView titleView = (TextView)linearLayout.findViewById(R.id.titleOfPage);
	String title = results.getPodTitle(arg0);
	titleView.setText(title);
	// Get and set the image results for current page
	for(String imageUrl:results.getPodImageUrls(arg0)){
		ImageView imageView = new ImageView(mContext);
		imageView.setPadding(0, 20, 0, 0);
		UrlImageViewHelper.setUrlDrawable(imageView, imageUrl, R.drawable.stat_notify_sync);
		linearLayout.addView(imageView);
	}
	return convertView;
}
 
开发者ID:AakashBPatel,项目名称:GlassCompute,代码行数:21,代码来源:ResultsScrollAdapter.java

示例5: instantiateItem

import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper; //导入方法依赖的package包/类
@Override
public Object instantiateItem(ViewGroup container, final int position) {
	// TODO Auto-generated method stub
	layoutInflater=(LayoutInflater)ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	View item_view=layoutInflater.inflate(R.layout.swipe_layout, container,false);
	final ImageView imageview=(ImageView)item_view.findViewById(R.id.image_view);
	TextView textview=(TextView)item_view.findViewById(R.id.image_count);
	//imageview.setImageResource(image_resources[position]);
	UrlImageViewHelper.setUrlDrawable(imageview, image_resources.get(position));
	
	
	textview.setText("Resim :"+(position+1));
	container.addView(item_view);
	return item_view;
}
 
开发者ID:revios,项目名称:WebServiceAndroid,代码行数:16,代码来源:CustomSwipeAdapter.java

示例6: getView

import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    AlbumHolder holder;

    if (convertView == null) {
        convertView = mInflater.inflate(R.layout.view_album_list_item, parent, false);
        holder = new AlbumHolder();
        holder.coverPhoto = (ImageView) convertView.findViewById(R.id.imageView_cover_photo);
        holder.name = (TextView) convertView.findViewById(R.id.textView_name);
        holder.photoCount = (TextView) convertView.findViewById(R.id.textView_count);
        convertView.setTag(holder);
    } else {
        holder = (AlbumHolder) convertView.getTag();
    }

    FBAlbum album = getItem(position);
    if (album.getCoverPhoto() != null)
        UrlImageViewHelper.setUrlDrawable(holder.coverPhoto, album.getCoverPhoto());

    holder.name.setText(album.getName());

    if (album.getCount() == 1)
        holder.photoCount.setText(album.getCount() + " " + mContext.getString(R.string.photo));
    else
        holder.photoCount.setText(album.getCount() + " " + mContext.getString(R.string.photos));

    return convertView;
}
 
开发者ID:theblindr,项目名称:blindr,代码行数:29,代码来源:FBAlbumArrayAdapter.java

示例7: makeHeader

import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper; //导入方法依赖的package包/类
private View makeHeader()
{
	LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	View layout = inflater.inflate(R.layout.drawer_header, null);
	layout.setOnClickListener(new View.OnClickListener()
	{
		@Override
		public void onClick(View v)
		{
			new ProfileTask(context).execute(prefs.getString("loggedIn", ""));
		}
	});

	RelativeLayout nameLayout = (RelativeLayout) layout.findViewById(R.id.nameLayout);
	Drawable nameBackground = nameLayout.getBackground();
	nameBackground.setAlpha(80);

	ImageView background = (ImageView) layout.findViewById(R.id.background);
	try
	{
		background.setImageBitmap(BitmapFactory.decodeStream(getResources().getAssets().open("pitt.jpg")));
	}
	catch(IOException e)
	{
		e.printStackTrace();
	}

	ImageView profileImage = (ImageView) layout.findViewById(R.id.profileImage);
	UrlImageViewHelper.setUrlDrawable(profileImage, "https://studentclassnet.appspot.com/addendum/getImage?username=" + prefs.getString("loggedIn", "default"));

	TextView realName = (TextView) layout.findViewById(R.id.realName);
	Gson gson = new Gson();
	User user = gson.fromJson(prefs.getString("userObject", ""), User.class);
	realName.setText(user.getFirstName() + " " + user.getLastName());
	TextView username = (TextView) layout.findViewById(R.id.username);
	username.setText(prefs.getString("loggedIn", "default"));

	return layout;
}
 
开发者ID:CS1635-ClassMe,项目名称:ClassMe-Android,代码行数:40,代码来源:StreamActivity.java

示例8: makeHeader

import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper; //导入方法依赖的package包/类
private View makeHeader()
{
	LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	View layout = inflater.inflate(R.layout.drawer_header, null);
	layout.setOnClickListener(new View.OnClickListener()
	{
		@Override
		public void onClick(View v)
		{
			drawerLayout.closeDrawers();
		}
	});

	RelativeLayout nameLayout = (RelativeLayout) layout.findViewById(R.id.nameLayout);
	Drawable nameBackground = nameLayout.getBackground();
	nameBackground.setAlpha(80);

	ImageView background = (ImageView) layout.findViewById(R.id.background);
	try
	{
		background.setImageBitmap(BitmapFactory.decodeStream(getResources().getAssets().open("pitt.jpg")));
	}
	catch(IOException e)
	{
		e.printStackTrace();
	}

	ImageView profileImage = (ImageView) layout.findViewById(R.id.profileImage);
	UrlImageViewHelper.setUrlDrawable(profileImage, "https://studentclassnet.appspot.com/addendum/getImage?username=" + prefs.getString("loggedIn", "default"));

	TextView realName = (TextView) layout.findViewById(R.id.realName);
	Gson gson = new Gson();
	User user = gson.fromJson(prefs.getString("userObject", ""), User.class);
	realName.setText(user.getFirstName() + " " + user.getLastName());
	TextView username = (TextView) layout.findViewById(R.id.username);
	username.setText(prefs.getString("loggedIn", "default"));

	return layout;
}
 
开发者ID:CS1635-ClassMe,项目名称:ClassMe-Android,代码行数:40,代码来源:ProfileActivity.java

示例9: getView

import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper; //导入方法依赖的package包/类
@Override
public View getView(int i, View view, ViewGroup viewGroup) {

    ViewHolder holder;
    if (view != null) {
        holder = (ViewHolder) view.getTag();
    } else {
        view = inflater.inflate(R.layout.grid_item_song, null, false);
        holder = new ViewHolder(view);
        view.setTag(holder);
    }

    final Track t = getItem(i);

    if(t.getArtworkUrl() != null && !t.getArtworkUrl().equals("")){
        UrlImageViewHelper.setUrlDrawable(holder.iv_artwork, t.getArtworkUrl(), R.drawable.ic_launcher);
    }

    holder.tv_title.setText(t.getTitle());

    if(showDownload){
        if(t.isDownloadable()){
            if(t.getOriginalContentSize() != 0) {
                float sizeInMb = t.getOriginalContentSize() / 1024.0f / 1024.0f;
                NumberFormat formatter = new DecimalFormat("#0.00");
                holder.tv_label_download.setText("Download\n(" + formatter.format(sizeInMb) + " Mb)");
            }
        }
    } else {
        holder.tv_label_download.setText(ctx.getString(R.string.play_song));
    }

    return view;
}
 
开发者ID:ForkITdev,项目名称:androidlx_2014,代码行数:35,代码来源:SongAdapter.java

示例10: getView

import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper; //导入方法依赖的package包/类
@Override
    public View getView(int position, View convertView, ViewGroup parent) {

        Log.d(TAG, "IN GET VIEW!!");
        final ViewHolderItem viewHolder;

        // convertView is the list item
        if (convertView == null) {
            // inflate the layout
            LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = inflater.inflate(R.layout.list_item_recipe, null);

            // set up the ViewHolder
            viewHolder = new ViewHolderItem();
            viewHolder.recipeTitle = (TextView) convertView.findViewById(R.id.recipeTitleTextView);
            viewHolder.recipeIngredients = (TextView) convertView.findViewById(R.id.recipeIngredientsTextView);
            viewHolder.recipeURL = (TextView) convertView.findViewById(R.id.recipeUrlTextView);
            viewHolder.recipeStar = (ImageView) convertView.findViewById(R.id.recipeFavoriteStarImageView);
            viewHolder.recipePic = (ImageView) convertView.findViewById(R.id.recipeImageView);

            convertView.setTag(viewHolder);

        } else {
            // we've just avoided calling findViewById() on the resource file every time
            // just use the viewHolder
            viewHolder = (ViewHolderItem) convertView.getTag();
        }

        // Recipe item based on the position
        if (recipeArrayList.isEmpty()) {
            Log.d(TAG, "recipeArrayList is empty");
            return convertView;
        }

        Recipe recipe = recipeArrayList.get(position);

        if (recipe != null) {
            String recipeImageURL = recipe.getRecipePicUrl();

            // assign values if the recipe is not null
            viewHolder.recipeTitle.setText(recipe.getRecipeTitle());
            viewHolder.recipeIngredients.setText(recipe.getRecipeIngredients());

            try {
                URL recipeUrl = new URL(recipe.getRecipeURL());
                viewHolder.recipeURL.setText(recipeUrl.getHost());
            } catch (MalformedURLException e) {
                Log.d(TAG, "URL parsing error.");
                recipeImageURL = "";
            }

            UrlImageViewHelper.setUrlDrawable(viewHolder.recipePic, recipeImageURL, R.drawable.placeholder);

            if (sqLiteDAO.isExistsRecipe(recipe)) {
                viewHolder.recipeStar.setImageResource(R.drawable.star_small);
            } else {
                viewHolder.recipeStar.setImageResource(0);
            }
            viewHolder.recipeStar.invalidate();
        }

//        viewHolder.recipeStar.invalidate();
//        notifyDataSetChanged();

        return convertView;
    }
 
开发者ID:icebox-creations,项目名称:RecipeComposer,代码行数:67,代码来源:RecipeAdapter.java

示例11: getView

import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper; //导入方法依赖的package包/类
@Override
public View getView(final int position, View convertView, ViewGroup parent) {

    final ViewHolderItem viewHolder;

    if (convertView == null) {
        LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        convertView = inflater.inflate(R.layout.list_item_recipe_favorite, null);

        viewHolder = new ViewHolderItem();
        viewHolder.recipeFavoriteTitle = (TextView) convertView.findViewById(R.id.recipeFavoriteTitleTextView);
        viewHolder.recipeFavoriteIngredients = (TextView) convertView.findViewById(R.id.recipeFavoriteIngredientsTextView);
        viewHolder.recipeFavoriteURL = (TextView) convertView.findViewById(R.id.recipeFavoriteUrlTextView);
        viewHolder.recipeFavoritePicImageView = (ImageView) convertView.findViewById(R.id.recipeFavoriteImageView);

        // store the holder with the view
        convertView.setTag(viewHolder);
    } else {
        viewHolder = (ViewHolderItem) convertView.getTag();
    }

    // Recipe favorite item based on the position
    Recipe recipe = recipeFavoritesArrayList.get(position);

    // assign values if the ingredient is not null
    if (recipe != null) {
        String recipeURLString;

        viewHolder.recipeFavoriteTitle.setText(recipe.getRecipeTitle());
        viewHolder.recipeFavoriteIngredients.setText(recipe.getRecipeIngredients());

        try {
            URL recipeUrl = new URL(recipe.getRecipeURL());
            recipeURLString = recipeUrl.getHost();
        } catch (MalformedURLException e) {
            Log.d(TAG, "URL parsing error.");
            recipeURLString = "";
        }
        viewHolder.recipeFavoriteURL.setText(recipeURLString);

        UrlImageViewHelper.setUrlDrawable(viewHolder.recipeFavoritePicImageView, recipe.getRecipePicUrl());
    }

    return convertView;
}
 
开发者ID:icebox-creations,项目名称:RecipeComposer,代码行数:46,代码来源:RecipeFavoritesAdapter.java

示例12: loadSafari

import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper; //导入方法依赖的package包/类
private void loadSafari() {
	UrlImageViewHelper.setUrlDrawable((ImageView) this.findViewById(R.id.safari_headerImageView), getString(R.string.base_url) + safari.getHeaderMediaUrl());
	UrlImageViewHelper.setUrlDrawable((ImageView) this.findViewById(R.id.safari_footerImageView), getString(R.string.base_url) + safari.getFooterMediaUrl());
	((TextView)this.findViewById(R.id.safari_descriptionTextView)).setText(safari.getDescription());
}
 
开发者ID:rpkelly,项目名称:tanapa-safari-android,代码行数:6,代码来源:SafariActivity.java

示例13: onCreate

import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper; //导入方法依赖的package包/类
protected void onCreate(Bundle savedInstanceState){
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_poi);
	
	Intent intent = getIntent();
	
	ImageView imageView = (ImageView) findViewById(R.id.POI_imageView);
	
	UrlImageViewHelper.setUrlDrawable(imageView, 
			getString(R.string.base_url) + intent.getStringExtra("mediaUrl"));
		
}
 
开发者ID:rpkelly,项目名称:tanapa-safari-android,代码行数:13,代码来源:POIActivity.java


注:本文中的com.koushikdutta.urlimageviewhelper.UrlImageViewHelper.setUrlDrawable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。