Attribute to customize Bounding box stroke
See original GitHub issueI can see that the bounding box for the TextInputLayout
has been explicitly declared here:
defaultStrokeColor =
ContextCompat.getColor(context, R.color.mtrl_textinput_default_box_stroke_color);
disabledColor = ContextCompat.getColor(context, R.color.mtrl_textinput_disabled_color);
hoveredStrokeColor =
ContextCompat.getColor(context, R.color.mtrl_textinput_hovered_box_stroke_color);
i.e :
Are there plans to provide an attribute that allows developers, to for example override these? For example, use color states?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:26
- Comments:26 (4 by maintainers)
Top Results From Across the Web
customize Bounding box stroke in TextInputLayout.OutlinedBox
To change the box stroke color just use the app:boxStrokeColor attribute in the xml. <com.google.android.material.textfield.
Read more >Apply and adjust stroke properties – Figma Help Center
Custom : to choose which sides to apply stroke. Custom also allows you to set a different stroke weight per side. Tip! Rectangles...
Read more >Proposals/Bounding boxes - SVG
In SVG 2, we add definitions for bounding boxes that include the stroke or even stroke plus markers (decorations). The Masking Module uses...
Read more >Common wrap and stroke attributes - Sitecore Documentation
The table lists the common wrap and stroke attributes with their use, (default) value(s), and description. ... 3: Wrap around bounding box.
Read more >transform-box - CSS: Cascading Style Sheets - MDN Web Docs
The stroke bounding box is used as the reference box. view-box. The nearest SVG viewport is used as the reference box. If a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Because the
defaultBoxStrokeColor
is currently private final int inTextInputLayout
class you can change it only by overriding the color resource it uses. This is a temporary solution if you need to change this color until the issue gets resolved.<color name="mtrl_textinput_default_box_stroke_color" tools:override="true">@color/white_40</color>
I believe I was able to do it with the following:
Take a note of the different android states, and then lastly the default state. Change the colors accordingly to what you need and then you can use it as a theme, an example is shown below.