整理hardcode问题,整理imageUtils工具类
This commit is contained in:
@ -38,16 +38,16 @@ import com.facebook.imagepipeline.image.ImageInfo;
|
||||
import com.facebook.imagepipeline.request.ImageRequest;
|
||||
import com.facebook.imagepipeline.request.ImageRequestBuilder;
|
||||
import com.gc.materialdesign.views.ProgressBarCircularIndeterminate;
|
||||
import com.halo.assistant.HaloApp;
|
||||
import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.EntranceUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.util.MessageShareUtils;
|
||||
import com.lightgame.utils.Utils;
|
||||
import com.gh.common.view.Gh_RelativeLayout;
|
||||
import com.gh.common.view.Gh_RelativeLayout.OnSingleTapListener;
|
||||
import com.gh.common.view.Gh_ViewPager;
|
||||
import com.gh.common.view.ZoomSimpleDraweeView;
|
||||
import com.halo.assistant.HaloApp;
|
||||
import com.lightgame.utils.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
@ -71,9 +71,16 @@ public class ViewImageActivity extends Activity implements OnPageChangeListener
|
||||
private Gh_ViewPager mViewimageVp;
|
||||
private View mViewimageLine;
|
||||
|
||||
private ViewImageAdapter adapter;
|
||||
private RelativeLayout.LayoutParams rparams;
|
||||
|
||||
private ViewImageAdapter adapter;
|
||||
|
||||
private ImagePipeline imagePipeline;
|
||||
|
||||
private static final String KEY_URLS = "urls";
|
||||
private static final String KEY_CURRENT = "current";
|
||||
private static final String KEY_SCALETYPE = "ScaleType";
|
||||
|
||||
private ArrayList<String> urls;
|
||||
private Map<Integer, String> newUrls;
|
||||
|
||||
@ -83,8 +90,6 @@ public class ViewImageActivity extends Activity implements OnPageChangeListener
|
||||
|
||||
private boolean isOrientation;
|
||||
|
||||
private ImagePipeline imagePipeline;
|
||||
|
||||
private Handler handler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
@ -94,9 +99,9 @@ public class ViewImageActivity extends Activity implements OnPageChangeListener
|
||||
|
||||
public static Intent getViewImageIntent(Context context, ArrayList<String> list, int position, String entrance) {
|
||||
Intent checkIntent = new Intent(context, ViewImageActivity.class);
|
||||
checkIntent.putExtra("urls", list);
|
||||
checkIntent.putExtra("current", position);
|
||||
checkIntent.putExtra("ScaleType", "FIT_CENTER");
|
||||
checkIntent.putExtra(KEY_URLS, list);
|
||||
checkIntent.putExtra(KEY_CURRENT, position);
|
||||
checkIntent.putExtra(KEY_SCALETYPE, "FIT_CENTER");
|
||||
checkIntent.putExtra(EntranceUtils.KEY_ENTRANCE, entrance);
|
||||
return checkIntent;
|
||||
}
|
||||
@ -136,13 +141,15 @@ public class ViewImageActivity extends Activity implements OnPageChangeListener
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
urls = getIntent().getStringArrayListExtra("urls");
|
||||
int current = getIntent().getIntExtra("current", 0);
|
||||
scaleType = getIntent().getStringExtra("ScaleType");
|
||||
if (getIntent().getBundleExtra(EntranceUtils.KEY_DATA) != null) {
|
||||
urls = getIntent().getBundleExtra(EntranceUtils.KEY_DATA).getStringArrayList("urls");
|
||||
current = getIntent().getBundleExtra(EntranceUtils.KEY_DATA).getInt("current", 0);
|
||||
scaleType = getIntent().getBundleExtra(EntranceUtils.KEY_DATA).getString("ScaleType");
|
||||
Bundle extras = getIntent().getExtras();
|
||||
urls = extras.getStringArrayList(KEY_URLS);
|
||||
int current = extras.getInt(KEY_CURRENT, 0);
|
||||
scaleType = extras.getString(KEY_SCALETYPE);
|
||||
Bundle data = getIntent().getBundleExtra(EntranceUtils.KEY_DATA);
|
||||
if (data != null) {
|
||||
urls = data.getStringArrayList(KEY_URLS);
|
||||
current = data.getInt(KEY_CURRENT, 0);
|
||||
scaleType = data.getString(KEY_SCALETYPE);
|
||||
}
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
|
||||
Reference in New Issue
Block a user