If you have to inject / create a React Native module into your Android Activity (that does not extend the default React Native Activity), please beware that the Activity lifecycle is not tied to the React Context lifecycle used to create the RN module.
So you have to be careful to retrieve it at the right moment, bearing in mind that a developer can hot reload (pressing double R on the simulator), causing the creation of a new React Context.
Also, the framework gives you a way to listen to the lifecycle of the topmost React Native Acitivity, so that you don’t need to hold a reference to it.
To show how to solve these things, I wrote a short example that you can find here.
Here is what the running app look like:
While ago I bought the Adafruit PiTFT 2.4″ touchscreen HAT and I wanted to use it with my Rapsberry Pi Zero.
Unfortunately, it seems that Adafruit supports only the Raspian distribution while my favourite distro is Archlinux.
However, I managed to get the screen to work under Archlinux too:
You can change the locale programmatically in an Espresso test too.
Here you can find a quick example I wrote.
The key part is to restart the Activity after you have set the new Locale.
Of course you can also set the flag of ActivityTestRule to manually re-launch the Activity so that you launch it after you set the new Locale.
Just ensure you have a new Activity after you change Locale.
Bear in mind that to change the locale taking into account all the deprecations and sdk versions is more complex than the code I wrote in my example. Read more here.
I wrote an IdlingResource for Espresso that works with thread pools.
You can find a repository in my github with an example application and test.
The IdlingResource is in the androidTest folder, the file is named ThreadIdlingResourceMonitor.java.
Just a quick note about the
Normally the widget has the magnifying on the left side if expanded. So if you do something like this:
SearchView searchView =
We will end up with something like this:
If we need to manipulate the magnifying icon, we need a reference to that View:
ImageView searchViewIcon =
After that just retrieve the parent ViewGroup. It is, at least today, a LinearLayout, so just remove the View and add it again to have it at the end / right side of the SearchView.
ViewGroup linearLayoutSearchView =
So we have something like this:
Of course, it is a standard View, so if we need to remove it altogether, just set its properties accordingly (from here):
searchViewIcon.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));
Using Atlassian Jira, it is very useful to have notifications for issues, created or edited, of your projects.
Unfortunately, to enable custom notifications, you have to create a notification scheme and only an administrator can do that.
Jira, however, offers you the ability to save searches, called filters and the results can be delivered by email through subscriptions.
With the right filter and the right subscription you can set Jira to notify you via email if and only if issues of your projects are creted or edited, without clogging your inbox.
After several days of hard work, I have just published an Android app of mine: Screenstash!