Former-commit-id: a4a8b888a5
This commit is contained in:
virvar 2016-02-26 18:22:54 +03:00
parent ada19a9598
commit 152787d5c6
4 changed files with 16 additions and 14 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 530 B

After

Width:  |  Height:  |  Size: 985 B

View File

@ -183,17 +183,20 @@
[this] [this]
(let [{:keys [nav]} (om/get-computed this) (let [{:keys [nav]} (om/get-computed this)
messages-ds (load-messages)] messages-ds (load-messages)]
(view {:style {:flex 1}} (view {:style {:flex 1
:backgroundColor "white"}}
(toolbar-android {:logo res/logo-icon (toolbar-android {:logo res/logo-icon
:title "Chat name" :title "Chat name"
:titleColor "#4A5258" :titleColor "#4A5258"
:subtitle "Last seen just now" :subtitle "Last seen just now"
:subtitleColor "#AAB2B2" :subtitleColor "#AAB2B2"
:navIcon res/nav-back-icon :navIcon res/nav-back-icon
:style {:backgroundColor "#e9eaed" :style {:backgroundColor "white"
:height 56} :height 56}
:onIconClicked (fn [] :onIconClicked (fn []
(nav-pop nav))}) (nav-pop nav))})
(view {:style {:backgroundColor "#F3F2F1"
:height 4}})
(list-view {:dataSource messages-ds (list-view {:dataSource messages-ds
:renderScrollComponent :renderScrollComponent
(fn [props] (fn [props]
@ -201,7 +204,8 @@
(clj->js (merge (js->clj props) (clj->js (merge (js->clj props)
{:inverted true})))) {:inverted true}))))
:renderRow render-row :renderRow render-row
:style {}}) :style {:marginTop 4
:backgroundColor "white"}})
(new-message))))) (new-message)))))
(def chat (om/factory Chat)) (def chat (om/factory Chat))

View File

@ -42,9 +42,7 @@
:marginBottom 5 :marginBottom 5
:paddingLeft 15 :paddingLeft 15
:paddingRight 15 :paddingRight 15
:height 75 :height 75}}
:transform [{:translateX 0}
{:translateY 0}]}}
(view {:width 54 (view {:width 54
:height 54} :height 54}
;;; photo ;;; photo
@ -61,10 +59,7 @@
:borderRadius 50 :borderRadius 50
:width 54 :width 54
:height 54 :height 54
:position "absolute" :position "absolute"}}))
;; :top 2
;; :right 2
}}))
;;; online ;;; online
(when online (when online
(view {:position "absolute" (view {:position "absolute"
@ -176,14 +171,16 @@
(render [this] (render [this]
(let [{:keys [contacts-ds]} (om/props this) (let [{:keys [contacts-ds]} (om/props this)
{:keys [nav]} (om/get-computed this)] {:keys [nav]} (om/get-computed this)]
(view {:style {:flex 1}} (view {:style {:flex 1
:backgroundColor "#F3F2F1"}}
(toolbar-android {:logo res/logo-icon (toolbar-android {:logo res/logo-icon
:title "Chats" :title "Chats"
:titleColor "#4A5258" :titleColor "#4A5258"
:style {:backgroundColor "#e9eaed" :style {:backgroundColor "white"
:height 56}}) :height 56}})
(list-view {:dataSource contacts-ds (list-view {:dataSource contacts-ds
:renderRow (partial render-row nav) :renderRow (partial render-row nav)
:style {}}))))) :style {:marginTop 4
:backgroundColor "white"}})))))
(def contacts-list (om/factory ContactsList)) (def contacts-list (om/factory ContactsList))

View File

@ -42,7 +42,8 @@
(init-back-button-handler! nav) (init-back-button-handler! nav)
(let [{:keys [component]} (let [{:keys [component]}
(js->clj route :keywordize-keys true)] (js->clj route :keywordize-keys true)]
(component (om/computed (om/props this) {:nav nav})))))})))) (component (om/computed (om/props this)
{:nav nav})))))}))))
(swap! state/app-state assoc :contacts-ds (swap! state/app-state assoc :contacts-ds
(data-source {:rowHasChanged (fn [row1 row2] (data-source {:rowHasChanged (fn [row1 row2]