Skip to content
Browse files

Simplified unnecessary complex method call.

  • Loading branch information...
1 parent c328bc5 commit c42d0ddd06e76b64ded05db7d059ccaee56fe9ec Stefano Dacchille committed Sep 27, 2012
View
5 ...main/java/com/github/ignition/support/images/remote/RemoteImageLoaderTextViewAdapter.java
@@ -1,11 +1,9 @@
package com.github.ignition.support.images.remote;
-import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
-import android.view.WindowManager;
import android.widget.TextView;
import com.github.ignition.support.images.remote.RemoteImageLoaderHandler.RemoteImageLoaderViewAdapter;
@@ -46,8 +44,7 @@ public TextView getView() {
private void setCompoundDrawable(Drawable drawable) {
DisplayMetrics metrics = new DisplayMetrics();
- ((WindowManager) view.getContext().getSystemService(Context.WINDOW_SERVICE))
- .getDefaultDisplay().getMetrics(metrics);
+ metrics = view.getContext().getResources().getDisplayMetrics();
if (drawable instanceof BitmapDrawable) {
// For some reason this must be set explicitly or otherwise the target density will be
// wrong.

0 comments on commit c42d0dd

Please sign in to comment.
Something went wrong with that request. Please try again.