Commit 1806cff8 authored by Dave Griffiths's avatar Dave Griffiths
Browse files

sorted layout more or less

parent 53834c24
......@@ -108,6 +108,9 @@
(define (mbutton2 id title fn)
(button (make-id id) title 20 (layout 150 100 1 'centre 5) fn))
(define (mbutton-small id title fn)
(button (make-id id) title 30 (layout 'wrap-content 'wrap-content -1 'right 5) fn))
(define (mtoggle-button id title fn)
(toggle-button (make-id id) title 20 (layout 'fill-parent 'wrap-content 1 'centre 5) "fancy" fn))
......@@ -478,7 +481,12 @@
(string-append (number->string (get-current 'timer-seconds 59))))
)))
(define (next-button id dialog-msg next-frag fn)
(define (next-button id dialog-msg last-frag next-frag fn)
(horiz
(mbutton (string-append id "-backb") "Back"
(lambda ()
(list (replace-fragment (get-id "gc-top") last-frag))))
(mbutton (string-append id "-nextb") "Next"
(lambda ()
(list
......@@ -493,7 +501,7 @@
(append
(fn) (list (replace-fragment
(get-id "gc-top") next-frag))))
(else '()))))))))
(else '())))))))))
(define (force-pause)
(list
......@@ -992,7 +1000,7 @@
(edit-text (make-id "gc-start-code") "" 30 "numeric" fillwrap
(lambda (v) (entity-set-value! "group-comp-code" "varchar" v) '()))
(build-grid-selector "gc-start-present" "toggle" "Who's present?")
(next-button "gc-start-" "Go to weighing, have you finished here?" "gc-weights"
(next-button "gc-start-" "Go to weighing, have you finished here?" "gc-start" "gc-weights"
(lambda () '()))
))
......@@ -1037,7 +1045,7 @@
'()))))
(mtoggle-button "gc-weigh-accurate" "Accurate?" (lambda (v) '()))
(next-button "gc-weigh-" "Go to pregnancies, have you finished here?" "gc-preg"
(next-button "gc-weigh-" "Go to pregnancies, have you finished here?" "gc-start" "gc-preg"
(lambda () '()))))
(lambda (fragment arg)
......@@ -1077,7 +1085,7 @@
(list
(mtitle "title" "Pregnant females")
(build-grid-selector "gc-preg-choose" "toggle" "Choose")
(next-button "gc-preg-" "Going to pup associations, have you finished here?" "gc-pup-assoc"
(next-button "gc-preg-" "Going to pup associations, have you finished here?" "gc-weights" "gc-pup-assoc"
(lambda () '()))))
(lambda (fragment arg)
......@@ -1113,7 +1121,7 @@
(spinner (make-id "gc-pup-accuracy") (list "Weak" "Medium" "Strong") fillwrap
(lambda (v) '()))))
(build-grid-selector "gc-pup-escort" "toggle" "Escort")
(next-button "gc-pup-assoc-" "Going to oestrus, have you finished here?" "gc-oestrus"
(next-button "gc-pup-assoc-" "Going to oestrus, have you finished here?" "gc-preg" "gc-oestrus"
(lambda () '()))))
(lambda (fragment arg)
......@@ -1151,7 +1159,7 @@
(spinner (make-id "gc-oestrus-accuracy") (list "Weak" "Medium" "Strong") fillwrap
(lambda (v) '()))))
(build-grid-selector "gc-oestrus-guard" "single" "Choose mate guard")
(next-button "gc-pup-oestrus-" "Going to babysitters, have you finished here?" "gc-babysitting"
(next-button "gc-pup-oestrus-" "Going to babysitters, have you finished here?" "gc-pup-assoc" "gc-babysitting"
(lambda () '()))))
(lambda (fragment arg)
(activity-layout fragment))
......@@ -1178,7 +1186,7 @@
(make-id "") 'vertical fill gc-col
(list
(mtitle "" "Babysitters")
(next-button "gc-pup-baby-" "Ending, have you finished here?" "gc-end"
(next-button "gc-pup-baby-" "Ending, have you finished here?" "gc-oestrus" "gc-end"
(lambda () '()))))
(lambda (fragment arg)
(activity-layout fragment))
......@@ -1195,7 +1203,7 @@
(make-id "") 'vertical fill gc-col
(list
(mtitle "" "Finish group composition")
(next-button "gc-pup-baby-" "Ending, have you finished here?" "gc-end"
(next-button "gc-pup-baby-" "Ending, have you finished here?" "gc-babysitting" "gc-end"
(lambda () (list (finish-activity 0))))))
(lambda (fragment arg)
(activity-layout fragment))
......@@ -1371,12 +1379,27 @@
(activity
"group-composition"
(linear-layout
0 'vertical fillwrap gc-bgcol
0 'vertical (layout 'fill-parent 'fill-parent 1 'left 0)
gc-col
(list
(relative
'(("parent-top"))
(list 0 0 0 0)
(horiz
(text-view (make-id "obs-title") "" 40 fillwrap)
(build-fragment "gc-start" (make-id "gc-top") (layout 'fill-parent 520 1 'left 0))
(build-fragment "events" (make-id "event-holder") (layout 'fill-parent 520 1 'left 0))
(mbutton "gc-done" "Done" (lambda () (list (finish-activity 0))))))
(mbutton-small "gc-done" "Exit" (lambda () (list (finish-activity 0))))))
(build-fragment "gc-start" (make-id "gc-top") (layout 'fill-parent 'wrap-content -1 'left 0))
(linear-layout
0 'vertical (layout 'fill-parent 'fill-parent 1 'left 0)
(list 0 0 0 0) (list (spacer 10)))
(relative
'(("parent-bottom"))
(list 0 0 0 0)
(build-fragment "events" (make-id "event-holder") (layout 'fill-parent 'wrap-content -1 'left 0)))))
(lambda (activity arg)
(activity-layout activity))
(lambda (activity arg)
......@@ -1395,9 +1418,6 @@
(activity
"pup-focal-start"
(linear-layout
0 'vertical fillwrap pf-bgcol
(list
(vert
(mtitle "" "Pup focal setup")
(mtext "pf1-pack" "Pack")
......@@ -1425,8 +1445,7 @@
(alert-dialog
"pup-focal-check"
"You need to specify an pup for the focal"
(lambda () '()))))))))
)))
(lambda () '())))))))))
(lambda (activity arg)
(activity-layout activity))
(lambda (activity arg)
......@@ -1449,8 +1468,12 @@
(activity
"pup-focal"
(linear-layout
0 'vertical fillwrap pf-bgcol
0 'vertical (layout 'fill-parent 'fill-parent 1 'left 0)
pf-col
(list
(relative
'(("parent-top"))
(list 0 0 0 0)
(horiz
(mtitle "title" "Pup Focal")
(linear-layout
......@@ -1470,10 +1493,8 @@
(msg "pausing")
(if v
(list (delayed "timer" 1000 (lambda () '())))
(list (delayed "timer" 1000 timer-cb))))))
(build-fragment "pf-timer" (make-id "pf-top") (layout 'fill-parent 515 1 'left 0))
(build-fragment "events" (make-id "event-holder") (layout 'fill-parent 515 1 'left 0))
(mbutton "pf-done" "Done"
(list (delayed "timer" 1000 timer-cb)))))
(mbutton-small "pf-done" "Exit"
(lambda ()
(list
(alert-dialog
......@@ -1486,6 +1507,17 @@
(else
(list))))))))))
(build-fragment "pf-timer" (make-id "pf-top") (layout 'fill-parent 'wrap-content -1 'left 0))
(linear-layout
0 'vertical (layout 'fill-parent 'fill-parent 1 'left 0)
(list 0 0 0 0) (list (spacer 10)))
(relative
'(("parent-bottom"))
(list 0 0 0 0)
(build-fragment "events" (make-id "event-holder") (layout 'fill-parent 'wrap-content 1 'left 0)))))
(lambda (activity arg)
(activity-layout activity))
(lambda (activity arg)
......@@ -1504,12 +1536,10 @@
(activity
"group-events"
(linear-layout
0 'vertical fill gp-col
(list
(build-fragment "events" (make-id "event-holder") (layout 'fill-parent 515 1 'left 0))
(vert
(build-fragment "events" (make-id "event-holder") (layout 'fill-parent 'wrap-content 1 'left 0))
(horiz
(mbutton "gpe-done" "Done" (lambda () (list (finish-activity 0)))))))
(mbutton "gpe-done" "Done" (lambda () (list (finish-activity 0))))))
(lambda (activity arg)
(activity-layout activity))
(lambda (activity arg) (list))
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<!-- Dummy item to prevent TextView from receiving focus -->
<LinearLayout
android:focusable="true" android:focusableInTouchMode="true"
android:layout_width="0px" android:layout_height="0px"/>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/main"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/debug"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</LinearLayout>
</LinearLayout>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment