Skip to content

Commit

Permalink
added collar weight and keep screen on in sync
Browse files Browse the repository at this point in the history
  • Loading branch information
nebogeo committed Feb 2, 2015
1 parent f186d9b commit ab324be
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions android/assets/starwisp.scm
Expand Up @@ -1514,6 +1514,9 @@
(text-view (make-id "new-individual-chip-text") "Chip code" 30 fillwrap)
(edit-text (make-id "new-individual-chip-code") "" 30 "text" fillwrap
(lambda (v) (entity-set-value! "chip-code" "varchar" v) '()))
(text-view (make-id "new-individual-collar-text") "Collar weight" 30 fillwrap)
(edit-text (make-id "new-individual-collar-weight") "" 30 "numeric" fillwrap
(lambda (v) (entity-set-value! "collar-weight" "real" (string->number v)) '()))
(horiz
(mbutton2 "new-individual-cancel" "Cancel"
(lambda () (list (finish-activity 2))))
Expand All @@ -1533,6 +1536,7 @@
(entity-set-value! "dob" "varchar" "00-00-00")
(entity-set-value! "litter-code" "varchar" "")
(entity-set-value! "chip-code" "varchar" "")
(entity-set-value! "collar-weight" "real" "")
(list
(update-widget 'text-view (get-id "new-individual-pack-name") 'text
(string-append "Pack: " (ktv-get (get-current 'pack '()) "name")))))
Expand Down Expand Up @@ -1579,6 +1583,9 @@
(text-view (make-id "update-individual-chip-text") "Chip code" 30 fillwrap)
(edit-text (make-id "update-individual-chip-code") "" 30 "text" fillwrap
(lambda (v) (entity-set-value! "chip-code" "varchar" v) '()))
(text-view (make-id "update-individual-collar-text") "Collar weight" 30 fillwrap)
(edit-text (make-id "update-individual-collar-weight") "" 30 "numeric" fillwrap
(lambda (v) (entity-set-value! "collar-weight" "real" (string->number v)) '()))
(spacer 10)
(horiz
(mtoggle-button2 "update-individual-delete" "Delete"
Expand Down Expand Up @@ -1614,6 +1621,8 @@
(ktv-get individual "litter-code"))
(update-widget 'edit-text (get-id "update-individual-chip-code") 'text
(ktv-get individual "chip-code"))
(update-widget 'edit-text (get-id "update-individual-collar-weight") 'text
(let ((v (ktv-get individual "collar-weight"))) (if v v 0)))

(update-widget 'toggle-button (get-id "update-individual-delete") 'checked
(if (eqv? (ktv-get individual "deleted") 1) 1 0))
Expand Down
7 changes: 7 additions & 0 deletions android/src/foam/mongoose/SyncActivity.java
Expand Up @@ -18,6 +18,8 @@
import android.app.Activity;
import android.os.Bundle;
import android.content.Context;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;

public class SyncActivity extends foam.starwisp.StarwispActivity
{
Expand All @@ -26,5 +28,10 @@ public void onCreate(Bundle savedInstanceState)
{
m_Name = "sync";
super.onCreate(savedInstanceState);

WindowManager.LayoutParams params = getWindow().getAttributes();
params.flags |= LayoutParams.FLAG_KEEP_SCREEN_ON;
getWindow().setAttributes(params);

}
}

0 comments on commit ab324be

Please sign in to comment.