DownloadManager does not let you set its proxy or change how it connects to
the internet. So we have to make a custom one, unfortunately. This is a
very basic downloader with none of the special sauce that makes the
built-in DownloadManager handy.
This makes sure that Orbot is running when the user expects it to be. If
NewPipe is configured to use Tor, then going to a NewPipe screen should
ensure Tor is running.
This adds an Application subclass to get the onCreate() method, which is
called once at the first start up of the app, before any Activity starts.
Tor is configured there to ensure it is setup before anything happens.
This also moves the "Use Tor" pref listener to a more appropriate place.
If the user has not changed the "Use Tor" preference, then the default
should be to use Tor if Orbot is installed. The user can still override it
by going an unchecking "Use Tor".
On all of the devices that I've checked, there is a folder called "Movies"
on the SD Card by default. NewPipe should use that standard location
since it is always downloading movies :). People can always change that
via the preferences.
Also, this makes the defaults the same when creating the dir and when
setting the destination URL.
This makes the app fully exit, and removes it from the Recent Apps listing
with the goal of hiding whatever the user was currently watching, and/or
searching for.
PanicKit provides a common framework for creating "panic button" apps that
can trigger actions in "panic responder" apps. In this case, the response
is to lock the app, if it has been configured to do so
https://dev.guardianproject.info/projects/panic/wiki
Also I added new variable `'final File dir`' with value of key
"download_path_preference" or externalStorageDirectory.
Firstly I check if dir exits, then eventually try to create it and next
- download file.
* ugly workaround for the details_view_layout problem on older devices
* removed "display button on the left side" option since it's not nececeay anymore.