I have a ListView in my application that has both text and images in it on each row. Now, when the row is clicked I'd like to zoom the image to fill the screen. On the next click it should collapse to it's original size.
What I'm looking for is something similar to Lightbox. When the image is clicked it expands.
I have access to the ImageView. What do I need to do to it to achieve this kind of effect?
If you want to zoom in/out view you can use scale animation. I recommend to watch Chet Haase tutorials called DevBytes: View Animations
Related
I want to design a custom card view which displays information about a duel in an android app. Here is a screenshot of what the view looks like right now.
The image and the green button should be clickable, however, this design is currently done in one custom view extending CardView. The green button is a Rectangle and the polygon is a filled Path which overlays the button.
Because I have done everything in one onDraw() method, there is no onClick() method for solely the button or solely the image. Is there any clever way to do this? Maybe I'm conceptually wrong somewhere?
My thoughts so far:
Have a transparent button on top of the green button in the xml
Maybe there is a way to include a button in the onDraw() method
Make the whole view clickable and include the image in the xml
This is how I solved it now. I changed the custom view to only display the skewed rectangle. The other resources were created in a seperate xml file. With an <include />, I was able to place the rectangle over the button.
I followed this link http://www.androidbegin.com/tutorial/android-implementing-viewpager-into-gridview-tutorial/ to obtain gridview in viewpager. But my problem is that the image displayed as full screen in viewpager appear to be cut in gridview window. I want the image that appear as full screen should also appear in gridview window. In other words, the image displayed as full screen should appear as whole in small size image in gridview window.I meant something like the images displayed in this question link...Order of images in Grid View in Android
I just start with programming, so please give some explanations, or it will be great if you also give some codes :)
I suggest you have a look at ImageView.ScaleType. It it will show you how the image should be scaled, cropped, etc. to be displayed in an ImageView.
I have a text view on my android app which I want to place in a specific place on the screen. This is because there is a background on the screen and the text view has to show in line with the space I have made for it in the background.
I'm moving the text around using the margins and entering for example 20dp for top margin 10dp for right margin.
Is there any other method I can use in order to ensure that the text view will be displayed in the right place on all devices? As other dvices mas have a higher or lower res.
use relativelayout and you can control the position of a view in a much better way.
android:layoutalign_parentright=true tag makes the view to be the right always.
android:align_right="#id/someViewId" makes the right edge of this view aligned with the right edge of someViewId view.
It packs a lot of tags that enables you to do such stuff.
I am trying to get images from Internet. (i can't show my code here). i AM storing a few images in a list and displaying them in an imageview each image after tapping other.
However, I want to make a slide of these images.
It's just a basic 'move to next picture' by sliding your finger on the screen.
Same as it would be in the phone photo gallery.
It's just to navigate through the images.
At the moment the image is going to the next one by the user tapping on the screen. But in this manner we can't go to the previous image. This is why we need to change the navigation to sliding a finger on the screen.
I have used View Flipper and ViewPager but how am i suppose to add images to these views after getting from internet each time.
Best Regards
here from below link you can download the example it can help you
https://github.com/nostra13/Android-Universal-Image-Loader
In my Android app I have a gallery which contains some TextViews. I realized that some users don't understand that they can scroll that gallery although the previous and next TextViews are partially visible. So I put an ImageView with a horizontal arrow under the gallery.
Now the users try to drag the arrow. Is it possible to redirect the touch event from the ImageView to the gallery so that dragging it would scroll the gallery?
Thanks in advance,
Fri
The simplest thing (if you don't mind scrolling one item at a time) is to detect the direction of the touch event on the arrow and then dispatchSetSelected(boolean selected) on the gallery... I believe that will work. after the user does that once, they will probably intuit that they can then just drag the gallery. Of course if you want to measure the touch event speed and do the calculation for how far to scroll based on that, you can do that too... but that seems like a lot of unnecessary trouble.