WhisperSystems/TextSecure — pull request #1890 by tinloaf (2014-08-30 17:07:52+00:00)
Title: Adding TimeDeltaPreference

This adds a TimeDeltaPreference as suggested by @mcginty in #1623, and made it the preference for the passphrase timeout. That gets rid of one preference. ;)

It uses the "betterpickers" library he suggested over there. Basically. the preference will (optionally) first launch a dialog to ask whether to enable to disable the timeout, and then (if "enable" was chosen) launch the time picker. "Disable" is then encoded as 0.

This looks like a huge change, but it isn't. I had to move everything from the PreferenceActivity to a (Support)PreferenceFragment, for this string of reasons:
Problem: The pickers library needs a SupportFragmentManager, but the PreferencesActivity does not supply this.
Solution: Move everything to a PreferencesFragment and attach it to a very simple FragmentActivity (that gives us a SupportFragmentManager).
Problem: PreferencesFragment is only available in API level 11+, and not part of the support library.
Solution: Use an external maven artifact supplying us with a SupportPreferencesFragment.

I hope that this can later also be used for the renotification interval preference in #1623. ;)