Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

New Forums: Nexus Player | Nexus 9
test: Reply
 
LinkBack Thread Tools
Old February 27th, 2011, 03:06 PM   #1 (permalink)
Member
Thread Author (OP)
 
Join Date: Jul 2010
Posts: 110
 
Device(s):
Carrier: Not Provided

Thanks: 17
Thanked 2 Times in 1 Post
Default Ok question to guys who are good at UI in android

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:[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

Advertisements
Arehexes is online now  
Reply With Quote
sponsored links
Old February 27th, 2011, 03:21 PM   #2 (permalink)
Member
 
Join Date: Dec 2010
Location: Aarhus, Denmark
Posts: 136
 
Device(s): SE Xperia X10
Carrier: Not Provided

Thanks: 2
Thanked 22 Times in 22 Posts
Default

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 " androidnClick="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...
JamTheMan is offline  
Reply With Quote
The Following User Says Thank You to JamTheMan For This Useful Post:
Arehexes (February 27th, 2011)
Old February 27th, 2011, 03:23 PM   #3 (permalink)
Over Macho Grande?
 
alostpacket's Avatar
 
Join Date: Nov 2009
Location: NY
Posts: 7,931
 
Device(s): Moto360, GlassXE, MotoX, MotoX'14, N5, N4, N7'12, GNex, N1, SGT10.1, Revue, Xoom, Eris, OG Droid
Carrier: TMO

Thanks: 4,611
Thanked 3,585 Times in 1,530 Posts
Default

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.
alostpacket is offline  
Reply With Quote
The Following User Says Thank You to alostpacket For This Useful Post:
Arehexes (February 27th, 2011)
Old February 27th, 2011, 04:29 PM   #4 (permalink)
Member
Thread Author (OP)
 
Join Date: Jul 2010
Posts: 110
 
Device(s):
Carrier: Not Provided

Thanks: 17
Thanked 2 Times in 1 Post
Default

Thanks I can't believe I forgot about the android dev pages >_>. Hopefully I can finish this screen to present to my group .
Arehexes is online now  
Reply With Quote
Old February 27th, 2011, 05:43 PM   #5 (permalink)
Member
Thread Author (OP)
 
Join Date: Jul 2010
Posts: 110
 
Device(s):
Carrier: Not Provided

Thanks: 17
Thanked 2 Times in 1 Post
Default

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.).
Arehexes is online now  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:40 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.