当前位置: 首页>>代码示例>>Java>>正文


Java ImageUtils.SCALE_IMAGE_HEIGHT属性代码示例

本文整理汇总了Java中com.hyphenate.util.ImageUtils.SCALE_IMAGE_HEIGHT属性的典型用法代码示例。如果您正苦于以下问题:Java ImageUtils.SCALE_IMAGE_HEIGHT属性的具体用法?Java ImageUtils.SCALE_IMAGE_HEIGHT怎么用?Java ImageUtils.SCALE_IMAGE_HEIGHT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.hyphenate.util.ImageUtils的用法示例。


在下文中一共展示了ImageUtils.SCALE_IMAGE_HEIGHT属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
	setContentView(R.layout.ease_activity_show_big_image);
	super.onCreate(savedInstanceState);

	image = (EasePhotoView) findViewById(R.id.image);
	ProgressBar loadLocalPb = (ProgressBar) findViewById(R.id.pb_load_local);
	default_res = getIntent().getIntExtra("default_image", R.drawable.ease_default_avatar);
	Uri uri = getIntent().getParcelableExtra("uri");
	localFilePath = getIntent().getExtras().getString("localUrl");
	String msgId = getIntent().getExtras().getString("messageId");
	EMLog.d(TAG, "show big msgId:" + msgId );

	//show the image if it exist in local path
	if (uri != null && new File(uri.getPath()).exists()) {
		EMLog.d(TAG, "showbigimage file exists. directly show it");
		DisplayMetrics metrics = new DisplayMetrics();
		getWindowManager().getDefaultDisplay().getMetrics(metrics);
		// int screenWidth = metrics.widthPixels;
		// int screenHeight =metrics.heightPixels;
		bitmap = EaseImageCache.getInstance().get(uri.getPath());
		if (bitmap == null) {
			EaseLoadLocalBigImgTask task = new EaseLoadLocalBigImgTask(this, uri.getPath(), image, loadLocalPb, ImageUtils.SCALE_IMAGE_WIDTH,
					ImageUtils.SCALE_IMAGE_HEIGHT);
			if (android.os.Build.VERSION.SDK_INT > 10) {
				task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
			} else {
				task.execute();
			}
		} else {
			image.setImageBitmap(bitmap);
		}
	} else if(msgId != null) {
	    downloadImage(msgId);
	}else {
		image.setImageResource(default_res);
	}

	image.setOnClickListener(new OnClickListener() {
		@Override
		public void onClick(View v) {
			finish();
		}
	});
}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:46,代码来源:EaseShowBigImageActivity.java

示例2: onCreate

@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
	setContentView(R.layout.ease_activity_show_big_image);
	super.onCreate(savedInstanceState);

	image = (EasePhotoView) findViewById(R.id.image);
	loadLocalPb = (ProgressBar) findViewById(R.id.pb_load_local);
	default_res = getIntent().getIntExtra("default_image", R.drawable.ease_default_avatar);
	Uri uri = getIntent().getParcelableExtra("uri");
	String remotepath = getIntent().getExtras().getString("remotepath");
	localFilePath = getIntent().getExtras().getString("localUrl");
	String secret = getIntent().getExtras().getString("secret");
	EMLog.d(TAG, "show big image uri:" + uri + " remotepath:" + remotepath);

	//本地存在,直接显示本地的图片
	if (uri != null && new File(uri.getPath()).exists()) {
		EMLog.d(TAG, "showbigimage file exists. directly show it");
		DisplayMetrics metrics = new DisplayMetrics();
		getWindowManager().getDefaultDisplay().getMetrics(metrics);
		// int screenWidth = metrics.widthPixels;
		// int screenHeight =metrics.heightPixels;
		bitmap = EaseImageCache.getInstance().get(uri.getPath());
		if (bitmap == null) {
			EaseLoadLocalBigImgTask task = new EaseLoadLocalBigImgTask(this, uri.getPath(), image, loadLocalPb, ImageUtils.SCALE_IMAGE_WIDTH,
					ImageUtils.SCALE_IMAGE_HEIGHT);
			if (android.os.Build.VERSION.SDK_INT > 10) {
				task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
			} else {
				task.execute();
			}
		} else {
			image.setImageBitmap(bitmap);
		}
	} else if (remotepath != null) { //去服务器下载图片
		EMLog.d(TAG, "download remote image");
		Map<String, String> maps = new HashMap<String, String>();
		if (!TextUtils.isEmpty(secret)) {
			maps.put("share-secret", secret);
		}
		downloadImage(remotepath, maps);
	} else {
		image.setImageResource(default_res);
	}

	image.setOnClickListener(new OnClickListener() {
		@Override
		public void onClick(View v) {
			finish();
		}
	});
}
 
开发者ID:Rabbit00,项目名称:MeifuGO,代码行数:52,代码来源:EaseShowBigImageActivity.java

示例3: onCreate

@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
	setContentView(R.layout.ease_activity_show_big_image);
	super.onCreate(savedInstanceState);

	image = (EasePhotoView) findViewById(R.id.image);
	loadLocalPb = (ProgressBar) findViewById(R.id.pb_load_local);
	default_res = getIntent().getIntExtra("default_image", R.drawable.ease_default_avatar);
	Uri uri = getIntent().getParcelableExtra("uri");
	String remotepath = getIntent().getExtras().getString("remotepath");
	localFilePath = getIntent().getExtras().getString("localUrl");
	String secret = getIntent().getExtras().getString("secret");
	EMLog.d(TAG, "show big image uri:" + uri + " remotepath:" + remotepath);

	//show the image if it exist in local path
	if (uri != null && new File(uri.getPath()).exists()) {
		EMLog.d(TAG, "showbigimage file exists. directly show it");
		DisplayMetrics metrics = new DisplayMetrics();
		getWindowManager().getDefaultDisplay().getMetrics(metrics);
		// int screenWidth = metrics.widthPixels;
		// int screenHeight =metrics.heightPixels;
		bitmap = EaseImageCache.getInstance().get(uri.getPath());
		if (bitmap == null) {
			EaseLoadLocalBigImgTask task = new EaseLoadLocalBigImgTask(this, uri.getPath(), image, loadLocalPb, ImageUtils.SCALE_IMAGE_WIDTH,
					ImageUtils.SCALE_IMAGE_HEIGHT);
			if (android.os.Build.VERSION.SDK_INT > 10) {
				task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
			} else {
				task.execute();
			}
		} else {
			image.setImageBitmap(bitmap);
		}
	} else if (remotepath != null) { //download image from server
		EMLog.d(TAG, "download remote image");
		Map<String, String> maps = new HashMap<String, String>();
		if (!TextUtils.isEmpty(secret)) {
			maps.put("share-secret", secret);
		}
		downloadImage(remotepath, maps);
	} else {
		image.setImageResource(default_res);
	}

	image.setOnClickListener(new OnClickListener() {
		@Override
		public void onClick(View v) {
			finish();
		}
	});
}
 
开发者ID:HyphenateInc,项目名称:Hyphenate-EaseUI-Android,代码行数:52,代码来源:EaseShowBigImageActivity.java


注:本文中的com.hyphenate.util.ImageUtils.SCALE_IMAGE_HEIGHT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。