fixed discovery screen design styles

This commit is contained in:
Adrian Tiberius 2016-05-03 16:00:44 +03:00
parent 5aef032c59
commit f402fc9b6e
4 changed files with 49 additions and 25 deletions

View File

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

View File

@ -42,7 +42,7 @@
(let [number (rand-int 999)]
(do
(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)
:photo ""
:location ""
@ -72,26 +72,32 @@
(let [search (aget e "nativeEvent" "text")
hashtags (get-hashtags search)]
(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 {}}
[view {:style {:paddingTop 5}}
[text {:style {:color "#b2bdc5"
:fontSize 14
:textAlign "center"}} "Discover popular contacts \n around the world"]]
[view {:style {:paddingLeft 30
:paddingTop 15
:paddingBottom 15}}
[text {:style {:color "#b2bdc5"
:fontSize 14
:fontWeight "bold"}} "Popular Tags"]]
[text {:style {:color "#8f838c93"
:fontFamily "sans-serif-medium"
:fontSize 14}} "Popular tags"]]
[discovery-popular]
[view {:style {:paddingLeft 30
:paddingTop 15
:paddingBottom 15}}
[text {:style {:color "#b2bdc5"
[text {:style {:color "#8f838c93"
:fontSize 14
:fontWeight "bold"}} "Recent"]]
:fontFamily "sans-serif-medium"}} "Recent"]]
[discovery-recent]
]
]

View File

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

View File

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