question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[MaterialButton] Change button insets programmatically especially since they don't default to 0dp

See original GitHub issue

Is your feature request related to a problem? Please describe. This might be more of question than a request, but I’m not sure why we would want inset at the top and bottom by default. I understand that the property could be of use, but I end up removing the inset by default in all my apps through a style like so:

<item name="android:insetTop">0dp</item>
<item name="android:insetBottom">0dp</item>
  • Could you provide more info for having inset having a value greater than 0dp by default?
  • Is the inset related to elevation and shadow?

Describe the solution you’d like Set the default inset of buttons to 0dp.

Describe alternatives you’ve considered As an alternative, and if the inset is related to the shadow from the elevation, maybe the UNELEVATED style could reset the inset to 0dp?.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
SubhrajyotiSencommented, Nov 13, 2019

Has there been any progress on this?

2reactions
ldjcmucommented, Sep 27, 2019

The insets exist as part of ensuring the touch targets are large enough for mobility impaired users with the default style, so we’re unlikely to change them. We recommend at least 48dp as a minimum touch target.

That said, it seems completely reasonable to want to change them programmaticly, so I’ll update the issue to reflect that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove padding around buttons in Android?
For removing padding around toggle button we need set minWidth and minHeight 0dp. android:minWidth="0dp" android:minHeight="0dp"
Read more >
Hands-on with Material Components for Android: Buttons
Material Buttons are slightly different to traditional Android buttons in that they do not include additional insets (4dp on the left/right) ...
Read more >
MaterialButton - Android Developers
A convenience class for creating a new Material button. This class supplies updated Material styles for the button in the constructor.
Read more >
COP4656 Midterm - Test Flashcards - Quizlet
The Android emulator is particularly useful if you do not have access to Android devices for testing. b. Although you can simulate orientation...
Read more >
Building a Material Theme on Android: Shape
Material button transforming from baseline style to show off ... theming gives you the ability to define global shape values that change the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found