本文整理汇总了Java中com.facebook.drawee.view.SimpleDraweeView类的典型用法代码示例。如果您正苦于以下问题:Java SimpleDraweeView类的具体用法?Java SimpleDraweeView怎么用?Java SimpleDraweeView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SimpleDraweeView类属于com.facebook.drawee.view包,在下文中一共展示了SimpleDraweeView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initViews
import com.facebook.drawee.view.SimpleDraweeView; //导入依赖的package包/类
@Override
public void initViews() {
post_recycler = (RecyclerView) findViewById(R.id.post_recycler);
text_quit = (TextView) findViewById(R.id.text_quit);
text_save = (TextView) findViewById(R.id.text_save);
text_send = (TextView) findViewById(R.id.text_send);
headView = LayoutInflater.from(this).inflate(R.layout.beegree_post_head_view, null);
footView = LayoutInflater.from(this).inflate(R.layout.beegree_post_foot_view, null);
image_cover_button = (ImageView) headView.findViewById(R.id.image_cover_button);
edit_title = (EditText) headView.findViewById(R.id.edit_title);
edit_title_place = (EditText) headView.findViewById(R.id.edit_title_place);
post_header = (RelativeLayout) headView.findViewById(R.id.post_header);
image_cover = (SimpleDraweeView) headView.findViewById(R.id.image_cover);
image_set_cover = (ImageView) headView.findViewById(R.id.image_set_cover);
image_delete_cover = (ImageView) headView.findViewById(R.id.image_delete_cover);
adapter = new MyAdapter(PostActivity.this, this);
linearLayoutManager = new LinearLayoutManager(this);
edit_title.setOnClickListener(this);
edit_title_place.setOnClickListener(this);
}
示例2: convert
import com.facebook.drawee.view.SimpleDraweeView; //导入依赖的package包/类
@Override
protected void convert(BaseViewHolder viewHolder, final Wares wares) {
SimpleDraweeView draweeView = (SimpleDraweeView) viewHolder.getView(R.id.drawee_view);
draweeView.setImageURI(Uri.parse(wares.getImgUrl()));
viewHolder.getTextView(R.id.text_title).setText(wares.getName());
viewHolder.getTextView(R.id.text_price).setText("¥ "+wares.getPrice());
Button button =viewHolder.getButton(R.id.btn_add);
if(button !=null) {
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
provider.put(wares);
ToastUtils.show(context, "已添加到购物车");
}
});
}
}
示例3: onViewCreated
import com.facebook.drawee.view.SimpleDraweeView; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) view.findViewById(R.id.drawee_view);
ImageDecodeOptions imageDecodeOptionsWithCustomDecoder = new ImageDecodeOptionsBuilder()
.setCustomImageDecoder(CUSTOM_COLOR_DECODER)
.build();
AbstractDraweeController controller = Fresco.newDraweeControllerBuilder()
.setImageRequest(
ImageRequestBuilder.newBuilderWithResourceId(R.raw.custom_color1)
.setImageDecodeOptions(imageDecodeOptionsWithCustomDecoder)
.build())
.build();
simpleDraweeView.setController(controller);
}
示例4: initAnimation
import com.facebook.drawee.view.SimpleDraweeView; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.HONEYCOMB)
private void initAnimation(View view) {
mSimpleDraweeView = (SimpleDraweeView) view.findViewById(R.id.drawee_view);
mSimpleDraweeView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setOldController(mSimpleDraweeView.getController())
.setUri(URI_KEYFRAMES_ANIMATION)
.setAutoPlayAnimations(true)
.build();
mSimpleDraweeView.setController(controller);
final SwitchCompat switchBackground = (SwitchCompat) view.findViewById(R.id.switch_background);
switchBackground.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mSimpleDraweeView.getHierarchy().setBackgroundImage(isChecked
? new CheckerBoardDrawable(getResources())
: null);
}
});
}
示例5: onViewCreated
import com.facebook.drawee.view.SimpleDraweeView; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
final SimpleDraweeView draweeView = (SimpleDraweeView) view.findViewById(R.id.drawee_view);
draweeView.setActualImageResource(R.drawable.logo);
draweeView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final RotateAnimation rotateAnimation = new RotateAnimation(
0,
360,
Animation.RELATIVE_TO_SELF,
0.5f,
Animation.RELATIVE_TO_SELF,
0.5f);
rotateAnimation.setDuration(1000);
rotateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
draweeView.startAnimation(rotateAnimation);
}
});
final Button buttonGitHub = (Button) view.findViewById(R.id.button_github);
setUriIntent(buttonGitHub, URL_GITHUB);
final Button buttonDocumentation = (Button) view.findViewById(R.id.button_documentation);
setUriIntent(buttonDocumentation, URL_DOCUMENTATION);
}
示例6: loadThumb
import com.facebook.drawee.view.SimpleDraweeView; //导入依赖的package包/类
private void loadThumb(
SimpleDraweeView draweeView,
Size size,
ImageRequest.RequestLevel requestLevel) {
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(size.uri)
.setMediaVariations(MediaVariations.newBuilderForMediaId(MEDIA_ID)
.setForceRequestForSpecifiedUri(true)
.build())
.setLowestPermittedRequestLevel(requestLevel)
.setResizeOptions(new ResizeOptions(draweeView.getWidth(), draweeView.getHeight()))
.setCacheChoice(size.cacheChoice)
.build();
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setImageRequest(request)
.setOldController(draweeView.getController())
.build();
draweeView.setController(controller);
}
示例7: changeDraweeViewScaleType
import com.facebook.drawee.view.SimpleDraweeView; //导入依赖的package包/类
private void changeDraweeViewScaleType(
SimpleDraweeView draweeView,
ScaleType scaleType,
@Nullable PointF focusPoint) {
final GenericDraweeHierarchy hierarchy = draweeView.getHierarchy();
hierarchy.setActualImageScaleType(scaleType);
hierarchy.setActualImageFocusPoint(focusPoint != null ? focusPoint : new PointF(0.5f, 0.5f));
final RoundingParams roundingParams = Preconditions.checkNotNull(hierarchy.getRoundingParams());
if (BITMAP_ONLY_SCALETYPES.contains(scaleType)) {
roundingParams.setRoundingMethod(RoundingParams.RoundingMethod.BITMAP_ONLY);
} else {
roundingParams.setOverlayColor(mWindowBackgroundColor);
}
hierarchy.setRoundingParams(roundingParams);
}
示例8: onCreate
import com.facebook.drawee.view.SimpleDraweeView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_drawee_transition_detail);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) findViewById(R.id.image);
simpleDraweeView.setImageURI(getIntent().getData());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().setSharedElementEnterTransition(DraweeTransition.createTransitionSet(
ScalingUtils.ScaleType.CENTER_CROP, ScalingUtils.ScaleType.FIT_CENTER));
getWindow().setSharedElementReturnTransition(DraweeTransition.createTransitionSet(
ScalingUtils.ScaleType.FIT_CENTER, ScalingUtils.ScaleType.CENTER_CROP));
}
}
示例9: onViewCreated
import com.facebook.drawee.view.SimpleDraweeView; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
final ImageUriProvider imageUriProvider = ImageUriProvider.getInstance(getContext());
final Uri imageUri = imageUriProvider.createSampleUri(ImageUriProvider.ImageSize.M);
final SimpleDraweeView simpleDraweeView =
(SimpleDraweeView) view.findViewById(R.id.drawee_view);
// You have to enable legacy visibility handling for the start view in order for this to work
simpleDraweeView.setLegacyVisibilityHandlingEnabled(true);
simpleDraweeView.setImageURI(imageUri);
simpleDraweeView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startTransition(v, imageUri);
}
});
}
示例10: prepareUI
import com.facebook.drawee.view.SimpleDraweeView; //导入依赖的package包/类
/**
* 准备UI
*/
private void prepareUI() {
mNavigationViewRed = (NavigationViewPush) findViewById(R.id.nav_user_info);
mPortraitImageView = (SimpleDraweeView) findViewById(R.id.sdv_user_info_portrait);
mUsernameTextView = (TextView) findViewById(R.id.tv_user_info_username);
mGroupNameTextView = (TextView) findViewById(R.id.tv_user_info_groupname);
mPointsTextView = (TextView) findViewById(R.id.tv_user_info_points);
mModifyInfoLayout = findViewById(R.id.rl_user_info_modify_info_layout);
mModifySafeInfoLayout = findViewById(R.id.rl_user_info_modify_safe_info_layout);
mRegisterTimeTextView = (TextView) findViewById(R.id.tv_user_info_registertime);
mMyPointsTextView = (TextView) findViewById(R.id.tv_user_info_mypoints);
mMyGroupNameTextView = (TextView) findViewById(R.id.tv_user_info_mygroupname);
mLogoutButton = (Button) findViewById(R.id.btn_user_info_logout);
mNavigationViewRed.setupNavigationView(true, false, "我的资料", new NavigationViewPush.OnClickListener() {
@Override
public void onBackClick(View v) {
finish();
}
});
mModifyInfoLayout.setOnClickListener(this);
mModifySafeInfoLayout.setOnClickListener(this);
mLogoutButton.setOnClickListener(this);
}
示例11: fillUserProfileData
import com.facebook.drawee.view.SimpleDraweeView; //导入依赖的package包/类
private void fillUserProfileData() {
SimpleDraweeView imageView = (SimpleDraweeView) navigationView.getHeaderView(0).findViewById(R.id.imageView);
TextView txtUserProfileName = (TextView) navigationView.getHeaderView(0).findViewById(R.id.txtUserProfileName);
TextView txtProfileEmail = (TextView) navigationView.getHeaderView(0).findViewById(R.id.txtProfileEmail);
// Check if user is signed in (non-null) and update UI accordingly.
FirebaseUser currentUser = mAuth.getCurrentUser();
// Name, email address, and profile photo Url
txtUserProfileName.setText(currentUser.getDisplayName());
txtProfileEmail.setText(currentUser.getEmail());
Uri photoUrl = currentUser.getPhotoUrl();
//set round icon
if (photoUrl != null) {
int color = ContextCompat.getColor(this, R.color.colorPrimary);
RoundingParams roundingParams = RoundingParams.fromCornersRadius(5f);
roundingParams.setBorder(color, 1.0f);
roundingParams.setRoundAsCircle(true);
imageView.getHierarchy().setRoundingParams(roundingParams);
imageView.setImageURI(photoUrl);//.setImageBitmap(stationImageSmall);
}
}
示例12: getView
import com.facebook.drawee.view.SimpleDraweeView; //导入依赖的package包/类
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = getLayoutInflater().inflate(R.layout.swipe_card, parent, false);
}
SimpleDraweeView imageView = (SimpleDraweeView) convertView.findViewById(R.id.community_group_image);
TextView textViewCard = (TextView) convertView.findViewById(R.id.textViewCard);
TextView members_in_group = (TextView) convertView.findViewById(R.id.members_in_group);
TextView group_tags_01 = (TextView) convertView.findViewById(R.id.group_tags_01);
TextView group_tags_02 = (TextView) convertView.findViewById(R.id.group_tags_02);
TextView group_tags_03 = (TextView) convertView.findViewById(R.id.group_tags_03);
TextView group_details = (TextView) convertView.findViewById(R.id.group_details);
group_tags_01.setText(mData.get(position).getCategoryName());
group_details.setText(mData.get(position).getGroup_description());
textViewCard.setText(mData.get(position).getGroupName());
members_in_group.setText(String.valueOf(mData.get(position).getGroup_members_joined() + " " + "members" + " " +
mData.get(position).getGroup_posts_inside() + " " + "posts"));
imageView.setImageURI(mData.get(position).getGroup_image_url());
imageView.setBackground(getResources().getDrawable(R.drawable.gradient_bg));
return convertView;
}
示例13: ItemViewHolder
import com.facebook.drawee.view.SimpleDraweeView; //导入依赖的package包/类
public ItemViewHolder(View itemView) {
super(itemView);
hotelName = (TextView) itemView.findViewById(R.id.hotel_name);
hotelPrice = (TextView) itemView.findViewById(R.id.price_text);
hotelImage = (SimpleDraweeView) itemView.findViewById(R.id.hotel_image);
hotelFavourite = (LikeButton) itemView.findViewById(R.id.post_Favourite);
// cardView = (CardView) itemView.findViewById(R.id.card_item);
}
示例14: into
import com.facebook.drawee.view.SimpleDraweeView; //导入依赖的package包/类
/**
* 指定控件
*
* @param simpleDraweeView
*/
public void into(@NonNull SimpleDraweeView simpleDraweeView) {
ImageRequestBuilder imageRequestBuilder = ImageRequestBuilder.newBuilderWithSource(uri);
if (resizeOptions != null) {
imageRequestBuilder.setResizeOptions(resizeOptions);
}
if (postprocessor != null) {
imageRequestBuilder.setPostprocessor(postprocessor);
}
if (priority != null) {
imageRequestBuilder.setRequestPriority(priority);
}
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setImageRequest(imageRequestBuilder.build())
.setOldController(simpleDraweeView.getController())
.build();
simpleDraweeView.setController(controller);
}
示例15: load
import com.facebook.drawee.view.SimpleDraweeView; //导入依赖的package包/类
private void load(ImageView target, Uri uri, Options options) {
if (target == null) {
throw new NullPointerException("this imageView is null.");
}
if (options == null) options = Options.defaultOptions();
if (target instanceof SimpleDraweeView) {
ViseLog.i("Fresco Load SimpleDraweeView Path:" + uri.getPath());
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) target;
simpleDraweeView.setImageURI(uri);
if (options.loadingResId != Options.RES_NONE) {
simpleDraweeView.getHierarchy().setPlaceholderImage(options.loadingResId);
}
if (options.loadErrorResId != Options.RES_NONE) {
simpleDraweeView.getHierarchy().setFailureImage(options.loadErrorResId);
}
} else {
ViseLog.e("Fresco Load ImageView must be SimpleDraweeView");
}
}