• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DynamicHeightImageView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.etsy.android.grid.util.DynamicHeightImageView的典型用法代码示例。如果您正苦于以下问题:Java DynamicHeightImageView类的具体用法?Java DynamicHeightImageView怎么用?Java DynamicHeightImageView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DynamicHeightImageView类属于com.etsy.android.grid.util包,在下文中一共展示了DynamicHeightImageView类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getView

import com.etsy.android.grid.util.DynamicHeightImageView; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder vh;
    if (convertView==null)
    {
        convertView=LayoutInflater.from(context).inflate(R.layout.fragment_category_list_item,parent,false);
        vh=new ViewHolder();
        vh.imageView= (DynamicHeightImageView) convertView.findViewById(R.id.imageViewCategory);
        vh.txtLineOne=(TextView) convertView.findViewById(R.id.textViewCategory);
        vh.layers= (LayerDrawable) this.context.getResources().getDrawable(R.drawable.white_layer_list);
        vh.shape=(GradientDrawable)vh.layers.findDrawableByLayerId(R.id.layerListItem);
        convertView.setTag(vh);
    }
    else {
        vh=(ViewHolder) convertView.getTag();
    }
    double positionHeight=getPositionRatio(position);
    vh.imageView.setHeightRatio(positionHeight);
    vh.imageView.setImageResource(this.categoryIcons.getResourceId(position,0));
    vh.shape.mutate();try {
        vh.shape.setColor(Color.parseColor(this.categoryColors[position]));
    }
    catch (Exception e){e.printStackTrace();}
    if(Build.VERSION.SDK_INT<16)
    {
        convertView.setBackgroundDrawable(vh.shape);
    }
    else
    {
        convertView.setBackground(vh.shape);
    }
    vh.txtLineOne.setTypeface(this.font);
    vh.txtLineOne.setText(this.categoryNames[position]);

    return convertView;
}
 
开发者ID:rishabh115,项目名称:Odyssey2017,代码行数:37,代码来源:CategoryAdapter.java


示例2: getView

import com.etsy.android.grid.util.DynamicHeightImageView; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
	StaggeredViewHolder holder;
	if( convertView == null ) {
		convertView = LayoutInflater.from(getContext()).inflate( R.layout.view_staggered_item, parent, false );
		holder = new StaggeredViewHolder();
		holder.imageView = (DynamicHeightImageView) convertView.findViewById( R.id.dynamic_image_view );
		holder.titleTextView = (TextView) convertView.findViewById( R.id.title_text_view );
		holder.subtitleTextView = (TextView) convertView.findViewById( R.id.subtitle_text_view );
		convertView.setTag( holder );
	} else {
		holder = (StaggeredViewHolder) convertView.getTag();
	}

	Picasso.with(getContext())
			.load( getItem( position ).getUrl() )
			.into( holder.imageView );

	holder.titleTextView.setText( getItem( position ).getTitle() );
	holder.subtitleTextView.setText( getItem( position ).getSubtitle() );
	holder.imageView.setHeightRatio( getItem( position ).getRatio() );

	final String itemText = holder.titleTextView.getText().toString();
	convertView.setOnClickListener( new View.OnClickListener() {
		@Override
		public void onClick(View view) {
			Toast.makeText( getContext(), itemText, Toast.LENGTH_SHORT ).show();
		}
	});

	return convertView;
}
 
开发者ID:Lakkichand,项目名称:AndroidDemoProjects,代码行数:33,代码来源:StaggeredGridAdapter.java


示例3: getView

import com.etsy.android.grid.util.DynamicHeightImageView; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder viewHolder;

    if (convertView == null) {
        convertView = mInflater.inflate(R.layout.day1_list_item_simple, parent, false);
        viewHolder = new ViewHolder();
        viewHolder.imageView =
                (DynamicHeightImageView) convertView.findViewById(R.id.image_view);

        convertView.setTag(viewHolder);
    }
    else {
        viewHolder = (ViewHolder) convertView.getTag();
    }

    double positionHeight = getPositionRatio(position);

    viewHolder.imageView.setHeightRatio(positionHeight);

    String path = getItem(position);
    Picasso.with(mContext)
            .load(path)
            .error(R.drawable.ic_launcher)
            .placeholder(R.drawable.ic_launcher)
            .into(viewHolder.imageView);


    return convertView;
}
 
开发者ID:Phonbopit,项目名称:30-android-libraries-in-30-days,代码行数:31,代码来源:CustomAdapter.java


示例4: getView

import com.etsy.android.grid.util.DynamicHeightImageView; //导入依赖的package包/类
public View getView(int position, View convertView, ViewGroup parent) {

LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

View gridView;
ViewHolder vh;

if (convertView == null) {



gridView = new View(context);
gridView = inflater.inflate(R.layout.home_grid, null);

LinearLayout addon_bg = (LinearLayout) gridView .findViewById(R.id.home_addon_bg);
ImageView addon_img = (ImageView) gridView .findViewById(R.id.home_addon_item);
TextView textView = (TextView) gridView.findViewById(R.id.home_addon_label);


String pkg = services.get(position).get(KEY_PKG);
try{

if(helper.get_Addon_isInstalled(pkg).equals("YES"))
{
Resources rc = getActivity().getPackageManager().getResourcesForApplication(pkg);
addon_bg.setBackgroundDrawable(rc.getDrawable(rc.getIdentifier(pkg+":drawable/bg_addon","drawable", null)));
//addon_img.setImageDrawable(rc.getDrawable(rc.getIdentifier(pkg+":drawable/ic_addon","drawable", null)));
//textView.setText(rc.getString(rc.getIdentifier(pkg+":string/addon_name","string", null)));
}
else
{
	addon_bg.setBackgroundColor(Color.parseColor("#616f69"));
	addon_bg.setAlpha((float) 0.8);
}

Bitmap bm = BitmapFactory.decodeByteArray(helper.get_Addon_img(pkg), 0, helper.get_Addon_img(pkg).length);
addon_img.setImageBitmap(bm);
textView.setText(helper.get_Addon_txt(pkg));
}catch(NameNotFoundException e)
{      	 
}


vh = new ViewHolder();
vh.imgView = (DynamicHeightImageView) gridView.findViewById(R.id.home_addon_item);
gridView.setTag(vh);


} else {
gridView = (View) convertView;
vh = (ViewHolder) gridView.getTag();
}

double positionHeight = getPositionRatio(position);
vh.imgView.setHeightRatio(positionHeight);

return gridView;
}
 
开发者ID:lethalskillzz,项目名称:Mimix-Client,代码行数:59,代码来源:Addon_Fragment.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CookieSerializer类代码示例发布时间:2022-05-23
下一篇:
Java ParserInterpreter类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap