diff --git a/android/app/src/main/res/drawable-hdpi/icon_chats.png b/android/app/src/main/res/drawable-hdpi/icon_chats.png new file mode 100644 index 0000000000..24acc606e4 Binary files /dev/null and b/android/app/src/main/res/drawable-hdpi/icon_chats.png differ diff --git a/android/app/src/main/res/drawable-hdpi/icon_chats_active.png b/android/app/src/main/res/drawable-hdpi/icon_chats_active.png new file mode 100644 index 0000000000..d8dd8877e9 Binary files /dev/null and b/android/app/src/main/res/drawable-hdpi/icon_chats_active.png differ diff --git a/android/app/src/main/res/drawable-hdpi/icon_contacts.png b/android/app/src/main/res/drawable-hdpi/icon_contacts.png new file mode 100644 index 0000000000..68185400b1 Binary files /dev/null and b/android/app/src/main/res/drawable-hdpi/icon_contacts.png differ diff --git a/android/app/src/main/res/drawable-hdpi/icon_contacts_active.png b/android/app/src/main/res/drawable-hdpi/icon_contacts_active.png new file mode 100644 index 0000000000..6df5188117 Binary files /dev/null and b/android/app/src/main/res/drawable-hdpi/icon_contacts_active.png differ diff --git a/android/app/src/main/res/drawable-hdpi/icon_discover.png b/android/app/src/main/res/drawable-hdpi/icon_discover.png new file mode 100644 index 0000000000..f0062b9ecb Binary files /dev/null and b/android/app/src/main/res/drawable-hdpi/icon_discover.png differ diff --git a/android/app/src/main/res/drawable-hdpi/icon_discover_active.png b/android/app/src/main/res/drawable-hdpi/icon_discover_active.png new file mode 100644 index 0000000000..bab95befde Binary files /dev/null and b/android/app/src/main/res/drawable-hdpi/icon_discover_active.png differ diff --git a/android/app/src/main/res/drawable-hdpi/icon_tab_chats.png b/android/app/src/main/res/drawable-hdpi/icon_tab_chats.png deleted file mode 100644 index cd49ce4003..0000000000 Binary files a/android/app/src/main/res/drawable-hdpi/icon_tab_chats.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-hdpi/icon_tab_contacts.png b/android/app/src/main/res/drawable-hdpi/icon_tab_contacts.png deleted file mode 100644 index b7f48eff4c..0000000000 Binary files a/android/app/src/main/res/drawable-hdpi/icon_tab_contacts.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-hdpi/icon_tab_discover.png b/android/app/src/main/res/drawable-hdpi/icon_tab_discover.png deleted file mode 100644 index 1166cab6f6..0000000000 Binary files a/android/app/src/main/res/drawable-hdpi/icon_tab_discover.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-mdpi/icon_chats.png b/android/app/src/main/res/drawable-mdpi/icon_chats.png new file mode 100644 index 0000000000..accffce44a Binary files /dev/null and b/android/app/src/main/res/drawable-mdpi/icon_chats.png differ diff --git a/android/app/src/main/res/drawable-mdpi/icon_chats_active.png b/android/app/src/main/res/drawable-mdpi/icon_chats_active.png new file mode 100644 index 0000000000..a7fb8a4f8c Binary files /dev/null and b/android/app/src/main/res/drawable-mdpi/icon_chats_active.png differ diff --git a/android/app/src/main/res/drawable-mdpi/icon_contacts.png b/android/app/src/main/res/drawable-mdpi/icon_contacts.png new file mode 100644 index 0000000000..c428fa16b0 Binary files /dev/null and b/android/app/src/main/res/drawable-mdpi/icon_contacts.png differ diff --git a/android/app/src/main/res/drawable-mdpi/icon_contacts_active.png b/android/app/src/main/res/drawable-mdpi/icon_contacts_active.png new file mode 100644 index 0000000000..568786dd1a Binary files /dev/null and b/android/app/src/main/res/drawable-mdpi/icon_contacts_active.png differ diff --git a/android/app/src/main/res/drawable-mdpi/icon_discover.png b/android/app/src/main/res/drawable-mdpi/icon_discover.png new file mode 100644 index 0000000000..3a6d1793d2 Binary files /dev/null and b/android/app/src/main/res/drawable-mdpi/icon_discover.png differ diff --git a/android/app/src/main/res/drawable-mdpi/icon_discover_active.png b/android/app/src/main/res/drawable-mdpi/icon_discover_active.png new file mode 100644 index 0000000000..9ace125674 Binary files /dev/null and b/android/app/src/main/res/drawable-mdpi/icon_discover_active.png differ diff --git a/android/app/src/main/res/drawable-mdpi/icon_tab_chats.png b/android/app/src/main/res/drawable-mdpi/icon_tab_chats.png deleted file mode 100644 index 6bb1a35f92..0000000000 Binary files a/android/app/src/main/res/drawable-mdpi/icon_tab_chats.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-mdpi/icon_tab_contacts.png b/android/app/src/main/res/drawable-mdpi/icon_tab_contacts.png deleted file mode 100644 index 277368a9b8..0000000000 Binary files a/android/app/src/main/res/drawable-mdpi/icon_tab_contacts.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-mdpi/icon_tab_discover.png b/android/app/src/main/res/drawable-mdpi/icon_tab_discover.png deleted file mode 100644 index 6b726371f7..0000000000 Binary files a/android/app/src/main/res/drawable-mdpi/icon_tab_discover.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xhdpi/icon_chats.png b/android/app/src/main/res/drawable-xhdpi/icon_chats.png new file mode 100644 index 0000000000..55ca434d47 Binary files /dev/null and b/android/app/src/main/res/drawable-xhdpi/icon_chats.png differ diff --git a/android/app/src/main/res/drawable-xhdpi/icon_chats_active.png b/android/app/src/main/res/drawable-xhdpi/icon_chats_active.png new file mode 100644 index 0000000000..9a2f4860a3 Binary files /dev/null and b/android/app/src/main/res/drawable-xhdpi/icon_chats_active.png differ diff --git a/android/app/src/main/res/drawable-xhdpi/icon_contacts.png b/android/app/src/main/res/drawable-xhdpi/icon_contacts.png new file mode 100644 index 0000000000..c8f1ab41f2 Binary files /dev/null and b/android/app/src/main/res/drawable-xhdpi/icon_contacts.png differ diff --git a/android/app/src/main/res/drawable-xhdpi/icon_contacts_active.png b/android/app/src/main/res/drawable-xhdpi/icon_contacts_active.png new file mode 100644 index 0000000000..c3d93c37c1 Binary files /dev/null and b/android/app/src/main/res/drawable-xhdpi/icon_contacts_active.png differ diff --git a/android/app/src/main/res/drawable-xhdpi/icon_discover.png b/android/app/src/main/res/drawable-xhdpi/icon_discover.png new file mode 100644 index 0000000000..713bdd1f3a Binary files /dev/null and b/android/app/src/main/res/drawable-xhdpi/icon_discover.png differ diff --git a/android/app/src/main/res/drawable-xhdpi/icon_discover_active.png b/android/app/src/main/res/drawable-xhdpi/icon_discover_active.png new file mode 100644 index 0000000000..828f60bb17 Binary files /dev/null and b/android/app/src/main/res/drawable-xhdpi/icon_discover_active.png differ diff --git a/android/app/src/main/res/drawable-xhdpi/icon_tab_chats.png b/android/app/src/main/res/drawable-xhdpi/icon_tab_chats.png deleted file mode 100644 index 87c2bc79f9..0000000000 Binary files a/android/app/src/main/res/drawable-xhdpi/icon_tab_chats.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xhdpi/icon_tab_contacts.png b/android/app/src/main/res/drawable-xhdpi/icon_tab_contacts.png deleted file mode 100644 index 9192c55522..0000000000 Binary files a/android/app/src/main/res/drawable-xhdpi/icon_tab_contacts.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xhdpi/icon_tab_discover.png b/android/app/src/main/res/drawable-xhdpi/icon_tab_discover.png deleted file mode 100644 index f40ba84519..0000000000 Binary files a/android/app/src/main/res/drawable-xhdpi/icon_tab_discover.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxhdpi/icon_chats.png b/android/app/src/main/res/drawable-xxhdpi/icon_chats.png new file mode 100644 index 0000000000..bf795c4c7f Binary files /dev/null and b/android/app/src/main/res/drawable-xxhdpi/icon_chats.png differ diff --git a/android/app/src/main/res/drawable-xxhdpi/icon_chats_active.png b/android/app/src/main/res/drawable-xxhdpi/icon_chats_active.png new file mode 100644 index 0000000000..3cd62cf21d Binary files /dev/null and b/android/app/src/main/res/drawable-xxhdpi/icon_chats_active.png differ diff --git a/android/app/src/main/res/drawable-xxhdpi/icon_contacts.png b/android/app/src/main/res/drawable-xxhdpi/icon_contacts.png new file mode 100644 index 0000000000..cf2806ecc2 Binary files /dev/null and b/android/app/src/main/res/drawable-xxhdpi/icon_contacts.png differ diff --git a/android/app/src/main/res/drawable-xxhdpi/icon_contacts_active.png b/android/app/src/main/res/drawable-xxhdpi/icon_contacts_active.png new file mode 100644 index 0000000000..e4f0b065d8 Binary files /dev/null and b/android/app/src/main/res/drawable-xxhdpi/icon_contacts_active.png differ diff --git a/android/app/src/main/res/drawable-xxhdpi/icon_discover.png b/android/app/src/main/res/drawable-xxhdpi/icon_discover.png new file mode 100644 index 0000000000..1b69063cfa Binary files /dev/null and b/android/app/src/main/res/drawable-xxhdpi/icon_discover.png differ diff --git a/android/app/src/main/res/drawable-xxhdpi/icon_discover_active.png b/android/app/src/main/res/drawable-xxhdpi/icon_discover_active.png new file mode 100644 index 0000000000..be0b04ab16 Binary files /dev/null and b/android/app/src/main/res/drawable-xxhdpi/icon_discover_active.png differ diff --git a/android/app/src/main/res/drawable-xxhdpi/icon_tab_chats.png b/android/app/src/main/res/drawable-xxhdpi/icon_tab_chats.png deleted file mode 100644 index 382bcaaaf6..0000000000 Binary files a/android/app/src/main/res/drawable-xxhdpi/icon_tab_chats.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxhdpi/icon_tab_contacts.png b/android/app/src/main/res/drawable-xxhdpi/icon_tab_contacts.png deleted file mode 100644 index 19f17a0942..0000000000 Binary files a/android/app/src/main/res/drawable-xxhdpi/icon_tab_contacts.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxhdpi/icon_tab_discover.png b/android/app/src/main/res/drawable-xxhdpi/icon_tab_discover.png deleted file mode 100644 index 8bc25d2ab3..0000000000 Binary files a/android/app/src/main/res/drawable-xxhdpi/icon_tab_discover.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/icon_chats.png b/android/app/src/main/res/drawable-xxxhdpi/icon_chats.png new file mode 100644 index 0000000000..4092c54b1c Binary files /dev/null and b/android/app/src/main/res/drawable-xxxhdpi/icon_chats.png differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/icon_chats_active.png b/android/app/src/main/res/drawable-xxxhdpi/icon_chats_active.png new file mode 100644 index 0000000000..a3e52f2405 Binary files /dev/null and b/android/app/src/main/res/drawable-xxxhdpi/icon_chats_active.png differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/icon_contacts.png b/android/app/src/main/res/drawable-xxxhdpi/icon_contacts.png new file mode 100644 index 0000000000..64ccdc7757 Binary files /dev/null and b/android/app/src/main/res/drawable-xxxhdpi/icon_contacts.png differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/icon_contacts_active.png b/android/app/src/main/res/drawable-xxxhdpi/icon_contacts_active.png new file mode 100644 index 0000000000..1ed7402549 Binary files /dev/null and b/android/app/src/main/res/drawable-xxxhdpi/icon_contacts_active.png differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/icon_discover.png b/android/app/src/main/res/drawable-xxxhdpi/icon_discover.png new file mode 100644 index 0000000000..75db73fc16 Binary files /dev/null and b/android/app/src/main/res/drawable-xxxhdpi/icon_discover.png differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/icon_discover_active.png b/android/app/src/main/res/drawable-xxxhdpi/icon_discover_active.png new file mode 100644 index 0000000000..601c213982 Binary files /dev/null and b/android/app/src/main/res/drawable-xxxhdpi/icon_discover_active.png differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/icon_tab_chats.png b/android/app/src/main/res/drawable-xxxhdpi/icon_tab_chats.png deleted file mode 100644 index 19020ea5b5..0000000000 Binary files a/android/app/src/main/res/drawable-xxxhdpi/icon_tab_chats.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/icon_tab_contacts.png b/android/app/src/main/res/drawable-xxxhdpi/icon_tab_contacts.png deleted file mode 100644 index d5bfcba9d2..0000000000 Binary files a/android/app/src/main/res/drawable-xxxhdpi/icon_tab_contacts.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/icon_tab_discover.png b/android/app/src/main/res/drawable-xxxhdpi/icon_tab_discover.png deleted file mode 100644 index cfc93ab11a..0000000000 Binary files a/android/app/src/main/res/drawable-xxxhdpi/icon_tab_discover.png and /dev/null differ diff --git a/ios/StatusIm/Images.xcassets/icon_tab_chats.imageset/Contents.json b/ios/StatusIm/Images.xcassets/icon_chats.imageset/Contents.json similarity index 86% rename from ios/StatusIm/Images.xcassets/icon_tab_chats.imageset/Contents.json rename to ios/StatusIm/Images.xcassets/icon_chats.imageset/Contents.json index 02a839408c..717ec72edb 100644 --- a/ios/StatusIm/Images.xcassets/icon_tab_chats.imageset/Contents.json +++ b/ios/StatusIm/Images.xcassets/icon_chats.imageset/Contents.json @@ -2,7 +2,7 @@ "images" : [ { "idiom" : "universal", - "filename" : "icon_tab_chats.png", + "filename" : "icon_chats.png", "scale" : "1x" }, { @@ -18,4 +18,4 @@ "version" : 1, "author" : "xcode" } -} \ No newline at end of file +} diff --git a/ios/StatusIm/Images.xcassets/icon_chats.imageset/icon_chats.png b/ios/StatusIm/Images.xcassets/icon_chats.imageset/icon_chats.png new file mode 100644 index 0000000000..4092c54b1c Binary files /dev/null and b/ios/StatusIm/Images.xcassets/icon_chats.imageset/icon_chats.png differ diff --git a/ios/StatusIm/Images.xcassets/icon_chats_active.imageset/Contents.json b/ios/StatusIm/Images.xcassets/icon_chats_active.imageset/Contents.json new file mode 100644 index 0000000000..933c163d2b --- /dev/null +++ b/ios/StatusIm/Images.xcassets/icon_chats_active.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "icon_chats_active.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/StatusIm/Images.xcassets/icon_chats_active.imageset/icon_chats_active.png b/ios/StatusIm/Images.xcassets/icon_chats_active.imageset/icon_chats_active.png new file mode 100644 index 0000000000..a3e52f2405 Binary files /dev/null and b/ios/StatusIm/Images.xcassets/icon_chats_active.imageset/icon_chats_active.png differ diff --git a/ios/StatusIm/Images.xcassets/icon_tab_contacts.imageset/Contents.json b/ios/StatusIm/Images.xcassets/icon_contacts.imageset/Contents.json similarity index 85% rename from ios/StatusIm/Images.xcassets/icon_tab_contacts.imageset/Contents.json rename to ios/StatusIm/Images.xcassets/icon_contacts.imageset/Contents.json index 1bd385d0a8..b1445eaf8e 100644 --- a/ios/StatusIm/Images.xcassets/icon_tab_contacts.imageset/Contents.json +++ b/ios/StatusIm/Images.xcassets/icon_contacts.imageset/Contents.json @@ -2,7 +2,7 @@ "images" : [ { "idiom" : "universal", - "filename" : "icon_tab_contacts.png", + "filename" : "icon_contacts.png", "scale" : "1x" }, { @@ -18,4 +18,4 @@ "version" : 1, "author" : "xcode" } -} \ No newline at end of file +} diff --git a/ios/StatusIm/Images.xcassets/icon_contacts.imageset/icon_contacts.png b/ios/StatusIm/Images.xcassets/icon_contacts.imageset/icon_contacts.png new file mode 100644 index 0000000000..64ccdc7757 Binary files /dev/null and b/ios/StatusIm/Images.xcassets/icon_contacts.imageset/icon_contacts.png differ diff --git a/ios/StatusIm/Images.xcassets/icon_contacts_active.imageset/Contents.json b/ios/StatusIm/Images.xcassets/icon_contacts_active.imageset/Contents.json new file mode 100644 index 0000000000..d88743a2e2 --- /dev/null +++ b/ios/StatusIm/Images.xcassets/icon_contacts_active.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "icon_contacts_active.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/StatusIm/Images.xcassets/icon_contacts_active.imageset/icon_contacts_active.png b/ios/StatusIm/Images.xcassets/icon_contacts_active.imageset/icon_contacts_active.png new file mode 100644 index 0000000000..1ed7402549 Binary files /dev/null and b/ios/StatusIm/Images.xcassets/icon_contacts_active.imageset/icon_contacts_active.png differ diff --git a/ios/StatusIm/Images.xcassets/icon_tab_discover.imageset/Contents.json b/ios/StatusIm/Images.xcassets/icon_discover.imageset/Contents.json similarity index 85% rename from ios/StatusIm/Images.xcassets/icon_tab_discover.imageset/Contents.json rename to ios/StatusIm/Images.xcassets/icon_discover.imageset/Contents.json index 4b8a714e71..0e3ee1aa4c 100644 --- a/ios/StatusIm/Images.xcassets/icon_tab_discover.imageset/Contents.json +++ b/ios/StatusIm/Images.xcassets/icon_discover.imageset/Contents.json @@ -2,7 +2,7 @@ "images" : [ { "idiom" : "universal", - "filename" : "icon_tab_discover.png", + "filename" : "icon_discover.png", "scale" : "1x" }, { @@ -18,4 +18,4 @@ "version" : 1, "author" : "xcode" } -} \ No newline at end of file +} diff --git a/ios/StatusIm/Images.xcassets/icon_discover.imageset/icon_discover.png b/ios/StatusIm/Images.xcassets/icon_discover.imageset/icon_discover.png new file mode 100644 index 0000000000..75db73fc16 Binary files /dev/null and b/ios/StatusIm/Images.xcassets/icon_discover.imageset/icon_discover.png differ diff --git a/ios/StatusIm/Images.xcassets/icon_discover_active.imageset/Contents.json b/ios/StatusIm/Images.xcassets/icon_discover_active.imageset/Contents.json new file mode 100644 index 0000000000..43e44f838b --- /dev/null +++ b/ios/StatusIm/Images.xcassets/icon_discover_active.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "icon_discover_active.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/StatusIm/Images.xcassets/icon_discover_active.imageset/icon_discover_active.png b/ios/StatusIm/Images.xcassets/icon_discover_active.imageset/icon_discover_active.png new file mode 100644 index 0000000000..601c213982 Binary files /dev/null and b/ios/StatusIm/Images.xcassets/icon_discover_active.imageset/icon_discover_active.png differ diff --git a/ios/StatusIm/Images.xcassets/icon_tab_chats.imageset/icon_tab_chats.png b/ios/StatusIm/Images.xcassets/icon_tab_chats.imageset/icon_tab_chats.png deleted file mode 100644 index 382bcaaaf6..0000000000 Binary files a/ios/StatusIm/Images.xcassets/icon_tab_chats.imageset/icon_tab_chats.png and /dev/null differ diff --git a/ios/StatusIm/Images.xcassets/icon_tab_contacts.imageset/icon_tab_contacts.png b/ios/StatusIm/Images.xcassets/icon_tab_contacts.imageset/icon_tab_contacts.png deleted file mode 100644 index 19f17a0942..0000000000 Binary files a/ios/StatusIm/Images.xcassets/icon_tab_contacts.imageset/icon_tab_contacts.png and /dev/null differ diff --git a/ios/StatusIm/Images.xcassets/icon_tab_discover.imageset/icon_tab_discover.png b/ios/StatusIm/Images.xcassets/icon_tab_discover.imageset/icon_tab_discover.png deleted file mode 100644 index 8bc25d2ab3..0000000000 Binary files a/ios/StatusIm/Images.xcassets/icon_tab_discover.imageset/icon_tab_discover.png and /dev/null differ diff --git a/src/status_im/chats_list/screen.cljs b/src/status_im/chats_list/screen.cljs index 31ff824cd0..ad5bf38185 100644 --- a/src/status_im/chats_list/screen.cljs +++ b/src/status_im/chats_list/screen.cljs @@ -89,9 +89,10 @@ [view st/chat-separator-item]])))) (defview chats-list [] - [chats [:filtered-chats] - edit? [:get-in [:chat-list-ui-props :edit?]] - search? [:get-in [:toolbar-search :show]]] + [chats [:filtered-chats] + edit? [:get-in [:chat-list-ui-props :edit?]] + search? [:get-in [:toolbar-search :show]] + tabs-hidden? [:tabs-hidden?]] [view st/chats-container (cond edit? [toolbar-edit] @@ -104,7 +105,7 @@ :renderFooter #(when (seq chats) (list-item [chat-shadow-item])) :renderSeparator (when (get-in platform-specific [:chats :render-separator?]) (render-separator-fn chats)) - :style st/list-container}] + :style (st/list-container tabs-hidden?)}] (when (and (not edit?) (not search?) (get-in platform-specific [:chats :action-button?])) diff --git a/src/status_im/chats_list/styles.cljs b/src/status_im/chats_list/styles.cljs index b0c3eb0598..f449465d4a 100644 --- a/src/status_im/chats_list/styles.cljs +++ b/src/status_im/chats_list/styles.cljs @@ -1,4 +1,5 @@ (ns status-im.chats-list.styles + (:require-macros [status-im.utils.styles :refer [defnstyle]]) (:require [status-im.components.styles :refer [color-white color-light-gray color-blue @@ -8,7 +9,7 @@ text4-color separator-color new-messages-count-color]] - [status-im.components.tabs.styles :refer [tabs-height]] + [status-im.components.tabs.styles :as tabs-st] [status-im.components.toolbar.styles :refer [toolbar-background1 toolbar-background2]] [status-im.utils.platform :as p])) @@ -99,10 +100,10 @@ :height 16}) (def last-message-container - {:flex-shrink 1}) + {:flex-shrink 1}) (def last-message-text - (merge {:color text4-color} + (merge {:color text4-color} (get-in p/platform-specific [:component-styles :chat-list :last-message]))) (def status-container @@ -136,9 +137,12 @@ (def chats-container {:flex 1}) -(def list-container - (merge (get-in p/platform-specific [:component-styles :main-tab-list]) - (get-in p/platform-specific [:component-styles :chat-list :list-container]))) +(defnstyle list-container [tabs-hidden?] + {:android {:background-color color-light-gray + :margin-bottom 20} + + :ios {:background-color color-white + :margin-bottom (if tabs-hidden? 20 (+ 16 tabs-st/tabs-height))}}) (def toolbar-actions {:flex-direction :row diff --git a/src/status_im/components/main_tabs.cljs b/src/status_im/components/main_tabs.cljs index bb5564e0d4..7a3734dbb9 100644 --- a/src/status_im/components/main_tabs.cljs +++ b/src/status_im/components/main_tabs.cljs @@ -4,16 +4,9 @@ [cljs.core.async.macros :as am]) (:require [re-frame.core :refer [subscribe dispatch dispatch-sync]] [reagent.core :as r] - [status-im.components.react :refer [view - animated-view - text - image - touchable-highlight - get-dimensions - swiper]] + [status-im.components.react :refer [view swiper]] [status-im.components.status-bar :refer [status-bar]] [status-im.components.drawer.view :refer [drawer-view]] - [status-im.components.animation :as anim] [status-im.components.tabs.bottom-shadow :refer [bottom-shadow-view]] [status-im.chats-list.screen :refer [chats-list]] [status-im.discover.screen :refer [discover]] @@ -25,37 +18,24 @@ [cljs.core.async :as a])) (def tab-list - [{:view-id :chat-list - :title (label :t/chats) - :screen chats-list - :icon :icon_tab_chats - :index 0} - {:view-id :discover - :title (label :t/discover) - :screen discover - :icon :icon_tab_discover - :index 1} - {:view-id :contact-list - :title (label :t/contacts) - :screen contact-list - :icon :icon_tab_contacts - :index 2}]) - -(defn animation-logic [{:keys [offsets val tab-id to-tab-id]}] - (fn [_] - (when-let [offsets @offsets] - (let [from-value (:from offsets) - to-value (:to offsets) - to-tab-id @to-tab-id] - (anim/set-value val from-value) - (when to-value - (anim/start - (anim/timing val {:toValue to-value - :duration 300}) - (when (= tab-id to-tab-id) - (fn [arg] - (when (.-finished arg) - (dispatch [:on-navigated-to-tab])))))))))) + [{:view-id :chat-list + :title (label :t/chats) + :screen chats-list + :icon-inactive :icon_chats + :icon-active :icon_chats_active + :index 0} + {:view-id :discover + :title (label :t/discover) + :screen discover + :icon-inactive :icon_discover + :icon-active :icon_discover_active + :index 1} + {:view-id :contact-list + :title (label :t/contacts) + :screen contact-list + :icon-inactive :icon_contacts + :icon-active :icon_contacts_active + :index 2}]) (def tab->index {:chat-list 0 :discover 1 @@ -96,12 +76,14 @@ (recur (a/<! scroll-start)))) (defn main-tabs [] - (let [view-id (subscribe [:get :view-id]) - prev-view-id (subscribe [:get :prev-view-id]) - main-swiper (r/atom nil) - swiped? (r/atom false) - scroll-start (a/chan 10) - scroll-ended (a/chan 10)] + (let [view-id (subscribe [:get :view-id]) + prev-view-id (subscribe [:get :prev-view-id]) + tabs-hidden? (subscribe [:tabs-hidden?]) + main-swiper (r/atom nil) + swiped? (r/atom false) + scroll-start (a/chan 10) + scroll-ended (a/chan 10) + tabs-were-hidden? (atom @tabs-hidden?)] (r/create-class {:component-did-mount #(start-scrolling-loop scroll-start scroll-ended) @@ -109,9 +91,10 @@ (fn [] (if @swiped? (reset! swiped? false) - (when @main-swiper + (when (and (= @tabs-were-hidden? @tabs-hidden?) @main-swiper) (let [to (scroll-to @prev-view-id @view-id)] - (a/put! scroll-start [@main-swiper to]))))) + (a/put! scroll-start [@main-swiper to])))) + (reset! tabs-were-hidden? @tabs-hidden?)) :reagent-render (fn [] [view common-st/flex @@ -120,7 +103,7 @@ [drawer-view [view {:style common-st/flex} [swiper (merge - st/main-swiper + (st/main-swiper @tabs-hidden?) {:index (get-tab-index @view-id) :loop false :ref #(reset! main-swiper %) @@ -131,4 +114,5 @@ [tabs {:selected-view-id @view-id :prev-view-id @prev-view-id :tab-list tab-list}] - [bottom-shadow-view]]]]])}))) + (when-not @tabs-hidden? + [bottom-shadow-view])]]]])}))) diff --git a/src/status_im/components/tabs/bottom_shadow.cljs b/src/status_im/components/tabs/bottom_shadow.cljs index c6e3a836a9..81f1b77851 100644 --- a/src/status_im/components/tabs/bottom_shadow.cljs +++ b/src/status_im/components/tabs/bottom_shadow.cljs @@ -4,9 +4,9 @@ [status-im.utils.platform :refer [platform-specific]])) (defn bottom-shadow-view [] - (if (get-in platform-specific [:tabs :tab-shadows?]) - [linear-gradient {:locations [0 0.8 1] + (when (get-in platform-specific [:tabs :tab-shadows?]) + [linear-gradient {:locations [0 0.98 1] :colors ["rgba(24, 52, 76, 0)" "rgba(24, 52, 76, 0.085)" "rgba(24, 52, 76, 0.165)"] :style (merge st/bottom-gradient - (get-in platform-specific [:component-styles :bottom-gradient]))}])) \ No newline at end of file + (get-in platform-specific [:component-styles :bottom-gradient]))}])) diff --git a/src/status_im/components/tabs/styles.cljs b/src/status_im/components/tabs/styles.cljs index 9bcf0f2866..d58f067894 100644 --- a/src/status_im/components/tabs/styles.cljs +++ b/src/status_im/components/tabs/styles.cljs @@ -1,7 +1,9 @@ (ns status-im.components.tabs.styles - (:require [status-im.components.styles :refer [color-white]])) + (:require [status-im.components.styles :as st] + [status-im.utils.platform :as p])) -(def tabs-height 56) + +(def tabs-height (if p/ios? 62 56)) (def tab-height (dec tabs-height)) (def bottom-gradient @@ -12,12 +14,11 @@ (defn tabs-container [hidden?] {:position :absolute - :bottom 0 + :bottom (if hidden? (- tabs-height) 0) :left 0 :right 0 :height tabs-height - :background-color color-white - :margin-bottom (if hidden? (- tabs-height) 0) + :background-color st/color-white :transform [{:translateY 1}]}) (def tabs-container-line @@ -37,12 +38,12 @@ :justifyContent :center :alignItems :center}) -(def tab-title - {:font-size 12 +(defn tab-title [active?] + {:font-size (if-not (or active? p/ios?) 12 14) :height 16 :min-width 60 :text-align :center - :color "#6e93d8"}) + :color (if active? st/color-light-blue st/color-gray4)}) (def tab-icon {:width 24 @@ -50,22 +51,16 @@ :marginBottom 1 :align-self :center}) -(defn tab-container [active?] +(def tab-container {:flex 1 :height tab-height :justifyContent :center - :alignItems :center - :padding-top (if active? 0 16)}) + :alignItems :center}) -(defn animated-offset [value] - {:top value - :justifyContent :center - :alignItems :center}) - -(def main-swiper +(defn main-swiper [tabs-hidden?] {:position :absolute :top 0 :left 0 :right 0 - :bottom tabs-height + :bottom (if tabs-hidden? 0 tabs-height) :shows-pagination false}) diff --git a/src/status_im/components/tabs/tab.cljs b/src/status_im/components/tabs/tab.cljs index 8474a91256..e9fa6427a0 100644 --- a/src/status_im/components/tabs/tab.cljs +++ b/src/status_im/components/tabs/tab.cljs @@ -1,58 +1,23 @@ (ns status-im.components.tabs.tab - (:require-macros [status-im.utils.views :refer [defview]]) (:require [re-frame.core :refer [subscribe dispatch dispatch-sync]] [status-im.components.react :refer [view - animated-view text image touchable-highlight]] - [reagent.core :as r] - [status-im.components.tabs.styles :as st] - [status-im.components.animation :as anim])) + [status-im.utils.platform :as p] + [status-im.components.tabs.styles :as st])) -(defn animation-logic [val to-value] - (fn [] - (anim/start (anim/spring val {:toValue to-value - :tension 40})))) - -(defview tab [_] - (let [icon-anim-value (anim/create-value 0) - text-anim-value (anim/create-value 0) - icon-reverse-anim-value (anim/create-value 0) - text-reverse-anim-value (anim/create-value 0) - on-update (comp (animation-logic icon-anim-value 0) - (animation-logic text-anim-value 0) - (animation-logic icon-reverse-anim-value 0) - (animation-logic text-reverse-anim-value 30))] - (r/create-class - {:component-did-mount - on-update - :component-did-update - on-update - :component-will-receive-props - (fn [] - (anim/set-value icon-anim-value 8) - (anim/set-value text-anim-value 30) - (anim/set-value icon-reverse-anim-value -8) - (anim/set-value text-reverse-anim-value -8)) - :reagent-render - (fn [{:keys [view-id title icon selected-view-id prev-view-id]}] - [touchable-highlight {:style st/tab - :disabled (= view-id selected-view-id) - :onPress #(dispatch [:navigate-to-tab view-id])} - [view {:style (st/tab-container (= selected-view-id view-id))} - [animated-view {:style (st/animated-offset (cond - (= selected-view-id view-id) icon-anim-value - (= prev-view-id view-id) icon-reverse-anim-value - :else 0))} - [image {:source {:uri icon} - :style st/tab-icon}]] - [animated-view {:style (st/animated-offset (cond - (= selected-view-id view-id) text-anim-value - (= prev-view-id view-id) text-reverse-anim-value - :else 0))} - [text {:style st/tab-title} - (if (or (= selected-view-id view-id) - (= prev-view-id view-id)) - title - " ")]]]])}))) +(defn tab [{:keys [view-id title icon-active icon-inactive selected-view-id prev-view-id]}] + (let [active? (= view-id selected-view-id) + previous? (= view-id prev-view-id)] + [touchable-highlight {:style st/tab + :disabled active? + :onPress #(dispatch [:navigate-to-tab view-id])} + [view {:style st/tab-container} + [view + [image {:source {:uri (if active? icon-active icon-inactive)} + :style st/tab-icon}]] + [view + [text {:style (st/tab-title active?) + :font (if (and p/ios? active?) :medium :regular)} + title]]]])) diff --git a/src/status_im/components/tabs/tabs.cljs b/src/status_im/components/tabs/tabs.cljs index f23d5eeeec..266e3e002c 100644 --- a/src/status_im/components/tabs/tabs.cljs +++ b/src/status_im/components/tabs/tabs.cljs @@ -21,36 +21,13 @@ :prev-view-id prev-view-id})] [tab data])) -(defn animation-logic [{:keys [hidden? val]}] - (let [was-hidden? (atom (not @hidden?))] - (fn [_] - (when (not= @was-hidden? @hidden?) - (let [to-value (if @hidden? 0 (- st/tabs-height))] - (swap! was-hidden? not) - (anim/start - (anim/timing val {:toValue to-value - :duration 300}))))))) - -(defn tabs-container [& _] - (let [chats-scrolled? (subscribe [:get :chats-scrolled?]) - tabs-bar-value (subscribe [:animations :tabs-bar-value]) - shadows? (get-in platform-specific [:tabs :tab-shadows?]) - context {:hidden? chats-scrolled? - :val @tabs-bar-value} - on-update (animation-logic context)] - (anim/set-value @tabs-bar-value 0) - (r/create-class - {:component-did-mount - on-update - :component-did-update - on-update - :reagent-render - (fn [& children] - @chats-scrolled? - (into [animated-view {:style (merge (st/tabs-container @chats-scrolled?) - (if-not shadows? st/tabs-container-line)) - :pointerEvents (if @chats-scrolled? :none :auto)}] - children))}))) +(defn tabs-container [& children] + (let [tabs-hidden? (subscribe [:tabs-hidden?]) + shadows? (get-in platform-specific [:tabs :tab-shadows?])] + (into [animated-view {:style (merge (st/tabs-container @tabs-hidden?) + (if-not shadows? st/tabs-container-line)) + :pointerEvents (if @tabs-hidden? :none :auto)}] + children))) (defn tabs [{:keys [tab-list selected-view-id prev-view-id]}] [tabs-container diff --git a/src/status_im/components/toolbar_new/styles.cljs b/src/status_im/components/toolbar_new/styles.cljs index 1db1d1bec7..c5a46bb26c 100644 --- a/src/status_im/components/toolbar_new/styles.cljs +++ b/src/status_im/components/toolbar_new/styles.cljs @@ -1,5 +1,5 @@ (ns status-im.components.toolbar-new.styles - (:require-macros [status-im.utils.styles :refer [defnstyles]]) + (:require-macros [status-im.utils.styles :refer [defnstyle]]) (:require [status-im.components.styles :refer [text1-color color-white color-light-gray @@ -25,7 +25,7 @@ (merge {:flex-direction :row} (get-in p/platform-specific [:component-styles :toolbar-new]))) -(defnstyles toolbar-nav-actions-container +(defnstyle toolbar-nav-actions-container [actions] {:flex-direction :row :ios {:width (when (and actions (pos? (count actions))) diff --git a/src/status_im/contacts/screen.cljs b/src/status_im/contacts/screen.cljs index 9a3882e267..fde74ed231 100644 --- a/src/status_im/contacts/screen.cljs +++ b/src/status_im/contacts/screen.cljs @@ -152,8 +152,9 @@ contacts-count [:added-contacts-count] click-handler [:get :contacts-click-handler] edit? [:get-in [:contacts-ui-props :edit?]] - groups [:all-added-groups]] - [view st/contacts-list-container + groups [:all-added-groups] + tabs-hidden? [:tabs-hidden?]] + [view (st/contacts-list-container tabs-hidden?) (if edit? [toolbar-edit] [toolbar-view]) diff --git a/src/status_im/contacts/styles.cljs b/src/status_im/contacts/styles.cljs index 7ffbfd52db..3d88cf27c4 100644 --- a/src/status_im/contacts/styles.cljs +++ b/src/status_im/contacts/styles.cljs @@ -1,5 +1,5 @@ (ns status-im.contacts.styles - (:require-macros [status-im.utils.styles :refer [defstyles]]) + (:require-macros [status-im.utils.styles :refer [defnstyle]]) (:require [status-im.components.styles :refer [text1-color text2-color text3-color @@ -11,6 +11,7 @@ color-light-red color-gray]] [status-im.components.toolbar.styles :refer [toolbar-background1 toolbar-background2]] + [status-im.components.tabs.styles :as tabs-st] [status-im.utils.platform :as p])) ;; Contacts list @@ -22,10 +23,10 @@ {:flex 1 :background-color toolbar-background2}) -(defstyles contacts-list-container +(defnstyle contacts-list-container [tabs-hidden?] {:flex 1 :android {:margin-bottom 20} - :ios {:margin-bottom 72}}) + :ios {:margin-bottom (if tabs-hidden? 20 (+ 16 tabs-st/tabs-height))}}) (def contacts-list {:background-color color-white}) @@ -137,8 +138,8 @@ (def info-container (merge (get-in p/platform-specific [:component-styles :contacts :info-container]) - {:flex 1 - :flexDirection :column})) + {:flex 1 + :flexDirection :column})) (def name-text (get-in p/platform-specific [:component-styles :contacts :name-text])) @@ -194,18 +195,18 @@ {:margin-right 42}) (def enter-address-icon - {:margin-left 21 - :margin-right 21 - :margin-top 19 - :width 20 - :height 18}) + {:margin-left 21 + :margin-right 21 + :margin-top 19 + :width 20 + :height 18}) (def scan-qr-icon - {:margin-left 21 - :margin-right 20 - :margin-top 18 - :width 20 - :height 20}) + {:margin-left 21 + :margin-right 20 + :margin-top 18 + :width 20 + :height 20}) ;; Contacts search diff --git a/src/status_im/db.cljs b/src/status_im/db.cljs index 0d6a14f620..153127deaa 100644 --- a/src/status_im/db.cljs +++ b/src/status_im/db.cljs @@ -42,7 +42,7 @@ :qr-codes {} :keyboard-height 0 :animations {;; todo clear this - :tabs-bar-value (anim/create-value 0)} + } :loading-allowed true :sync-state :done diff --git a/src/status_im/discover/screen.cljs b/src/status_im/discover/screen.cljs index 50692ab82e..17e4d93cca 100644 --- a/src/status_im/discover/screen.cljs +++ b/src/status_im/discover/screen.cljs @@ -78,12 +78,13 @@ search-text [:get-in [:toolbar-search :text]] contacts [:get :contacts] current-account [:get-current-account] - discoveries [:get-recent-discoveries]] + discoveries [:get-recent-discoveries] + tabs-hidden? [:tabs-hidden?]] [view st/discover-container [toolbar-view (and current-view? (= show-search :discover)) search-text] (if discoveries - [scroll-view {:style (get-in platform-specific [:component-styles :main-tab-list])} + [scroll-view (st/list-container tabs-hidden?) [discover-popular {:contacts contacts :current-account current-account}] [discover-recent {:current-account current-account}]] diff --git a/src/status_im/discover/styles.cljs b/src/status_im/discover/styles.cljs index c215993350..43f44ba245 100644 --- a/src/status_im/discover/styles.cljs +++ b/src/status_im/discover/styles.cljs @@ -1,8 +1,11 @@ (ns status-im.discover.styles + (:require-macros [status-im.utils.styles :refer [defnstyle]]) (:require [status-im.components.styles :refer [color-white color-light-gray color-blue]] - [status-im.components.toolbar.styles :refer [toolbar-background2]])) + [status-im.components.toolbar.styles :refer [toolbar-background2]] + [status-im.components.tabs.styles :as tabs-st] + [status-im.utils.platform :as p])) ;; Common @@ -12,7 +15,7 @@ (def row {:flex-direction :row - :margin-bottom 10}) + :margin-bottom 10}) (def column {:flex-direction :column}) @@ -72,7 +75,7 @@ (def popular-list-item {:flex-direction :row :padding-bottom 16 - :top 1}) + :top 1}) (def popular-list-item-name {:color "black" @@ -138,6 +141,10 @@ {:flex 1 :backgroundColor color-white}) +(defnstyle list-container [tabs-hidden?] + {:android {:margin-bottom 20} + :ios {:margin-bottom (if tabs-hidden? 20 (+ 16 tabs-st/tabs-height))}}) + (def search-icon {:width 17 :height 17}) diff --git a/src/status_im/subs.cljs b/src/status_im/subs.cljs index 62dc54226b..a79860c48a 100644 --- a/src/status_im/subs.cljs +++ b/src/status_im/subs.cljs @@ -33,3 +33,13 @@ accounts (subscribe [:get :accounts])] (reaction (when (and @accounts @account-id) (get-in @accounts [@account-id :signed-up?])))))) + +(register-sub :tabs-hidden? + (fn [] + (let [search-mode? (subscribe [:get-in [:toolbar-search :show]]) + chats-edit-mode? (subscribe [:get-in [:chat-list-ui-props :edit?]]) + contacts-edit-mode? (subscribe [:get-in [:contacts-ui-props :edit?]]) + view-id (subscribe [:get :view-id])] + (reaction (or @search-mode? + (and (= @view-id :chat-list) @chats-edit-mode?) + (and (= @view-id :contact-list) @contacts-edit-mode?)))))) diff --git a/src/status_im/utils/styles.clj b/src/status_im/utils/styles.clj index 46ac5179f7..eb4165ebd6 100644 --- a/src/status_im/utils/styles.clj +++ b/src/status_im/utils/styles.clj @@ -1,51 +1,51 @@ (ns status-im.utils.styles) -(defn body [styles] - `(let [styles# ~styles - common# (dissoc styles# :android :ios) +(defn body [style] + `(let [style# ~style + common# (dissoc style# :android :ios) platform# (keyword status-im.utils.platform/platform) - platform-specific# (get styles# platform#)] + platform-specific# (get style# platform#)] (if platform-specific# (merge common# platform-specific#) common#))) -(defmacro defstyles - "Defines styles symbol. - Styles parameter may contain plaform specific styles: +(defmacro defstyle + "Defines style symbol. + Style parameter may contain plaform specific style: {:width 100 :height 125 :ios {:height 20} :android {:margin-top 3}} - Reuslting styles for Android: + Reuslting style for Android: {:width 100 :height 125 :margin-top 3} - Resulting styles for iOS: + Resulting style for iOS: {:width 100 :height 20}" - [style-name styles] + [style-name style] `(def ~style-name - ~(body styles))) + ~(body style))) -(defmacro defnstyles - "Defines styles function. - Styles parameter may contain plaform specific styles: +(defmacro defnstyle + "Defines style function. + Style parameter may contain plaform specific style: {:width 100 :height (* a 2) :ios {:height (/ a 2)} :android {:margin-top 3}} - Resulting styles for Android (with (= a 10)): + Resulting style for Android (with (= a 10)): {:width 100 :height 20 :margin-top 3} - Resulting styles for iOS (with (= a 10)): + Resulting style for iOS (with (= a 10)): {:width 100 :height 5}" - [style-name params styles] + [style-name params style] `(defn ~style-name [~@params] - ~(body styles))) + ~(body style)))