- 
                Notifications
    
You must be signed in to change notification settings  - Fork 476
 
Fixes #4673: Fixes BrowserToolbar ripple issues #7301
Conversation
          Codecov Report
 @@             Coverage Diff              @@
##             master    #7301      +/-   ##
============================================
+ Coverage     77.35%   77.37%   +0.02%     
  Complexity     5054     5054              
============================================
  Files           674      674              
  Lines         24731    24718      -13     
  Branches       3654     3652       -2     
============================================
- Hits          19130    19126       -4     
+ Misses         4088     4080       -8     
+ Partials       1513     1512       -1     
 Continue to review full report at Codecov. 
  | 
    
| 
           @sblatz I've checked your changes against Fenix app, the buttons work as expected, but there are issues with the positioning and a visible "snap" and reordering of items. The issue with ripple being cut can be solved with adding  The open tabs button will still be cut by the url view because they are on the same parent. IMO after aligning the icons and solving that snapping it will still be a big improvement comparing to the current behavior. LE: The edit-toolbar appears to be broken in this PR.  | 
    
26534e4    to
    934289b      
    Compare
  
    934289b    to
    6e3cfdf      
    Compare
  
    | 
           Looks like some tests are failing:  | 
    
| 
           @pocmo I'm hopping on those now!  | 
    
6e3cfdf    to
    dc80037      
    Compare
  
    | <ImageView | ||
| <androidx.constraintlayout.widget.ConstraintLayout | ||
| android:id="@+id/mozac_browser_toolbar_background" | ||
| android:clipChildren="false" | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want the ripple to not be cut, this should be on the parent constraint layout.
| <ImageView | ||
| <androidx.constraintlayout.widget.ConstraintLayout | ||
| android:id="@+id/mozac_browser_toolbar_background" | ||
| android:clipChildren="false" | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as for display toolbar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some random thoughts:
- 
When we rewrote the layouts of the toolbar we tried to have a flat layout structure to avoid the performance penalties that come from nested layouts. I'm a bit sad if we need to introduce a nested structure again. :(
 - 
The patch seems to solve the problem for indicators and page actions that live inside the nested layout. But it seems like we still have the problem that browser actions, the menu button or navigation actions (depending on how the toolbar in configured) will be drawn behind the background.
 - 
Nit: Is extending the ripple something we actually want? Clipping them seems to be more in line with desktop at least (although it uses a rectangle shape)
 
| 
           Two alternative ideas that we could try to fix it for all actions and with keeping the flat structure: 
 🤔  | 
    
| 
           I did try to prototype option 2 and something like this seems to work: class DisplayToolbarView @JvmOverloads constructor(
    context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {
    init {
        // Forcing transparent background so that draw methods will get called and ripple effect
        // for children will be drawn on this layout.
        setBackgroundColor(0x00000000)
    }
    lateinit var backgroundView: ImageView
    override fun onFinishInflate() {
        backgroundView = findViewById(R.id.mozac_browser_toolbar_background)
        backgroundView.visibility = View.INVISIBLE
    }
    // Overrding draw instead of onDraw since we want to draw the background before the actual
    // (transparent) background (with a ripple effect) is drawn.
    override fun draw(canvas: Canvas) {
        canvas.save()
        canvas.translate(backgroundView.x, backgroundView.y)
        backgroundView.drawable.draw(canvas)
        canvas.restore()
        super.draw(canvas)
    }
} | 
    
7323: For #7301: Fix drawable ripple issues on BrowserToolbar r=pocmo a=sblatz Co-authored-by: pocmo <skaspari@mozilla.com>  Thanks for the much simpler solution @pocmo! 😄 7343: For #6996: Slightly increase delay to fix intermittent loginDialog issues r=Amejia481 a=sblatz 7344: Closes #6680: Handle exceptions thrown by capturePixels r=jonalmeida a=csadilek We're still seeing `IllegalStateException`s (Compositor not ready) when capturing thumbnails. We fixed this a while ago by checking if `firstContentfulPaint` has happened, but that's not working/reliable. There's currently no other way to handle this but to catch-all and return an empty/null bitmap. See #6680. I've also added a missing test for the `onFirstContentfulPaint` observer which was missing from #6844. The internal var we can remove now. r? @jonalmeida ticket is labelled "skittle", but this is really independent of the new tabs tray work. Co-authored-by: Sawyer Blatz <sdblatz@gmail.com> Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
7323: For #7301: Fix drawable ripple issues on BrowserToolbar r=pocmo a=sblatz Co-authored-by: pocmo <skaspari@mozilla.com>  Thanks for the much simpler solution @pocmo! 😄 7343: For #6996: Slightly increase delay to fix intermittent loginDialog issues r=Amejia481 a=sblatz 7344: Closes #6680: Handle exceptions thrown by capturePixels r=jonalmeida a=csadilek We're still seeing `IllegalStateException`s (Compositor not ready) when capturing thumbnails. We fixed this a while ago by checking if `firstContentfulPaint` has happened, but that's not working/reliable. There's currently no other way to handle this but to catch-all and return an empty/null bitmap. See #6680. I've also added a missing test for the `onFirstContentfulPaint` observer which was missing from #6844. The internal var we can remove now. r? @jonalmeida ticket is labelled "skittle", but this is really independent of the new tabs tray work. Co-authored-by: Sawyer Blatz <sdblatz@gmail.com> Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>


Old Behavior
New Behavior
Pull Request checklist
After merge