[TextInputLayout] How to simulate clicks to drawables?
See original GitHub issueDescription: How to simulate a click onto TextInputLayout
end drawable? Right now I use callOnClick
to test button presses, and I don’t see a corresponding method to simulate clicks to the End Drawable. I am using Robolectric as well - if that helps somehow.
Material Library version: 1.1.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Click on EditText's drawable right with Espresso - Stack Overflow
The trick here is to set the app:endIconMode="custom" then add your drawable as u want. In java class: you can use the setEndIconOnClickListener ......
Read more >TextInputLayout | Android Developers
Note: Use the setStartIconDrawable(Drawable) API in place of setting a start/left compound drawable on the EditText. When using a start icon, ...
Read more >How To Click On Drawableright On Every Textinputedittext - ADocLib
Answer #5: Create an XML layout that contains the EditText and Image Subclass ... Description: How to simulate a click onto TextInputLayout end...
Read more >Android TextInputLayout Example | DigitalOcean
In this tutorial, we'll be looking in depth at the features that Android TextInputLayout provides us. Android TextInputLayout is a design ...
Read more >Espresso i - Tutorialspoint
by clicking Refactor -> Migrate to AndroidX in the menu. To migrate to Androidx, ... onView(allOf(withId("image"), hasBackground(R.drawable.your_drawable))).
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
Grazie! This helps. For reference on those that might find this thread, this is how I did it for pure Unit Test using Robolectric:
My bad, I completely forgot about this. Using the internal ID is 100 times better than accessing the view with reflection
@pedronveloso You should follow this approach if it is ok for you