     (fit-linear-layout!)
     (.setImageBitmap (BitmapFactory/decodeFile path))))
 
-(defn view-image [activity intruction]
-  (on-ui
-      (replace-view! activity
-                     (make-ui activity
-                              [:linear-layout {:background-color Color/BLACK
-                                               :gravity Gravity/CENTER}
-                               (image-from-uri activity
-                                               "http://whyquit.com/freedom/ImageLibrary/Frogs/frog32.jpg")]))))
-
 (defn default-view [activity]
   (replace-view! activity
                  (make-ui activity

    (.superOnCreate this bundle)
    (let [on-message (fn [str]
                       (let [instruction (->instruction str)]
                         (case (:message instruction)
                           "startCameraStream" (do (log/i "startCameraStream " instruction)
                                                   (camera-view this instruction))
                           "streamVideo" (stream-view this instruction)
                           "displayImage" (view-image this instruction)
                           ;; "viewVideo" (view-video this instruction)
                           "save" (save-local! this instruction)
                           "viewLocal" (on-ui (swap-view! this (view-local this instruction)))
                           "stop" (default-view this)
                           :default)))

        "image" (layout activity (image-from-path activity path))
        "video" (layout activity (video-from-path activity path))))))

(defn view-remote [activity instruction]
  (when-let [url (:url instruction)]
    (case (:type instruction)
      "image" (layout activity (image-from-url activity url))
      "video" (layout activity (video-from-path activity url)))))

(defn swap-view! [activity view]
  (replace-view! activity view))

