Ok question to guys who are good at UI in android

Last Updated:

  1. Arehexes

    Arehexes Well-Known Member

    I am really bad at GUI programming, but I need to figure out a few things for a project I'm having trouble with.

    First how does the linear layout work? Like I'm trying to make a screen with a list with.

    Class Name:[EditText]
    Teacher Email:[EditText]
    Time:[Click it and it pops up a smaller window with a time picker (kinda like the alarm on android)]
    Days:[A textview showing all the dates picked, but when you clicked the section it pops up a mini window with check boxes for each days]
    Location:[A textview that shows location, but when you click on the location section it pops up]

    From my understanding a linear layout would be the best way to do this.

    My other question is how to I get a linear layout to do a action when clicked. Like if I click the Time layout I want it to pop up a smaller window with a time picker on it.

    Any help would be appreciated

  2. JamTheMan

    JamTheMan Well-Known Member

    AS you say, on vertical LinearLayout with a horizontal LinearLayout for each line is a way to do this. In the horizontal ones you then place e.g. a TextView and an EditText or a TextView and a Button.

    Then you can add a TimePicker to the button at time and something like the DatePicker at Days.

    See all of it in action here

    And you can just add " android:eek:nClick="someMethodYouDefine" " to the layouts in the xml or do it in code with .setOnClickListener(); . So using a button or just clicking the layout is up to you - same thing actually, the one is just drawing a button for you...
    Arehexes likes this.
  3. alostpacket

    alostpacket Over Macho Grande? VIP Member

    You have some reading to do :)

    Common Layout Objects | Android Developers

    Creating Dialogs | Android Developers

    I would say LinearLayout is the most basic but least flexible layout. It just puts all items inside it aligned together in one direction (either horizontal or vertical).

    I'm guessing you want a TableLayout for what you're doing but dont be afraid to try each of them. They all have uses.
    Arehexes likes this.
  4. Arehexes

    Arehexes Well-Known Member

    Thanks I can't believe I forgot about the android dev pages >_>. Hopefully I can finish this screen to present to my group :D.
  5. Arehexes

    Arehexes Well-Known Member

    Ok I have one more layout question and I think this is for linear layout in mind

    I have a section for time and date, and I read a little bit on the dailog box to have it pop up for a picker but my question is this


    The highlighted sections I want to have a click response, I was wondering what do I have to do in the xml file to have that respond to a click (for now I just want it to pop a Toast up which I can do I just need proof of concept.).

Share This Page