fixed discovery screen design styles

Former-commit-id: f402fc9b6e
This commit is contained in:
Adrian Tiberius 2016-05-03 16:00:44 +03:00
parent 38f7ea1ebf
commit ee3800897d
4 changed files with 49 additions and 25 deletions

View File

@ -17,11 +17,13 @@
[view {:style {:flex 0.8 [view {:style {:flex 0.8
:flexDirection "column"}} :flexDirection "column"}}
[text {:style {:color "black" [text {:style {:color "black"
:fontWeight "bold" :fontFamily "sans-serif-medium"
:fontSize 12}} (aget discovery "name")] :fontSize 14
:lineHeight 24}} (aget discovery "name")]
[text {:style {:color "black" [text {:style {:color "black"
:fontWeight "normal" :fontFamily "sans-serif"
:fontSize 12} :lineHeight 22
:fontSize 14}
:numberOfLines 2} (aget discovery "status")] :numberOfLines 2} (aget discovery "status")]
] ]
[view {:style {:flex 0.2 [view {:style {:flex 0.2
@ -30,8 +32,8 @@
:paddingTop 5}} :paddingTop 5}}
[image {:style {:resizeMode "contain" [image {:style {:resizeMode "contain"
:borderRadius 150 :borderRadius 150
:width 30 :width 40
:height 30} :height 40}
:source res/user-no-photo}] :source res/user-no-photo}]
] ]
])) ]))

View File

@ -42,7 +42,7 @@
(let [number (rand-int 999)] (let [number (rand-int 999)]
(do (do
(save-discoveries [{:name (str "Name " number) (save-discoveries [{:name (str "Name " number)
:status (str "Status " number) :status (str "Status This is some longer status to get the second line " number)
:whisper-id (str number) :whisper-id (str number)
:photo "" :photo ""
:location "" :location ""
@ -72,26 +72,32 @@
(let [search (aget e "nativeEvent" "text") (let [search (aget e "nativeEvent" "text")
hashtags (get-hashtags search)] hashtags (get-hashtags search)]
(dispatch [:broadcast-status search hashtags])))}] (dispatch [:broadcast-status search hashtags])))}]
[text "Discover"])] [view {:style {;:flex 1
;:flexDirection "row"
;:justifyContent "center"
;:alignSelf "stretch"
;:alignItems "center"
}}
[text {:style {:color "#000000de"
:alignSelf "center"
:textAlign "center"
:fontFamily "sans-serif"
:fontSize 16}} "Discover"]])]
[scroll-view {:style {}} [scroll-view {:style {}}
[view {:style {:paddingTop 5}}
[text {:style {:color "#b2bdc5"
:fontSize 14
:textAlign "center"}} "Discover popular contacts \n around the world"]]
[view {:style {:paddingLeft 30 [view {:style {:paddingLeft 30
:paddingTop 15 :paddingTop 15
:paddingBottom 15}} :paddingBottom 15}}
[text {:style {:color "#b2bdc5" [text {:style {:color "#8f838c93"
:fontSize 14 :fontFamily "sans-serif-medium"
:fontWeight "bold"}} "Popular Tags"]] :fontSize 14}} "Popular tags"]]
[discovery-popular] [discovery-popular]
[view {:style {:paddingLeft 30 [view {:style {:paddingLeft 30
:paddingTop 15 :paddingTop 15
:paddingBottom 15}} :paddingBottom 15}}
[text {:style {:color "#b2bdc5" [text {:style {:color "#8f838c93"
:fontSize 14 :fontSize 14
:fontWeight "bold"}} "Recent"]] :fontFamily "sans-serif-medium"}} "Recent"]]
[discovery-recent] [discovery-recent]
] ]
] ]

View File

@ -24,7 +24,7 @@
:pageWidth (- (page-width) 60) :pageWidth (- (page-width) 60)
:sneak 20} :sneak 20}
(for [tag @popular-tags] (for [tag @popular-tags]
(discovery-popular-list (.-name tag)))] (discovery-popular-list (.-name tag) (.-count tag)))]
[text "None"] [text "None"]
) )
) )

View File

@ -25,28 +25,44 @@
:key rowID}])] :key rowID}])]
elem)) elem))
(defn discovery-popular-list [tag] (defn discovery-popular-list [tag count]
(let [discoveries (subscribe [:get-discoveries-by-tag tag 3])] (let [discoveries (subscribe [:get-discoveries-by-tag tag 3])]
(log/debug "Got discoveries for tag (" tag "): " @discoveries) (log/debug "Got discoveries for tag (" tag "): " @discoveries)
[view {:style {:flex 1 [view {:style {:flex 1
:backgroundColor "white" :backgroundColor "white"
:paddingLeft 10 :paddingLeft 10
:paddingTop 10}} :paddingTop 16}}
[view {:style {:flexDirection "row" [view {:style {:flexDirection "row"
:backgroundColor "white" :backgroundColor "white"
:padding 0}} :padding 0}}
[view {:style {:flexDirection "column" [view {:style {
:backgroundColor "#e9f7fe" :flexDirection "column"}}
[view {:style {:backgroundColor "#eef2f5"
:borderRadius 5 :borderRadius 5
:padding 0}} :padding 4}}
[text {:style {:color "#6092df" [text {:style {:color "#7099e6"
:fontFamily "sans-serif-medium"
:fontSize 14
:paddingRight 5 :paddingRight 5
:paddingBottom 2 :paddingBottom 2
:alignItems "center" :alignItems "center"
:justifyContent "center"}} :justifyContent "center"}}
(str " #" (name tag))]]] (str " #" (name tag))]]]
[view {:style {:flex 0.2
:alignItems "flex-end"
:paddingTop 10
:paddingRight 9}}
[text {:style {:color "#838c93"
:fontFamily "sans-serif"
:fontSize 12
:paddingRight 5
:paddingBottom 2
:alignItems "center"
:justifyContent "center"}}
count]]]
[list-view {:dataSource (to-realm-datasource @discoveries) [list-view {:dataSource (to-realm-datasource @discoveries)
:renderRow render-row :renderRow render-row
:renderSeparator render-separator :renderSeparator render-separator
:style {:backgroundColor "white"}}] :style {:backgroundColor "white"
:paddingTop 13}}]
])) ]))