游戏-插件页面,未完成

This commit is contained in:
huangzhuanghua
2016-08-29 10:28:33 +08:00
parent 20e9fcf172
commit e3fc761414
18 changed files with 817 additions and 226 deletions

View File

@ -12,6 +12,7 @@ import android.widget.ImageView.ScaleType;
import com.gh.common.view.CircleImageView;
import com.gh.gamecenter.R;
import com.gh.gamecenter.eventbus.EBImage;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
@ -23,6 +24,8 @@ import java.lang.ref.WeakReference;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import de.greenrobot.event.EventBus;
public class ImageUtils {
private static ImageUtils singleton;
private static ImageLoader imageLoader;
@ -153,14 +156,16 @@ public class ImageUtils {
int width = loadedImage.getWidth();
int height = loadedImage.getHeight();
int widthPixels = context.getResources().getDisplayMetrics().widthPixels;
float index = (float) height/(float) width;
int newHeight = (int)(index*widthPixels);
float index = (float) height / (float) width;
int newHeight = (int)(index * widthPixels);
ViewGroup.LayoutParams layoutParams = imageView.getLayoutParams();
layoutParams.height = newHeight;
layoutParams.width = widthPixels;
imageView.setLayoutParams(layoutParams);
EventBus.getDefault().post(new EBImage(imageUri, newHeight));
if (imageView instanceof CircleImageView) {
imageView.setScaleType(ScaleType.CENTER_CROP);
} else {