[fix 4417] update toolbar style

This commit is contained in:
Eric Dvorsak 2018-06-14 02:54:02 +02:00 committed by Roman Volosovskyi
parent 71867a9674
commit 8848b37433
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
8 changed files with 48 additions and 37 deletions

View File

@ -1,12 +1,13 @@
(ns status-im.android.platform) (ns status-im.android.platform)
(def fonts (def fonts
{:light {:font-family "Roboto-Light"} {:light {:font-family "Roboto-Light"}
:default {:font-family "Roboto-Regular"} :default {:font-family "Roboto-Regular"}
:medium {:font-family "Roboto-Medium"} :medium {:font-family "Roboto-Medium"}
:toolbar-title {:font-family "Roboto-Regular"} :toolbar-title {:font-family "Roboto-Medium"}
:roboto-mono {:font-family "RobotoMono-Medium"}}) :toolbar-subtitle {:font-family "Roboto-Regular"}
:roboto-mono {:font-family "RobotoMono-Medium"}})
;; Structure to be exported ;; Structure to be exported

View File

@ -54,8 +54,9 @@
:margin-bottom 2}) :margin-bottom 2})
(def chat-name-text (def chat-name-text
{:color component.styles/color-gray6 {:color component.styles/color-black
:font-size 16}) :line-height 18
:font-size 15})
(def group-icon (def group-icon
{:margin-top 4 {:margin-top 4
@ -68,16 +69,17 @@
:height 8}) :height 8})
(defstyle toolbar-subtitle (defstyle toolbar-subtitle
{:color component.styles/text4-color {:color component.styles/text4-color
:ios {:font-size 14 :line-height 15
:margin-top 4} :font-size 13
:android {:font-size 13}}) :ios {:margin-top 4}})
(defstyle last-activity-text (defstyle last-activity-text
{:color component.styles/text4-color {:color component.styles/text4-color
:ios {:font-size 14 :line-height 15
:margin-top 4} :ios {:font-size 14
:android {:font-size 13}}) :margin-top 4}
:android {:font-size 13}})
(defn actions-wrapper [status-bar-height] (defn actions-wrapper [status-bar-height]
{:background-color component.styles/color-white {:background-color component.styles/color-white

View File

@ -41,6 +41,7 @@
(defview last-activity [{:keys [sync-state accessibility-label]}] (defview last-activity [{:keys [sync-state accessibility-label]}]
(letsubs [state [:get :sync-data]] (letsubs [state [:get :sync-data]]
[react/text {:style st/last-activity-text [react/text {:style st/last-activity-text
:font :toolbar-subtitle
:accessibility-label accessibility-label} :accessibility-label accessibility-label}
(case sync-state (case sync-state
:in-progress (in-progress-text state) :in-progress (in-progress-text state)
@ -52,10 +53,12 @@
[last-activity {:sync-state sync-state}] [last-activity {:sync-state sync-state}]
(if public? (if public?
[react/view {:flex-direction :row} [react/view {:flex-direction :row}
[react/text {:style st/toolbar-subtitle} [react/text {:style st/toolbar-subtitle
:font :toolbar-subtitle}
(i18n/label :t/public-group-status)]] (i18n/label :t/public-group-status)]]
[react/view {:flex-direction :row} [react/view {:flex-direction :row}
[react/text {:style st/toolbar-subtitle} [react/text {:style st/toolbar-subtitle
:font :toolbar-subtitle}
(if public? (if public?
(i18n/label :t/public-group-status) (i18n/label :t/public-group-status)
(let [cnt (inc (count contacts))] (let [cnt (inc (count contacts))]

View File

@ -2,13 +2,14 @@
(:require [status-im.react-native.js-dependencies :as rn-dependencies])) (:require [status-im.react-native.js-dependencies :as rn-dependencies]))
(def fonts (def fonts
{:light {:font-family "SFUIText-Light"} {:light {:font-family "SFUIText-Light"}
:default {:font-family "SFUIText-Regular"} :default {:font-family "SFUIText-Regular"}
:medium {:font-family "SFUIText-Medium"} :medium {:font-family "SFUIText-Medium"}
:bold {:font-family "SFUIText-Bold"} :bold {:font-family "SFUIText-Bold"}
:toolbar-title {:font-family "SFUIText-Semibold"} :toolbar-title {:font-family "SFUIText-Semibold"}
:roboto-mono {:font-family "RobotoMono-Medium"}}) :toolbar-subtitle {:font-family "SFUIText-Regular"}
:roboto-mono {:font-family "RobotoMono-Medium"}})
;; iPhone X dimensions ;; iPhone X dimensions
(def x-width 375) (def x-width 375)

View File

@ -246,7 +246,7 @@
:empty-chat-description "There are no messages \nin this chat yet" :empty-chat-description "There are no messages \nin this chat yet"
:empty-chat-description-console "Look under the hood! Console is a javascript runtime environment that exposes the whole web3 API. Type \"web3.\" to get started." :empty-chat-description-console "Look under the hood! Console is a javascript runtime environment that exposes the whole web3 API. Type \"web3.\" to get started."
:empty-chat-description-one-to-one "Any messages you send here are encrypted and can only be read by you and " :empty-chat-description-one-to-one "Any messages you send here are encrypted and can only be read by you and "
:counter-99-plus "99+" :counter-9-plus "9+"
:show-more "Show more" :show-more "Show more"
:show-less "Show less" :show-less "Show less"

View File

@ -82,11 +82,13 @@
(defn counter (defn counter
([value] (counter nil value)) ([value] (counter nil value))
([{:keys [size accessibility-label] :or {size 18}} value] ([{:keys [size accessibility-label] :or {size 18}} value]
[react/view {:style (styles/counter-container size)} (let [more-than-9 (> value 9)]
[react/text (cond-> {:style (styles/counter-label size)} [react/view {:style (styles/counter-container size more-than-9)}
accessibility-label [react/text (cond-> {:style (styles/counter-label size)
(assoc :accessibility-label accessibility-label)) :font :toolbar-title}
(if (<= value 99) value (i18n/label :t/counter-99-plus))]])) accessibility-label
(assoc :accessibility-label accessibility-label))
(if more-than-9 (i18n/label :t/counter-9-plus) value)]])))
(defn image-contain [_ _] (defn image-contain [_ _]
(let [content-width (reagent/atom 0)] (let [content-width (reagent/atom 0)]

View File

@ -149,19 +149,19 @@
:text-align :center :text-align :center
:color colors/blue}) :color colors/blue})
(defn counter-container [size] (defn counter-container [size more-than-nine]
{:width size {:width (if more-than-nine (+ 2 size) size)
:height size :height size
:border-radius (/ size 2) :border-radius (/ size 2)
:background-color colors/blue :background-color colors/blue
:align-items :center :align-items :center
:justify-content :center}) :justify-content :center})
(defn counter-label [size] (defnstyle counter-label [size]
{:font-size (/ size 2) {:font-size (/ size 2)
:letter-spacing -0.2 :color colors/white
:text-align :center :android {:line-height (+ (/ size 2) 2)}
:color colors/white}) :text-align :center})
(def image-contain (def image-contain
{:align-self :stretch}) {:align-self :stretch})

View File

@ -26,7 +26,9 @@
(defn nav-button (defn nav-button
[{:keys [icon icon-opts unread-messages?] :as props}] [{:keys [icon icon-opts unread-messages?] :as props}]
[nav-item (merge {:style (styles/nav-item-button unread-messages?)} props) [nav-item (merge {:style (styles/nav-item-button unread-messages?)} props)
[vector-icons/icon icon icon-opts]]) [vector-icons/icon icon (if unread-messages?
(assoc icon-opts :color :active)
icon-opts)]])
(defview nav-button-with-count [props] (defview nav-button-with-count [props]
(letsubs [unread-messages-number [:get-chats-unread-messages-number]] (letsubs [unread-messages-number [:get-chats-unread-messages-number]]