I created a layout.
I putted a 2 relative_layouts on top of each other.
I can slide the top layout to the left. Depending on the slide, the bottom layoutchanges color.
I want to use this layout in 2 different listviews.
I want to change the layout of the top layout in the 2 listviews.
Can i put the layout in some kind of interface?
I hope this helps
i found the solution.
I Used a viewstub. It solved my problem
Related
So what I am trying to do is to have 2 invisible LinearLayouts with buttons they will be from the start to the screen.
On the onClick event one of them will appear with a translate animation,when the other is invisible and then on the other onClick event to close the open one and open the new one.
It will look similar to a sliding menu with the animation.
I want to know how the xml will look like in order to do that.
If it's possible with other layout (RelativeLayout), I also want to know.
Any tips on that?
There are multiple ways to achieve it.
Relative Layout definitely being the one as you your self know. :)
Add both the LinearLayouts with layout_width="match_parent" and layout_height="match_parent" and then toggle between them using setVisibility(View.GONE) and setVisibility(View.VISIBLE). Since View.GONE will remove one Linear Layout the other one will occupy the entire screen in its absence and vice versa.
You can also use FrameLayout. This by default places its children on top of each other.
Suit yourself. :)
I am interested to learn how to make this Layout (in Picture):
:
As you can see there are 2 Layouts and user can switch them with the button what is in upper right corner. Can someone learn me how to make this Layout?
I'd recommend you using SlidingMenu library.
That is exactly what you want.
It has numerous options, so you can customize the view you want to get behind.
The left menu is implemented with a library called SlidingMenu. In the sliding menu you can simply add normal layout / android ui components. So there is a ListView with items. The items are simple LinearLayouts with the correct weights, to achieve a "table like" layout.
There are two ViewTypes in the ListView. One is a normal Item, one is a section header (Linear Layout or Framelayout).
You could also use a RelativeLayout instead of LinearLayout, but Relative Layout are "more expensive" (performance) than a LinearLayout.
i think you had to customise viewpager layout .
set first layout width as u need to be shown.
sample view pager
I want to create home layout with 6 button for menu
How can create this list with girdview or relative layout ?
my problem is when rotate screen relative layout don't work good and design not good
For a stylish looking of your Home page. its always recommended to use two layouts as
layout-land and layout. so that it will be better to look. Whether it may be Relative layout or Linear Layout or gridview use two layouts. Its not necessary but for the purpose of looking its recommended
I need to make an android layout like this one.
tile background all over the screen.
top menu which, overlays the background ( note the shadow ).
some sort of a table with text options, maybe pictures, which can be scrolled up and down.
bottom menu, which appears by sliding up after a menu button is hit.
What kind of layout elements do you think I should use for that?
Thanks!
I think you should first learn about the Android Layout and XML layout design, then you can easily prepare this layout as well.
Relative Layout will be the better layout as compare to other layouts like Linear Layout and Table Layout.
To display middle part that is showing textual description may contains ListView (ListView because as you have mentioned Text Options should scroll up and down), but it depends on your requirement.
The RelativeLayout is the most flexible, and I think you can make all this with a minimal hierarchy view depth.
My approach would be to use a RelativeLayout. The Top Menu bar could be a custom class which extends a LinearLayout and this can be used in the RelativeLayout (in fact in any screen you have to provide UI consistency). Similarly, the bottom menu would be a custom control containing the appropriate animations. The rest of the screen would be contained in a ScrollView, possibly containing a TableLayout. I have something very similar using a MapView in the main screen and it works fine.
I am confused with the appropriate layout design to be used for grid of buttons. I want to display a "textview and EditText" at the top. Below that there should be a 3*4 grid/matrix of 12 buttons(like cell phone keys), following another three linear buttons at the bottom of the root layout. (upper layout should not overlap the bottom buttons).
It would be of great help if anybody guide me in this regard.
UI layouts are done using xml files. Read about it before you start
While this is not exactly what you want here is a something to get you going.