Android - Best Implementation of an expanding ImageView - android

I have a gallery and I am trying to expand an image that the user selects. Currently what I have is a new xml layout with the ImageView (and will eventually have a close and maximize button. I add the view using an inflater and addContentView() but when I reload the old layout using setContentView I can't edit any of the views and they all go back to their default value.
Best case scenario for the scenario would be for the user to click the picture and have it launch the new layout with the ImageView and buttons on top of the layout behind it but when exited the layout returns to normal.
So I guess the question is, how would you do this? I have a very basic understanding of layout inflating and this might be a little more advanced.

Instead of doing that you should try using an intent with the ACTION_VIEW action, that way other applications can handle the displaying.

Related

android ui design for an app help needed

One activity in my app looks like below picture. In the below picture ,can any one suggest that best way to implement view,
view in my app
and when i click one of the options(filters in app) available on activity,
the view will be extended like below
view after one of the option selected
For this, i want to use a horizontal linear layout for below options bar,
when one of the options clicked, i wanna use slide up functionality and views show and hide functionalities.
can any one suggest better design for this . thanks.
I think for most apps, all toolbars should stay in the same place throughout the execution of the app. When the toolbar item ("Veg & Non Veg") is clicked, the filter should appear above the toolbar instead of below it. You can still use the slide up function, just have the toolbar layout displayed above (higher z-index) the filter linear layout.
You should also standardize the sizes for the distances/times to each location, personally I think the first one looks better.
Other than that, I think your UI looks pretty good!

How to implement Drag and Drop in Android

I want to make a drag and drop in my Android App.
This exemple (Link) needs a Long Click to start the Drag
But I want a Drag and Drop inside my App just like Facebook Messenger:
I also want that when the icon is clicked, a pop-up to be open
is there a way to use it inside an app?
I don't fully think this may solve everything but this might be worth a shot.
Try adding a frame layout as the parent(top level) layout of all of your activities' layout. Then add the chathead view on this frame layout which has the same child level as your activities' layout. This way you can still use the chathead while still interacting with your activity. #vinijow's answer is very helpful with this topic.

Android Layout Background Using Previous Layout's View

This may sounds simple, but I really need help on it. I have searched for related topics but not found any.
Is it possible to set a layout which is displayed now to be the next layout's background? For example, now I display layout A, then I click a button which starts the layout B (on activity). I want layout A to be layout B's background. If yes, how to achieve it progmatically or by XML manipulation?
Thank you.

Simple full screen image in Android

I want to make it such that when a person clicks an image, it opens up in full screen.
What is the most effective way to do this in Android?
The simplest way I can think of is creating an activity, with a layout with the ImageView filling the whole screen. But I think there's some way to directly open just the layout or the ImageView with an Intent?
The Best way to do this is..
When you click on image open a full screen Custom dialog with the image in it having attributes fill parent. You don't need to go in another activity your purpose will be solved in 1 activity itself thereby increasing performance and also lesser activities will be in stack.

Android: How can I use the space from objects with visibility GONE?

When I try to make a layout while working with the graphical layout interface in Eclipse (and not the xml) I came across with this problem:
Let's say that my main layout is only a simple button on the bottom of the screen,
when clicked the button opens up a text box that covers most of the screen.
note : I do this be setting the visibility of the text box from GONE to VISIBLE (and the other way around when I want to hide the text box).
Now (the text box is hidden) I want to use the extra space I have and add a button to the main layout.
normally this isn't much of a problem but since I have the text box covering almost the entire screen in the graphical layout I'm having a lot of trouble doing so (and this is just an example, I want to add more complicated things to my new gained space).
What can I do ? in the graphical layout I can't hide an object (like text box or button) and I drag another button to that space I can see/work with it.
set the android:visibility attribute to "gone" while designing the layout
You are going about this all wrong.
You should be using either a new activity or a diloag box to create a textbox that covers the entire screen or a ViewFlipper to create multiple views on your activity.
It appears that you want to do it from one layout so ViewFlipper would be the simplest choice here.
The documentation is available in the usual place:
http://developer.android.com/reference/android/widget/ViewFlipper.html
Some examples can be found at:
http://www.androidpeople.com/android-viewflipper-example
http://android-pro.blogspot.com/2010/09/using-view-flipper-in-android.html
EDIT
Your question isn't very clear so I have tried to give you my best guess from the information provided. Perhaps a diagram of what you are trying to do here might be more easily understood. Though as I stated a new activity or a dialog box might be better. So you could also look at using a dialog method:
http://www.androidsnippets.com/prompt-user-input-with-an-alertdialog

Categories

Resources