Android Layout Background Using Previous Layout's View - android

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.

Related

Change Specific Layout on Android Studio

I just wanted to ask if this is possible in android studio
As you can see I pointed out the blue area that I needed to change after I pressed the Send Profile button . Change I mean is that I can hide or something like that the fullname,address,phonenumber,emailaddress etc because I wanted to add some more forms to fill up.
Thank you if someone can direct me to a reference.
You can have a fragment place holder for the outlined blue area, and do fragment transitions as you want to go.
Each form can be represented by a separate xml layout file that you can place in this place holder.
Well... if you are using something like a Constraintlayout you can just reference the views and set their visibility to View.GONE
So you would put that into the onClickListener of the Button (after validating perhaps) and then you could hide those views.
You can also use fragments but those might be hard for a beginner (which I assume you are) so instead for replacing those views you might be able to just use a mix of setting titles/hints of textfields to something different and hiding views (or showing new ones).
LinearLayout would also make this easy because views are just ontop of one another like in your case (only the blue area) so hiding/showing is straight forward.
Simplest way would be putting another LinearLayout there, and all those other elements into this new LinearLayout. Then you can just use
findViewById(R.id.yourNewLinearLayout).setVisibility(View.GONE);
to hide all those things.

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!

Layout for MapView

Hello there android experts, I have a problem for some time and after some workaround, I can't achieved what I want.
I just want to have a layout (not sure what the name of it) that is similar to the Map application on android:
Here's the image of the layout:
How to achieve / call this kind of layout if you are in a MapView?
Is it possible?
Based on examining this in Hierarchy View, it would appear that your panel is a separate activity, themed with a translucent background so the underlying activity shows through.

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

Opening an activity within a View in Android

I've recently started developing Android Apps, and whilst the model is making more sense the more I look at it, I cannot do something (nor find any reference material on it) which to me seems quite simple.
I have an activity which has five buttons along the bottom, and a blank View taking up the rest of the screen. I want, upon clicking these buttons, for an activity to be opened in (and confined to) this view. I can get a new activity running without incident, but this opens in a new screen.
If anyone can show me an easy way to launch a (sub/child?) activity within a view which is defined in the parent activity's layout xml file - equally, it could be created in the parent activity - you'd really be doing me a favor!
I'd recommend taking a look at TabHost. The tabhost is an Activity itself, and the sub-views are all Actvities as well.
Here is a good tutorial that'll get you going very quickly. There is a more work to create (optional) icons for the tabs (also describe in the tutorial).
Hope this helps.
Edit* You mentioned buttons being at the bottom of the screen. Take a look at this SO Question
You can achieve that by using an ActivityGroup... here is a simple example which shows how to do it using a TabActivity:
http://web.archive.org/web/20100816175634/http://blog.henriklarsentoft.com/2010/07/android-tabactivity-nested-activities/
Of course, you will have to change the code since you are not using TabActivities. Just take a look at the getLocalActivityManager and getDecorView methods that is what you will be using.

Categories

Resources