imageview

[Android] How to make an image easier to click ?

I placed an image in each ListView Item at the right side,In the layout xml,I set its width and length as 20dip ,kind of small,and I find it is hard to click at it cause the image only occupied 20*20 dip,I hope the length of it doesn't change,while its height full filling the parent, I tried : android:layout_width="20dip" androi...

Is it possible to have another layout in my main layout?

Is it possible to have another layout in my main layout? Such that i can set my imageview in another layout. ...

How to set a clickable region for an ImageView?

I have 2 ImageViews which have AnimationDrawable backgrounds to animate a box opening and closing when you click on it. The 2 images are slightly overlapping (the transparent area) so they can be closer together. The problem this is causing is that I am unable to click on regions of the 1st image where the 2nd image (transparent area) i...

Changing ImageView on button click

Wondering if I'm going about this the right way or not. I have 3 buttons on my screen (Restart, Previous, Next). When the view loads it shows the first image which is fine. When I click the "Next" button I want it to load a second image and so on for up to 9 images. If I click the "Previous" button it should go back one image. Clicking "...

ImageView onClickListener changing the image source

Im working on changing the image being shown when I have my ImageView Clicked. Im trying to use a similar code that I used for accomplishing this with a TextView but I can't seem to find the right terms to get it to work. Here is my current code. Thanks electronconfiguration.setOnClickListener(new View.OnClickListener() { publi...

Updating images dynamically from URL with Android

So I have this program that grabs the RSS feed at http://www.muttville.org/mutts/feed and displays a list of the available dogs, basically filling out each item in a ListView with an image of the dog on the left, and the headline about the dog on the right. My application executes and grabs and parses the XML feed fine. onCreate, it sto...

set source of ImageView dynamically android

I have an ImageView on my scene that I would like to set the source of dynamically based on user input. Let's say I have 4 images in my drawable folder: aaa.png, bbb.png, ccc.png, and ddd.png. When my application loads I set the image to: aaa.png myImageView.setImageResource(R.drawable.aaa); now I have an EditText where a user can t...

clearing contents of a RelativeLayout programmatically - android java

I am dynamically adding ImageViews to a RelativeLayout depending on user input. I have also created a button that when pressed, should clear all of the content of that RelativeLayout (remove all children). I was hoping for a .clear() method, but no such luck. can someone point me in the right direction here? RelativeLayout rel = (Rel...

set extended ImageView width and height programatically - android

I have a custom class that extends ImageView that I'm programatically putting on to a RelativeLayout. I want each one of these images to be a specific width and height. I've tried setting the width/height in code with LayoutParams and with setMaxWidth/setMaxHeight...neither seem to be working. Here is the code from the constructor of ...

Dragging an image from a scrollview

This is driving me bonkers, have been on it ages and still can get the thing to do what I want! My view is set out like this: RootViewController contains (UIView)flipView FlipView contains (UiView)firstView FirstView contains a scrollview and a load of imageviews Scrollview contains a series of custom imageViews I can drag the cust...

Android imageview not respecting maxWidth?

So, I have an imageview that should display an arbitrary image, a profile picture downloaded from the internet. I want this the ImageView to scale its image to fit inside the height of the parent container, and a set max width of 60dip. However, if the image is tall ratio-wise, and doesn't need the full 60dip of width, the ImageView's wi...

Scrolling multiple images in android.

Hello, I´m writing an application for Android in which I have a character that I must dress with multiple items, such as clothes, hairs, hats, earrings, etc. and on one side of the screen I need to have a container with many items inside that are available for use. My problem is that I haven´t found any object that lets me do this simpl...

Android - Image button (XML) isn't working?

I have three images in my drawable folder, and an XML Image Button code: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;\ <item android:state_pressed="true" android:drawable="@drawable/happycarrot" /> <!-- pressed --> <item android:state_focused="true" android:drawable="@d...

16 bit images and android processing.

Am i correct in saying a 16 bit image will be decode and drawn faster than a 24 or 32 bit? I know the file size will be less but if the bitmaps will actually be drawn faster than it would be worth the effort to convert them. If it is faster, how would i go about saving a 16 bit jpeg file? I only found an option in photoshop to save a 16 ...

Android - Image button size help?

My imagebutton code wont respond to "fill_parent" and "wrap_content". Instead, it just shows the middle of the image (because it is a pretty big image). I tried setting specific values for the image but it still didn't work! Can somebody help me? My button.xml in the res/drawable folder: <?xml version="1.0" encoding="utf-8"?> <selector...

Passing image to another activity

I figured out how to pass a String value between activites thanks to this site, however I'm having trouble passing an image. What I'm trying to to is have a user click a button that opens the gallery and allows selecting of a picture. Then I have another button that opens another activity that displays an ImageView. I want to be able to ...

How works android ImageView android:scaleType="fitXY" property?

I need to know how he takes drawable object. I'm collecting some ImageView objects in array, they have background images that are rather big in resolution so they take lot of memory... I have read somewhere that it will automatically create image with resolution that my imageView have, so i think it will take less memory than first one....

Android Drop Shadow on View

I have done some extensive searching for code examples on this but cannot find anything. In particular, I am looking to add a shadow to a png drawable I am using in an ImageView. This png drawable is a rounded rect with transparent corners. Can somebody please provide a code example of how to add a decent drop shadow to a view either...

android Imageview layoutparams in dip ?

Hi, I'm using the following code : ImageView i = new ImageView(mContext); i.setImageResource(mImageIds[position]); i.setScaleType(ImageView.ScaleType.FIT_XY); //pixels settings !!! i.setLayoutParams(new Gallery.LayoutParams(200, 100)); but as you can see, it is setting the layout dimensions in pixels. Does...

Need to resize Android ImageView to match changing Drawable size

I would like to be able to alter the size of some of my ImageViews based on what Drawable they are showing. I've not yet decided on whether I'll get them to read the new dimensions from the Drawable or if I will just have an array/enum storing the heights of these, but what I need help with is the actual changing of the ImageView size. ...