android-glide

Glide: show image with radius corners only on top

时光总嘲笑我的痴心妄想 提交于 2021-02-16 15:53:05
问题 I use Glide. Here snippet: Glide.with(context).load(referenceUrl).into(holder.imageViewPhoto); OK. It's work fine. But I need image to show with radius corners only on TOP. Something like this: Is it possible by Glide? 回答1: You can use : requestOptions.centerInside().transform(new CenterInside(), new GranularRoundedCorners(topLeft, topRight, bottomRight, bottomLeft)) 来源: https://stackoverflow.com/questions/47350973/glide-show-image-with-radius-corners-only-on-top

How to show database image in Glide on Android?

风格不统一 提交于 2021-02-08 05:16:54
问题 I have a SqliteDatabase in my application. In this database, I save Sting and Blob(for save image) . This image is saved in application with byte[ ] . I convert this image to Bitmap with the help of following code: byte[] Recycler_imageByte; Bitmap Recycler_theImage; holder.Recycler_imageByte = data.get(position).getKey_image(); ByteArrayInputStream imageStream = new ByteArrayInputStream(holder.Recycler_imageByte); holder.Recycler_theImage = BitmapFactory.decodeStream(imageStream); I want to

How to show database image in Glide on Android?

断了今生、忘了曾经 提交于 2021-02-08 05:16:33
问题 I have a SqliteDatabase in my application. In this database, I save Sting and Blob(for save image) . This image is saved in application with byte[ ] . I convert this image to Bitmap with the help of following code: byte[] Recycler_imageByte; Bitmap Recycler_theImage; holder.Recycler_imageByte = data.get(position).getKey_image(); ByteArrayInputStream imageStream = new ByteArrayInputStream(holder.Recycler_imageByte); holder.Recycler_theImage = BitmapFactory.decodeStream(imageStream); I want to

How to add authorization in header by Glide in Android Studio?

大城市里の小女人 提交于 2021-02-07 14:24:16
问题 I am using Glide version = 4.7.1 I have no idea how to authenticate an image by glide. This code is what I did. I created: private static final String AUTHORIZATION = "ss-id=doa3cx8OV3aGLThRrpnh;"; private static final String ABC = "application/json"; public static GlideUrl getUrlWithHeaders(String url){ return new GlideUrl(url, new LazyHeaders.Builder() .addHeader("Cookie", AUTHORIZATION) .addHeader("Accept", ABC) .build()); } } String s = "http://192.168.1.144/api/download/" + mImageIds.get

How to add authorization in header by Glide in Android Studio?

我怕爱的太早我们不能终老 提交于 2021-02-07 14:21:12
问题 I am using Glide version = 4.7.1 I have no idea how to authenticate an image by glide. This code is what I did. I created: private static final String AUTHORIZATION = "ss-id=doa3cx8OV3aGLThRrpnh;"; private static final String ABC = "application/json"; public static GlideUrl getUrlWithHeaders(String url){ return new GlideUrl(url, new LazyHeaders.Builder() .addHeader("Cookie", AUTHORIZATION) .addHeader("Accept", ABC) .build()); } } String s = "http://192.168.1.144/api/download/" + mImageIds.get

How to fit Image into ImageView using Glide

∥☆過路亽.° 提交于 2021-02-05 13:10:04
问题 My concern is how to fit image using android:scaleType="fitXY" into image using Glide . My ImageView is <ImageView android:id="@+id/img_pager" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:scaleType="fitXY" /> Loads image using Glide like this Glide.with(context).load(url).placeholder(R.drawable.default_image).into(img); but image is not getting fit into ImageView it show space on image either side as shown in screen I

Found Drawable, Required 'int'. I am trying to load image in gravityView by Glide library

房东的猫 提交于 2021-01-29 14:58:56
问题 I am trying to load images from url with the help of glide library in gravityView. I searched many solutions and came up with this solution, but this code is giving me the error - Found Drawable, Required 'int'. public class gravity_view extends AppCompatActivity { public String imgurl; ImageView img; GravityView gravityView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.gravity_view); img = findViewById(R.id.bg); <-

Remove transparent white background from gif image using glide?

天大地大妈咪最大 提交于 2021-01-29 04:39:15
问题 How can I remove white background around image when loading with glide.. You can find out below code as well as screenshot; Glide.with(thiscontext).load(R.drawable.badge_green_yellow) .asGif().crossFade() .diskCacheStrategy(DiskCacheStrategy.SOURCE).into(holder.ivHourlyIcon); ScreenShot 回答1: Put your GIF into the raw folder (res/raw/badge_green_yellow.gif) and then load it like this Glide.with(thiscontext).asGif().load(R.raw.badge_green_yellow).into(holder.ivHourlyIcon); 来源: https:/

Remove transparent white background from gif image using glide?

谁都会走 提交于 2021-01-29 04:38:35
问题 How can I remove white background around image when loading with glide.. You can find out below code as well as screenshot; Glide.with(thiscontext).load(R.drawable.badge_green_yellow) .asGif().crossFade() .diskCacheStrategy(DiskCacheStrategy.SOURCE).into(holder.ivHourlyIcon); ScreenShot 回答1: Put your GIF into the raw folder (res/raw/badge_green_yellow.gif) and then load it like this Glide.with(thiscontext).asGif().load(R.raw.badge_green_yellow).into(holder.ivHourlyIcon); 来源: https:/

Download Image via Glide with rxJava

爱⌒轻易说出口 提交于 2021-01-28 05:22:09
问题 I need to download pictures (Bitmaps) via a given url. As I use Glide in my project to display the pictures I thought I could simply use their mechanism to download the pictures as well. I need to use it in a RxJava Environment and my problem is that the callback onResourceReady() is not called and of course the methods subscriber.onNext() and subscriber.onCompleted() are not getting called either. I get an IllegalStateException (see below). I guess the call to Glide needs to be done on the