当前位置: 首页>>代码示例>>Java>>正文


Java RequestOptions.centerCrop方法代码示例

本文整理汇总了Java中com.bumptech.glide.request.RequestOptions.centerCrop方法的典型用法代码示例。如果您正苦于以下问题:Java RequestOptions.centerCrop方法的具体用法?Java RequestOptions.centerCrop怎么用?Java RequestOptions.centerCrop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.bumptech.glide.request.RequestOptions的用法示例。


在下文中一共展示了RequestOptions.centerCrop方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: loadImageViewCrop

import com.bumptech.glide.request.RequestOptions; //导入方法依赖的package包/类
/**
 * api提供了比如:centerCrop()、fitCenter()等
 */

//设置动态转换
public static void loadImageViewCrop(Context mContext, String path, ImageView mImageView) {

    RequestOptions options = new RequestOptions();
    final RequestOptions requestOptions = options.centerCrop();
    Glide.with(mContext).load(path).apply(requestOptions).into(mImageView);
}
 
开发者ID:zhangYanGitHub,项目名称:model_master,代码行数:12,代码来源:GlideUtil.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: 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

示例5: squareThumb

import com.bumptech.glide.request.RequestOptions; //导入方法依赖的package包/类
@GlideOption
public static RequestOptions squareThumb(RequestOptions requestOptions) {
  return requestOptions.centerCrop();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:ExtensionWithOption.java

示例6: test

import com.bumptech.glide.request.RequestOptions; //导入方法依赖的package包/类
@GlideOption(memoizeStaticMethod = true)
public static void test(RequestOptions requestOptions) {
  requestOptions.centerCrop();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:Extension.java

示例7: test

import com.bumptech.glide.request.RequestOptions; //导入方法依赖的package包/类
@GlideOption(staticMethodName = "testSomething")
public static void test(RequestOptions requestOptions) {
  requestOptions.centerCrop();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:Extension.java

示例8: centerCrop

import com.bumptech.glide.request.RequestOptions; //导入方法依赖的package包/类
@GlideOption(override = GlideOption.OVERRIDE_EXTEND)
public static void centerCrop(RequestOptions requestOptions) {
  requestOptions.centerCrop();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:Extension.java

示例9: test

import com.bumptech.glide.request.RequestOptions; //导入方法依赖的package包/类
@GlideOption(skipStaticMethod = true)
public static void test(RequestOptions requestOptions) {
  requestOptions.centerCrop();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:Extension.java

示例10: centerCrop

import com.bumptech.glide.request.RequestOptions; //导入方法依赖的package包/类
@GlideOption(override = GlideOption.OVERRIDE_REPLACE)
public static void centerCrop(RequestOptions requestOptions) {
  requestOptions.centerCrop();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:Extension.java

示例11: squareThumb

import com.bumptech.glide.request.RequestOptions; //导入方法依赖的package包/类
@GlideOption
public static void squareThumb(RequestOptions requestOptions) {
  requestOptions.centerCrop();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:ExtensionWithOption.java

示例12: test

import com.bumptech.glide.request.RequestOptions; //导入方法依赖的package包/类
@GlideOption(memoizeStaticMethod = true)
public static RequestOptions test(RequestOptions requestOptions) {
  return requestOptions.centerCrop();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:Extension.java

示例13: test

import com.bumptech.glide.request.RequestOptions; //导入方法依赖的package包/类
@GlideOption(staticMethodName = "testSomething")
public static RequestOptions test(RequestOptions requestOptions) {
  return requestOptions.centerCrop();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:Extension.java

示例14: centerCrop

import com.bumptech.glide.request.RequestOptions; //导入方法依赖的package包/类
@GlideOption(override = GlideOption.OVERRIDE_EXTEND)
public static RequestOptions centerCrop(RequestOptions requestOptions) {
  return requestOptions.centerCrop();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:Extension.java

示例15: test

import com.bumptech.glide.request.RequestOptions; //导入方法依赖的package包/类
@GlideOption(skipStaticMethod = true)
public static RequestOptions test(RequestOptions requestOptions) {
  return requestOptions.centerCrop();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:Extension.java


注:本文中的com.bumptech.glide.request.RequestOptions.centerCrop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。