Fork me on GitHub
#cljsrn
<
2016-05-15
>
dotboris02:05:23

I'm trying to start my first project and when I run run-android it's complaining about not being able to find a bunch of appcompat-* packages. Am I missing some sdk version or package?

dotboris04:05:07

I solved my problem. I need to install the android support repository

dotboris14:05:51

I'm using re-natal and I'm trying to display a ListView. I can't seem to figure out how to put my data in a ListView.DataSource. Can someone point me to an example?

madvas14:05:22

@dotboris: I have some old snippet here:

(ns future-app.ios.components.movies-list
  (:require-macros [natal-shell.components :as ui]
                   [natal-shell.data-source :as ds])
  (:require [om.next :as om :refer-macros [defui]]
            [print.foo :as pf :include-macros true]))

(set! js/window.React (js/require "react-native"))

(def styles
  {:container      {:flex            1,
                    :flexDirection   "row",
                    :justifyContent  "center",
                    :alignItems      "center",
                    :backgroundColor "#F5FCFF"},
   :rightContainer {:flex 1},
   :title          {:fontSize 20, :marginBottom 8, :textAlign "center"},
   :year           {:textAlign "center"},
   :thumbnail      {:width 53, :height 81},
   :listView       {:paddingTop 20, :backgroundColor "#F5FCFF"}})

(defn movie [movie]
  (let [{:keys [container rightContainer title year thumbnail]} styles]
    (ui/view
      {:style container}
      (ui/image {:source {:uri (get-in movie [:posters :thumbnail])}
                 :style  thumbnail})
      (ui/view {:style rightContainer}
               (ui/text {:style title} (:title movie))
               (ui/text {:style year} (:year movie))))))

(def list-view-ds (ds/data-source
                    {:rowHasChanged #(not= %1 %2)}))

(defui MovieList
  static om/IQuery
  (query [this]
    '[:movies/list])
  Object
  (render [this]
    (let [{:keys [movies]} (om/props this)]
      (ui/list-view {:dataSource (ds/clone-with-rows list-view-ds movies)
                     :renderRow  #(movie (js->clj % :keywordize-keys true))
                     :style      (:listView styles)}))))

(def movie-list (om/factory MovieList))

amar18:05:40

Hi everyone. Has anyone experienced jumpy/stuttering TextInput behavior when the user types? I'm using reagent with re-frame.

dotboris20:05:20

@amar: I'm experiencing them right now. I think it's because I the value of the text input as an r/atom updating it every onChangeText call. I'm not sure how to work around this tho. I do get something very similar with the Switch control