Commit 29da6b9b authored by Dave Griffiths's avatar Dave Griffiths
Browse files

audio and back icon at top

parent 40a5ffbf
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="foam.symbai" package="foam.symbai"
android:versionCode="7" android:versionCode="8"
android:versionName="1.0"> android:versionName="1.0">
<application android:label="@string/app_name" <application android:label="@string/app_name"
android:icon="@drawable/logo" android:icon="@drawable/logo"
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="foam.symbai.MainActivity" android:configChanges="orientation"></activity>
<activity android:name="foam.symbai.VillageActivity" android:configChanges="orientation"></activity> <activity android:name="foam.symbai.VillageActivity" android:configChanges="orientation"></activity>
<activity android:name="foam.symbai.HouseholdListActivity" android:configChanges="orientation"></activity> <activity android:name="foam.symbai.HouseholdListActivity" android:configChanges="orientation"></activity>
<activity android:name="foam.symbai.HouseholdActivity" android:configChanges="orientation"></activity> <activity android:name="foam.symbai.HouseholdActivity" android:configChanges="orientation"></activity>
...@@ -45,6 +46,7 @@ ...@@ -45,6 +46,7 @@
<uses-permission android:name="android.permission.VIBRATE"/> <uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COURSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COURSE_LOCATION" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-sdk android:minSdkVersion="8" /> <uses-sdk android:minSdkVersion="8" />
<uses-feature android:name="android.hardware.camera" android:required="true" /> <uses-feature android:name="android.hardware.camera" android:required="true" />
......
...@@ -500,6 +500,10 @@ ...@@ -500,6 +500,10 @@
(define (toast msg) (list "toast" 0 "toast" msg)) (define (toast msg) (list "toast" 0 "toast" msg))
(define (play-sound wav) (list "play-sound" 0 "play-sound" wav)) (define (play-sound wav) (list "play-sound" 0 "play-sound" wav))
(define (soundfile-start-recording wav) (list "soundfile-start-recording" 0 "soundfile-start-recording" wav))
(define (soundfile-stop-recording) (list "soundfile-stop-recording" 0 "soundfile-stop-recording"))
(define (soundfile-start-playback wav) (list "soundfile-start-playback" 0 "soundfile-start-playback" wav))
(define (soundfile-stop-playback) (list "soundfile-stop-playback" 0 "soundfile-stop-playback"))
(define (vibrate time) (list "vibrate" 0 "vibrate" time)) (define (vibrate time) (list "vibrate" 0 "vibrate" time))
(define (make-directory name) (list "make-directory" 0 "make-directory" name)) (define (make-directory name) (list "make-directory" 0 "make-directory" name))
;; treat this like a dialog so the callback fires ;; treat this like a dialog so the callback fires
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
(define household-ktvlist (define household-ktvlist
(list (list
(ktv "name" "varchar" (mtext-lookup 'default-household-name)) (ktv "name" "varchar" "")
(ktv "num-pots" "int" 0) (ktv "num-pots" "int" 0)
(ktv "num-children" "int" 0) (ktv "num-children" "int" 0)
(ktv "house-lat" "real" 0) ;; get from current location? (ktv "house-lat" "real" 0) ;; get from current location?
...@@ -94,9 +94,10 @@ ...@@ -94,9 +94,10 @@
(define individual-ktvlist (define individual-ktvlist
(list (list
(ktv "name" "varchar" (mtext-lookup 'default-individual-name)) (ktv "name" "varchar" "")
(ktv "family" "varchar" (mtext-lookup 'default-family-name)) (ktv "first-name" "varchar" "")
(ktv "photo-id" "varchar" (mtext-lookup 'default-photo-id)) (ktv "family" "varchar" "")
(ktv "photo-id" "varchar" "")
(ktv "photo" "file" "") (ktv "photo" "file" "")
(ktv "tribe" "varchar" "") (ktv "tribe" "varchar" "")
(ktv "subtribe" "varchar" "") (ktv "subtribe" "varchar" "")
...@@ -296,7 +297,8 @@ ...@@ -296,7 +297,8 @@
(fragment (fragment
"top" "top"
(horiz (horiz
(image-view 0 "face" (layout 48 64 -1 'centre 0)) (image-button (make-id "top-icon") "logo" (layout 48 64 -1 'centre 0)
(lambda () (list (start-activity-goto "main2" 0 ""))))
(text-view (make-id "title") "" 30 (text-view (make-id "title") "" 30
(layout 'fill-parent 'fill-parent 0.5 'centre 10)) (layout 'fill-parent 'fill-parent 0.5 'centre 10))
...@@ -672,6 +674,19 @@ ...@@ -672,6 +674,19 @@
(activity (activity
"main" "main"
(vert
(mbutton 'start (lambda () (list (start-activity-goto "main2" 0 "")))))
(lambda (activity arg)
(activity-layout activity))
(lambda (activity arg) '())
(lambda (activity) '())
(lambda (activity) '())
(lambda (activity) '())
(lambda (activity) '())
(lambda (activity requestcode resultcode) '()))
(activity
"main2"
(build-activity (build-activity
(mtitle 'title) (mtitle 'title)
(horiz (horiz
...@@ -696,11 +711,10 @@ ...@@ -696,11 +711,10 @@
household-ktvlist household-ktvlist
(list (ktv "name" "varchar" (list (ktv "name" "varchar"
(string-append (string-append
(mtext-lookup 'default-household-name) "-" (ktv-get (get-entity-by-unique db "sync" (get-setting-value "current-village")) "name")
(get-setting-value "user-id") "-" (get-setting-value "user-id")
(number->string (get/inc-setting "house-id")))))))) (number->string (get/inc-setting "house-id"))))))))
(mbutton 'villages (lambda () (list (start-activity "villages" 0 "")))) (mbutton 'villages (lambda () (list (start-activity "villages" 0 ""))))
(mbutton 'sync (lambda () (list (start-activity "sync" 0 "")))) (mbutton 'sync (lambda () (list (start-activity "sync" 0 ""))))
...@@ -713,11 +727,12 @@ ...@@ -713,11 +727,12 @@
(lambda (activity arg) (lambda (activity arg)
(activity-layout activity)) (activity-layout activity))
(lambda (activity arg) (lambda (activity arg)
(alog "start main start")
(set-current! 'activity-title "Main screen") (set-current! 'activity-title "Main screen")
(set-current! 'village (get-setting-value "current-village")) (set-current! 'village (get-setting-value "current-village"))
(set-current! 'household #f) (set-current! 'household #f)
(set-current! 'individual #f) (set-current! 'individual #f)
(append (let ((r (append
(update-top-bar) (update-top-bar)
(list (list
(update-widget 'edit-text (get-id "user-id") 'text (get-setting-value "user-id")) (update-widget 'edit-text (get-id "user-id") 'text (get-setting-value "user-id"))
...@@ -731,7 +746,8 @@ ...@@ -731,7 +746,8 @@
(number->string (car loc)) ", " (number->string (car loc)) ", "
(number->string (cadr loc))))))) (number->string (cadr loc)))))))
(update-list-widget (update-list-widget
db "sync" "household" "household" (get-setting-value "current-village"))))) db "sync" "household" "household" (get-setting-value "current-village"))))))
(alog "end main start") r))
(lambda (activity) '()) (lambda (activity) '())
(lambda (activity) '()) (lambda (activity) '())
(lambda (activity) '()) (lambda (activity) '())
...@@ -852,8 +868,8 @@ ...@@ -852,8 +868,8 @@
household-ktvlist household-ktvlist
(list (ktv "name" "varchar" (list (ktv "name" "varchar"
(string-append (string-append
(mtext-lookup 'default-household-name) "-" (ktv-get (get-entity-by-unique db "sync" (get-setting-value "current-village")) "name")
(get-setting-value "user-id") "-" (get-setting-value "user-id")
(number->string (get/inc-setting "house-id"))))))))) (number->string (get/inc-setting "house-id")))))))))
(lambda (activity arg) (lambda (activity arg)
(activity-layout activity)) (activity-layout activity))
...@@ -873,10 +889,8 @@ ...@@ -873,10 +889,8 @@
"household" "household"
(build-activity (build-activity
(horiz (horiz
(medit-text 'household-name "normal" (lambda (v) (entity-set-value! "name" "varchar" v) '())) (medit-text 'num-pots "numeric" (lambda (v) (entity-set-value! "num-pots" "int" v) '()))
(vert (medit-text 'num-children "numeric" (lambda (v) (entity-set-value! "num-children" "int" v) '())))
(medit-text 'num-pots "numeric" (lambda (v) (entity-set-value! "num-pots" "int" v) '()))
(medit-text 'num-children "numeric" (lambda (v) (entity-set-value! "num-children" "int" v) '()))))
(horiz (horiz
(vert (vert
(mtext 'location) (mtext 'location)
...@@ -894,15 +908,18 @@ ...@@ -894,15 +908,18 @@
db "sync" 'individuals "individual" "individual" db "sync" 'individuals "individual" "individual"
(lambda () (get-current 'household #f)) (lambda () (get-current 'household #f))
(lambda () (lambda ()
(let ((photo-id (get/inc-setting "photo-id"))) (let ((photo-id (get/inc-setting "photo-id"))
(household-name (ktv-get (dbg (get-entity-by-unique db "sync" (dbg (get-current 'household #f)))) "name")))
(msg household-name)
(ktvlist-merge (ktvlist-merge
individual-ktvlist individual-ktvlist
(list (list
(ktv "photo-id" "varchar" (ktv "name" "varchar"
(string-append (string-append
(get-setting-value "user-id") household-name ":"
"-"
(number->string photo-id))) (number->string photo-id)))
(ktv "photo-id" "varchar"
(number->string photo-id))
(ktv "social-type" "varchar" (ktv "social-type" "varchar"
(symbol->string (symbol->string
(list-ref social-types-list (list-ref social-types-list
...@@ -922,7 +939,6 @@ ...@@ -922,7 +939,6 @@
(update-top-bar) (update-top-bar)
(list (list
(update-list-widget db "sync" "individual" "individual" arg) (update-list-widget db "sync" "individual" "individual" arg)
(mupdate 'edit-text 'household-name "name")
(mupdate 'edit-text 'num-pots "num-pots") (mupdate 'edit-text 'num-pots "num-pots")
(mupdate 'edit-text 'num-children "num-children")) (mupdate 'edit-text 'num-children "num-children"))
(mupdate-gps 'house "house") (mupdate-gps 'house "house")
...@@ -942,6 +958,8 @@ ...@@ -942,6 +958,8 @@
(vert (vert
(mtext 'name-display) (mtext 'name-display)
(spacer 20) (spacer 20)
(mtext 'first-name-display)
(spacer 20)
(mtext 'family-display) (mtext 'family-display)
(spacer 20) (spacer 20)
(mtext 'photo-id-display) (mtext 'photo-id-display)
...@@ -972,6 +990,7 @@ ...@@ -972,6 +990,7 @@
(update-top-bar) (update-top-bar)
(list (list
(mupdate 'text-view 'name-display "name") (mupdate 'text-view 'name-display "name")
(mupdate 'text-view 'first-name-display "first-name")
(mupdate 'text-view 'family-display "family") (mupdate 'text-view 'family-display "family")
(mupdate 'text-view 'photo-id-display "photo-id") (mupdate 'text-view 'photo-id-display "photo-id")
(mupdate 'image-view 'photo "photo")))) (mupdate 'image-view 'photo "photo"))))
...@@ -998,9 +1017,8 @@ ...@@ -998,9 +1017,8 @@
))) )))
(vert (vert
(medit-text 'details-name "normal" (lambda (v) (entity-set-value! "name" "varchar" v) '())) (medit-text 'details-first-name "normal" (lambda (v) (entity-set-value! "first-name" "varchar" v) '()))
(medit-text 'details-family "normal" (lambda (v) (entity-set-value! "family" "varchar" v) '())) (medit-text 'details-family "normal" (lambda (v) (entity-set-value! "family" "varchar" v) '()))))
(medit-text 'details-photo-id "normal" (lambda (v) (entity-set-value! "photo-id" "varchar" v) '()))))
(mspinner-other 'tribe tribes-list (lambda (v) (entity-set-value! "tribe" "varchar" (spinner-choice tribes-list v)) '())) (mspinner-other 'tribe tribes-list (lambda (v) (entity-set-value! "tribe" "varchar" (spinner-choice tribes-list v)) '()))
(mspinner-other 'sub-tribe subtribe-list (lambda (v) (entity-set-value! "subtribe" "varchar" (spinner-choice subtribe-list v)) '())) (mspinner-other 'sub-tribe subtribe-list (lambda (v) (entity-set-value! "subtribe" "varchar" (spinner-choice subtribe-list v)) '()))
(horiz (horiz
...@@ -1019,9 +1037,8 @@ ...@@ -1019,9 +1037,8 @@
(mupdate-spinner-other 'tribe "tribe" tribes-list) (mupdate-spinner-other 'tribe "tribe" tribes-list)
(mupdate-spinner-other 'sub-tribe "subtribe" subtribe-list) (mupdate-spinner-other 'sub-tribe "subtribe" subtribe-list)
(list (list
(mupdate 'edit-text 'details-name "name") (mupdate 'edit-text 'details-first-name "first-name")
(mupdate 'edit-text 'details-family "family") (mupdate 'edit-text 'details-family "family")
(mupdate 'edit-text 'details-photo-id "photo-id")
(mupdate 'image-view 'photo "photo") (mupdate 'image-view 'photo "photo")
(mupdate 'edit-text 'age "age") (mupdate 'edit-text 'age "age")
(mupdate-spinner 'gender "gender" gender-list) (mupdate-spinner 'gender "gender" gender-list)
...@@ -1421,11 +1438,25 @@ ...@@ -1421,11 +1438,25 @@
(social-connection-return requestcode "friendship-five" social-request-code-five) (social-connection-return requestcode "friendship-five" social-request-code-five)
'())) '()))
;; todo: stop/rec/play on exit
(activity (activity
"agreement" "agreement"
(build-activity (build-activity
) (horiz
(mtoggle-button-scale
'agree-record
(lambda (v)
(list
(if (eqv? v 1) (soundfile-start-recording "/sdcard/symbai/test.3gp")
(soundfile-stop-recording)))))
(mtoggle-button-scale
'agree-playback
(lambda (v)
(list
(if (eqv? v 1) (soundfile-start-playback "/sdcard/symbai/test.3gp")
(soundfile-stop-playback)))))
))
(lambda (activity arg) (lambda (activity arg)
(set-current! 'activity-title "Agreement") (set-current! 'activity-title "Agreement")
(activity-layout activity)) (activity-layout activity))
......
(define i18n-text (define i18n-text
(list (list
(list 'test-num (list "1" "1" "1" "" )) (list 'test-num (list "1" "1" "1" "" ))
(list 'test-text (list "I am test text" "I am test text" "I am test text" "" )) (list 'test-text (list "I am test text" "I am test text" "I am test text" "" ))
(list 'one (list "one" "" )) (list 'one (list "one" "" ))
...@@ -118,6 +117,7 @@ ...@@ -118,6 +117,7 @@
(list 'is-a-child (list "Child" "" )) (list 'is-a-child (list "Child" "" ))
(list 'change-photo (list "Change photo" "" )) (list 'change-photo (list "Change photo" "" ))
(list 'details-name (list "Name" "Kyrteng" )) (list 'details-name (list "Name" "Kyrteng" ))
(list 'details-first-name (list "Name" "Kyrteng" ))
(list 'details-photo-id (list "Photo ID" "Nombor dur ID" )) (list 'details-photo-id (list "Photo ID" "Nombor dur ID" ))
(list 'details-family (list "Family" "" )) (list 'details-family (list "Family" "" ))
(list 'tribe (list "Tribe" "Jaidbynriew:" )) (list 'tribe (list "Tribe" "Jaidbynriew:" ))
...@@ -252,9 +252,7 @@ ...@@ -252,9 +252,7 @@
(list 'occupation-cows (list "Cows" )) (list 'occupation-cows (list "Cows" ))
(list 'occupation-fishing (list "Fishing" )) (list 'occupation-fishing (list "Fishing" ))
(list 'occupation-other (list "Other" )) (list 'occupation-other (list "Other" ))
(list 'friendship-question (list "LIST UP TO FIVE PERSONS whom you have really liked to talk to in the last year. They can be of either sex. They can be friends, neighbours, relatives, co-wives; they can live in this village or elsewhere; anyone you like to talk to." )) (list 'friendship-question (list "LIST UP TO FIVE PERSONS whom you have really liked to talk to in the last year. They can be of either sex. They can be friends, neighbours, relatives, co-wives; they can live in this village or elsewhere; anyone you like to talk to." "" ))
(list 'prestige-question (list "LIST UP TO FIVE PERSONS who you think are the most respected in the village:" )) (list 'prestige-question (list "LIST UP TO FIVE PERSONS who you think are the most respected in the village:" ))
(list 'knowledge-question (list "LIST UP TO FIVE PERSONS who you think are the most knowledgeable in the village:" )) (list 'knowledge-question (list "LIST UP TO FIVE PERSONS who you think are the most knowledgeable in the village:" ))
)) ))
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
<item name="android:colorBackground">@color/bg</item> <item name="android:colorBackground">@color/bg</item>
<item name="android:buttonStyle">@style/StarwispButton</item> <item name="android:buttonStyle">@style/StarwispButton</item>
<item name="android:buttonStyleToggle">@style/StarwispButton</item> <item name="android:buttonStyleToggle">@style/StarwispButton</item>
<item name="android:imageButtonStyle">@style/StarwispButton</item>
<item name="android:seekBarStyle">@style/StarwispSeekBar</item> <item name="android:seekBarStyle">@style/StarwispSeekBar</item>
<item name="android:spinnerItemStyle">@style/StarwispSpinnerItem</item> <item name="android:spinnerItemStyle">@style/StarwispSpinnerItem</item>
......
...@@ -62,6 +62,7 @@ public class starwisp extends StarwispActivity ...@@ -62,6 +62,7 @@ public class starwisp extends StarwispActivity
static { static {
// register all activities here // register all activities here
ActivityManager.RegisterActivity("main",starwisp.class); ActivityManager.RegisterActivity("main",starwisp.class);
ActivityManager.RegisterActivity("main2",MainActivity.class);
ActivityManager.RegisterActivity("village",VillageActivity.class); ActivityManager.RegisterActivity("village",VillageActivity.class);
ActivityManager.RegisterActivity("household-list",HouseholdListActivity.class); ActivityManager.RegisterActivity("household-list",HouseholdListActivity.class);
ActivityManager.RegisterActivity("household",HouseholdActivity.class); ActivityManager.RegisterActivity("household",HouseholdActivity.class);
...@@ -79,6 +80,7 @@ public class starwisp extends StarwispActivity ...@@ -79,6 +80,7 @@ public class starwisp extends StarwispActivity
ActivityManager.RegisterActivity("child",ChildActivity.class); ActivityManager.RegisterActivity("child",ChildActivity.class);
ActivityManager.RegisterActivity("move",MoveActivity.class); ActivityManager.RegisterActivity("move",MoveActivity.class);
ActivityManager.RegisterActivity("villages",VillagesActivity.class); ActivityManager.RegisterActivity("villages",VillagesActivity.class);
ActivityManager.RegisterActivity("agreement",AgreementActivity.class);
}; };
/** Called when the activity is first created. */ /** Called when the activity is first created. */
......
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
"is-a-child"," Child"," ",, "is-a-child"," Child"," ",,
"change-photo"," Change photo"," ",, "change-photo"," Change photo"," ",,
"details-name"," Name","Kyrteng",, "details-name"," Name","Kyrteng",,
"details-first-name","Name","Kyrteng",,
"details-photo-id"," Photo ID","Nombor dur ID",, "details-photo-id"," Photo ID","Nombor dur ID",,
"details-family"," Family"," ",, "details-family"," Family"," ",,
"tribe"," Tribe","Jaidbynriew:",, "tribe"," Tribe","Jaidbynriew:",,
......
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