切换Fresco框架
This commit is contained in:
@ -13,6 +13,7 @@ import android.util.Log;
|
||||
import com.android.volley.Request;
|
||||
import com.android.volley.RequestQueue;
|
||||
import com.android.volley.toolbox.Volley;
|
||||
import com.facebook.drawee.backends.pipeline.Fresco;
|
||||
import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.Utils;
|
||||
import com.xiaomi.channel.commonutils.logger.LoggerInterface;
|
||||
@ -42,6 +43,8 @@ public class AppController extends Application {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
//初始化Fresco
|
||||
Fresco.initialize(this);
|
||||
|
||||
// File dexPath = new File(getDir("dex", Context.MODE_PRIVATE), "hackdex_dex.jar");
|
||||
// DexUtils.prepareAssetsDex(this, dexPath, "hackdex_dex.jar");
|
||||
|
||||
@ -1,291 +1,151 @@
|
||||
package com.gh.common.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Matrix;
|
||||
import android.support.v4.util.ArrayMap;
|
||||
import android.view.View;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Animatable;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.AlphaAnimation;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ImageView.ScaleType;
|
||||
|
||||
import com.gh.common.view.CircleImageView;
|
||||
import com.facebook.common.executors.CallerThreadExecutor;
|
||||
import com.facebook.common.references.CloseableReference;
|
||||
import com.facebook.datasource.DataSource;
|
||||
import com.facebook.drawee.backends.pipeline.Fresco;
|
||||
import com.facebook.drawee.controller.BaseControllerListener;
|
||||
import com.facebook.drawee.controller.ControllerListener;
|
||||
import com.facebook.drawee.drawable.ScalingUtils;
|
||||
import com.facebook.drawee.generic.GenericDraweeHierarchy;
|
||||
import com.facebook.drawee.generic.GenericDraweeHierarchyBuilder;
|
||||
import com.facebook.drawee.interfaces.DraweeController;
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.facebook.imagepipeline.core.ImagePipeline;
|
||||
import com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber;
|
||||
import com.facebook.imagepipeline.image.CloseableImage;
|
||||
import com.facebook.imagepipeline.image.ImageInfo;
|
||||
import com.facebook.imagepipeline.request.ImageRequest;
|
||||
import com.facebook.imagepipeline.request.ImageRequestBuilder;
|
||||
import com.gh.gamecenter.R;
|
||||
import com.nostra13.universalimageloader.core.DisplayImageOptions;
|
||||
import com.nostra13.universalimageloader.core.ImageLoader;
|
||||
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
|
||||
import com.nostra13.universalimageloader.core.assist.FailReason;
|
||||
import com.nostra13.universalimageloader.core.assist.ImageScaleType;
|
||||
import com.nostra13.universalimageloader.core.listener.ImageLoadingListener;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public class ImageUtils {
|
||||
private static ImageUtils singleton;
|
||||
private static ImageLoader imageLoader;
|
||||
private static DisplayImageOptions options;
|
||||
private ArrayMap<String, WeakReference<Bitmap>> imageCache = new ArrayMap<String, WeakReference<Bitmap>>();
|
||||
|
||||
ExecutorService fixedThreadPool = Executors.newFixedThreadPool(5);
|
||||
|
||||
public static ImageUtils getInstance(Context context) {
|
||||
if (singleton == null) {
|
||||
synchronized (ImageUtils.class) {
|
||||
if (singleton == null) {
|
||||
singleton = new ImageUtils(context.getApplicationContext(),
|
||||
(int) Runtime.getRuntime().maxMemory() / 10);
|
||||
singleton = new ImageUtils();
|
||||
return singleton;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return singleton;
|
||||
}
|
||||
|
||||
private ImageUtils(Context context, int size) {
|
||||
|
||||
options = new DisplayImageOptions.Builder().cacheInMemory(true)
|
||||
.cacheOnDisk(true).considerExifParams(true)
|
||||
.bitmapConfig(Bitmap.Config.RGB_565)
|
||||
.imageScaleType(ImageScaleType.IN_SAMPLE_INT)
|
||||
// .showImageOnLoading(R.drawable.ocupy)
|
||||
// .showImageForEmptyUri(R.drawable.ocupy)
|
||||
// .showImageOnFail(R.drawable.ocupy)
|
||||
// 自适应图片宽高
|
||||
public void display (String url , final SimpleDraweeView simpleDraweeView, final Context context, final int paddingSize){
|
||||
ControllerListener listener = new BaseControllerListener(){
|
||||
@Override
|
||||
public void onFinalImageSet(String id, Object imageInfo, Animatable animatable) {
|
||||
super.onFinalImageSet(id, imageInfo, animatable);
|
||||
if (imageInfo == null){
|
||||
return;
|
||||
}
|
||||
ImageInfo imageInfo1 = (ImageInfo) imageInfo;
|
||||
int height = imageInfo1.getHeight();
|
||||
int width = imageInfo1.getWidth();
|
||||
int widthPixels = context.getResources().getDisplayMetrics().widthPixels - DisplayUtils.dip2px(context,paddingSize);
|
||||
float index = (float) height / (float) width;
|
||||
int newHeight = (int)(index * widthPixels);
|
||||
ViewGroup.LayoutParams layoutParams = simpleDraweeView.getLayoutParams();
|
||||
layoutParams.height = newHeight;
|
||||
simpleDraweeView.setLayoutParams(layoutParams);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIntermediateImageSet(String id, Object imageInfo) {
|
||||
super.onIntermediateImageSet(id, imageInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIntermediateImageFailed(String id, Throwable throwable) {
|
||||
super.onIntermediateImageFailed(id, throwable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String id, Throwable throwable) {
|
||||
super.onFailure(id, throwable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRelease(String id) {
|
||||
super.onRelease(id);
|
||||
}
|
||||
};
|
||||
|
||||
DraweeController controller = Fresco.newDraweeControllerBuilder()
|
||||
.setUri(url)
|
||||
.setControllerListener(listener)
|
||||
.build();
|
||||
|
||||
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(
|
||||
context).writeDebugLogs()
|
||||
.memoryCacheExtraOptions(480, 800)
|
||||
.build();
|
||||
simpleDraweeView.setController(controller);
|
||||
|
||||
ImageLoader.getInstance().init(config);
|
||||
imageLoader = ImageLoader.getInstance();
|
||||
}
|
||||
|
||||
public void displayFile(String url, ImageView imageView) {
|
||||
imageLoader.displayImage(url, imageView, options,
|
||||
new ImageLoadingListener() {
|
||||
//设置缩放类型,设置按压状态下的叠加图
|
||||
public void display (String url , SimpleDraweeView simpleDraweeView, ScalingUtils.ScaleType scaleType, Context context){
|
||||
GenericDraweeHierarchyBuilder builder =
|
||||
new GenericDraweeHierarchyBuilder(context.getResources());
|
||||
GenericDraweeHierarchy hierarchy = builder
|
||||
.setFadeDuration(500)
|
||||
.setPressedStateOverlay(new ColorDrawable(context.getResources().getColor(R.color.pressed_bg)))
|
||||
.setPlaceholderImage(R.drawable.ocupy, ScalingUtils.ScaleType.CENTER)
|
||||
.setBackground(new ColorDrawable(Color.parseColor("#ececec")))
|
||||
.setActualImageScaleType(scaleType)
|
||||
.build();
|
||||
simpleDraweeView.setHierarchy(hierarchy);
|
||||
simpleDraweeView.setImageURI(url);
|
||||
|
||||
@Override
|
||||
public void onLoadingCancelled(String arg0, View arg1) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingComplete(String arg0, View view,
|
||||
Bitmap arg2) {
|
||||
AlphaAnimation animation = new AlphaAnimation(0f, 1f);
|
||||
animation.setDuration(500);
|
||||
view.startAnimation(animation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingFailed(String arg0, View arg1,
|
||||
FailReason arg2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingStarted(String arg0, View arg1) {
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
//增加一个上下文环境,图片宽度设最大(paddSize为左右边距大小),高度自适应
|
||||
public void display(String url, ImageView imageView, int drawable, Context context, int paddingSize) {
|
||||
display(url, imageView, drawable, ScaleType.FIT_XY, null, context, paddingSize);
|
||||
}
|
||||
|
||||
public void display(String url, ImageView imageView, int drawable) {
|
||||
display(url, imageView, drawable, ScaleType.FIT_XY, null);
|
||||
//设置占位符
|
||||
public void display (String url , SimpleDraweeView simpleDraweeView, int placeholderImage, Context context){
|
||||
|
||||
GenericDraweeHierarchyBuilder builder =
|
||||
new GenericDraweeHierarchyBuilder(context.getResources());
|
||||
GenericDraweeHierarchy hierarchy = builder
|
||||
.setFadeDuration(500)
|
||||
.setPressedStateOverlay(new ColorDrawable(context.getResources().getColor(R.color.pressed_bg)))
|
||||
.setBackground(new ColorDrawable(Color.parseColor("#ececec")))
|
||||
.setPlaceholderImage(placeholderImage, ScalingUtils.ScaleType.CENTER)
|
||||
.build();
|
||||
simpleDraweeView.setHierarchy(hierarchy);
|
||||
simpleDraweeView.setImageURI(url);
|
||||
|
||||
}
|
||||
|
||||
public void display(final String url, final ImageView imageView,
|
||||
final int drawable, final ScaleType scaleType,
|
||||
final OnLoadingCompleteListener listener) {
|
||||
imageLoader.displayImage(url, imageView, options,
|
||||
new ImageLoadingListener() {
|
||||
@Override
|
||||
public void onLoadingComplete(String imageUri, View view,
|
||||
Bitmap loadedImage) {
|
||||
if (imageView instanceof CircleImageView) {
|
||||
imageView.setScaleType(ScaleType.CENTER_CROP);
|
||||
} else {
|
||||
imageView.setScaleType(scaleType);
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onLoadingComplete();
|
||||
}
|
||||
}
|
||||
//图片下载监听
|
||||
public void display (String url, SimpleDraweeView simpleDraweeView, ControllerListener listener){
|
||||
|
||||
@Override
|
||||
public void onLoadingStarted(String imageUri, View view) {
|
||||
if (imageView instanceof CircleImageView) {
|
||||
imageView.setScaleType(ScaleType.CENTER_CROP);
|
||||
} else {
|
||||
imageView.setScaleType(ScaleType.CENTER);
|
||||
}
|
||||
if (drawable != -1) {
|
||||
imageView.setImageResource(drawable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingCancelled(String imageUri, View view) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingFailed(String imageUri, View view,
|
||||
FailReason reason) {
|
||||
|
||||
}
|
||||
});
|
||||
DraweeController controller = Fresco.newDraweeControllerBuilder()
|
||||
.setUri(url)
|
||||
.setControllerListener(listener)
|
||||
.build();
|
||||
simpleDraweeView.setController(controller);
|
||||
}
|
||||
|
||||
public void display(final String url, final ImageView imageView,
|
||||
final int drawable, final ScaleType scaleType,
|
||||
final OnLoadingCompleteListener listener, final Context context, final int paddSize) {
|
||||
imageLoader.displayImage(url, imageView, options,
|
||||
new ImageLoadingListener() {
|
||||
@Override
|
||||
public void onLoadingComplete(String imageUri, View view,
|
||||
Bitmap loadedImage) {
|
||||
int width = loadedImage.getWidth();
|
||||
int height = loadedImage.getHeight();
|
||||
int widthPixels = context.getResources().getDisplayMetrics().widthPixels;
|
||||
widthPixels = widthPixels - DisplayUtils.dip2px(context,paddSize);
|
||||
float index = (float) height / (float) width;
|
||||
int newHeight = (int)(index * widthPixels);
|
||||
//获取bitmap
|
||||
public void display (String url, BaseBitmapDataSubscriber dataSubscriber, Context context){
|
||||
ImageRequest imageRequest = ImageRequestBuilder
|
||||
.newBuilderWithSource(Uri.parse(url))
|
||||
.setProgressiveRenderingEnabled(true)
|
||||
.build();
|
||||
|
||||
ViewGroup.LayoutParams layoutParams = imageView.getLayoutParams();
|
||||
if (layoutParams != null){
|
||||
layoutParams.height = newHeight;
|
||||
layoutParams.width = widthPixels;
|
||||
imageView.setLayoutParams(layoutParams);
|
||||
}
|
||||
ImagePipeline imagePipeline = Fresco.getImagePipeline();
|
||||
DataSource<CloseableReference<CloseableImage>>
|
||||
dataSource = imagePipeline.fetchDecodedImage(imageRequest, context);
|
||||
dataSource.subscribe(dataSubscriber, CallerThreadExecutor.getInstance());
|
||||
|
||||
if (imageView instanceof CircleImageView) {
|
||||
imageView.setScaleType(ScaleType.CENTER_CROP);
|
||||
} else {
|
||||
imageView.setScaleType(scaleType);
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onLoadingComplete();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingStarted(String imageUri, View view) {
|
||||
imageView.setScaleType(ScaleType.CENTER);
|
||||
if (drawable != -1) {
|
||||
imageView.setImageResource(drawable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingCancelled(String imageUri, View view) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingFailed(String imageUri, View view,
|
||||
FailReason reason) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void display(final String url, final ImageView imageView,
|
||||
final int drawable, final ScaleType scaleType,
|
||||
final OnLoadingCompleteListener listener, final int i) {
|
||||
imageLoader.displayImage(url, imageView, options,
|
||||
new ImageLoadingListener() {
|
||||
@Override
|
||||
public void onLoadingComplete(String imageUri, View view,
|
||||
Bitmap loadedImage) {
|
||||
WeakReference<Bitmap> bitmapWeakReference = imageCache.get(imageUri);
|
||||
try {
|
||||
if (bitmapWeakReference!=null){
|
||||
Bitmap bitmap = bitmapWeakReference.get();
|
||||
imageView.setImageBitmap(bitmap);
|
||||
}else {
|
||||
Matrix m = new Matrix();
|
||||
m.setRotate(i, (float) loadedImage.getWidth() / 2, (float) loadedImage.getHeight() / 2);
|
||||
Bitmap bm1 = Bitmap.createBitmap(loadedImage, 0, 0, loadedImage.getWidth(), loadedImage.getHeight(), m, true);
|
||||
imageView.setImageBitmap(bm1);
|
||||
WeakReference<Bitmap> weakBM = new WeakReference<Bitmap>(bm1);
|
||||
imageCache.put(imageUri, weakBM);
|
||||
}
|
||||
|
||||
} catch (OutOfMemoryError ex) {
|
||||
Utils.log("Bitmap:::内存溢出");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (imageView instanceof CircleImageView) {
|
||||
imageView.setScaleType(ScaleType.CENTER_CROP);
|
||||
} else {
|
||||
imageView.setScaleType(scaleType);
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onLoadingComplete();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingStarted(String imageUri, View view) {
|
||||
imageView.setScaleType(ScaleType.CENTER);
|
||||
if (drawable != -1) {
|
||||
imageView.setImageResource(drawable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingCancelled(String imageUri, View view) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingFailed(String imageUri, View view,
|
||||
FailReason reason) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//获取图片BitMap
|
||||
public void loadBitmap(String url, ImageLoadingListener listener){
|
||||
imageLoader.loadImage(url, listener);
|
||||
}
|
||||
|
||||
public void display(String url, ImageView imageView, ScaleType scaleType) {
|
||||
display(url, imageView, R.drawable.ocupy, scaleType, null);
|
||||
}
|
||||
|
||||
public void display(String url, ImageView imageView) {
|
||||
display(url, imageView, R.drawable.ocupy, ScaleType.FIT_XY, null);
|
||||
}
|
||||
|
||||
//旋转图片 i表示角度
|
||||
public void display(String url, ImageView imageView, int i, boolean isHorizontal) {
|
||||
display(url, imageView, R.drawable.ocupy, ScaleType.FIT_XY, null, i);
|
||||
}
|
||||
|
||||
public void display(String url, ImageView imageView, ScaleType scaleType, OnLoadingCompleteListener listener) {
|
||||
display(url, imageView, R.drawable.ocupy, scaleType, listener);
|
||||
}
|
||||
|
||||
public void display(String url, ImageView imageView, OnLoadingCompleteListener listener) {
|
||||
display(url, imageView, R.drawable.ocupy, ScaleType.FIT_XY, listener);
|
||||
}
|
||||
|
||||
public interface OnLoadingCompleteListener {
|
||||
void onLoadingComplete();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -23,9 +23,11 @@ import android.widget.PopupWindow;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.facebook.common.references.CloseableReference;
|
||||
import com.facebook.datasource.DataSource;
|
||||
import com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber;
|
||||
import com.facebook.imagepipeline.image.CloseableImage;
|
||||
import com.gh.gamecenter.R;
|
||||
import com.nostra13.universalimageloader.core.assist.FailReason;
|
||||
import com.nostra13.universalimageloader.core.listener.ImageLoadingListener;
|
||||
import com.tencent.connect.share.QQShare;
|
||||
import com.tencent.connect.share.QzoneShare;
|
||||
import com.tencent.mm.sdk.openapi.IWXAPI;
|
||||
@ -426,20 +428,9 @@ public class ShareUtils {
|
||||
}
|
||||
|
||||
private void loadBitMap(final String iconUrl, final WXMediaMessage msg, final SendMessageToWX.Req req){
|
||||
ImageUtils.getInstance(context).loadBitmap(iconUrl, new ImageLoadingListener() {
|
||||
ImageUtils.getInstance(context).display(iconUrl, new BaseBitmapDataSubscriber() {
|
||||
@Override
|
||||
public void onLoadingStarted(String s, View view) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingFailed(String s, View view, FailReason failReason) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingComplete(String s, View view, Bitmap bitmap) {
|
||||
|
||||
protected void onNewResultImpl(Bitmap bitmap) {
|
||||
Bitmap compressBp = compressBitmap(bitmap);
|
||||
Bitmap resultBp = addBackGround(compressBp);
|
||||
msg.thumbData = Util.bmpToByteArray(resultBp, true);
|
||||
@ -447,10 +438,10 @@ public class ShareUtils {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingCancelled(String s, View view) {
|
||||
|
||||
protected void onFailureImpl(DataSource<CloseableReference<CloseableImage>> dataSource) {
|
||||
Utils.log("分享获取bitmap失败");
|
||||
}
|
||||
});
|
||||
}, context);
|
||||
}
|
||||
|
||||
//添加背景,防止图片格式为PNG的图片分享出现黑框问题
|
||||
|
||||
@ -1,67 +0,0 @@
|
||||
package com.gh.common.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
/**
|
||||
* Created by khy on 2016/8/9.
|
||||
*/
|
||||
public class ChildLinearLayoutManager extends LinearLayoutManager {
|
||||
|
||||
public ChildLinearLayoutManager(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public ChildLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
|
||||
super(context, orientation, reverseLayout);
|
||||
}
|
||||
@Override
|
||||
public boolean canScrollVertically() {
|
||||
return false;
|
||||
}
|
||||
private int[] mMeasuredDimension = new int[1];
|
||||
|
||||
@Override
|
||||
public void onMeasure(RecyclerView.Recycler recycler, RecyclerView.State state,
|
||||
int widthSpec, int heightSpec) {
|
||||
|
||||
final int heightMode = View.MeasureSpec.getMode(heightSpec);
|
||||
final int heightSize = View.MeasureSpec.getSize(heightSpec);
|
||||
|
||||
int height = 0;
|
||||
for (int i = 0; i < getItemCount(); i++) {
|
||||
measureScrapChild(recycler, i,
|
||||
View.MeasureSpec.makeMeasureSpec(i, View.MeasureSpec.UNSPECIFIED),
|
||||
View.MeasureSpec.makeMeasureSpec(i, View.MeasureSpec.UNSPECIFIED),
|
||||
mMeasuredDimension);
|
||||
height = height + mMeasuredDimension[0];
|
||||
|
||||
}
|
||||
if (heightMode == View.MeasureSpec.EXACTLY){
|
||||
height = heightSize;
|
||||
}
|
||||
|
||||
setMeasuredDimension(View.MeasureSpec.getSize(widthSpec), height);
|
||||
}
|
||||
|
||||
private void measureScrapChild(RecyclerView.Recycler recycler, int position, int widthSpec,
|
||||
int heightSpec, int[] measuredDimension) {
|
||||
View view = recycler.getViewForPosition(position);
|
||||
if (view.getVisibility() == View.GONE) {
|
||||
measuredDimension[0] = 0;
|
||||
return;
|
||||
}
|
||||
super.measureChildWithMargins(view, 0, 0);
|
||||
RecyclerView.LayoutParams p = (RecyclerView.LayoutParams) view.getLayoutParams();
|
||||
int childHeightSpec = ViewGroup.getChildMeasureSpec(
|
||||
heightSpec,
|
||||
getPaddingTop() + getPaddingBottom() + getDecoratedTop(view) + getDecoratedBottom(view),
|
||||
p.height);
|
||||
view.measure(0, childHeightSpec);
|
||||
measuredDimension[0] = getDecoratedMeasuredHeight(view) + p.bottomMargin + p.topMargin;
|
||||
recycler.recycleView(view);
|
||||
}
|
||||
}
|
||||
@ -16,7 +16,6 @@ import com.gh.common.constant.Config;
|
||||
import com.gh.common.util.DialogUtils;
|
||||
import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.FileUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.util.TokenUtils;
|
||||
import com.gh.common.view.CropImageCustom;
|
||||
|
||||
@ -110,8 +109,9 @@ public class CropImageActivity extends BaseActivity {
|
||||
|
||||
String path = getIntent().getStringExtra("path");
|
||||
|
||||
ImageUtils.getInstance(getApplicationContext()).displayFile(
|
||||
"file://" + path, cropimage_custom.getCropImageZoomView());
|
||||
// TODO displayFile
|
||||
// ImageUtils.getInstance(getApplicationContext()).displayFile(
|
||||
// "file://" + path, cropimage_custom.getCropImageZoomView());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -575,31 +575,35 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
new Response.Listener<JSONObject>() {
|
||||
@Override
|
||||
public void onResponse(JSONObject response) {
|
||||
Gson gson = new Gson();
|
||||
GameEntity gameEntity = gson.fromJson(response.toString(), GameEntity.class);
|
||||
ConcernInfo concernInfo = concernManager.findConcernById(gameEntity.getId());
|
||||
if (concernInfo != null && gameEntity.getApk() != null
|
||||
&& gameEntity.getApk().size() != 0) {
|
||||
HashMap<String, Boolean> packageNames = new HashMap<>();
|
||||
String packageName;
|
||||
for (int i = 0, size = gameEntity.getApk().size(); i < size; i++) {
|
||||
packageName = gameEntity.getApk().get(i).getPackageName();
|
||||
if (PackageManager.isInstalled(packageName)) {
|
||||
packageNames.put(packageName, true);
|
||||
} else {
|
||||
packageNames.put(packageName, false);
|
||||
if (response.length() != 0) {
|
||||
Gson gson = new Gson();
|
||||
GameEntity gameEntity = gson.fromJson(response.toString(), GameEntity.class);
|
||||
ConcernInfo concernInfo = concernManager.findConcernById(gameEntity.getId());
|
||||
if (concernInfo != null && gameEntity.getApk() != null
|
||||
&& gameEntity.getApk().size() != 0) {
|
||||
HashMap<String, Boolean> packageNames = new HashMap<>();
|
||||
String packageName;
|
||||
for (int i = 0, size = gameEntity.getApk().size(); i < size; i++) {
|
||||
packageName = gameEntity.getApk().get(i).getPackageName();
|
||||
if (PackageManager.isInstalled(packageName)) {
|
||||
packageNames.put(packageName, true);
|
||||
} else {
|
||||
packageNames.put(packageName, false);
|
||||
}
|
||||
}
|
||||
concernInfo.setTime(System.currentTimeMillis());
|
||||
concernInfo.setPackageNames(packageNames);
|
||||
concernManager.updateByConcern(concernInfo);
|
||||
}
|
||||
|
||||
if (isNewFirstLaunch) {
|
||||
//默认安装即为关注
|
||||
if (!concernManager.isConcern(gameEntity.getId())) {
|
||||
concernManager.addByEntity(gameEntity);
|
||||
}
|
||||
}
|
||||
concernInfo.setTime(System.currentTimeMillis());
|
||||
concernInfo.setPackageNames(packageNames);
|
||||
concernManager.updateByConcern(concernInfo);
|
||||
}
|
||||
if (isNewFirstLaunch) {
|
||||
//默认安装即为关注
|
||||
if (!concernManager.isConcern(gameEntity.getId())) {
|
||||
concernManager.addByEntity(gameEntity);
|
||||
}
|
||||
}
|
||||
|
||||
addConcernCount();
|
||||
if (cCount == size) {
|
||||
update();
|
||||
|
||||
@ -2,6 +2,8 @@ package com.gh.gamecenter;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.drawable.Animatable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
@ -11,10 +13,15 @@ import android.support.v4.view.ViewPager.OnPageChangeListener;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ImageView.ScaleType;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.facebook.drawee.backends.pipeline.Fresco;
|
||||
import com.facebook.drawee.controller.BaseControllerListener;
|
||||
import com.facebook.drawee.drawable.ScalingUtils;
|
||||
import com.facebook.drawee.interfaces.DraweeController;
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.facebook.imagepipeline.request.ImageRequest;
|
||||
import com.facebook.imagepipeline.request.ImageRequestBuilder;
|
||||
import com.gc.materialdesign.views.ProgressBarCircularIndeterminate;
|
||||
import com.gh.base.BaseActivity;
|
||||
import com.gh.common.util.DisplayUtils;
|
||||
@ -22,16 +29,11 @@ import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.view.Gh_RelativeLayout;
|
||||
import com.gh.common.view.Gh_RelativeLayout.OnSingleTapListener;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import pl.droidsonroids.gif.GifDrawable;
|
||||
import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
|
||||
/**
|
||||
* 查看游戏截图页面
|
||||
@ -53,7 +55,6 @@ public class ViewImageActivity extends BaseActivity implements
|
||||
private int width;
|
||||
|
||||
private boolean isOrientation;
|
||||
private boolean isLoading = false;
|
||||
|
||||
private Handler handler = new Handler() {
|
||||
@Override
|
||||
@ -66,27 +67,17 @@ public class ViewImageActivity extends BaseActivity implements
|
||||
Object object = viewimage_vp_show.findViewWithTag(position);
|
||||
if (object != null) {
|
||||
RelativeLayout view = (RelativeLayout) object;
|
||||
ImageView imageView = (ImageView) view.findViewById(R.id.viewimage_iv_show);
|
||||
SimpleDraweeView imageView = (SimpleDraweeView) view.findViewById(R.id.viewimage_iv_show);
|
||||
final ProgressBarCircularIndeterminate progressBar = (ProgressBarCircularIndeterminate) view.findViewById(R.id.viewimage_pb_loading);
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
if (scaleType != null) {
|
||||
ImageUtils.getInstance(getApplicationContext()).display(
|
||||
urls.get(position), imageView, ScaleType.FIT_CENTER,
|
||||
new ImageUtils.OnLoadingCompleteListener() {
|
||||
@Override
|
||||
public void onLoadingComplete() {
|
||||
progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ImageUtils.getInstance(getApplicationContext()).display(
|
||||
urls.get(position), imageView, new ImageUtils.OnLoadingCompleteListener() {
|
||||
@Override
|
||||
public void onLoadingComplete() {
|
||||
progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
}
|
||||
ImageUtils.getInstance(getApplicationContext()).display(urls.get(position), imageView
|
||||
, new BaseControllerListener(){
|
||||
@Override
|
||||
public void onFinalImageSet(String id, Object imageInfo, Animatable animatable) {
|
||||
super.onFinalImageSet(id, imageInfo, animatable);
|
||||
progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,32 +142,24 @@ public class ViewImageActivity extends BaseActivity implements
|
||||
@Override
|
||||
public Object instantiateItem(ViewGroup container, int position) {
|
||||
String url = urls.get(position);
|
||||
Gh_RelativeLayout view;
|
||||
if (url.contains(".gif")) {
|
||||
view = (Gh_RelativeLayout) View.inflate(container.getContext(),
|
||||
R.layout.viewimage_gif_item, null);
|
||||
GifImageView gifImageView = (GifImageView) view.findViewById(R.id.viewimage_iv_gif);
|
||||
if (!isLoading) {
|
||||
loadGifData(gifImageView, urls.get(position));
|
||||
}
|
||||
|
||||
} else {
|
||||
view = (Gh_RelativeLayout) View.inflate(container.getContext(),
|
||||
R.layout.viewimage_normal_item, null);
|
||||
ImageView imageView = (ImageView) view.findViewById(R.id.viewimage_iv_show);
|
||||
if (scaleType != null) {
|
||||
ImageUtils.getInstance(getApplicationContext()).display(
|
||||
urls.get(position), imageView, ScaleType.FIT_CENTER);
|
||||
} else if (isOrientation && imageView.getDrawable() == null) {
|
||||
ImageUtils.getInstance(getApplicationContext()).display(
|
||||
urls.get(position), imageView, 270, isOrientation);
|
||||
} else if (imageView.getDrawable() == null) {
|
||||
ImageUtils.getInstance(getApplicationContext()).display(
|
||||
urls.get(position), imageView);
|
||||
}
|
||||
if (!urls.get(position).startsWith("http://image.ghzhushou.com/pic/hq/")) {
|
||||
checkUrl(urls.get(position));
|
||||
}
|
||||
Gh_RelativeLayout view = (Gh_RelativeLayout) View.inflate(container.getContext(),
|
||||
R.layout.viewimage_normal_item, null);
|
||||
SimpleDraweeView imageView = (SimpleDraweeView) view.findViewById(R.id.viewimage_iv_show);
|
||||
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse(url))
|
||||
.setAutoRotateEnabled(false)
|
||||
.build();
|
||||
DraweeController controller = Fresco.newDraweeControllerBuilder()
|
||||
.setImageRequest(request)
|
||||
.setAutoPlayAnimations(true)
|
||||
.build();
|
||||
imageView.setController(controller);
|
||||
|
||||
if (scaleType != null || isOrientation) {
|
||||
imageView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
|
||||
}
|
||||
if (!urls.get(position).startsWith("http://image.ghzhushou.com/pic/hq/")) {
|
||||
checkUrl(urls.get(position));
|
||||
}
|
||||
view.setOnSingleTapListener(this);
|
||||
view.setTag(position);
|
||||
@ -184,46 +167,6 @@ public class ViewImageActivity extends BaseActivity implements
|
||||
return view;
|
||||
}
|
||||
|
||||
private void loadGifData(final GifImageView gifImageView, final String gifUrl) {
|
||||
isLoading = true;
|
||||
gifImageView.setImageResource(R.drawable.ocupy);
|
||||
gifImageView.setScaleType(ScaleType.CENTER);
|
||||
final GifDrawable[] gifDrawable = {null};
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
URL url = new URL(gifUrl);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestMethod("GET");
|
||||
conn.setConnectTimeout(5 * 1000);
|
||||
conn.setReadTimeout(5 * 1000);
|
||||
conn.connect();
|
||||
if (conn.getResponseCode() == 200) {
|
||||
InputStream inputStream = conn.getInputStream();
|
||||
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
||||
byte[] data = new byte[1024 * 5];
|
||||
int count = -1;
|
||||
while ((count = inputStream.read(data, 0, 1024 * 5)) != -1) {
|
||||
output.write(data, 0, count);
|
||||
}
|
||||
byte[] bytes = output.toByteArray();
|
||||
gifDrawable[0] = new GifDrawable(bytes);
|
||||
handler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
gifImageView.setImageDrawable(gifDrawable[0]);
|
||||
gifImageView.setScaleType(ScaleType.FIT_CENTER);
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isViewFromObject(View view, Object object) {
|
||||
return view == object;
|
||||
|
||||
77
app/src/main/java/com/gh/gamecenter/WebActivity.java
Normal file
77
app/src/main/java/com/gh/gamecenter/WebActivity.java
Normal file
@ -0,0 +1,77 @@
|
||||
package com.gh.gamecenter;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import com.gh.base.BaseActivity;
|
||||
|
||||
/**
|
||||
* Created by khy on 2016/10/18.
|
||||
*/
|
||||
public class WebActivity extends BaseActivity {
|
||||
private WebView mWebView;
|
||||
private ProgressBar mProgressBar;
|
||||
|
||||
private String webUrl;
|
||||
private String webTitle;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
Bundle extras = getIntent().getExtras();
|
||||
webUrl = extras.getString("url");
|
||||
webTitle = extras.getString("gameName");
|
||||
|
||||
View contentView = View.inflate(this, R.layout.activity_web, null);
|
||||
init(contentView, webTitle);
|
||||
|
||||
mWebView = (WebView) findViewById(R.id.news_webview);
|
||||
mProgressBar = (ProgressBar) findViewById(R.id.web_progressbar);
|
||||
|
||||
mWebView.loadUrl(webUrl);
|
||||
|
||||
WebSettings settings = mWebView.getSettings();
|
||||
settings.setJavaScriptEnabled(true);
|
||||
|
||||
//用webview打开url
|
||||
mWebView.setWebViewClient(new WebViewClient(){
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
view.loadUrl(url);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
//设置加载进度条
|
||||
mWebView.setWebChromeClient(new WebChromeClient(){
|
||||
@Override
|
||||
public void onProgressChanged(WebView view, int newProgress) {
|
||||
mProgressBar.setProgress(newProgress);
|
||||
if (newProgress == 100){
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
} else {
|
||||
if (mProgressBar.getVisibility() == View.GONE) {
|
||||
mProgressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && mWebView.canGoBack()) {
|
||||
mWebView.goBack();// 返回前一个页面
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
}
|
||||
@ -14,7 +14,6 @@ import com.gh.common.constant.Config;
|
||||
import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.DialogUtils;
|
||||
import com.gh.common.util.GameUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.gamecenter.ConcernActivity;
|
||||
import com.gh.gamecenter.R;
|
||||
import com.gh.gamecenter.adapter.viewholder.ConcernViewHolder;
|
||||
@ -123,7 +122,8 @@ public class ConcernAdapter extends RecyclerView.Adapter<ConcernViewHolder> {
|
||||
@Override
|
||||
public void onBindViewHolder(final ConcernViewHolder holder, int position) {
|
||||
ConcernInfo concernInfo = concernList.get(position);
|
||||
ImageUtils.getInstance(context).display(concernInfo.getIcon(), holder.concern_item_icon);
|
||||
// ImageUtils.getInstance(context).display(concernInfo.getIcon(), holder.concern_item_icon);
|
||||
holder.concern_item_icon.setImageURI(concernInfo.getIcon());
|
||||
holder.concern_item_name.setText(concernInfo.getGameName());
|
||||
holder.concern_item_concern.setText("取消关注");
|
||||
holder.concern_item_concern.setBackgroundResource(R.drawable.textview_cancel_style);
|
||||
|
||||
@ -13,7 +13,6 @@ import com.gh.base.AppController;
|
||||
import com.gh.common.constant.Config;
|
||||
import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.GameUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.gamecenter.ConcernActivity;
|
||||
import com.gh.gamecenter.R;
|
||||
import com.gh.gamecenter.adapter.viewholder.ConcernViewHolder;
|
||||
@ -144,8 +143,9 @@ public class ConcernRecommendAdapter extends RecyclerView.Adapter<ConcernViewHol
|
||||
@Override
|
||||
public void onBindViewHolder(final ConcernViewHolder holder, int position) {
|
||||
GameEntity gameEntity = recommendGameList.get(position);
|
||||
ImageUtils.getInstance(context).display(
|
||||
gameEntity.getIcon(), holder.concern_item_icon);
|
||||
// ImageUtils.getInstance(context).display(
|
||||
// gameEntity.getIcon(), holder.concern_item_icon);
|
||||
holder.concern_item_icon.setImageURI(gameEntity.getIcon());
|
||||
holder.concern_item_name.setText(gameEntity.getName());
|
||||
holder.concern_item_concern.setText("关注");
|
||||
holder.concern_item_concern.setBackgroundResource(R.drawable.textview_blue_style);
|
||||
|
||||
@ -9,8 +9,8 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.GameUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
@ -73,7 +73,7 @@ public class ImagePagerAdapter extends RecyclingPagerAdapter {
|
||||
ViewHolder holder;
|
||||
if (view == null) {
|
||||
holder = new ViewHolder();
|
||||
view = holder.imageView = new ImageView(context);
|
||||
view = holder.imageView = new SimpleDraweeView(context);
|
||||
view.setTag(holder);
|
||||
} else {
|
||||
holder = (ViewHolder) view.getTag();
|
||||
@ -81,9 +81,10 @@ public class ImagePagerAdapter extends RecyclingPagerAdapter {
|
||||
|
||||
final SlideEntity slideEntity = slideList.get(getPosition(position));
|
||||
|
||||
ImageUtils.getInstance(context).display(slideEntity.getImage(),
|
||||
holder.imageView, R.drawable.preload);
|
||||
// indicator.setPosition(slideList.size(), getPosition(position));
|
||||
// ImageUtils.getInstance(context).display(slideEntity.getImage(),
|
||||
// holder.imageView, R.drawable.preload);
|
||||
ImageUtils.getInstance(context).display(slideEntity.getImage(), holder.imageView, R.drawable.preload, context);
|
||||
// indicator.setPosition(slideList.size(), getPosition(position));
|
||||
|
||||
holder.imageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@ -118,7 +119,7 @@ public class ImagePagerAdapter extends RecyclingPagerAdapter {
|
||||
}
|
||||
|
||||
private static class ViewHolder {
|
||||
ImageView imageView;
|
||||
SimpleDraweeView imageView;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -9,6 +9,7 @@ import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.graphics.drawable.LayerDrawable;
|
||||
import android.net.Uri;
|
||||
import android.support.v4.util.ArrayMap;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.TextUtils;
|
||||
@ -25,7 +26,6 @@ import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.DialogUtils;
|
||||
import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.FileUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.util.NetworkUtils;
|
||||
import com.gh.common.util.PackageUtils;
|
||||
import com.gh.common.util.PlatformUtils;
|
||||
@ -42,6 +42,7 @@ import com.gh.gamecenter.listener.OnCollectionCallBackListener;
|
||||
import com.gh.gamecenter.manager.DataCollectionManager;
|
||||
import com.gh.gamecenter.manager.PackageManager;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -253,8 +254,9 @@ public class PlatformAdapter extends RecyclerView.Adapter<PlatformViewHolder> {
|
||||
.getPlatformPicPath(apkEntity.getPlatform());
|
||||
if (path != null) {
|
||||
viewHolder.download_item_iv_pic.setVisibility(View.VISIBLE);
|
||||
ImageUtils.getInstance(context).display(
|
||||
"file://" + path, viewHolder.download_item_iv_pic);
|
||||
// ImageUtils.getInstance(context).display(
|
||||
// "file://" + path, viewHolder.download_item_iv_pic);
|
||||
viewHolder.download_item_iv_pic.setImageURI(Uri.fromFile(new File(path)));
|
||||
viewHolder.download_item_tv_hint.setVisibility(View.GONE);
|
||||
viewHolder.download_item_progressbar.setVisibility(View.GONE);
|
||||
viewHolder.download_item_tv_name.setVisibility(View.GONE);
|
||||
@ -310,9 +312,9 @@ public class PlatformAdapter extends RecyclerView.Adapter<PlatformViewHolder> {
|
||||
viewHolder.download_item_tv_status.setVisibility(View.GONE);
|
||||
viewHolder.itemView.setBackgroundColor(0x00ffffff);
|
||||
|
||||
ImageUtils.getInstance(context).display(
|
||||
apkEntity.getApkCollection().getIcon(), viewHolder.download_item_iv_pic);
|
||||
|
||||
// ImageUtils.getInstance(context).display(
|
||||
// apkEntity.getApkCollection().getIcon(), viewHolder.download_item_iv_pic);
|
||||
viewHolder.download_item_iv_pic.setImageURI(apkEntity.getApkCollection().getIcon());
|
||||
if (closeEntity.getPosition() == position && adapterPosition == closeEntity.getAdapterPosition()) {
|
||||
viewHolder.download_item_open_collection.setVisibility(View.GONE);
|
||||
viewHolder.download_item_colse_collection.setVisibility(View.VISIBLE);
|
||||
|
||||
@ -12,7 +12,6 @@ import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.DownloadItemUtils;
|
||||
import com.gh.common.util.GameUtils;
|
||||
import com.gh.common.util.GameViewUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.util.PlatformUtils;
|
||||
import com.gh.common.view.CardLinearLayout;
|
||||
import com.gh.download.DownloadManager;
|
||||
@ -156,7 +155,8 @@ public class PluginAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
|
||||
viewHolder.home1_game_order.setVisibility(View.GONE);
|
||||
|
||||
ImageUtils.getInstance(context).display(gameEntity.getIcon(), viewHolder.gameThumb);
|
||||
// ImageUtils.getInstance(context).display(gameEntity.getIcon(), viewHolder.gameThumb);
|
||||
viewHolder.gameThumb.setImageURI(gameEntity.getIcon());
|
||||
if (gameEntity.isPluggable()) {
|
||||
viewHolder.gameNameAndSize.setText(gameEntity.getName() + " - " +
|
||||
PlatformUtils.getInstance(context).getPlatformName(gameEntity.getApk().get(0).getPlatform()));
|
||||
|
||||
@ -19,7 +19,6 @@ import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.DownloadItemUtils;
|
||||
import com.gh.common.util.GameUtils;
|
||||
import com.gh.common.util.GameViewUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.view.CardLinearLayout;
|
||||
import com.gh.download.DownloadManager;
|
||||
import com.gh.gamecenter.R;
|
||||
@ -285,7 +284,8 @@ public class SubjectAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||
|
||||
final GameEntity gameEntity = subjectList.get(position);
|
||||
|
||||
ImageUtils.getInstance(context).display(gameEntity.getIcon(), holder.gameThumb);
|
||||
// ImageUtils.getInstance(context).display(gameEntity.getIcon(), holder.gameThumb);
|
||||
holder.gameThumb.setImageURI(gameEntity.getIcon());
|
||||
holder.gameNameAndSize.setText(gameEntity.getName());
|
||||
if (gameEntity.getApk() == null || gameEntity.getApk().isEmpty()) {
|
||||
holder.gameDes.setText(gameEntity.getBrief());
|
||||
@ -373,7 +373,8 @@ public class SubjectAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||
|
||||
final GameEntity gameEntity = subjectList.get(position);
|
||||
|
||||
ImageUtils.getInstance(context).display(gameEntity.getIcon(), holder.gameThumb);
|
||||
// ImageUtils.getInstance(context).display(gameEntity.getIcon(), holder.gameThumb);
|
||||
holder.gameThumb.setImageURI(gameEntity.getIcon());
|
||||
holder.gameNameAndSize.setText(gameEntity.getName());
|
||||
if (gameEntity.getApk() == null || gameEntity.getApk().isEmpty()) {
|
||||
holder.gameDes.setText(gameEntity.getBrief());
|
||||
|
||||
@ -2,9 +2,9 @@ package com.gh.gamecenter.adapter.viewholder;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.gamecenter.R;
|
||||
|
||||
/**
|
||||
@ -12,14 +12,14 @@ import com.gh.gamecenter.R;
|
||||
*/
|
||||
public class ConcernViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public ImageView concern_item_icon;
|
||||
public SimpleDraweeView concern_item_icon;
|
||||
public TextView concern_item_name;
|
||||
public TextView concern_item_concern;
|
||||
|
||||
public ConcernViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
concern_item_icon = (ImageView) itemView.findViewById(R.id.concern_item_icon);
|
||||
concern_item_icon = (SimpleDraweeView) itemView.findViewById(R.id.concern_item_icon);
|
||||
concern_item_name = (TextView) itemView.findViewById(R.id.concern_item_name);
|
||||
concern_item_concern = (TextView) itemView.findViewById(R.id.concern_item_concern);
|
||||
}
|
||||
|
||||
@ -2,8 +2,8 @@ package com.gh.gamecenter.adapter.viewholder;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.gamecenter.R;
|
||||
|
||||
/**
|
||||
@ -11,12 +11,12 @@ import com.gh.gamecenter.R;
|
||||
*/
|
||||
public class GameImageViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public ImageView image;
|
||||
public SimpleDraweeView image;
|
||||
|
||||
public GameImageViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
image = (ImageView) itemView.findViewById(R.id.home_game_iv_image);
|
||||
image = (SimpleDraweeView) itemView.findViewById(R.id.home_game_iv_image);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,11 +2,11 @@ package com.gh.gamecenter.adapter.viewholder;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.gamecenter.R;
|
||||
|
||||
/**
|
||||
@ -15,7 +15,7 @@ import com.gh.gamecenter.R;
|
||||
public class GameNormalViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public TextView home1_game_order;
|
||||
public ImageView gameThumb;
|
||||
public SimpleDraweeView gameThumb;
|
||||
public TextView gameNameAndSize;
|
||||
public TextView downloadBtn;
|
||||
public TextView gameDes;
|
||||
@ -29,7 +29,7 @@ public class GameNormalViewHolder extends RecyclerView.ViewHolder {
|
||||
super(itemView);
|
||||
|
||||
home1_game_order = (TextView) itemView.findViewById(R.id.home1_game_order);
|
||||
gameThumb = (ImageView) itemView.findViewById(R.id.home1_game_thumb);
|
||||
gameThumb = (SimpleDraweeView) itemView.findViewById(R.id.home1_game_thumb);
|
||||
gameNameAndSize = (TextView) itemView.findViewById(R.id.home1_game_nameAndsize);
|
||||
downloadBtn = (TextView) itemView.findViewById(R.id.home1_download_btn);
|
||||
gameDes = (TextView) itemView.findViewById(R.id.home1_game_des);
|
||||
|
||||
@ -2,11 +2,11 @@ package com.gh.gamecenter.adapter.viewholder;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.gamecenter.R;
|
||||
|
||||
/**
|
||||
@ -15,7 +15,7 @@ import com.gh.gamecenter.R;
|
||||
public class GameTestViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public TextView home2_game_order;
|
||||
public ImageView gameThumb;
|
||||
public SimpleDraweeView gameThumb;
|
||||
public TextView gameNameAndSize;
|
||||
public TextView downloadBtn;
|
||||
public TextView gameDes;
|
||||
@ -31,7 +31,7 @@ public class GameTestViewHolder extends RecyclerView.ViewHolder {
|
||||
super(itemView);
|
||||
|
||||
home2_game_order = (TextView) itemView.findViewById(R.id.home2_game_order);
|
||||
gameThumb = (ImageView) itemView.findViewById(R.id.home2_game_thumb);
|
||||
gameThumb = (SimpleDraweeView) itemView.findViewById(R.id.home2_game_thumb);
|
||||
gameNameAndSize = (TextView) itemView.findViewById(R.id.home2_game_nameAndsize);
|
||||
downloadBtn = (TextView) itemView.findViewById(R.id.home2_download_btn);
|
||||
gameDes = (TextView) itemView.findViewById(R.id.home2_game_des);
|
||||
|
||||
@ -2,9 +2,9 @@ package com.gh.gamecenter.adapter.viewholder;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.gamecenter.R;
|
||||
|
||||
/**
|
||||
@ -12,7 +12,7 @@ import com.gh.gamecenter.R;
|
||||
*/
|
||||
public class NewsImage1ViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public ImageView fm_read_iv_thumb;
|
||||
public SimpleDraweeView fm_read_iv_thumb;
|
||||
public TextView fm_read_tv_title;
|
||||
public TextView fm_read_tv_read;
|
||||
public TextView fm_read_tv_type;
|
||||
@ -20,7 +20,7 @@ public class NewsImage1ViewHolder extends RecyclerView.ViewHolder {
|
||||
public NewsImage1ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
fm_read_iv_thumb = (ImageView) itemView.findViewById(R.id.fm_read_iv_thumb);
|
||||
fm_read_iv_thumb = (SimpleDraweeView) itemView.findViewById(R.id.fm_read_iv_thumb);
|
||||
fm_read_tv_title = (TextView) itemView.findViewById(R.id.fm_read_tv_title);
|
||||
fm_read_tv_read = (TextView) itemView.findViewById(R.id.fm_read_tv_read);
|
||||
fm_read_tv_type = (TextView) itemView.findViewById(R.id.fm_read_tv_type);
|
||||
|
||||
@ -2,9 +2,9 @@ package com.gh.gamecenter.adapter.viewholder;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.gamecenter.R;
|
||||
|
||||
/**
|
||||
@ -13,9 +13,9 @@ import com.gh.gamecenter.R;
|
||||
public class NewsImage2ViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public TextView fm_read2_special2_title;
|
||||
public ImageView fm_read2_special2_thumb1;
|
||||
public ImageView fm_read2_special2_thumb2;
|
||||
public ImageView fm_read2_special2_thumb3;
|
||||
public SimpleDraweeView fm_read2_special2_thumb1;
|
||||
public SimpleDraweeView fm_read2_special2_thumb2;
|
||||
public SimpleDraweeView fm_read2_special2_thumb3;
|
||||
public TextView fm_read2_special2_tv_read;
|
||||
public TextView fm_read2_special2_tv_type;
|
||||
|
||||
@ -23,9 +23,9 @@ public class NewsImage2ViewHolder extends RecyclerView.ViewHolder {
|
||||
super(itemView);
|
||||
|
||||
fm_read2_special2_title = (TextView) itemView.findViewById(R.id.fm_read2_special2_title);
|
||||
fm_read2_special2_thumb1 = (ImageView) itemView.findViewById(R.id.fm_read2_special2_thumb1);
|
||||
fm_read2_special2_thumb2 = (ImageView) itemView.findViewById(R.id.fm_read2_special2_thumb2);
|
||||
fm_read2_special2_thumb3 = (ImageView) itemView.findViewById(R.id.fm_read2_special2_thumb3);
|
||||
fm_read2_special2_thumb1 = (SimpleDraweeView) itemView.findViewById(R.id.fm_read2_special2_thumb1);
|
||||
fm_read2_special2_thumb2 = (SimpleDraweeView) itemView.findViewById(R.id.fm_read2_special2_thumb2);
|
||||
fm_read2_special2_thumb3 = (SimpleDraweeView) itemView.findViewById(R.id.fm_read2_special2_thumb3);
|
||||
fm_read2_special2_tv_read = (TextView) itemView.findViewById(R.id.fm_read2_special2_tv_read);
|
||||
fm_read2_special2_tv_type = (TextView) itemView.findViewById(R.id.fm_read2_special2_tv_type);
|
||||
}
|
||||
|
||||
@ -2,9 +2,9 @@ package com.gh.gamecenter.adapter.viewholder;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.gamecenter.R;
|
||||
|
||||
/**
|
||||
@ -13,7 +13,7 @@ import com.gh.gamecenter.R;
|
||||
public class NewsImage3ViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public TextView fm_read2_special1_title;
|
||||
public ImageView fm_read2_special1_thumb;
|
||||
public SimpleDraweeView fm_read2_special1_thumb;
|
||||
public TextView fm_read2_special1_tv_read;
|
||||
public TextView fm_read2_special1_tv_type;
|
||||
|
||||
@ -21,7 +21,7 @@ public class NewsImage3ViewHolder extends RecyclerView.ViewHolder {
|
||||
super(itemView);
|
||||
|
||||
fm_read2_special1_title = (TextView) itemView.findViewById(R.id.fm_read2_special1_title);
|
||||
fm_read2_special1_thumb = (ImageView) itemView.findViewById(R.id.fm_read2_special1_thumb);
|
||||
fm_read2_special1_thumb = (SimpleDraweeView) itemView.findViewById(R.id.fm_read2_special1_thumb);
|
||||
fm_read2_special1_tv_read = (TextView) itemView.findViewById(R.id.fm_read2_special1_tv_read);
|
||||
fm_read2_special1_tv_type = (TextView) itemView.findViewById(R.id.fm_read2_special1_tv_type);
|
||||
}
|
||||
|
||||
@ -2,9 +2,9 @@ package com.gh.gamecenter.adapter.viewholder;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.gamecenter.R;
|
||||
|
||||
/**
|
||||
@ -12,14 +12,14 @@ import com.gh.gamecenter.R;
|
||||
*/
|
||||
public class NewsImageViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public ImageView newsThumb;
|
||||
public SimpleDraweeView newsThumb;
|
||||
public TextView newsMainTitle;
|
||||
public TextView newsSubTitle;
|
||||
|
||||
public NewsImageViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
newsThumb = (ImageView) itemView.findViewById(R.id.news_thumb);
|
||||
newsThumb = (SimpleDraweeView) itemView.findViewById(R.id.news_thumb);
|
||||
newsMainTitle = (TextView) itemView.findViewById(R.id.news_main_title);
|
||||
newsSubTitle = (TextView) itemView.findViewById(R.id.news_sub_title);
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.gamecenter.R;
|
||||
|
||||
/**
|
||||
@ -18,7 +19,7 @@ public class PlatformViewHolder extends RecyclerView.ViewHolder {
|
||||
public TextView download_item_tv_hint;
|
||||
public ImageView download_item_open_collection;
|
||||
public ImageView download_item_colse_collection;
|
||||
public ImageView download_item_iv_pic;
|
||||
public SimpleDraweeView download_item_iv_pic;
|
||||
public ProgressBar download_item_progressbar;
|
||||
|
||||
public PlatformViewHolder(View itemView) {
|
||||
@ -30,7 +31,7 @@ public class PlatformViewHolder extends RecyclerView.ViewHolder {
|
||||
.findViewById(R.id.download_item_tv_status);
|
||||
download_item_progressbar = (ProgressBar) itemView
|
||||
.findViewById(R.id.download_item_progressbar);
|
||||
download_item_iv_pic = (ImageView) itemView
|
||||
download_item_iv_pic = (SimpleDraweeView) itemView
|
||||
.findViewById(R.id.download_item_iv_pic);
|
||||
download_item_tv_hint = (TextView) itemView
|
||||
.findViewById(R.id.download_item_tv_hint);
|
||||
|
||||
@ -17,7 +17,6 @@ import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.DialogUtils;
|
||||
import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.FileUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.util.NetworkUtils;
|
||||
import com.gh.common.util.PackageUtils;
|
||||
import com.gh.common.util.PlatformUtils;
|
||||
@ -149,9 +148,9 @@ public class GameDownloadAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
||||
|
||||
String icon = downloadEntity.getIcon();
|
||||
if (!TextUtils.isEmpty(icon)) {
|
||||
ImageUtils.getInstance(context).display(icon, viewHolder.dm_item_iv_icon);
|
||||
viewHolder.dm_item_iv_icon.setImageURI(icon);
|
||||
} else {
|
||||
viewHolder.dm_item_iv_icon.setImageResource(R.drawable.logo);
|
||||
viewHolder.dm_item_iv_icon.setImageURI("res:///" + R.drawable.logo);
|
||||
}
|
||||
|
||||
if (downloadEntity.getName().contains("光环助手")
|
||||
|
||||
@ -6,6 +6,7 @@ import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.gamecenter.R;
|
||||
|
||||
/**
|
||||
@ -13,7 +14,7 @@ import com.gh.gamecenter.R;
|
||||
*/
|
||||
public class GameDownloadViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public ImageView dm_item_iv_icon;
|
||||
public SimpleDraweeView dm_item_iv_icon;
|
||||
public TextView dm_item_tv_title;
|
||||
public TextView dm_item_tv_downloads;
|
||||
public ImageView dm_item_iv_delete;
|
||||
@ -24,7 +25,7 @@ public class GameDownloadViewHolder extends RecyclerView.ViewHolder {
|
||||
public GameDownloadViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
dm_item_iv_icon = (ImageView) itemView.findViewById(R.id.dm_item_iv_icon);
|
||||
dm_item_iv_icon = (SimpleDraweeView) itemView.findViewById(R.id.dm_item_iv_icon);
|
||||
dm_item_tv_title = (TextView) itemView.findViewById(R.id.dm_item_tv_title);
|
||||
dm_item_tv_downloads = (TextView) itemView.findViewById(R.id.dm_item_tv_downloads);
|
||||
dm_item_iv_delete = (ImageView) itemView.findViewById(R.id.dm_item_iv_delete);
|
||||
|
||||
@ -20,7 +20,6 @@ import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.DialogUtils;
|
||||
import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.FileUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.util.MD5Utils;
|
||||
import com.gh.common.util.NetworkUtils;
|
||||
import com.gh.common.util.PackageUtils;
|
||||
@ -387,8 +386,9 @@ public class GameUpdateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||
if (updateEntity.getName().contains("光环助手")) {
|
||||
viewHolder.gu_item_iv_icon.setImageResource(R.drawable.logo);
|
||||
} else {
|
||||
ImageUtils.getInstance(context).display(
|
||||
updateEntity.getIcon(), viewHolder.gu_item_iv_icon);
|
||||
// ImageUtils.getInstance(context).display(
|
||||
// updateEntity.getIcon(), viewHolder.gu_item_iv_icon);
|
||||
viewHolder.gu_item_iv_icon.setImageURI(updateEntity.getIcon());
|
||||
}
|
||||
|
||||
final String platform = PlatformUtils.getInstance(context)
|
||||
|
||||
@ -2,9 +2,9 @@ package com.gh.gamecenter.download;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.gamecenter.R;
|
||||
|
||||
/**
|
||||
@ -12,7 +12,7 @@ import com.gh.gamecenter.R;
|
||||
*/
|
||||
public class GameUpdateViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public ImageView gu_item_iv_icon;
|
||||
public SimpleDraweeView gu_item_iv_icon;
|
||||
public TextView gu_item_tv_name;
|
||||
public TextView gu_item_tv_current;
|
||||
public TextView gu_item_tv_new;
|
||||
@ -21,7 +21,7 @@ public class GameUpdateViewHolder extends RecyclerView.ViewHolder {
|
||||
public GameUpdateViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
gu_item_iv_icon = (ImageView) itemView.findViewById(R.id.gu_item_iv_icon);
|
||||
gu_item_iv_icon = (SimpleDraweeView) itemView.findViewById(R.id.gu_item_iv_icon);
|
||||
gu_item_tv_name = (TextView) itemView.findViewById(R.id.gu_item_tv_name);
|
||||
gu_item_tv_current = (TextView) itemView.findViewById(R.id.gu_item_tv_current);
|
||||
gu_item_tv_new = (TextView) itemView.findViewById(R.id.gu_item_tv_new);
|
||||
|
||||
@ -18,6 +18,14 @@ public class ConcernEntity {
|
||||
private String content;
|
||||
private int time;
|
||||
private List<String> img;
|
||||
private String link;
|
||||
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
public void setLink(String link) {
|
||||
this.link = link;
|
||||
}
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@ -41,6 +41,17 @@ public class GameEntity {
|
||||
|
||||
private String link;
|
||||
|
||||
@SerializedName("concern_article_exists")
|
||||
private boolean exists = true;
|
||||
|
||||
public boolean isExists() {
|
||||
return exists;
|
||||
}
|
||||
|
||||
public void setExists(boolean exists) {
|
||||
this.exists = exists;
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
@ -599,7 +599,7 @@ public class Game1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
} else {
|
||||
holder.home2_game_order.setVisibility(View.GONE);
|
||||
}
|
||||
ImageUtils.getInstance(context).display(gameEntity.getIcon(), holder.gameThumb);
|
||||
holder.gameThumb.setImageURI(gameEntity.getImage());
|
||||
holder.gameNameAndSize.setText(gameEntity.getName());
|
||||
if (gameEntity.getApk() == null || gameEntity.getApk().isEmpty()) {
|
||||
holder.gameDes.setText(gameEntity.getBrief());
|
||||
@ -727,7 +727,7 @@ public class Game1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
} else {
|
||||
holder.home1_game_order.setVisibility(View.GONE);
|
||||
}
|
||||
ImageUtils.getInstance(context).display(gameEntity.getIcon(), holder.gameThumb);
|
||||
holder.gameThumb.setImageURI(gameEntity.getIcon());
|
||||
if (gameEntity.isPluggable()) {
|
||||
holder.gameNameAndSize.setText(String.format("%s - %s", gameEntity.getName(),
|
||||
PlatformUtils.getInstance(context).getPlatformName(
|
||||
@ -799,7 +799,7 @@ public class Game1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
final String name = subjectList.get(i).getName();
|
||||
String tag = entity.getImage();
|
||||
holder.image.setTag(tag);
|
||||
ImageUtils.getInstance(context).display(entity.getImage(), holder.image, R.drawable.preload, context, 16);//默认应该设置占位符,防止图片混乱
|
||||
ImageUtils.getInstance(context).display(entity.getImage(), holder.image, context, 16);
|
||||
holder.image.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
@ -382,7 +382,7 @@ public class Game2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
} else {
|
||||
holder.home1_game_order.setVisibility(View.GONE);
|
||||
}
|
||||
ImageUtils.getInstance(context).display(entity.getIcon(), holder.gameThumb);
|
||||
holder.gameThumb.setImageURI(entity.getIcon());
|
||||
holder.gameNameAndSize.setText(entity.getName());
|
||||
if (entity.getApk() == null || entity.getApk().isEmpty()) {
|
||||
holder.gameDes.setText(entity.getBrief());
|
||||
@ -469,7 +469,7 @@ public class Game2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
} else {
|
||||
holder.home2_game_order.setVisibility(View.GONE);
|
||||
}
|
||||
ImageUtils.getInstance(context).display(gameEntity.getIcon(), holder.gameThumb);
|
||||
holder.gameThumb.setImageURI(gameEntity.getIcon());
|
||||
holder.gameNameAndSize.setText(gameEntity.getName());
|
||||
if (gameEntity.getApk() == null || gameEntity.getApk().isEmpty()) {
|
||||
holder.gameDes.setText(gameEntity.getBrief());
|
||||
@ -551,7 +551,8 @@ public class Game2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
}
|
||||
final GameEntity entity = gameEntity;
|
||||
final String name = subjectList.get(i).getName();
|
||||
ImageUtils.getInstance(context).display(entity.getImage(), holder.image, R.drawable.preload, context, 16);//默认应该设置占位符,防止图片混乱
|
||||
ImageUtils.getInstance(context).display(entity.getImage(), holder.image, context, 16);
|
||||
holder.image.setImageURI(entity.getImage());
|
||||
holder.image.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
@ -19,7 +19,6 @@ import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.DownloadItemUtils;
|
||||
import com.gh.common.util.GameUtils;
|
||||
import com.gh.common.util.GameViewUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.view.CardLinearLayout;
|
||||
import com.gh.download.DownloadManager;
|
||||
import com.gh.gamecenter.R;
|
||||
@ -245,7 +244,8 @@ public class Game3FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
((CardLinearLayout) holder.itemView).setBottom(false);
|
||||
}
|
||||
|
||||
ImageUtils.getInstance(context).display(gameEntity.getIcon(), holder.gameThumb);
|
||||
// ImageUtils.getInstance(context).display(gameEntity.getIcon(), holder.gameThumb);
|
||||
holder.gameThumb.setImageURI(gameEntity.getIcon());
|
||||
holder.gameNameAndSize.setText(gameEntity.getName());
|
||||
if (gameEntity.getApk() == null || gameEntity.getApk().isEmpty()) {
|
||||
holder.gameDes.setText(gameEntity.getBrief());
|
||||
|
||||
@ -11,20 +11,19 @@ import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.base.AppController;
|
||||
import com.gh.common.constant.Config;
|
||||
import com.gh.common.util.ConcernUtils;
|
||||
import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.DialogUtils;
|
||||
import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.util.NewsUtils;
|
||||
import com.gh.common.util.TokenUtils;
|
||||
import com.gh.common.util.Utils;
|
||||
@ -441,13 +440,13 @@ public class GameDetailAdapter extends RecyclerView.Adapter {
|
||||
int childCount = viewHolder.gamedetail_ll_plugin.getChildCount();
|
||||
if (childCount == 0) {
|
||||
View view;
|
||||
ImageView iv_hint;
|
||||
SimpleDraweeView iv_hint;
|
||||
TextView tv_hint;
|
||||
TextView tv_content;
|
||||
TagEntity tagEntity;
|
||||
for (int i = 0, size = tags.size() + 1; i < size; i++) {
|
||||
view = View.inflate(context, R.layout.gamedetail_plugin_item, null);
|
||||
iv_hint = (ImageView) view.findViewById(R.id.gamedetail_iv_hint);
|
||||
iv_hint = (SimpleDraweeView) view.findViewById(R.id.gamedetail_iv_hint);
|
||||
tv_hint = (TextView) view.findViewById(R.id.gamedetail_tv_hint);
|
||||
tv_content = (TextView) view.findViewById(R.id.gamedetail_tv_content);
|
||||
if (i == 0) {
|
||||
@ -461,7 +460,7 @@ public class GameDetailAdapter extends RecyclerView.Adapter {
|
||||
tagEntity = tags.get(i - 1);
|
||||
tv_content.setText(tagEntity.getDes());
|
||||
tv_hint.setText(tagEntity.getName());
|
||||
ImageUtils.getInstance(context).display(tagEntity.getIcon(), iv_hint);
|
||||
iv_hint.setImageURI(tagEntity.getIcon());
|
||||
}
|
||||
viewHolder.gamedetail_ll_plugin.addView(view);
|
||||
}
|
||||
@ -523,7 +522,7 @@ public class GameDetailAdapter extends RecyclerView.Adapter {
|
||||
linearLayout.setGravity(Gravity.CENTER_VERTICAL | Gravity.RIGHT);
|
||||
}
|
||||
|
||||
ImageView pluginIcon = new ImageView(context);
|
||||
SimpleDraweeView pluginIcon = new SimpleDraweeView(context);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DisplayUtils.dip2px(context, 15), DisplayUtils.dip2px(context, 15));
|
||||
params.setMargins(0, 0, DisplayUtils.dip2px(context, 5), 0);
|
||||
pluginIcon.setLayoutParams(params);
|
||||
@ -540,7 +539,7 @@ public class GameDetailAdapter extends RecyclerView.Adapter {
|
||||
@Override
|
||||
public void onBindViewHolder(PluginAdapter.ViewHolder holder, int position) {
|
||||
holder.pluginTitle.setText(tags.get(position).getName());
|
||||
ImageUtils.getInstance(context).display(tags.get(position).getIcon(), holder.pluginIcon);
|
||||
holder.pluginIcon.setImageURI(tags.get(position).getIcon());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -551,13 +550,13 @@ public class GameDetailAdapter extends RecyclerView.Adapter {
|
||||
public class ViewHolder extends RecyclerView.ViewHolder{
|
||||
|
||||
LinearLayout linearLayout;
|
||||
ImageView pluginIcon;
|
||||
SimpleDraweeView pluginIcon;
|
||||
TextView pluginTitle;
|
||||
|
||||
public ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
linearLayout = (LinearLayout) itemView;
|
||||
pluginIcon = (ImageView) linearLayout.getChildAt(0);
|
||||
pluginIcon = (SimpleDraweeView) linearLayout.getChildAt(0);
|
||||
pluginTitle = (TextView) linearLayout.getChildAt(1);
|
||||
}
|
||||
}
|
||||
@ -575,7 +574,7 @@ public class GameDetailAdapter extends RecyclerView.Adapter {
|
||||
}
|
||||
|
||||
viewHolder.gamedetail_tv_name.setText(gameEntity.getName());
|
||||
ImageUtils.getInstance(context).display(gameEntity.getIcon(), viewHolder.gamedetail_iv_thumb);
|
||||
viewHolder.gamedetail_iv_thumb.setImageURI(gameEntity.getIcon());
|
||||
if (gameEntity.getApk() == null || gameEntity.getApk().isEmpty()) {
|
||||
viewHolder.gamedetail_tv_info.setText("");
|
||||
} else {
|
||||
|
||||
@ -2,9 +2,9 @@ package com.gh.gamecenter.gamedetail;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.gamecenter.R;
|
||||
|
||||
/**
|
||||
@ -12,7 +12,7 @@ import com.gh.gamecenter.R;
|
||||
*/
|
||||
public class GameDetailTopViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public ImageView gamedetail_iv_thumb;
|
||||
public SimpleDraweeView gamedetail_iv_thumb;
|
||||
public TextView gamedetail_tv_name;
|
||||
public TextView gamedetail_tv_info;
|
||||
public TextView gamedetail_tv_concern;
|
||||
@ -20,7 +20,7 @@ public class GameDetailTopViewHolder extends RecyclerView.ViewHolder {
|
||||
public GameDetailTopViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
gamedetail_iv_thumb = (ImageView) itemView.findViewById(R.id.gamedetail_iv_thumb);
|
||||
gamedetail_iv_thumb = (SimpleDraweeView) itemView.findViewById(R.id.gamedetail_iv_thumb);
|
||||
gamedetail_tv_name = (TextView) itemView.findViewById(R.id.gamedetail_tv_name);
|
||||
gamedetail_tv_info = (TextView) itemView.findViewById(R.id.gamedetail_tv_info);
|
||||
gamedetail_tv_concern = (TextView) itemView.findViewById(R.id.gamedetail_tv_concern);
|
||||
|
||||
@ -8,7 +8,6 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.gamecenter.R;
|
||||
import com.gh.gamecenter.ViewImageActivity;
|
||||
import com.gh.gamecenter.manager.DataCollectionManager;
|
||||
@ -40,7 +39,7 @@ public class GameGalleryAdapter extends RecyclerView.Adapter<GameGalleryViewHold
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final GameGalleryViewHolder holder, int position) {
|
||||
ImageUtils.getInstance(context).display(gallery.get(position), holder.screenshot_item_iv);
|
||||
holder.screenshot_item_iv.setImageURI(gallery.get(position));
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
@ -2,8 +2,8 @@ package com.gh.gamecenter.gamedetail;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.gamecenter.R;
|
||||
|
||||
/**
|
||||
@ -11,12 +11,12 @@ import com.gh.gamecenter.R;
|
||||
*/
|
||||
public class GameGalleryViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public ImageView screenshot_item_iv;
|
||||
public SimpleDraweeView screenshot_item_iv;
|
||||
|
||||
public GameGalleryViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
screenshot_item_iv = (ImageView) itemView.findViewById(R.id.screenshot_item_iv);
|
||||
screenshot_item_iv = (SimpleDraweeView) itemView.findViewById(R.id.screenshot_item_iv);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ public class News1Fragment extends BaseFragment implements SwipeRefreshLayout.On
|
||||
//Fragment界面切换事件
|
||||
public void onEventMainThread(EBUISwitch busNine) {
|
||||
if ("NewsFragment".equals(busNine.getFrom())) {
|
||||
if (busNine.getPosition() == 0) {
|
||||
if (busNine.getPosition() == 1) {
|
||||
if (original_pb_loading.getVisibility() == View.VISIBLE) {
|
||||
adapter.addList(0);
|
||||
}
|
||||
|
||||
@ -274,7 +274,7 @@ public class News1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
NewsUtils.startNewsActivity(context, newsEntity, "(资讯-资讯)");
|
||||
}
|
||||
});
|
||||
ImageUtils.getInstance(context).display(newsEntity.getThumbnail().getUrl().get(0), viewHolder.fm_read_iv_thumb);
|
||||
viewHolder.fm_read_iv_thumb.setImageURI(newsEntity.getThumbnail().getUrl().get(0));
|
||||
viewHolder.fm_read_tv_title.setText(newsEntity.getTitle());
|
||||
Integer views = viewsMap.get(newsEntity.getId());
|
||||
if (views == null) {
|
||||
@ -342,12 +342,9 @@ public class News1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
}
|
||||
});
|
||||
viewHolder.fm_read2_special2_title.setText(newsEntity.getTitle());
|
||||
ImageUtils.getInstance(context).display(newsEntity.getThumbnail().getUrl().get(0),
|
||||
viewHolder.fm_read2_special2_thumb1);
|
||||
ImageUtils.getInstance(context).display(newsEntity.getThumbnail().getUrl().get(1),
|
||||
viewHolder.fm_read2_special2_thumb2);
|
||||
ImageUtils.getInstance(context).display(newsEntity.getThumbnail().getUrl().get(2),
|
||||
viewHolder.fm_read2_special2_thumb3);
|
||||
viewHolder.fm_read2_special2_thumb1.setImageURI(newsEntity.getThumbnail().getUrl().get(0));
|
||||
viewHolder.fm_read2_special2_thumb2.setImageURI(newsEntity.getThumbnail().getUrl().get(1));
|
||||
viewHolder.fm_read2_special2_thumb3.setImageURI(newsEntity.getThumbnail().getUrl().get(2));
|
||||
Integer views = viewsMap.get(newsEntity.getId());
|
||||
if (views == null) {
|
||||
viewHolder.fm_read2_special2_tv_read.setVisibility(View.GONE);
|
||||
@ -395,8 +392,8 @@ public class News1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
}
|
||||
});
|
||||
viewHolder.fm_read2_special1_title.setText(newsEntity.getTitle());
|
||||
ImageUtils.getInstance(context).display(newsEntity.getThumbnail().getUrl().get(0),
|
||||
viewHolder.fm_read2_special1_thumb, R.drawable.preload, context, 40);
|
||||
ImageUtils.getInstance(context).display(newsEntity.getThumbnail().getUrl().get(0)
|
||||
, viewHolder.fm_read2_special1_thumb, context, 40);
|
||||
Integer views = viewsMap.get(newsEntity.getId());
|
||||
if (views == null) {
|
||||
viewHolder.fm_read2_special1_tv_read.setVisibility(View.GONE);
|
||||
|
||||
@ -109,7 +109,7 @@ public class News2Fragment extends BaseFragment implements SwipeRefreshLayout.On
|
||||
//Fragment界面切换事件
|
||||
public void onEventMainThread(EBUISwitch busNine) {
|
||||
if ("NewsFragment".equals(busNine.getFrom())) {
|
||||
if (busNine.getPosition() == 1) {
|
||||
if (busNine.getPosition() == 2) {
|
||||
if (original_pb_loading.getVisibility() == View.VISIBLE) {
|
||||
adapter.addList(0);
|
||||
}
|
||||
|
||||
@ -276,7 +276,7 @@ public class News2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
}
|
||||
});
|
||||
viewHolder.fm_read_tv_read.setTextColor(Color.parseColor("#9a9a9a"));
|
||||
ImageUtils.getInstance(context).display(newsEntity.getThumbnail().getUrl().get(0), viewHolder.fm_read_iv_thumb);
|
||||
viewHolder.fm_read_iv_thumb.setImageURI(newsEntity.getThumbnail().getUrl().get(0));
|
||||
viewHolder.fm_read_tv_title.setText(newsEntity.getTitle());
|
||||
Integer views = viewsMap.get(newsEntity.getId());
|
||||
if (views == null) {
|
||||
@ -338,12 +338,9 @@ public class News2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
}
|
||||
});
|
||||
viewHolder.fm_read2_special2_title.setText(newsEntity.getTitle());
|
||||
ImageUtils.getInstance(context).display(newsEntity.getThumbnail().getUrl().get(0),
|
||||
viewHolder.fm_read2_special2_thumb1);
|
||||
ImageUtils.getInstance(context).display(newsEntity.getThumbnail().getUrl().get(1),
|
||||
viewHolder.fm_read2_special2_thumb2);
|
||||
ImageUtils.getInstance(context).display(newsEntity.getThumbnail().getUrl().get(2),
|
||||
viewHolder.fm_read2_special2_thumb3);
|
||||
viewHolder.fm_read2_special2_thumb1.setImageURI(newsEntity.getThumbnail().getUrl().get(0));
|
||||
viewHolder.fm_read2_special2_thumb2.setImageURI(newsEntity.getThumbnail().getUrl().get(1));
|
||||
viewHolder.fm_read2_special2_thumb3.setImageURI(newsEntity.getThumbnail().getUrl().get(2));
|
||||
Integer views = viewsMap.get(newsEntity.getId());
|
||||
if (views == null) {
|
||||
viewHolder.fm_read2_special2_tv_read.setVisibility(View.GONE);
|
||||
@ -391,8 +388,8 @@ public class News2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
}
|
||||
});
|
||||
viewHolder.fm_read2_special1_title.setText(newsEntity.getTitle());
|
||||
ImageUtils.getInstance(context).display(newsEntity.getThumbnail().getUrl().get(0),
|
||||
viewHolder.fm_read2_special1_thumb, R.drawable.preload, context, 40);
|
||||
ImageUtils.getInstance(context).display(newsEntity.getThumbnail().getUrl().get(0)
|
||||
, viewHolder.fm_read2_special1_thumb, context, 40);
|
||||
Integer views = viewsMap.get(newsEntity.getId());
|
||||
if (views == null) {
|
||||
viewHolder.fm_read2_special1_tv_read.setVisibility(View.GONE);
|
||||
|
||||
@ -149,7 +149,7 @@ public class News3Fragment extends BaseFragment implements SwipeRefreshLayout.On
|
||||
//Fragment界面切换事件
|
||||
public void onEventMainThread(EBUISwitch busNine) {
|
||||
if ("NewsFragment".equals(busNine.getFrom())) {
|
||||
if (busNine.getPosition() == 2) {
|
||||
if (busNine.getPosition() == 3) {
|
||||
if (news_pb_loading.getVisibility() == View.VISIBLE) {
|
||||
adapter.addList(0);
|
||||
}
|
||||
|
||||
@ -19,7 +19,6 @@ import com.gh.base.AppController;
|
||||
import com.gh.common.constant.Config;
|
||||
import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.util.NewsUtils;
|
||||
import com.gh.common.view.CardLinearLayout;
|
||||
import com.gh.common.view.CardRelativeLayout;
|
||||
@ -356,7 +355,7 @@ public class News3FragmentAdapter extends
|
||||
NewsImageViewHolder viewHolder = (NewsImageViewHolder) holder;
|
||||
|
||||
final NewsEntity newsEntity = todayNewsList.get(0);
|
||||
ImageUtils.getInstance(context).display(newsEntity.getThumb(), viewHolder.newsThumb);
|
||||
viewHolder.newsThumb.setImageURI(newsEntity.getThumb());
|
||||
String title = newsEntity.getTitle();
|
||||
if (title.contains("》")) {
|
||||
viewHolder.newsMainTitle.setText(title.substring(0, title.indexOf("》") + 1));
|
||||
|
||||
@ -15,11 +15,13 @@ import android.widget.TextView;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gc.materialdesign.views.ProgressBarCircularIndeterminate;
|
||||
import com.gh.base.AppController;
|
||||
import com.gh.base.BaseFragment;
|
||||
import com.gh.common.constant.Config;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.util.PackageUtils;
|
||||
import com.gh.gamecenter.R;
|
||||
import com.gh.gamecenter.db.info.ConcernInfo;
|
||||
import com.gh.gamecenter.entity.GameEntity;
|
||||
@ -37,6 +39,9 @@ import org.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -148,7 +153,7 @@ public class News4Fragment extends BaseFragment implements SwipeRefreshLayout.On
|
||||
//Fragment界面切换事件
|
||||
public void onEventMainThread(EBUISwitch swith) {
|
||||
if ("NewsFragment".equals(swith.getFrom())) {
|
||||
if (swith.getPosition() == 3) {
|
||||
if (swith.getPosition() == 0) {
|
||||
if (news_pb_loading.getVisibility() == View.VISIBLE) {
|
||||
adapter.loadDataByKey(0);
|
||||
}
|
||||
@ -255,6 +260,7 @@ public class News4Fragment extends BaseFragment implements SwipeRefreshLayout.On
|
||||
news_rv_show.setVisibility(View.GONE);
|
||||
reuse_none_data.setVisibility(View.VISIBLE);
|
||||
news_swipe_refresh.setRefreshing(false);
|
||||
news4_recommend_ly.setVisibility(View.GONE);
|
||||
|
||||
initInstallGame();
|
||||
}
|
||||
@ -264,8 +270,38 @@ public class News4Fragment extends BaseFragment implements SwipeRefreshLayout.On
|
||||
//推荐关注改为手机安装的游戏+光环助手
|
||||
private void initInstallGame() {
|
||||
List<ConcernInfo> installedList = concernManager.getInstalledGame();
|
||||
String gameId;
|
||||
List<Long> installedTimes = new ArrayList<>();
|
||||
|
||||
count = 0;
|
||||
|
||||
//获取第一次安装时间,多版本获取最近安装版本时间
|
||||
for (ConcernInfo concernInfo : installedList) {
|
||||
HashMap<String, Boolean> packageNames = concernInfo.getPackageNames();
|
||||
for (String s : packageNames.keySet()) {
|
||||
if (packageNames.get(s)){
|
||||
long installedTime = PackageUtils.getInstalledTime(getActivity(), s);
|
||||
installedTimes.add(installedTime);
|
||||
}
|
||||
}
|
||||
Collections.sort(installedTimes, new Comparator<Long>() {
|
||||
@Override
|
||||
public int compare(Long lhs, Long rhs) {
|
||||
return rhs.compareTo(lhs);
|
||||
}
|
||||
});
|
||||
concernInfo.setTime(installedTimes.get(0));//Time改为第一次安装时间
|
||||
installedTimes.clear();
|
||||
}
|
||||
|
||||
//对已安装的游戏排序
|
||||
Collections.sort(installedList, new Comparator<ConcernInfo>() {
|
||||
@Override
|
||||
public int compare(ConcernInfo lhs, ConcernInfo rhs) {
|
||||
return String.valueOf(rhs.getTime()).compareTo(String.valueOf(lhs.getTime()));
|
||||
}
|
||||
});
|
||||
|
||||
String gameId;
|
||||
final int size = installedList.size() + 1;
|
||||
|
||||
installGameList = new ArrayList<>();
|
||||
@ -288,7 +324,7 @@ public class News4Fragment extends BaseFragment implements SwipeRefreshLayout.On
|
||||
|
||||
if (finalI == size - 1){
|
||||
recommendGameList.add(gameEntity);
|
||||
}else {
|
||||
}else if (gameEntity.isExists()){
|
||||
installGameList.add(gameEntity);
|
||||
}
|
||||
|
||||
@ -344,7 +380,8 @@ public class News4Fragment extends BaseFragment implements SwipeRefreshLayout.On
|
||||
//自由排序
|
||||
if (recommendGameList.size() < 4){
|
||||
for (GameEntity gameEntity : installGameList) {
|
||||
if (recommendGameList.size() >= 4) continue;
|
||||
if (recommendGameList.size() >= 4
|
||||
|| concernManager.isConcern(gameEntity.getId())) continue;
|
||||
recommendGameList.add(gameEntity);
|
||||
}
|
||||
}
|
||||
@ -365,7 +402,7 @@ public class News4Fragment extends BaseFragment implements SwipeRefreshLayout.On
|
||||
private void initConcernRecommendView() {
|
||||
news4_concern_ly.removeAllViews();
|
||||
|
||||
ImageView ivIcon;
|
||||
SimpleDraweeView ivIcon;
|
||||
TextView tvName;
|
||||
ImageView ivConcern;
|
||||
|
||||
@ -376,13 +413,13 @@ public class News4Fragment extends BaseFragment implements SwipeRefreshLayout.On
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
params.weight = 1;
|
||||
|
||||
ivIcon = (ImageView) view.findViewById(R.id.concern_item_icon);
|
||||
ivIcon = (SimpleDraweeView) view.findViewById(R.id.concern_item_icon);
|
||||
tvName = (TextView) view.findViewById(R.id.concern_item_name);
|
||||
ivConcern = (ImageView) view.findViewById(R.id.concern_item_concern_iv);
|
||||
view.findViewById(R.id.concern_item_concern).setVisibility(View.GONE);
|
||||
|
||||
ivConcern.setVisibility(View.VISIBLE);
|
||||
ImageUtils.getInstance(getActivity()).display(recommendGameList.get(i).getIcon(), ivIcon);
|
||||
ImageUtils.getInstance(getActivity()).display(recommendGameList.get(i).getIcon(), ivIcon, R.drawable.ocupy, getActivity());
|
||||
tvName.setText(recommendGameList.get(i).getName());
|
||||
ivConcern.setImageResource(R.drawable.concern_select_true);
|
||||
|
||||
|
||||
@ -8,7 +8,6 @@ import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
@ -18,6 +17,8 @@ import com.android.volley.Response;
|
||||
import com.android.volley.TimeoutError;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.android.volley.toolbox.DiskBasedCache;
|
||||
import com.facebook.drawee.drawable.ScalingUtils;
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.base.AppController;
|
||||
import com.gh.common.constant.Config;
|
||||
import com.gh.common.util.ConcernUtils;
|
||||
@ -32,6 +33,7 @@ import com.gh.common.view.CardLinearLayout;
|
||||
import com.gh.gamecenter.NewsDetailActivity;
|
||||
import com.gh.gamecenter.R;
|
||||
import com.gh.gamecenter.ViewImageActivity;
|
||||
import com.gh.gamecenter.WebActivity;
|
||||
import com.gh.gamecenter.adapter.viewholder.FooterViewHolder;
|
||||
import com.gh.gamecenter.db.info.ConcernInfo;
|
||||
import com.gh.gamecenter.entity.ConcernEntity;
|
||||
@ -486,7 +488,8 @@ public class News4FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
- DisplayUtils.dip2px(context, 34), viewHolder.contentPicLl, concernEntity.getImg());
|
||||
}
|
||||
|
||||
ImageUtils.getInstance(context).display(concernEntity.getGameIcon(), viewHolder.concernThumb);
|
||||
// ImageUtils.getInstance(context).display(concernEntity.getGameIcon(), viewHolder.concernThumb);
|
||||
viewHolder.concernThumb.setImageURI(concernEntity.getGameIcon());
|
||||
viewHolder.concernContent.setText(Html.fromHtml(concernEntity.getContent()));
|
||||
viewHolder.concernTitle.setText(concernEntity.getGameName());
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd", Locale.getDefault());
|
||||
@ -536,10 +539,19 @@ public class News4FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
//统计阅读量
|
||||
statNewsViews(concernEntity.getId(), viewHolder.getPosition());
|
||||
|
||||
Intent intent = new Intent(context, NewsDetailActivity.class);
|
||||
intent.putExtra("newsId", concernEntity.getId());
|
||||
intent.putExtra("entrance", "(资讯-关注)");
|
||||
context.startActivity(intent);
|
||||
if (concernEntity.getLink() != null){
|
||||
Intent intent = new Intent(context, WebActivity.class);
|
||||
intent.putExtra("url",
|
||||
concernEntity.getLink());
|
||||
intent.putExtra("gameName", concernEntity.getGameName());
|
||||
context.startActivity(intent);
|
||||
}else {
|
||||
Intent intent = new Intent(context, NewsDetailActivity.class);
|
||||
intent.putExtra("newsId", concernEntity.getId());
|
||||
intent.putExtra("entrance", "(资讯-关注)");
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -607,33 +619,33 @@ public class News4FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
}
|
||||
}
|
||||
|
||||
private ImageView getImageView(final List<String> list, final int position, int width, int type) {
|
||||
ImageView imageView;
|
||||
private SimpleDraweeView getImageView(final List<String> list, final int position, int width, int type) {
|
||||
SimpleDraweeView imageView;
|
||||
if (type == 0) {
|
||||
imageView = new ImageView(context);
|
||||
imageView = new SimpleDraweeView(context);
|
||||
LinearLayout.LayoutParams lparams = new LinearLayout.LayoutParams(
|
||||
0, width / 3 - DisplayUtils.dip2px(context, 4));
|
||||
lparams.setMargins(DisplayUtils.dip2px(context, 2), 0,
|
||||
DisplayUtils.dip2px(context, 2), DisplayUtils.dip2px(context, 4));
|
||||
lparams.weight = 1;
|
||||
imageView.setLayoutParams(lparams);
|
||||
ImageUtils.getInstance(context).display(list.get(position), imageView, ImageView.ScaleType.CENTER_CROP);
|
||||
ImageUtils.getInstance(context).display(list.get(position), imageView, ScalingUtils.ScaleType.CENTER_CROP, context);
|
||||
} else if (type == 1) {
|
||||
imageView = new ImageView(context);
|
||||
imageView = new SimpleDraweeView(context);
|
||||
LinearLayout.LayoutParams lparams = new LinearLayout.LayoutParams(width, width / 2);
|
||||
lparams.setMargins(DisplayUtils.dip2px(context, 2), 0,
|
||||
DisplayUtils.dip2px(context, 2), DisplayUtils.dip2px(context, 4));
|
||||
imageView.setLayoutParams(lparams);
|
||||
ImageUtils.getInstance(context).display(list.get(position), imageView, ImageView.ScaleType.CENTER_CROP);
|
||||
ImageUtils.getInstance(context).display(list.get(position), imageView, ScalingUtils.ScaleType.CENTER_CROP, context);
|
||||
} else {
|
||||
imageView = new ImageView(context);
|
||||
imageView = new SimpleDraweeView(context);
|
||||
LinearLayout.LayoutParams lparams = new LinearLayout.LayoutParams(
|
||||
0, width / 2 - DisplayUtils.dip2px(context, 4));
|
||||
lparams.setMargins(DisplayUtils.dip2px(context, 2), 0,
|
||||
DisplayUtils.dip2px(context, 2), DisplayUtils.dip2px(context, 4));
|
||||
lparams.weight = 1;
|
||||
imageView.setLayoutParams(lparams);
|
||||
ImageUtils.getInstance(context).display(list.get(position), imageView, ImageView.ScaleType.CENTER_CROP);
|
||||
ImageUtils.getInstance(context).display(list.get(position), imageView, ScalingUtils.ScaleType.CENTER_CROP, context);
|
||||
}
|
||||
imageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
||||
@ -2,10 +2,10 @@ package com.gh.gamecenter.news;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.gamecenter.R;
|
||||
|
||||
/**
|
||||
@ -13,7 +13,7 @@ import com.gh.gamecenter.R;
|
||||
*/
|
||||
public class NewsConcernViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public ImageView concernThumb;
|
||||
public SimpleDraweeView concernThumb;
|
||||
public LinearLayout contentPicLl;
|
||||
public TextView concernTitle;
|
||||
public TextView concerntTime;
|
||||
@ -25,7 +25,7 @@ public class NewsConcernViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
concernContent = (TextView) itemView.findViewById(R.id.concern_rv_item_content);
|
||||
concernRead = (TextView) itemView.findViewById(R.id.concern_rv_item_read);
|
||||
concernThumb = (ImageView) itemView.findViewById(R.id.concern_rv_item_thumb);
|
||||
concernThumb = (SimpleDraweeView) itemView.findViewById(R.id.concern_rv_item_thumb);
|
||||
concerntTime = (TextView) itemView.findViewById(R.id.concern_rv_item_time);
|
||||
concernTitle = (TextView) itemView.findViewById(R.id.concern_rv_item_title);
|
||||
contentPicLl = (LinearLayout) itemView.findViewById(R.id.concern_rv_item_iv_ll);
|
||||
|
||||
@ -47,7 +47,7 @@ public class NewsFragment extends HomeFragment implements View.OnClickListener,
|
||||
home_vp_content.setAdapter(new FragmentAdapter(getChildFragmentManager()));
|
||||
home_vp_content.addOnPageChangeListener(this);
|
||||
|
||||
currentItem = 0;
|
||||
currentItem = 1;
|
||||
if (savedInstanceState != null) {
|
||||
currentItem = savedInstanceState.getInt("currentItem");
|
||||
}
|
||||
@ -71,6 +71,16 @@ public class NewsFragment extends HomeFragment implements View.OnClickListener,
|
||||
}
|
||||
|
||||
private void initTextView() {
|
||||
tv_guanzhu = new TextView(getActivity());
|
||||
tv_guanzhu.setText("关注");
|
||||
tv_guanzhu.setTextColor(getResources().getColor(R.color.title));
|
||||
tv_guanzhu.setGravity(Gravity.CENTER);
|
||||
tv_guanzhu.setOnClickListener(this);
|
||||
LinearLayout.LayoutParams lparams4 = new LinearLayout.LayoutParams(
|
||||
0, DisplayUtils.dip2px(getActivity(), 35));
|
||||
lparams4.weight = 1;
|
||||
home_ll_top.addView(tv_guanzhu, lparams4);
|
||||
|
||||
tv_zixun = new TextView(getActivity());
|
||||
tv_zixun.setText("资讯");
|
||||
tv_zixun.setTextColor(getResources().getColor(R.color.theme));
|
||||
@ -101,15 +111,6 @@ public class NewsFragment extends HomeFragment implements View.OnClickListener,
|
||||
lparams3.weight = 1;
|
||||
home_ll_top.addView(tv_gonglve, lparams3);
|
||||
|
||||
tv_guanzhu = new TextView(getActivity());
|
||||
tv_guanzhu.setText("关注");
|
||||
tv_guanzhu.setTextColor(getResources().getColor(R.color.title));
|
||||
tv_guanzhu.setGravity(Gravity.CENTER);
|
||||
tv_guanzhu.setOnClickListener(this);
|
||||
LinearLayout.LayoutParams lparams4 = new LinearLayout.LayoutParams(
|
||||
0, DisplayUtils.dip2px(getActivity(), 35));
|
||||
lparams4.weight = 1;
|
||||
home_ll_top.addView(tv_guanzhu, lparams4);
|
||||
}
|
||||
|
||||
public class FragmentAdapter extends FragmentPagerAdapter{
|
||||
@ -121,13 +122,13 @@ public class NewsFragment extends HomeFragment implements View.OnClickListener,
|
||||
@Override
|
||||
public Fragment getItem(int i) {
|
||||
if (i == 0) {
|
||||
return new News1Fragment();
|
||||
} else if (i == 1) {
|
||||
return new News2Fragment();
|
||||
} else if (i == 2) {
|
||||
return new News3Fragment();
|
||||
} else {
|
||||
return new News4Fragment();
|
||||
} else if (i == 1) {
|
||||
return new News1Fragment();
|
||||
} else if (i == 2) {
|
||||
return new News2Fragment();
|
||||
} else {
|
||||
return new News3Fragment();
|
||||
}
|
||||
}
|
||||
|
||||
@ -141,13 +142,13 @@ public class NewsFragment extends HomeFragment implements View.OnClickListener,
|
||||
public void onClick(View v) {
|
||||
super.onClick(v);
|
||||
if (v == tv_zixun) {
|
||||
home_vp_content.setCurrentItem(0);
|
||||
} else if (v == tv_yuanchuang) {
|
||||
home_vp_content.setCurrentItem(1);
|
||||
} else if (v == tv_gonglve) {
|
||||
} else if (v == tv_yuanchuang) {
|
||||
home_vp_content.setCurrentItem(2);
|
||||
} else if (v == tv_guanzhu) {
|
||||
} else if (v == tv_gonglve) {
|
||||
home_vp_content.setCurrentItem(3);
|
||||
} else if (v == tv_guanzhu) {
|
||||
home_vp_content.setCurrentItem(0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,22 +168,22 @@ public class NewsFragment extends HomeFragment implements View.OnClickListener,
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
if (position == 0) {
|
||||
if (position == 1) {
|
||||
tv_zixun.setTextColor(getResources().getColor(R.color.theme));
|
||||
tv_yuanchuang.setTextColor(getResources().getColor(R.color.title));
|
||||
tv_gonglve.setTextColor(getResources().getColor(R.color.title));
|
||||
tv_guanzhu.setTextColor(getResources().getColor(R.color.title));
|
||||
} else if (position == 1) {
|
||||
} else if (position == 2) {
|
||||
tv_zixun.setTextColor(getResources().getColor(R.color.title));
|
||||
tv_yuanchuang.setTextColor(getResources().getColor(R.color.theme));
|
||||
tv_gonglve.setTextColor(getResources().getColor(R.color.title));
|
||||
tv_guanzhu.setTextColor(getResources().getColor(R.color.title));
|
||||
} else if (position == 2) {
|
||||
} else if (position == 3) {
|
||||
tv_zixun.setTextColor(getResources().getColor(R.color.title));
|
||||
tv_yuanchuang.setTextColor(getResources().getColor(R.color.title));
|
||||
tv_gonglve.setTextColor(getResources().getColor(R.color.theme));
|
||||
tv_guanzhu.setTextColor(getResources().getColor(R.color.title));
|
||||
}else if (position == 3){
|
||||
}else if (position == 0){
|
||||
tv_zixun.setTextColor(getResources().getColor(R.color.title));
|
||||
tv_yuanchuang.setTextColor(getResources().getColor(R.color.title));
|
||||
tv_gonglve.setTextColor(getResources().getColor(R.color.title));
|
||||
|
||||
@ -27,7 +27,6 @@ import com.gh.common.util.ConcernUtils;
|
||||
import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.DialogUtils;
|
||||
import com.gh.common.util.GameUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.util.NewsUtils;
|
||||
import com.gh.common.util.RandomUtils;
|
||||
import com.gh.common.util.TokenUtils;
|
||||
@ -240,7 +239,7 @@ public class NewsDetailAdapter extends RecyclerView.Adapter {
|
||||
}
|
||||
|
||||
private void initGameDetailTopViewHolder(GameDetailTopViewHolder viewHolder) {
|
||||
ImageUtils.getInstance(context).displayFile(gameEntity.getIcon(), viewHolder.gamedetail_iv_thumb);
|
||||
viewHolder.gamedetail_iv_thumb.setImageURI(gameEntity.getIcon());
|
||||
viewHolder.gamedetail_tv_name.setText(gameEntity.getName());
|
||||
if (gameEntity.getApk() != null && gameEntity.getApk().size() != 0) {
|
||||
for (int i = 0, size = gameEntity.getApk().size(); i < size; i++) {
|
||||
|
||||
@ -16,7 +16,6 @@ import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.DownloadItemUtils;
|
||||
import com.gh.common.util.GameUtils;
|
||||
import com.gh.common.util.GameViewUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.view.CardLinearLayout;
|
||||
import com.gh.download.DownloadManager;
|
||||
import com.gh.gamecenter.R;
|
||||
@ -213,7 +212,7 @@ public class ConcernFragmentAdapter extends RecyclerView.Adapter<RecyclerView.Vi
|
||||
((CardLinearLayout) holder.itemView).setBottom(false);
|
||||
}
|
||||
|
||||
ImageUtils.getInstance(context).display(gameEntity.getIcon(), holder.gameThumb);
|
||||
holder.gameThumb.setImageURI(gameEntity.getIcon());
|
||||
holder.gameNameAndSize.setText(gameEntity.getName());
|
||||
|
||||
if (gameEntity.getApk() == null || gameEntity.getApk().isEmpty()) {
|
||||
|
||||
@ -16,7 +16,6 @@ import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.DownloadItemUtils;
|
||||
import com.gh.common.util.GameUtils;
|
||||
import com.gh.common.util.GameViewUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.util.PackageUtils;
|
||||
import com.gh.common.util.PlatformUtils;
|
||||
import com.gh.common.util.TrafficUtils;
|
||||
@ -377,7 +376,7 @@ public class InstallFragmentAdapter extends RecyclerView.Adapter<RecyclerView.Vi
|
||||
((CardLinearLayout) holder.itemView).setBottom(false);
|
||||
}
|
||||
|
||||
ImageUtils.getInstance(context).display(gameEntity.getIcon(), holder.gameThumb);
|
||||
holder.gameThumb.setImageURI(gameEntity.getIcon());
|
||||
|
||||
if (gameEntity.getApk() == null || gameEntity.getApk().isEmpty()
|
||||
|| gameEntity.getTag() == null || gameEntity.getTag().isEmpty()) {
|
||||
|
||||
@ -37,12 +37,12 @@ import android.widget.Toast;
|
||||
import com.android.volley.Request;
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.base.AppController;
|
||||
import com.gh.common.constant.Config;
|
||||
import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.DialogUtils;
|
||||
import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.util.TokenUtils;
|
||||
import com.gh.common.util.Utils;
|
||||
import com.gh.gamecenter.CropImageActivity;
|
||||
@ -73,7 +73,7 @@ public class PersonalFragment extends Fragment implements View.OnClickListener,
|
||||
private ViewPager me_vp_show;
|
||||
|
||||
private ImageView me_iv_top_setting;
|
||||
private ImageView me_iv_top_icon;
|
||||
private SimpleDraweeView me_iv_top_icon;
|
||||
private TextView me_tv_top_install;
|
||||
private TextView me_tv_top_concern;
|
||||
private TextView me_tv_top_name;
|
||||
@ -96,8 +96,9 @@ public class PersonalFragment extends Fragment implements View.OnClickListener,
|
||||
}
|
||||
String icon = sp.getString("user_icon", null);
|
||||
if (!TextUtils.isEmpty(icon)) {
|
||||
ImageUtils.getInstance(getActivity()).display(icon, me_iv_top_icon, R.drawable.user_default_icon);
|
||||
}
|
||||
// ImageUtils.getInstance(getActivity()).display(icon, me_iv_top_icon, R.drawable.user_default_icon);
|
||||
me_iv_top_icon.setImageURI(icon);
|
||||
}
|
||||
isLogin = true;
|
||||
checkDeviceInfo();
|
||||
}
|
||||
@ -115,7 +116,7 @@ public class PersonalFragment extends Fragment implements View.OnClickListener,
|
||||
|
||||
view = View.inflate(getActivity(), R.layout.home3_fragment, null);
|
||||
|
||||
me_iv_top_icon = (ImageView) view.findViewById(R.id.me_iv_top_icon);
|
||||
me_iv_top_icon = (SimpleDraweeView) view.findViewById(R.id.me_iv_top_icon);
|
||||
me_iv_top_icon.setOnClickListener(this);
|
||||
me_tv_top_name = (TextView) view.findViewById(R.id.me_tv_top_name);
|
||||
me_tv_top_name.setOnClickListener(this);
|
||||
@ -319,7 +320,8 @@ public class PersonalFragment extends Fragment implements View.OnClickListener,
|
||||
String url = data.getExtras().getString("url");
|
||||
SharedPreferences sp = getActivity().getSharedPreferences(Config.PREFERENCE, Context.MODE_PRIVATE);
|
||||
sp.edit().putString("user_icon", url).apply();
|
||||
ImageUtils.getInstance(getActivity()).display(url, me_iv_top_icon, R.drawable.user_default_icon);
|
||||
// ImageUtils.getInstance(getActivity()).display(url, me_iv_top_icon, R.drawable.user_default_icon);
|
||||
me_iv_top_icon.setImageURI(url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -19,7 +19,6 @@ import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.GameUtils;
|
||||
import com.gh.common.util.GameViewUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.view.CardLinearLayout;
|
||||
import com.gh.common.view.DownloadDialog;
|
||||
import com.gh.gamecenter.R;
|
||||
@ -140,7 +139,7 @@ public class SearchGameDetailFragmentAdapter extends RecyclerView.Adapter<GameNo
|
||||
((CardLinearLayout) viewHolder.itemView).setBottom(false);
|
||||
}
|
||||
|
||||
ImageUtils.getInstance(context).display(gameEntity.getIcon(), viewHolder.gameThumb);
|
||||
viewHolder.gameThumb.setImageURI(gameEntity.getIcon());
|
||||
viewHolder.gameNameAndSize.setText(gameEntity.getName());
|
||||
if (gameEntity.getApk() == null || gameEntity.getApk().isEmpty()) {
|
||||
viewHolder.gameDes.setText(gameEntity.getBrief());
|
||||
|
||||
@ -18,7 +18,6 @@ import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.GameUtils;
|
||||
import com.gh.common.util.GameViewUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.view.CardLinearLayout;
|
||||
import com.gh.common.view.DownloadDialog;
|
||||
import com.gh.gamecenter.R;
|
||||
@ -126,7 +125,7 @@ public class SearchGameListFragmentAdapter extends RecyclerView.Adapter<Recycler
|
||||
((CardLinearLayout) viewHolder.itemView).setmTop(DisplayUtils.dip2px(context, 8));
|
||||
((CardLinearLayout) viewHolder.itemView).setmBottom(0);
|
||||
|
||||
ImageUtils.getInstance(context).display(gameEntity.getIcon(), viewHolder.gameThumb);
|
||||
((GameNormalViewHolder) holder).gameThumb.setImageURI(gameEntity.getIcon());
|
||||
viewHolder.gameNameAndSize.setText(gameEntity.getName());
|
||||
if (gameEntity.getApk() == null || gameEntity.getApk().isEmpty()) {
|
||||
viewHolder.gameDes.setText(gameEntity.getBrief());
|
||||
|
||||
Reference in New Issue
Block a user