Skip to content

Conversation

@malmstein
Copy link
Contributor

@malmstein malmstein commented Apr 17, 2020

Task/Issue URL: https://app.asana.com/0/488551667048375/1168086989855979
Pixels and Dashboard: https://app.asana.com/0/1157893581871903/1168245052250051
Product Changes: https://app.asana.com/0/1157893581871903/1170128420609770

Description:
Device comfort on our Android app is pretty bad - on larger devices it’s impossible to use our app with one hand and we get consistent (though low to mid frequency) around this.
Material design has bottom navigation options that we could leverage to improve device comfort and bring the navigation patterns closer to what we have on iOS, which is better when it comes to device comfort (with room to improve though).
I’d like to experiment around migrating the primary navigation (if not all of it) to the bottom of the screen to see what impact it has on retention.

Steps to test this PR:
Concept test variant mf: Control group

  1. Open app
  2. Navigate to a website
  3. Check that bottom bar is not present

Concept test variant mm: Bottom Navigation

  1. Open app
  2. Navigate to a website
  3. Check that bottom bar is present

Steps to test Pixels

Each pixel event has a suffix that identifies either the control group or the experiment group.

  • Control group: mm
  • Experiment group: mn
  1. Open Popup menu, pixel should fire m_nav_pm_o_mm or m_nav_pm_o_mn
  2. Press fire icon, pixel should fire m_nav_f_p_mm or m_nav_f_p_mn
  3. Press Refresh in the Popup Menu, pixel should fire m_nav_r_p__mm or m_nav_r_p_mn
  4. New Tab pressed, pixel should fire m_nav_nt_p_mm or m_nav_nt_p_mn
  5. Bookmarks button pressed, pixel should fire m_nav_b_p_mm or m_nav_b_p__mn
  6. Search Loupe pressed (only in the experiment group) pixel should fire m_nav_s_p_mn

Screenshots:

Light theme:

Bottom bar Omnibar focused Popup Menu Tabs
device-2020-04-17-141414 device-2020-04-17-141406 device-2020-04-17-141433 device-2020-04-17-141422

Dark theme:

Bottom bar Omnibar focused Popup Menu Tabs
device-2020-04-17-141447 device-2020-04-17-141456 device-2020-04-17-141504 device-2020-04-17-141511

# Conflicts:
#	app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
# Conflicts:
#	app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
#	app/src/main/res/layout/fragment_browser_tab.xml
@malmstein malmstein reopened this Apr 27, 2020
@malmstein malmstein requested a review from cmonfortep April 27, 2020 14:13
@malmstein malmstein changed the title Feature/david/bottom navigation bar Bottom Navigation Apr 27, 2020
Copy link
Contributor

@cmonfortep cmonfortep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are getting close to finishing this, it's looking very good. GJ

About testing:

  • ❌New tab pixel not triggered when using bottom bar, it works for the control group
  • Question: why all the icons from the bottom bar fire pixels except the tab switcher button?

}

private fun openInNewBackgroundTab() {
appBarLayout.setExpanded(true, true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed that appBarLayout.setExpanded(true, true) was here to show/expand the appBarLayout when the user opens a new tab in the background.
The reason may be to show the appBar and make the tab counter animation visible to the user to let them see a new tab has been created. For the Bottom Bar variant, we show the appbar too but the tab counter is not there. Have you considered showing the bottombar in that variant too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setExpanded is not used to make the counter animation visible, but to make the whole appBar visible. There are cases where the appBar will be hidden (the user is scrolling down and opens a new tab in the background). In that case we want to make sure that the appBar is visible, so we expand it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed this offline and agreed that we should show the bottom bar when opening a background tab to make the tab icon visible so the animation is performed in the foreground.

val view = tabsButton?.actionView as TabSwitcherButton
view.increment {
tabsButton?.increment {
addTabsObserver()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we adding two observers each time we open a background tab?
Maybe we should check if experiment is enabled? (maybe also part of the decorator?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that, good call

configureKeyboardAwareLogoAnimation()
configureShowTabSwitcherListener()
configureLongClickOpensNewTabListener()
configureAppBar()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method is already called at line 344.

}
}

private fun configureAppBar() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I already commented something similar (maybe it was another method), but I think appbarnot only contains the privacyGrade, so naming is confusing here. Maybe we should change it after to configurePrivacyGrade instead.

inner class BrowserTabFragmentDecorator {
fun decorateToolbar(viewState: BrowserViewState) {
if (variantManager.getVariant().hasFeature(VariantManager.VariantFeature.BottomBarNavigation)) {
decorator.hideToolbarMenu()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decorateAppBarWithBottomBar already does a menuButton?.gone(). And based on the checked condition + not using viewState, I think we can remove this method call.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call, it's not necessary

}

lastSeenBrowserViewState?.let {
decorator.decorateToolbar(it)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is already called inside renderToolbarMenus.


companion object {

private const val margin = 30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const names should be in uppercase?

android:viewportHeight="24">
<path
android:pathData="M16,4C16.8284,4 17.5,4.6716 17.5,5.5V18.6667L12.9459,16.2378C12.3546,15.9225 11.6452,15.9226 11.0541,16.2378L6.5,18.6667V5.5C6.5,4.6716 7.1716,4 8,4H16ZM8,2C6.067,2 4.5,3.567 4.5,5.5V20.3333C4.5,21.0883 5.3045,21.5709 5.9706,21.2157L11.9953,18.0025C11.9982,18.0009 12.0018,18.0009 12.0047,18.0025L18.0294,21.2157C18.6955,21.5709 19.5,21.0883 19.5,20.3333V5.5C19.5,3.567 17.933,2 16,2H8Z"
android:fillColor="@color/bottom_bar_icon_color_selector"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid future problems, if this color is tied to the bottom bar, icon name should reflect that it is expected to be used in the bottom bar too. Otherwise, the color can be generic maybe.

Same applies to rest of icons.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not to all the icons, I've renamed the ones that only apply to the Bottom Bar. Fire and Overflow icons are used in the control group and shouldn't be renamed.

android:layout_marginStart="7dp"
android:layout_marginEnd="7dp"
android:clipToPadding="false"
android:paddingTop="40dp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I alredy commented this, but this paddingTop seems not correct. There's too much space at the top of the screen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the design specs in Figma and already reviewed by Design

build.gradle Outdated
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.2'
classpath 'com.android.tools.build:gradle:3.6.3'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, this is not related to this PR

…duckgo/Android into feature/david/bottom_navigation_bar
@malmstein
Copy link
Contributor Author

We are getting close to finishing this, it's looking very good. GJ

About testing:

  • ❌New tab pixel not triggered when using bottom bar, it works for the control group
  • Question: why all the icons from the bottom bar fire pixels except the tab switcher button?

If you follow the discussion here https://app.asana.com/0/1157893581871903/1168245052250051 you'll see that the Tab Switcher was not considered a top level action and therefore we didn't feel the need to pixel it. In the end, we want to compare the engagement for top level actions and the tab switcher is not one of them @cmonfortep

@malmstein malmstein requested a review from cmonfortep April 28, 2020 08:48
Copy link
Contributor

@cmonfortep cmonfortep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay! We did a great effort here, this looks good to me. Thanks @malmstein for the work here, I know it has been long and complex but I'm looking forward to seeing this released for our users.

sweat

:shipit:

@malmstein
Copy link
Contributor Author

Thanks for all the work @cmonfortep !

@malmstein malmstein merged commit f2c16b7 into develop Apr 28, 2020
@malmstein malmstein deleted the feature/david/bottom_navigation_bar branch April 28, 2020 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants