本文整理匯總了Java中com.flyco.bannersamples.entity.BannerItem類的典型用法代碼示例。如果您正苦於以下問題:Java BannerItem類的具體用法?Java BannerItem怎麽用?Java BannerItem使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BannerItem類屬於com.flyco.bannersamples.entity包,在下文中一共展示了BannerItem類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreateItemView
import com.flyco.bannersamples.entity.BannerItem; //導入依賴的package包/類
@Override
public View onCreateItemView(int position) {
View inflate = View.inflate(context, R.layout.adapter_simple_image, null);
ImageView iv = ViewFindUtils.find(inflate, R.id.iv);
final BannerItem item = list.get(position);
int itemWidth = dm.widthPixels;
int itemHeight = (int) (itemWidth * 360 * 1.0f / 640);
iv.setScaleType(ImageView.ScaleType.CENTER_CROP);
iv.setLayoutParams(new LinearLayout.LayoutParams(itemWidth, itemHeight));
String imgUrl = item.imgUrl;
if (!TextUtils.isEmpty(imgUrl)) {
Glide.with(context)
.load(imgUrl)
.override(itemWidth, itemHeight)
.centerCrop()
.placeholder(colorDrawable)
.into(iv);
} else {
iv.setImageDrawable(colorDrawable);
}
return inflate;
}
示例2: onCreateItemView
import com.flyco.bannersamples.entity.BannerItem; //導入依賴的package包/類
@Override
public View onCreateItemView(int position) {
View inflate = View.inflate(mContext, R.layout.adapter_simple_image, null);
ImageView iv = ViewFindUtils.find(inflate, R.id.iv);
final BannerItem item = mDatas.get(position);
int itemWidth = mDisplayMetrics.widthPixels;
int itemHeight = (int) (itemWidth * 360 * 1.0f / 640);
iv.setScaleType(ImageView.ScaleType.CENTER_CROP);
iv.setLayoutParams(new LinearLayout.LayoutParams(itemWidth, itemHeight));
String imgUrl = item.imgUrl;
if (!TextUtils.isEmpty(imgUrl)) {
Glide.with(mContext)
.load(imgUrl)
.override(itemWidth, itemHeight)
.centerCrop()
.placeholder(colorDrawable)
.into(iv);
} else {
iv.setImageDrawable(colorDrawable);
}
return inflate;
}
示例3: getList
import com.flyco.bannersamples.entity.BannerItem; //導入依賴的package包/類
public static ArrayList<BannerItem> getList() {
ArrayList<BannerItem> list = new ArrayList<>();
for (int i = 0; i < urls.length; i++) {
BannerItem item = new BannerItem();
item.imgUrl = urls[i];
item.title = titles[i];
list.add(item);
}
return list;
}
示例4: onTitleSlect
import com.flyco.bannersamples.entity.BannerItem; //導入依賴的package包/類
@Override
public void onTitleSlect(TextView tv, int position) {
final BannerItem item = list.get(position);
tv.setText(item.title);
}
示例5: onTitleSlect
import com.flyco.bannersamples.entity.BannerItem; //導入依賴的package包/類
@Override
public void onTitleSlect(TextView tv, int position) {
final BannerItem item = mDatas.get(position);
tv.setText(item.title);
}