How to show imageView full screen on imageView click?

You can use ImageView below two properties to show image based on your requirement : android:adjustViewBounds : Set this to true if you want the ImageView to adjust its bounds to preserve the aspect ratio of its drawable. android:scaleType :Controls how the image should be resized or moved to match the size of this ImageView … Read more

How to highlight ImageView when focused or clicked?

You need to assign the src attribute of the ImageView a state list drawable. In other words, that state list would have a different image for selected, pressed, not selected, etc. – that’s how the Twitter App does it. So if you had an ImageView: <ImageView style=”@style/TitleBarLogo” android:contentDescription=”@string/description_logo” android:src=”https://stackoverflow.com/questions/4185930/@drawable/title_logo” /> The src drawable (title_logo.xml) would … Read more

Trying to get the display size of an image in an ImageView

None of the answers here actually answer the question: From a Bitmap of any size displayed by an ImageView, find the actual dimensions of the displayed image as opposed to the dimensions of the supplied Bitmap. Namely: Using ImageView.getDrawable().getInstrinsicWidth() and getIntrinsicHeight() will both return the original dimensions. Getting the Drawable through ImageView.getDrawable() and casting it … Read more

How to get the Dimensions of a Drawable in an ImageView? [duplicate]

Just tried this out and it works for me: int finalHeight, finalWidth; final ImageView iv = (ImageView)findViewById(R.id.scaled_image); final TextView tv = (TextView)findViewById(R.id.size_label); ViewTreeObserver vto = iv.getViewTreeObserver(); vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { public boolean onPreDraw() { // Remove after the first run so it doesn’t fire forever iv.getViewTreeObserver().removeOnPreDrawListener(this); finalHeight = iv.getMeasuredHeight(); finalWidth = iv.getMeasuredWidth(); tv.setText(“Height: ” + finalHeight … Read more