Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
citizen-science
symbai
Commits
7783bb0a
Commit
7783bb0a
authored
Apr 16, 2014
by
Dave Griffiths
Browse files
social fixes and cycle social type
parent
55422843
Changes
2
Show whitespace changes
Inline
Side-by-side
android/assets/dbsync.scm
View file @
7783bb0a
...
...
@@ -585,8 +585,12 @@
(
symbol->string
(
list-ref
l
i
)))
(
define
(
mupdate-spinner
id-symbol
key
choices
)
(
let*
((
val
(
entity-get-value
key
))
(
index
(
index-find
(
string->symbol
val
)
choices
)))
(
let*
((
val
(
entity-get-value
key
)))
(
if
(
not
val
)
(
update-widget
'spinner
(
get-id
(
string-append
(
symbol->string
id-symbol
)
"-spinner"
))
'selection
0
)
(
let
((
index
(
index-find
(
string->symbol
val
)
choices
)))
(
if
index
(
update-widget
'spinner
(
get-id
(
string-append
(
symbol->string
id-symbol
)
"-spinner"
))
...
...
@@ -595,19 +599,22 @@
(
msg
"spinner item in db "
val
" not found in list of items"
)
(
update-widget
'spinner
(
get-id
(
string-append
(
symbol->string
id-symbol
)
"-spinner"
))
'selection
0
)))))
'selection
0
)))))
))
(
define
(
mupdate-spinner-other
id-symbol
key
choices
)
(
msg
"update spinner other..."
)
(
let*
((
val
(
entity-get-value
key
))
(
index
(
index-find
(
string->symbol
val
)
choices
)))
(
let*
((
val
(
dbg
(
entity-get-value
key
))))
(
if
(
not
val
)
(
update-widget
'spinner
(
get-id
(
string-append
(
symbol->string
id-symbol
)
"-spinner"
))
'selection
0
)
(
let
((
index
(
index-find
(
string->symbol
val
)
choices
)))
(
if
index
(
update-widget
'spinner
(
get-id
(
string-append
(
symbol->string
id-symbol
)
"-spinner"
))
'selection
index
)
(
update-widget
'edit-text
(
get-id
(
string-append
(
symbol->string
id-symbol
)
"-edit-text"
))
'selection
index
))))
'selection
index
))))
))
;;;;
;; (y m d h m s)
...
...
android/assets/starwisp.scm
View file @
7783bb0a
...
...
@@ -417,7 +417,11 @@
(
list
(
start-activity
"individual-chooser"
request-code
""
))))))
(
define
(
build-small-person-selector
id
key
filter
request-code
)
(
vert
(
linear-layout
0
'vertical
(
layout
300
'wrap-content
1
'centre
10
)
(
list
0
0
0
0
)
(
list
(
mtitle
id
)
(
image-view
(
make-id
(
string-append
(
symbol->string
id
)
"-image"
))
"face"
(
layout
120
160
-1
'centre
0
))
...
...
@@ -425,10 +429,10 @@
(
button
(
make-id
(
string-append
"change-"
(
symbol->string
id
)))
(
mtext-lookup
'change-id
)
40
(
layout
'
fill-par
ent
'wrap-content
-1
'centre
5
)
40
(
layout
'
wrap-cont
ent
'wrap-content
-1
'centre
5
)
(
lambda
()
(
filter-set!
filter
)
(
list
(
start-activity
"individual-chooser"
request-code
""
))))))
(
list
(
start-activity
"individual-chooser"
request-code
""
))))))
)
;; from activity on result with request id: choose-code
...
...
@@ -456,10 +460,16 @@
(
update-widget
'image-view
id
'external-image
(
string-append
dirname
"files/"
(
cadr
image-name
))))))))
(
define
(
build-social-connection
id
key
type
request-code
)
(
define
(
build-social-connection
id
key
type
request-code
shade
)
(
let
((
id-text
(
string-append
(
symbol->string
id
))))
(
horiz
(
linear-layout
0
'horizontal
(
layout
'wrap-content
'wrap-content
1
'centre
20
)
(
if
shade
colour-one
colour-two
)
(
list
(
build-small-person-selector
id
key
(
list
)
request-code
)
(
vert
(
horiz
(
mspinner-other-vert
(
string->symbol
(
string-append
id-text
"-relationship"
))
'social-relationship
...
...
@@ -474,7 +484,7 @@
social-residence-list
(
lambda
(
v
)
(
entity-set-value!
(
string-append
key
"-residence"
)
"varchar"
(
spinner-choice
social-residence-list
v
))
'
()))
(
spinner-choice
social-residence-list
v
))
'
()))
)
(
vert
(
text-view
0
(
mtext-lookup
'social-strength
)
30
(
layout
'wrap-content
'wrap-content
1
'centre
10
))
...
...
@@ -484,7 +494,7 @@
(
layout
'wrap-content
'wrap-content
1
'centre
0
)
(
lambda
(
v
)
(
entity-set-value!
(
string-append
key
"-strength"
)
"varchar"
(
spinner-choice
social-strength-list
v
))
'
()))))))
(
spinner-choice
social-strength-list
v
))
'
()))))))
))
(
define
(
social-connection-return
request-code
key
choose-code
)
(
when
(
eqv?
request-code
choose-code
)
...
...
@@ -724,13 +734,20 @@
db
"sync"
'individuals
"individual"
"individual"
(
lambda
()
(
get-current
'household
#f
))
(
lambda
()
(
let
((
photo-id
(
get/inc-setting
"photo-id"
)))
(
ktvlist-merge
individual-ktvlist
(
list
(
ktv
"photo-id"
"varchar"
(
list
(
ktv
"photo-id"
"varchar"
(
string-append
(
get-setting-value
"user-id"
)
"-"
(
number->string
(
get/inc-setting
"photo-id"
))))))))
(
number->string
photo-id
)))
(
ktv
"social-type"
"varchar"
(
symbol->string
(
list-ref
social-types-list
(
modulo
photo-id
(
length
social-types-list
)))))
)))))
(
delete-button
))
...
...
@@ -1140,8 +1157,6 @@
(
lambda
(
activity
)
'
())
(
lambda
(
activity
)
'
())
(
lambda
(
activity
requestcode
resultcode
)
(
msg
"hello!!!"
)
(
msg
requestcode
)
(
person-selector-return
requestcode
"id-mother"
mother-request-code
)
(
person-selector-return
requestcode
"id-father"
father-request-code
)
'
()))
...
...
@@ -1149,18 +1164,21 @@
(
activity
"social"
(
build-activity
(
mspinner
'social-type
social-types-list
(
lambda
(
v
)
(
entity-set-value!
"social-type"
"varchar"
(
mspinner
'social-type
social-types-list
(
lambda
(
v
)
(
entity-set-value!
"social-type"
"varchar"
(
spinner-choice
social-types-list
v
))
'
()))
(
build-social-connection
'social-one
"social-one"
"friend"
social-request-code-one
)
(
build-social-connection
'social-two
"social-two"
"friend"
social-request-code-two
)
(
build-social-connection
'social-three
"social-three"
"friend"
social-request-code-three
)
(
build-social-connection
'social-four
"social-four"
"friend"
social-request-code-four
)
(
build-social-connection
'social-five
"social-five"
"friend"
social-request-code-five
)
(
build-social-connection
'social-one
"social-one"
"friend"
social-request-code-one
#t
)
(
build-social-connection
'social-two
"social-two"
"friend"
social-request-code-two
#f
)
(
build-social-connection
'social-three
"social-three"
"friend"
social-request-code-three
#t
)
(
build-social-connection
'social-four
"social-four"
"friend"
social-request-code-four
#f
)
(
build-social-connection
'social-five
"social-five"
"friend"
social-request-code-five
#t
)
)
(
lambda
(
activity
arg
)
(
set-current!
'activity-title
"Individual social network"
)
(
activity-layout
activity
))
(
lambda
(
activity
arg
)
(
msg
"wooooop"
)
(
append
(
update-top-bar
(
entity-get-value
"name"
)
(
entity-get-value
"photo-id"
))
(
list
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment