當前位置: 首頁>>代碼示例>>Java>>正文


Java SimpleDraweeView類代碼示例

本文整理匯總了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);
}
 
開發者ID:gitxuyulin,項目名稱:EditorImageAndText,代碼行數:21,代碼來源:PostActivity.java

示例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, "已添加到購物車");
            }
        });
    }

}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:23,代碼來源:HWAdatper.java

示例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);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:17,代碼來源:ImageFormatOverrideExample.java

示例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);
    }
  });
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:22,代碼來源:ImageFormatKeyframesFragment.java

示例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);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:27,代碼來源:WelcomeFragment.java

示例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);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:19,代碼來源:MediaVariationsFragment.java

示例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);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:17,代碼來源:DraweeRoundedCornersFragment.java

示例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));
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:21,代碼來源:ImageDetailsActivity.java

示例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);
    }
  });
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:18,代碼來源:DraweeTransitionFragment.java

示例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);
}
 
開發者ID:6ag,項目名稱:LiuAGeAndroid,代碼行數:28,代碼來源:UserInfoActivity.java

示例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);
    }
}
 
開發者ID:malah-code,項目名稱:Open-Quran-Radio,代碼行數:24,代碼來源:MainActivity.java

示例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;
}
 
開發者ID:sciage,項目名稱:FinalProject,代碼行數:25,代碼來源:CommunityGroupFragment.java

示例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);
        }
 
開發者ID:Elbehiry,項目名稱:Viajes,代碼行數:9,代碼來源:HotelDataAdapter.java

示例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);
}
 
開發者ID:senierr,項目名稱:ModuleFrame,代碼行數:25,代碼來源:FrescoUtil.java

示例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");
    }
}
 
開發者ID:xiaoyaoyou1212,項目名稱:XSnow,代碼行數:20,代碼來源:FrescoLoader.java


注:本文中的com.facebook.drawee.view.SimpleDraweeView類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。