How to Disable Image like Iphone in ANDROID? - android

i want to disable view of image in my app.(like iphone). when my activity is launch i show one Image in Imageview then if i click on image i want to make it disable it. disable in the sense it will become more transparent.
Thanks....

onClicking the ImageView
myImageView.getDrawable().mutate().setAlpha(70);
myImageView.invalidate();
this will make the image somewhat transparent. Lesser the value in setAlpha(), the more transparent the image will become.

Related

How to place a rectangular image background to a button in Android?

I am working on an Android GUI, and I want to place some buttons with image backgrounds on a vertical linear layout. I designed button graphics and saved it in .png format. Then, I created a new Android Icon set which will be later related with a button or an imagebutton view.
I can only select "launcher icon" because notification, actionbar, menu type of icons are not suitable (they are not color at first).
When I select "Center" option, my button images do not fully cover the button area. So I cannot align button images appropriately. When I select "crop" option, my button image is cropped and is no longer a rounded rectangle as I desire.
What can I do? Thanks for your patience in reading, it may be longer than necessary.

Flip an Imageview with two images back to back

I need to have a set of Image views on a Linear Layout. &
==> onClick of an ImageView, I want to turn the Image to the back(Like Flipping Effect) & show another Image.
==> Again on click of that Image or another Image, I want to apply the same effect for that Image View & the Previous Imageview must come to the default position.
---> I just checked the FLIP ANIMATION in Android. But it is flipping the total view.
So I Just need How to flip an Image view in the same manner, with support from Android v2.2 & up
I think it is quite complicated but it is interesting & need some help how to achieve this as I am just learning the Android(& Coding).
Thanks.!!!
You can use this small library to do that :
https://github.com/castorflex/FlipImageView

set up different clickable part image android

Im working with android about image and onclick listener. The purpose of my app is to monitor the area that user clicks on the screen. For example, I have a picture containing a rectangular and a circle. Assume that the color of the whole picture is brown(wood). So when I click on the rectangular, the color of rectangle will change to yellow. When I click on the one part of the picture, the color of that part will change its color, but other parts do not change. So, Im thinking about the solution for this app. Do I have to cut this picture separately and put them into the screen by using relative review? Or is there any other way to do this(Set up a coordination system)?
Yes you have to cut this picture separately and put them into the screen by using relative review. For example two ImageView with your backgound.
You can slse the image as recommeded by the other post, or overlay the image with a RelitiveLayout with specific sized buttons (background = #android/color/transparent)

Android: Draw image over button

Is it possible to draw an image over another view (like a button) and still have the view work normally? The user would still be able to click on the button even though there is another image on top of it. I want to draw some mostly transparent pngs over my layout for lighting effects, but I want to make sure everything will still work correctly.
Try using a RelativeLayout with an ImageView on top of the widget(s) in your app. See this question for a quick example.

Android writing over image in button

If I have a custom image can I write over it, will it always write to the center of the button image? Ie will setText on image always right to center of the image provided or do I need to do something to have this effect? Thanks Also is it better to use ImageButton or set Image as background of Button? and write over it that way. I want to use 3d images and write on top of them in black text.
I don't know if there is a preformance difference for using image button of a normal button, but I'd imagine that and image button will work better. Albiet I always just use a normal button and setBackground(...). Also if you want to set the text to always be in the middle, use android:gravity="center" in the layout file.

Categories

Resources