Skip to content

Commit

Permalink
Android specific updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferossgp committed Feb 27, 2020
1 parent 7a1fa85 commit 2aad9cb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 32 deletions.
7 changes: 1 addition & 6 deletions components/src/status_im/ui/components/react.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,4 @@

(def safe-area-consumer (adapt-class (object/get js-dependencies/safe-area-context "SafeAreaConsumer")))

;; NOTE: Due to a known bug in android: https://github.com/th3rdwave/react-native-safe-area-context/issues/29
;; do not use safe area in android
(def safe-area-view
(if platform/ios?
(adapt-class (object/get js-dependencies/safe-area-context "SafeAreaView"))
view))
(def safe-area-view (adapt-class (object/get js-dependencies/safe-area-context "SafeAreaView")))
41 changes: 20 additions & 21 deletions src/status_im/ui/components/tabbar/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -113,28 +113,27 @@
(.remove listener)))))
:reagent-render
(fn [{:keys [navigate index inset]}]
(when-not @keyboard-shown?
[react/animated-view {:style (tabs.styles/tabs-wrapper @minimized-state inset)}
[react/animated-view {:style (tabs.styles/animated-container visible?)}
[react/view
{:style tabs.styles/tabs-container}
[react/view {:style tabs.styles/tabs}
(for [[route-index
{:keys [nav-stack accessibility-label count-subscription content]}]
tabs-list-data
[react/animated-view {:style (tabs.styles/tabs-wrapper @keyboard-shown? @minimized-state inset)}
[react/animated-view {:style (tabs.styles/animated-container visible?)}
[react/view
{:style tabs.styles/tabs-container}
[react/view {:style tabs.styles/tabs}
(for [[route-index
{:keys [nav-stack accessibility-label count-subscription content]}]
tabs-list-data

:let [{:keys [icon title]} content]]
^{:key nav-stack}
[tab
{:icon icon
:label title
:on-press #(navigate (name nav-stack))
:accessibility-label accessibility-label
:count-subscription count-subscription
:active? (= (str index) (str route-index))
:nav-stack nav-stack}])]]]
[react/view
{:style (tabs.styles/ios-titles-cover inset)}]]))})))
:let [{:keys [icon title]} content]]
^{:key nav-stack}
[tab
{:icon icon
:label title
:on-press #(navigate (name nav-stack))
:accessibility-label accessibility-label
:count-subscription count-subscription
:active? (= (str index) (str route-index))
:nav-stack nav-stack}])]]]
[react/view
{:style (tabs.styles/ios-titles-cover inset)}]])})))

(defn tabbar [props]
(let [navigate (oget props "navigation" "navigate")
Expand Down
13 changes: 8 additions & 5 deletions src/status_im/ui/components/tabbar/styles.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,11 @@
:right 0
:left 0})

(defn tabs-wrapper [minimized inset]
{:padding-bottom inset
:elevation 8
:padding-top (if minimized 0 tabs-diff)
:background-color :white})
(defn tabs-wrapper [keyboard minimized inset]
(merge {:padding-bottom inset
:elevation 8
:padding-top (if minimized 0 tabs-diff)
:background-color :white}
(when keyboard
{:position :absolute
:bottom (- tabs-height)})))

0 comments on commit 2aad9cb

Please sign in to comment.