本文整理汇总了Java中android.support.v7.widget.AppCompatImageView.setScaleType方法的典型用法代码示例。如果您正苦于以下问题:Java AppCompatImageView.setScaleType方法的具体用法?Java AppCompatImageView.setScaleType怎么用?Java AppCompatImageView.setScaleType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.AppCompatImageView
的用法示例。
在下文中一共展示了AppCompatImageView.setScaleType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showThumbnail
import android.support.v7.widget.AppCompatImageView; //导入方法依赖的package包/类
@Override
public View showThumbnail(BigImageView parent, Uri thumbnail, int scaleType) {
AppCompatImageView thumbnailView = (AppCompatImageView) LayoutInflater.from(parent.getContext())
.inflate(R.layout.ui_glide_thumbnail, parent, false);
switch (scaleType) {
case BigImageView.INIT_SCALE_TYPE_CENTER_CROP:
thumbnailView.setScaleType(ImageView.ScaleType.CENTER_CROP);
break;
case BigImageView.INIT_SCALE_TYPE_CENTER_INSIDE:
thumbnailView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
break;
case BigImageView.INIT_SCALE_TYPE_START:
thumbnailView.setScaleType(ImageView.ScaleType.FIT_START);
break;
default:
break;
}
mRequestManager
.load(thumbnail)
.into(thumbnailView);
return thumbnailView;
}
示例2: onCreateViewHolder
import android.support.v7.widget.AppCompatImageView; //导入方法依赖的package包/类
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
AppCompatImageView img = new AppCompatImageView(parent.getContext());
RecyclerView.LayoutParams params = new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
img.setLayoutParams(params);
img.setId(R.id.rvb_banner_image_view_id);
img.setScaleType(AppCompatImageView.ScaleType.CENTER_CROP);
img.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (onRvBannerClickListener != null) {
onRvBannerClickListener.onClick(currentIndex % mData.size());
}
}
});
return new RecyclerView.ViewHolder(img) {
};
}
示例3: addToolbarItem
import android.support.v7.widget.AppCompatImageView; //导入方法依赖的package包/类
public ImageView addToolbarItem(int viewId, int resourceId,View.OnClickListener clickDelegate) {
AppCompatImageView modAdd = new AppCompatImageView(toolbar.getContext());
if (viewId>0) {
modAdd.setId(viewId);
}
modAdd.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
modAdd.setImageDrawable(ViewUtils.circleIcon(modAdd.getContext(), resourceId));
modAdd.setOnClickListener(clickDelegate);
toolbarLayout.addView(modAdd,toolbarLayout.getChildCount()-1, params);
return modAdd;
}
示例4: intiView
import android.support.v7.widget.AppCompatImageView; //导入方法依赖的package包/类
/**
* Inti view.
*/
protected void intiView() {
exoControlsBack = new AppCompatImageView(getContext());
exoControlsBack.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
int ss = VideoPlayUtils.dip2px(getContext(), 7f);
exoControlsBack.setId(R.id.exo_controls_back);
exoControlsBack.setImageDrawable(ContextCompat.getDrawable(getContext(), icBackImage));
exoControlsBack.setPadding(ss, ss, ss, ss);
FrameLayout frameLayout = playerView.getContentFrameLayout();
frameLayout.setBackgroundColor(ContextCompat.getColor(activity, android.R.color.black));
exoPlayErrorLayout.setVisibility(GONE);
playReplayLayout.setVisibility(GONE);
playBtnHintLayout.setVisibility(GONE);
exoLoadingLayout.setVisibility(GONE);
dialogProLayout.setVisibility(GONE);
exoAudioLayout.setVisibility(GONE);
exoBrightnessLayout.setVisibility(GONE);
exoPlayLockLayout.setVisibility(GONE);
exoPlayLockLayout.setBackgroundColor(Color.TRANSPARENT);
exoLoadingLayout.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.simple_exo_color_33));
exoLoadingLayout.setClickable(true);
frameLayout.addView(exoBrightnessLayout, frameLayout.getChildCount());
frameLayout.addView(exoAudioLayout, frameLayout.getChildCount());
frameLayout.addView(dialogProLayout, frameLayout.getChildCount());
frameLayout.addView(exoPlayErrorLayout, frameLayout.getChildCount());
frameLayout.addView(playReplayLayout, frameLayout.getChildCount());
frameLayout.addView(playBtnHintLayout, frameLayout.getChildCount());
frameLayout.addView(exoLoadingLayout, frameLayout.getChildCount());
frameLayout.addView(exoPlayLockLayout, frameLayout.getChildCount());
if (exoPlayPreviewLayout != null) {
frameLayout.addView(exoPlayPreviewLayout, frameLayout.getChildCount());
}
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(VideoPlayUtils.dip2px(getContext(), 35f), VideoPlayUtils.dip2px(getContext(), 35f));
frameLayout.addView(exoControlsBack, frameLayout.getChildCount(), layoutParams);
exoPlayWatermark = (ImageView) playerView.findViewById(R.id.exo_player_watermark);
videoLoadingShowText = (TextView) playerView.findViewById(R.id.exo_loading_show_text);
exoPlayerLockProgress = (ExoDefaultTimeBar) exoPlayLockLayout.findViewById(R.id.exo_player_lock_progress);
lockCheckBox = (AppCompatCheckBox) exoPlayLockLayout.findViewById(R.id.exo_player_lock_btn_id);
exoPreviewBottomImage = (ImageView) playerView.findViewById(R.id.exo_preview_image_bottom);
if (playerView.findViewById(R.id.exo_preview_image) != null) {
exoPreviewImage = (ImageView) playerView.findViewById(R.id.exo_preview_image);
exoPreviewImage.setBackgroundResource(android.R.color.transparent);
} else {
exoPreviewImage = exoPreviewBottomImage;
}
}