collapse search actionview after starting search
add auto-refresh settings

Add a new activity SettingsActivity which simply contains an instance of
another new fragment SettingsFragment. Add a menu item to the main
activity to open the settings activity. Slight code cleanup in
MainActivity while we're there.

Add the following settings:
 * Automatically refresh shows - a checkbox that enables or disables
   auto-refresh. Defaults to checked.

 * Auto-refresh frequency - selects the frequency at which the shows are
   automatically refreshed. Can be set to the following options:
    * Daily
    * Twice weekly
    * Weekly
    * Fortnightly
   Defaults to weekly.
   The constants associated with these strings are periods not
   frequencies, so the variables are named as such. The user-facing
   strings refer to them as frequencies.
   Only enabled if "automatically refresh shows" is checked.

This commit only adds these settings, it doesn't implement the
functionality.

Bump minSdkVersion to 11, for PreferenceFragment, as it unfortunately
doesn't exist in the support library.
initialise default settings values on first launch
split refresh show implementation from service

Create a RefreshShowUtil class with a static function
refreshShow(). Move the implementation of RefreshShowService into the
new class and function, and make the service call the function.
schedule periodic alarm to auto refresh shows

Create a singelton class AutoRefreshHelper. Make it read and listen to
changes in the settings regarding auto-refresh. When auto-refresh is
enabled schedule a service to run after roughly a certain time, and when
auto refresh is disabled cancel that service. Use AlarmManager to do
this. Use the value of the auto-refresh frequency setting, along with
the time of the last auto-refresh, to determine what time to run the
service at.

The service itself is responsible for refreshing all of the shows,
storing the time at which it last did so, and asking the helper to
schedule it again.

Using the AlarmManager was chosen over using a SyncAdapter for a few
reasons:
 * We do not use accounts, and adding a dummy one to the system--like
   the SyncAdapter approach required--looked very strange.
 * I believe it will be easier to add an "only auto-refresh over Wi-Fi"
   option in the future using this approach.
 * I don't think a SyncAdapter's periodic sync works correctly when it
   is toggled on/off or the phone reboots. So part of the chosen
   approach (storing the time of last refresh) would have had to be
   implemented anyway.
schedule auto-refresh alarm when app is ran
schedule auto-refresh alarm on phone boot

Requires new permission RECEIVE_BOOT_COMPLETED.
wait until network is available for auto-refresh

If an auto-refresh is attempted but a network connection is not
available then a broadcast receiver is enabled to listen for the network
state change. When the network becomes available again the receiver is
disabled (to conserve battery) and the auto-refresh is rescheduled. This
auto-refresh should now run straight away as it will be overdue from the
previous attempt.
add only-via-wifi option for auto-refresh

When checked, auto-refresh will wait until an unmetered network
connection is available.
Merge branch 'auto-refresh'

Implements a feature to auto-refresh tv show information. By default it
is enabled to fetch new data once a week and only via Wi-Fi. This can be
configured in the settings screen.

Closes #16.

Bumps the minSdkVersion to 11.
switch build system to gradle
various lint warning fixes
update gitignore for gradle

and remove some things that should really be done in my global or local
gitignores (editor-specific files).
move "refresh show" action to overflow menu

with the auto-refresh feature the user shouldn't have to manually refresh
shows very often.
implement back up library to sdcard

Add class BackupRestoreHelper with a function backup() that copies the
application's database to the device's external storage, adding a
timestamp to the filename. Perform this task using an AsyncTask.

Add an item to the main activity's menu which calls this function.
implement restore library from backup

Add a function restore() to BackupRestoreHelper. It copies a backed-up
database to the location of the application's actual database. It then
makes the content provider reopen the database and notify everything
that the data has changed.

Add an item to the main activity's menu which calls this
function. Currently the location of the backup database is hardcoded.
make back up complete toast longer

give the user a chance to read the backup location
allow user to pick which backup to restore

When the user selects restore from the main menu a dialog is opened
listing all the files in the app's backup folder on the phone's external
storage. If one of these backups is selected then the app data is
restored from it.

If the backup folder is empty then a message saying so is displayed
instead of a list of backups.

There is no protection against selecting any random file that isn't a
previously made backup. Doing so will probably not cause an error but
obviously will not result in any valid data being restored: effectively
the data will be cleared.
Merge branch 'backup-restore'

Fixes #19
build with sdk and support libs version 21