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


Java RequestOptions.error方法代碼示例

本文整理匯總了Java中com.bumptech.glide.request.RequestOptions.error方法的典型用法代碼示例。如果您正苦於以下問題:Java RequestOptions.error方法的具體用法?Java RequestOptions.error怎麽用?Java RequestOptions.error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.bumptech.glide.request.RequestOptions的用法示例。


在下文中一共展示了RequestOptions.error方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setupGlideOptions

import com.bumptech.glide.request.RequestOptions; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void setupGlideOptions() {
   	options = new RequestOptions();
   	int size;
   	
   	if (isShapeCircle) {
   		if (Defaults.CIRCLE_RADIUS > 0) {
   			size = (int) (0.65 * Defaults.IMAGE_HEIGHT);
   			options.transforms(new CenterCrop(), new RoundedCorners(Defaults.CIRCLE_RADIUS));
   			
   		} else { 
   			size = Defaults.IMAGE_HEIGHT;
   			options.circleCrop();
   		}
   		
   	} else {
   		size = (int) (0.65 * Defaults.IMAGE_HEIGHT); 
   	}
   	
   	options.override(size, size);
   	options.error(error_image);
   	options.priority(Priority.HIGH);
   }
 
開發者ID:prashantsaini1,項目名稱:titanium-android-imagepicker,代碼行數:24,代碼來源:ImagePickerActivity.java

示例2: onCreate

import com.bumptech.glide.request.RequestOptions; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_edit_intake);
    ButterKnife.bind(this);
    //setSupportActionBar(toolbar);
    intakeID = getIntent().getLongExtra("intakeID",-1);
    intakeMoment  = DataSupport.find(IntakeMoment.class,intakeID);
    medicine = DataSupport.find(Medicine.class,intakeMoment.getMedicineId());

    RequestOptions requestOptions = new RequestOptions();
    requestOptions.placeholder(R.drawable.pill_placeholder);
    requestOptions.error(R.drawable.pill_placeholder);
    requestOptions.centerCrop();
    String image_path= medicine.getImage();

    Glide.with(this).setDefaultRequestOptions(requestOptions).load(image_path).into(imageView);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    getSupportActionBar().setTitle(medicine.getName());
    imageView.setBackgroundColor(getResources().getColor(R.color.grey));

    time_text.setText(String.format("%02d:%02d", intakeMoment.getStartDate().getHours(),intakeMoment.getStartDate().getMinutes()));
    seekBar.setProgress(intakeMoment.getQuantity());
}
 
開發者ID:jcolladosp,項目名稱:ePills,代碼行數:27,代碼來源:EditIntakeActivity.java

示例3: onBindViewHolder

import com.bumptech.glide.request.RequestOptions; //導入方法依賴的package包/類
@Override
public void onBindViewHolder(final MyViewHolder holder, int position) {
    final IntakeMoment intakeMoment = pillList.get(position);

    String info_pill = mContext.getString(R.string.pill_info_card,String.valueOf(intakeMoment.getQuantity()) ,
            String.valueOf(intakeMoment.getStartDate().getHours()),
            String.format("%02d",  intakeMoment.getStartDate().getMinutes()));


    holder.title.setText(intakeMoment.getMedicine().getName());
    holder.count.setText(info_pill);

    // loading album cover using Glide library
    RequestOptions requestOptions = new RequestOptions();
    requestOptions.placeholder(R.drawable.pill_placeholder);
    requestOptions.error(R.drawable.pill_placeholder);
    requestOptions.centerCrop();
    String image_path= intakeMoment.getMedicine().getImage();

    Glide.with(mContext).setDefaultRequestOptions(requestOptions).load(image_path).into(holder.thumbnail);


    holder.cardViewPill.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent i = new Intent(mContext,EditIntakeActivity.class);
            i.putExtra("intakeID", intakeMoment.getId());
            mContext.startActivity(i);
        }
    });
}
 
開發者ID:jcolladosp,項目名稱:ePills,代碼行數:32,代碼來源:PillCardAdapter.java

示例4: setImageUrl

import com.bumptech.glide.request.RequestOptions; //導入方法依賴的package包/類
/**
 * Reference : https://medium.com/fueled-android/data-binding-adapter-write-bind-repeat-50e9c64fe806
 * Bind Glide with an ImageView.
 *
 * @param view        the ImageView to bind to Glide.
 * @param src         The URL of the image to load.
 * @param placeholder The placeholder icon.
 * @param error       The error icon.
 * @param blurValue   The blur radius value between 1 and 25.
 * @param cropCircle  Crop the image in a circle of not.
 */
@SuppressWarnings("unchecked")
@android.databinding.BindingAdapter(value = {"src", "placeholder", "error", "blur", "cropCircle"},
        requireAll = false)
public void setImageUrl(ImageView view, String src, Drawable placeholder, Drawable error,
                        int blurValue, boolean cropCircle) {

    Context ctx = view.getContext();
    RequestOptions options = new RequestOptions();

    RequestBuilder<Drawable> glideBuilder = requestManager.load(src);


    if (placeholder != null) {
        options.placeholder(placeholder);
    }

    if (error != null) {
        options.error(error);
    }

    if (blurValue > 0) {
        options.transform(new BlurTransformation(ctx, blurValue));
    }

    if (cropCircle) {
        options.circleCrop();
    }

    glideBuilder
            .apply(options)
            .into(view);
}
 
開發者ID:ragdroid,項目名稱:Dahaka,代碼行數:44,代碼來源:BindingAdapter.java

示例5: GlideManager

import com.bumptech.glide.request.RequestOptions; //導入方法依賴的package包/類
public GlideManager(Builder builder){
    RequestOptions options = new RequestOptions()
            .placeholder(builder.placeresid);

    if (builder.eroorresid != 0){
        options.error(builder.eroorresid);
    }


    switch (builder.type){
        case BITMAP_SCAN_CENTERN:
            options.centerCrop();
            break;
        case BITMAP_SCAN_FIT:
            options.fitCenter();
            break;
        default:
            break;
    }
    if (builder.setCircleCrop){
        options.circleCrop();
    }
    if (builder.radius != 0){
        options.transform(new RoundedCorners(builder.radius));
    }

    RequestBuilder requestBuilder = null;

    requestBuilder = Glide.with(builder.context).load(builder.source);

    if (builder.animtime > 0){
        requestBuilder.transition(new DrawableTransitionOptions().crossFade(builder.animtime));
    }

    requestBuilder.apply(options)
            .listener(new LoadListener())
            .into(builder.imageView);


}
 
開發者ID:LillteZheng,項目名稱:ViewPagerHelper,代碼行數:41,代碼來源:GlideManager.java


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