Comments (3)
Sorry for the delay in responding. At a glance, that sounds like a reasonable idea. It would be useful to see what changes are required to change the font size and if that's something we'd need to do at the system level or if we could get away with just modifying the base Context
or using a ContextThemeWrapper
.
I don't currently have the bandwidth to look into this myself, but anyone who's interested is welcome to do some investigation and share their findings!
from test-butler.
No problem, Drew. Yeah, perhaps doing it in a ContextThemeWrapper
would be a good idea however I wouldn't know how to inject ContextThemeWrapper
in to the app. I think you could apply different scaling by overriding the getResources().getConfiguration()
call to override fontScale
or something?
from test-butler.
Hi there!
I created a TestRule by using getResources().getConfiguration()
which actually serves the purpose of "simulating" the fontsize change, so I can confirm that approach works.
I guess this option might not be optimal for book-reader apps and the like that have in-app options to configure the font size, since they likely use this approach as well, and might interfere with it.
Keep in mind that such an approach is just a simulation, since the font scale in the device settings stays the same.
In order to actually change the font size in the device settings, I found out that novoda has already implemented a TestRule that does it. For more info:
https://proandroiddev.com/testing-views-in-isolation-at-romobos-d288e76fe10e
https://github.com/novoda/espresso-support
However, while using Novoda's FontScaleTestRule I experienced some problems on some old Samsung devices, on which the font size change fails randomly... that's why I decided to create my own based on modifying getResources().getConfiguration()
what serves for most of the apps and works reliably... so far.
Just my two cents ;)
from test-butler.
Related Issues (20)
- Could not find com.linkedin.testbutler:test-butler-api:2.1.0 HOT 4
- Set cursor drawable to empty in tests HOT 3
- Can't resolve androidTestUtil HOT 2
- Follow-up on #109 to remove Bintray references from readme.md HOT 2
- https://b.corp.google.com/issues/37057596 is fixed HOT 1
- AnimationsUtil.loadAnimation is not going to be disabled by TestButler HOT 1
- Lost transitive dependencies during mavenCentral migration HOT 5
- Fix information in the README HOT 4
- Android 8 (SDK 26) fail to install test butler app HOT 3
- Ability to change date/time of emulator HOT 1
- sharedUserId changed on newer Android versions HOT 1
- How to use test-butler on api 27? HOT 1
- Locale changer do not work on Android8 HOT 3
- Cannot change developer settings after TestButler.setup() HOT 9
- Grant permissions could be removed due to new Android Test rule HOT 1
- java.lang.NoClassDefFoundError: android.provider.Settings$Global HOT 8
- Does test butler work with android-library modules? HOT 4
- Example custom test runner crashes HOT 6
- Support for Android Q (API 29) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from test-butler.