-1

I'm quite new in developing for android.

Is there a way to split the RelativeLayout into multiple sections that would perform tasks that are linked to each other.

Picture link : https://i.stack.imgur.com/4r1Qp.jpg


Section 1 - A menu bar that the user can click.
Section 2 - A submenu that will change depending on the selected menu in Section 1.
Section 3 - The content that would appear depending on what is selected in Section 2.

I cant seem to understand the concept on how I can achieve this and I don't know what kind of Views to use.

Any kind of help is much appreciated. (Tutorials, explanations)

4 Answers4

1

Please post the questions after some homework. A simple google search gave me many resources:

Adding "section dividers" to my layout?

https://developer.android.com/guide/topics/ui/layout/relative.html

http://code.tutsplus.com/tutorials/android-user-interface-design-relative-layouts--mobile-4301

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
PseudoAj
  • 5,234
  • 2
  • 17
  • 37
0

Start with creating LinearLayouts inside the RelativeLayout. You will need 4. One for the menu, one for the bottom part, then two to split the bottom part to two parts. There are many ways to specify the positions but you could for example specify the second one to be below first and the fourth to be right of third, if third is inside second :) Be careful to set +id to all layouts and refer to them without the + sign. Use attributes such as android:layout_below in the XML.

If you are not forced to use RelativeLayout I would do this with LinearLayouts only. In one main "container" LinearLayout with vertical orientation, put two LinearLayouts with orientation:horizontal and inside the latter one add two more LinearLayouts

milez
  • 2,201
  • 12
  • 31
0

You have alot of way to achieve this.
1. use to Linear layout :
first with vertical orientation for top header and content and second on for left and right part with horizontal orientation.
2. Play with android:layout_alignParentRight="true" , android:layout_alignParentLeft="true" and android:layout_alignParentTop="true" and also android:layout_below="@id/yourItemId" , android:layout_toLeftOF="@id/yourItemId" in RelativeLayout.
Use your creative for best solution.

YFeizi
  • 1,498
  • 3
  • 28
  • 50
0

Use fragments to design 1, 2, 3 follow http://simpledeveloper.com/how-to-communicate-between-fragments-and-activities/ for more details.

Shiv
  • 1
  • 3