Browse Source

Merge branch 'dev'

pull/82/head v2.0.1
Eric Kok 11 years ago
parent
commit
2f00afd788
  1. 3
      README.md
  2. 4
      core/AndroidManifest.xml
  3. 2
      core/project.properties
  4. 1
      core/res/layout/fragment_torrents.xml
  5. 323
      core/res/values-nl/strings.xml
  6. 5
      core/res/values/changelog.xml
  7. 17
      core/res/values/strings.xml
  8. 3
      core/res/xml/pref_system.xml
  9. 33
      core/src/org/transdroid/core/app/settings/SystemSettings.java
  10. 31
      core/src/org/transdroid/core/gui/DetailsActivity.java
  11. 5
      core/src/org/transdroid/core/gui/DetailsFragment.java
  12. 28
      core/src/org/transdroid/core/gui/TorrentsActivity.java
  13. 5
      core/src/org/transdroid/core/gui/TorrentsFragment.java
  14. 17
      core/src/org/transdroid/core/gui/lists/NoProgressHeaderTransformer.java
  15. 10
      core/src/org/transdroid/core/gui/navigation/NavigationHelper.java
  16. 4
      core/src/org/transdroid/core/gui/navigation/RefreshableActivity.java
  17. 15
      core/src/org/transdroid/core/gui/settings/SystemSettingsActivity.java
  18. 19
      core/src/org/transdroid/core/service/AppUpdateService.java
  19. 2
      core/src/org/transdroid/core/service/BootReceiver.java
  20. 7
      external/ActionBar-PullToRefresh-actionbarsherlock/AndroidManifest.xml
  21. 25
      external/ActionBar-PullToRefresh-actionbarsherlock/build.gradle
  22. 92
      external/ActionBar-PullToRefresh-actionbarsherlock/build.xml
  23. 3
      external/ActionBar-PullToRefresh-actionbarsherlock/gradle.properties
  24. 20
      external/ActionBar-PullToRefresh-actionbarsherlock/proguard-project.txt
  25. 17
      external/ActionBar-PullToRefresh-actionbarsherlock/project.properties
  26. 22
      external/ActionBar-PullToRefresh-actionbarsherlock/res/anim/fade_in.xml
  27. 22
      external/ActionBar-PullToRefresh-actionbarsherlock/res/anim/fade_out.xml
  28. 187
      external/ActionBar-PullToRefresh-actionbarsherlock/src/uk/co/senab/actionbarpulltorefresh/extras/actionbarsherlock/AbsDefaultHeaderTransformer.java
  29. 75
      external/ActionBar-PullToRefresh-actionbarsherlock/src/uk/co/senab/actionbarpulltorefresh/extras/actionbarsherlock/PullToRefreshAttacher.java
  30. 7
      external/ActionBar-PullToRefresh/AndroidManifest.xml
  31. 16
      external/ActionBar-PullToRefresh/build.gradle
  32. 92
      external/ActionBar-PullToRefresh/build.xml
  33. 3
      external/ActionBar-PullToRefresh/gradle.properties
  34. 20
      external/ActionBar-PullToRefresh/proguard-project.txt
  35. 15
      external/ActionBar-PullToRefresh/project.properties
  36. BIN
      external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progress_primary_holo.9.png
  37. BIN
      external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progressbar_indeterminate_holo1.png
  38. BIN
      external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progressbar_indeterminate_holo2.png
  39. BIN
      external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progressbar_indeterminate_holo3.png
  40. BIN
      external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progressbar_indeterminate_holo4.png
  41. BIN
      external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progressbar_indeterminate_holo5.png
  42. BIN
      external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progressbar_indeterminate_holo6.png
  43. BIN
      external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progressbar_indeterminate_holo7.png
  44. BIN
      external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progressbar_indeterminate_holo8.png
  45. BIN
      external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progress_primary_holo.9.png
  46. BIN
      external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progressbar_indeterminate_holo1.png
  47. BIN
      external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progressbar_indeterminate_holo2.png
  48. BIN
      external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progressbar_indeterminate_holo3.png
  49. BIN
      external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progressbar_indeterminate_holo4.png
  50. BIN
      external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progressbar_indeterminate_holo5.png
  51. BIN
      external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progressbar_indeterminate_holo6.png
  52. BIN
      external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progressbar_indeterminate_holo7.png
  53. BIN
      external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progressbar_indeterminate_holo8.png
  54. 27
      external/ActionBar-PullToRefresh/res/drawable/ptr_progress_horizontal_holo_center.xml
  55. 45
      external/ActionBar-PullToRefresh/res/drawable/ptr_progress_indeterminate_horizontal_holo.xml
  56. 45
      external/ActionBar-PullToRefresh/res/layout/default_header.xml
  57. 21
      external/ActionBar-PullToRefresh/res/values-ar/pull_refresh_strings.xml
  58. 21
      external/ActionBar-PullToRefresh/res/values-cs/pull_refresh_strings.xml
  59. 21
      external/ActionBar-PullToRefresh/res/values-de/pull_refresh_strings.xml
  60. 22
      external/ActionBar-PullToRefresh/res/values-es/pull_refresh_strings.xml
  61. 21
      external/ActionBar-PullToRefresh/res/values-fi/pull_refresh_strings.xml
  62. 21
      external/ActionBar-PullToRefresh/res/values-fr/pull_refresh_strings.xml
  63. 22
      external/ActionBar-PullToRefresh/res/values-he/pull_refresh_strings.xml
  64. 21
      external/ActionBar-PullToRefresh/res/values-it/pull_refresh_strings.xml
  65. 21
      external/ActionBar-PullToRefresh/res/values-iw/pull_refresh_strings.xml
  66. 22
      external/ActionBar-PullToRefresh/res/values-ja/pull_refresh_strings.xml
  67. 22
      external/ActionBar-PullToRefresh/res/values-ko/pull_refresh_strings.xml
  68. 21
      external/ActionBar-PullToRefresh/res/values-nl/pull_refresh_strings.xml
  69. 21
      external/ActionBar-PullToRefresh/res/values-pl/pull_refresh_strings.xml
  70. 22
      external/ActionBar-PullToRefresh/res/values-pt-rBR/pull_refresh_strings.xml
  71. 21
      external/ActionBar-PullToRefresh/res/values-pt/pull_refresh_strings.xml
  72. 21
      external/ActionBar-PullToRefresh/res/values-ro/pull_refresh_strings.xml
  73. 21
      external/ActionBar-PullToRefresh/res/values-ru/pull_refresh_strings.xml
  74. 23
      external/ActionBar-PullToRefresh/res/values-sv/pull_refresh_strings.xml
  75. 22
      external/ActionBar-PullToRefresh/res/values-zh/pull_refresh_strings.xml
  76. 48
      external/ActionBar-PullToRefresh/res/values/attrs.xml
  77. 24
      external/ActionBar-PullToRefresh/res/values/ids.xml
  78. 23
      external/ActionBar-PullToRefresh/res/values/pull_refresh_strings.xml
  79. 29
      external/ActionBar-PullToRefresh/res/values/styles.xml
  80. 397
      external/ActionBar-PullToRefresh/src/uk/co/senab/actionbarpulltorefresh/library/DefaultHeaderTransformer.java
  81. 91
      external/ActionBar-PullToRefresh/src/uk/co/senab/actionbarpulltorefresh/library/InstanceCreationUtils.java
  82. 948
      external/ActionBar-PullToRefresh/src/uk/co/senab/actionbarpulltorefresh/library/PullToRefreshAttacher.java
  83. 133
      external/ActionBar-PullToRefresh/src/uk/co/senab/actionbarpulltorefresh/library/PullToRefreshLayout.java
  84. 27
      external/ActionBar-PullToRefresh/src/uk/co/senab/actionbarpulltorefresh/library/platform/SDK11.java
  85. 93
      external/ActionBar-PullToRefresh/src/uk/co/senab/actionbarpulltorefresh/library/viewdelegates/AbsListViewDelegate.java
  86. 32
      external/ActionBar-PullToRefresh/src/uk/co/senab/actionbarpulltorefresh/library/viewdelegates/ScrollYDelegate.java
  87. 35
      external/ActionBar-PullToRefresh/src/uk/co/senab/actionbarpulltorefresh/library/viewdelegates/WebViewDelegate.java
  88. 2
      external/ColorPickerPreference/build.xml
  89. 6
      full/AndroidManifest.xml
  90. 12
      lite/AndroidManifest.xml
  91. 2
      lite/ant.properties
  92. 92
      lite/build.xml
  93. 2
      lite/res/values/strings.xml

3
README.md

@ -60,6 +60,9 @@ Some code/libraries/resources are used in the project:
* [AndroidAnnotations](http://androidannotations.org/) * [AndroidAnnotations](http://androidannotations.org/)
Pierre-Yves Ricau (eBusinessInformations) et al. Pierre-Yves Ricau (eBusinessInformations) et al.
Apache License, Version 2.0 Apache License, Version 2.0
* [ActionBar-PullToRefresh](https://github.com/chrisbanes/ActionBar-PullToRefresh)
Chris Banes
Apache License, Version 2.0
* [Crouton](https://github.com/keyboardsurfer/Crouton) * [Crouton](https://github.com/keyboardsurfer/Crouton)
Code: Benjamin Weiss (Neofonie Mobile Gmbh) et al. Code: Benjamin Weiss (Neofonie Mobile Gmbh) et al.
Idea: Cyril Mottier Idea: Cyril Mottier

4
core/AndroidManifest.xml

@ -17,8 +17,8 @@
--> -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.transdroid.core" package="org.transdroid.core"
android:versionCode="6" android:versionCode="7"
android:versionName="2.0" > android:versionName="2.0.1" >
<uses-sdk <uses-sdk
android:minSdkVersion="7" android:minSdkVersion="7"

2
core/project.properties

@ -16,3 +16,5 @@ android.library.reference.1=../external/JakeWharton-ActionBarSherlock/library
android.library.reference.2=../external/ColorPickerPreference android.library.reference.2=../external/ColorPickerPreference
android.library=true android.library=true
android.library.reference.3=../external/Crouton/library android.library.reference.3=../external/Crouton/library
android.library.reference.4=../external/ActionBar-PullToRefresh-actionbarsherlock
android.library.reference.5=../external/ActionBar-PullToRefresh

1
core/res/layout/fragment_torrents.xml

@ -74,7 +74,6 @@
android:gravity="center" android:gravity="center"
android:maxWidth="400dip" android:maxWidth="400dip"
android:padding="@dimen/margin_default" android:padding="@dimen/margin_default"
android:text="@string/navigation_nosettings"
android:textIsSelectable="false" android:textIsSelectable="false"
android:visibility="gone" /> android:visibility="gone" />

323
core/res/values-nl/strings.xml

@ -0,0 +1,323 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2010-2013 Eric Kok et al.
Transdroid is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Transdroid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<string name="action_add">Toevoegen</string>
<string name="action_addall">Allen toevoegen</string>
<string name="action_addfromfile">Met een bestand</string>
<string name="action_addfromurl">Met een URL</string>
<string name="action_scanbarcode">Barcode scanner</string>
<string name="action_search">Zoeken</string>
<string name="action_refresh">Verversen</string>
<string name="action_rss">RSS</string>
<string name="action_enableturtle">Turtle mode aanzetten</string>
<string name="action_disableturtle">Turtle mode uitzetten</string>
<string name="action_sort">Lijst sorteren</string>
<string name="action_sort_alpha">Naam</string>
<string name="action_sort_status">Status</string>
<string name="action_sort_done">Datum gereed</string>
<string name="action_sort_added">Datum toegevoegd</string>
<string name="action_sort_upspeed">Uploadsnelheid</string>
<string name="action_sort_ratio">Ratio</string>
<string name="action_filter">Lijst filteren</string>
<string name="action_settings">Instellingen</string>
<string name="action_help">Help</string>
<string name="action_start">Start</string>
<string name="action_start_default">Normaal starten</string>
<string name="action_start_forced">Geforceerd starten</string>
<string name="action_stop">Stoppen</string>
<string name="action_resume">Hervatten</string>
<string name="action_pause">Pauzeren</string>
<string name="action_remove">Verwijderen</string>
<string name="action_remove_default">Verwijder torrent</string>
<string name="action_remove_withdata">Verwijder en wis bestanden</string>
<string name="action_setlabel">Label toewijzen</string>
<string name="action_updatetrackers">Trackers updaten</string>
<string name="action_changelocation">Opslaglocatie wijzigen</string>
<string name="action_priority_off">Uit</string>
<string name="action_priority_low">Laag</string>
<string name="action_priority_normal">Normaal</string>
<string name="action_priority_high">Hoog</string>
<string name="action_remoteplay">Afspelen op server met VLC</string>
<string name="action_download">Downloaden met (S)FTP</string>
<string name="action_showdetails">Toon details</string>
<string name="action_removesettings">Verwijder instellingen</string>
<string name="action_visitwebsite">Bezoek transdroid.org</string>
<string name="navigation_nosettings">Met %1$s kun je je torrents beheren die op je torrent client thuis of op je seedbox draaien. Het opzetten van een verbinding is soms wat lastig, maar er zijn stap voor stap-instructies beschikbaar en we beloven dat het de moeite waard is!</string>
<string name="navigation_emptytorrents">Verbonden, maar geen torrents actief in het huidige filter</string>
<string name="navigation_emptydetails">Selecteer een torrent op details te bekijken</string>
<string name="navigation_servers">SERVERS</string>
<string name="navigation_status">STATUS</string>
<string name="navigation_labels">LABELS</string>
<string name="navigation_status_showall">Alles</string>
<string name="navigation_status_onlydown">Downloads</string>
<string name="navigation_status_onlyup">Uploads</string>
<string name="navigation_status_onlyactive">Actief</string>
<string name="navigation_status_onlyinactive">Inactief</string>
<plurals name="navigation_torrentsselected">
<item quantity="one">%1$d torrent geselecteerd</item>
<item quantity="other">%1$d torrents geselecteerd</item>
</plurals>
<plurals name="navigation_filesselected">
<item quantity="one">%1$d bestand geselecteerd</item>
<item quantity="other">%1$d bestanden geselecteerd</item>
</plurals>
<string name="navigation_selectall">Alles selecteren</string>
<string name="navigation_invertselection">Selectie omdraaien</string>
<string name="status_status">STATUS: %1$s</string>
<string name="status_waiting">Zal worden gecontroleerd&#8230;</string>
<string name="status_checking">Locale data verifiëren&#8230;</string>
<string name="status_waitingtodl">Zal worden gedownload&#8230;</string>
<string name="status_error">Fout&#8230;</string>
<string name="status_size1">%1$s VAN %2$s (%3$s)</string>
<string name="status_size2">%1$s, %2$s GEÜPLOAD</string>
<string name="status_sincedate">SINDS %1$s</string>
<string name="status_eta">~ %1$s</string>
<string name="status_etalong">ETA %1$s</string>
<string name="status_ofsize">VAN %1$s</string>
<string name="status_unknowneta">ONBEKENDE ETA</string>
<string name="status_ratio">RATIO %1$s</string>
<string name="status_peers">%1$s VAN %2$s PEERS</string>
<string name="status_downloading">Downloaden</string>
<string name="status_seeding">Seeden</string>
<string name="status_paused">Gepauzeerd</string>
<string name="status_queued">In de wachtrij</string>
<string name="status_stopped">Gestopt</string>
<string name="status_unknown">Onbekende status</string>
<string name="status_priority_off">Niet gedownload</string>
<string name="status_priority_low">Lage prioriteit</string>
<string name="status_priority_normal">Normale prioriteit</string>
<string name="status_priority_high">Hoge prioriteit</string>
<string name="status_trackers">TRACKERS</string>
<string name="status_errors">FOUTEN</string>
<string name="status_files">BESTANDEN</string>
<string name="status_maxspeed">Maximale snelheden</string>
<string name="status_maxspeed_down">NAX DOWNLOAD</string>
<string name="status_maxspeed_up">MAX UPLOAD</string>
<string name="status_maxspeed_unit">KB/S</string>
<string name="status_maxspeed_reset">Resetten</string>
<string name="status_update">Updaten</string>
<plurals name="status_service_added">
<item quantity="one">Nieuwe torrent toegevoegd</item>
<item quantity="other">%1$s nieuwe torrents toegevoegd</item>
</plurals>
<plurals name="status_service_finished">
<item quantity="one">Torrent is gereed</item>
<item quantity="other">%1$s torrents zijn gereed</item>
</plurals>
<plurals name="status_service_addedfinished">
<item quantity="one">%1$s torrent toegevoed, %2$s gereed</item>
<item quantity="other">%1$s torrents toegevoed, %2$s gereed</item>
</plurals>
<string name="status_service_andothers">%1$s and anderen</string>
<string name="labels_showall">Alle labels</string>
<string name="labels_unlabeled">Ongelabeld</string>
<string name="labels_newlabel">Nieuw label</string>
<string name="labels_no_support">Labels worden niet ondersteund door je torrent client</string>
<string name="status_label_pick">KIES EEN LABEL</string>
<string name="status_label_new">NIEUW LABEL</string>
<string name="status_label_remove">Verwijder label</string>
<string name="status_label_hint">Bijv. films of linux</string>
<string name="result_added">%1$s toegevoegd (nu verversen)</string>
<string name="result_removed">%1$s verwijderd</string>
<string name="result_removed_with_data">%1$s verwijderd en bestanden gewist</string>
<string name="result_resumed">%1$s hervat (nu versersen)</string>
<string name="result_stopped">%1$s gestopt (nu verversen)</string>
<string name="result_started">%1$s gestart (nu verversen)</string>
<string name="result_paused">%1$s gepauzeerd (nu verversen)</string>
<string name="result_paused_all">Torrents gepauseerd (nu verversen)</string>
<string name="result_resumed_all">Torrents hervat (nu verversen)</string>
<string name="result_stopped_all">Torrents gestopt (nu verversen)</string>
<string name="result_started_all">Torrents gestart (nu verversen)</string>
<string name="result_trackersupdated">Trackers geüpdatet</string>
<string name="result_labelset">Label \'%1$s\' toegewezen</string>
<string name="result_labelremoved">Label verwijderd</string>
<string name="result_locationset">Torrent verplaatst naar \'%1$s\'</string>
<string name="result_priotitiesset">Bestandsprioriteiten geüpdatet</string>
<string name="result_maxspeedsset">Maximale snelheden ingesteld</string>
<string name="search_torrentsearch">Torrents zoeken</string>
<string name="search_queryonsite">\'%1$s\' op %2$s</string>
<string name="search_hint">Zoeken naar torrents</string>
<string name="search_noresults">Geen resultaten voor je zoekopdracht</string>
<string name="search_seeders">S: %1$s</string>
<string name="search_leechers">L: %1$s</string>
<string name="search_installsearch">Deze functie vereist een eenmalige installatie van de Torrent Search-module. Kies download om het installatiepakket (apk) te installeren van transdroid.org en herstart je zoekopdracht.</string>
<string name="search_download">Module downloaden</string>
<string name="search_openingdetails">Details voor %1$s worden geopend</string>
<string name="search_barcodescannernotfound">De Barcode Scanner-app kan niet worden gevonden. Wil je deze installeren via de Play Store?</string>
<string name="search_filemanagernotfound">Geen ondersteunde bestandsbeheer-app gevonden. WIl je IO File Manager installeren via de Play Store?</string>
<plurals name="search_resutlsselected">
<item quantity="one">%1$d resultaat geselecteerd</item>
<item quantity="other">%1$d resutaten geselecteerd</item>
</plurals>
<string name="rss_feeds">RSS feeds</string>
<string name="rss_nosettings">Je monitort nog geen RSS feeds. Torrent-specifieke RSS feeds bieden de laatste nieuwe torrents en je krijgt meldingen als er nieuwe torrents beschikbaar zijn.</string>
<string name="rss_noselection">Selecteer een RSS feed om de nieuwe items te beijken</string>
<string name="rss_empty">De RSS feed is niet beschikbaar of bevat geen items</string>
<string name="rss_notloaded">Sorry, nog even wachten tot de RSS feed is geladen</string>
<string name="rss_error">Sorry, deze RSS feed kon momenteel niet worden geladen</string>
<plurals name="rss_itemsselected">
<item quantity="one">%1$d item geselecteerd</item>
<item quantity="other">%1$d items geselecteerd</item>
</plurals>
<plurals name="rss_service_new">
<item quantity="one">Nieuwe RSS-feedtorrent beschikbaar</item>
<item quantity="other">%1$s nieuwe RSS-feedtorrents</item>
</plurals>
<string name="rss_service_newfor">Nieuwe torrent voor %1$s</string>
<string name="widget_loading">Laden&#8230;</string>
<string name="widget_opentransdroid">Transdroid openen</string>
<string name="widget_filter">SERVERSELECTIE</string>
<string name="widget_lookfeel">UITERLIJK</string>
<string name="widget_sortby">SORTEERVOLGORDE</string>
<string name="widget_reversesortorder">Omgekeerde sorteervolgorde</string>
<string name="widget_usedarktheme">Gebruik donker kleurenschema (geen preview)</string>
<string name="widget_done">KLAAR</string>
<string name="pref_servers">Servers</string>
<string name="pref_addserver">Nieuwe server toevoegen</string>
<string name="pref_searchsites">Zoeksites</string>
<string name="pref_setsearchsite">Stel standaardsite in</string>
<string name="pref_addwebsearch">Nieuwe webgebaseerde site toevoegen</string>
<string name="pref_rssfeeds">RSS feeds</string>
<string name="pref_addrssfeed">Nieuwe RSS feed</string>
<string name="pref_others">Andere instellingen</string>
<string name="pref_name">Naam</string>
<string name="pref_name_optional">Optionele persoonlijke naam</string>
<string name="pref_searchurl">URL van zoekpagina</string>
<string name="pref_searchurl_info">%s zal worden vervangen door de zoekopdracht</string>
<string name="pref_cookies">Cookies</string>
<string name="pref_cookies_info">Optioneel; gebruik key1=value1;key2=value2 als formaat</string>
<string name="pref_feedurl">URL van de feed</string>
<string name="pref_reqauth">Inloggen vereist</string>
<string name="pref_reqauth_info">Links zullen in de browser worden geopend op in te loggen</string>
<string name="pref_servertype">Servertype</string>
<string name="pref_address">IP of domeinnaam</string>
<string name="pref_port">Poortnummer</string>
<string name="pref_user">Gebruikersnaam</string>
<string name="pref_pass">Wachtwoord</string>
<string name="pref_extrapass">Deluge webwachtwoord</string>
<string name="pref_advanced">Geavanceerde instellingen</string>
<string name="pref_localaddress">Loale IP of hostnaam</string>
<string name="pref_localaddress_info">Mits verbonden met het opgegeven lokale netwerk</string>
<string name="pref_localnetwork">Lokale netwerk</string>
<string name="pref_localnetwork_info">De SSID van het lokale netwerk</string>
<string name="pref_folder">Relatieve directory</string>
<string name="pref_folder_info">Normaal gesproken leeg</string>
<string name="pref_scgifolder">SCGI mountpunt</string>
<string name="pref_optional">Optionele instellingen</string>
<string name="pref_alarmdone">Voltooidmelding</string>
<string name="pref_alarmdone_info">Meld als een torrent is voltooid</string>
<string name="pref_alarmnew">Nieuwetorrentmelding</string>
<string name="pref_alarmnew_info">Meld al een torrent is toegevoegd</string>
<string name="pref_os">Besturingssysteem</string>
<string name="pref_downdir">Downloaddirectory</string>
<string name="pref_downdir_info">Handmatig de absolute directory instellen voor commando\'s naar de server</string>
<string name="pref_timeout">Verbindingstimeout</string>
<string name="pref_timeout_info">Aantal seconden voordat een poging wordt afgebroken</string>
<string name="pref_ftpurl">Basis-URL voor (S)FTP</string>
<string name="pref_ftpurl_into">Bijvoorbeeld ftp://me@server/downloads/</string>
<string name="pref_ftppass">(S)FTP-wachtwoord</string>
<string name="pref_sslenable">Gebruik SSL</string>
<string name="pref_sslenable_info">Via https verbinden</string>
<string name="pref_sslkey">Handmatige SSL-vingerafdruk (SHA-1)</string>
<string name="pref_sslkey_info">Alleen verbindingen met dit certificaat toestaan</string>
<string name="pref_sslacceptall">Alle SSL-certificaten toestaan</string>
<string name="pref_sslacceptall_info">Verbindingen met alle SSL-vingerafdrukken toestaan</string>
<string name="pref_background">Meldingen op achtergrond</string>
<string name="pref_notifications">Meldingen aanzetten</string>
<string name="pref_notifications_info">Meldingen op de achtergrond toestaan</string>
<string name="pref_notifyinterval">Interval</string>
<string name="pref_notifyinterval_info">Hoe vaak de server gecontroleerd moet worden</string>
<string name="pref_notifysound">Geluid</string>
<string name="pref_notifyvibrate">Trillen</string>
<string name="pref_notifyled">LED-kleur</string>
<string name="pref_notifyled_info">Mits ondersteund door je apparaat</string>
<string name="pref_adw">ADW-meldingen ondersteunen</string>
<string name="pref_adw_info">Toon het aantal torrents in ADW Launcher</string>
<string name="pref_system">Systeem</string>
<string name="pref_checkupdates">Controleren op updates</string>
<string name="pref_checkupdates_info">Controleer transdroid.org voor de meest recente versie</string>
<string name="pref_usedarktheme">Gebruik donker kleurenschema</string>
<string name="pref_usedarktheme_info">Vereist een herstart om toe te passen</string>
<string name="pref_import">Importeer instellingen</string>
<string name="pref_import_dialog">%1$s zal proberen server-, zoeksite-, RSS- en systeeminstellingen te laden uit: %2$s</string>
<string name="pref_import_success">Instellingen succesvol geïmporteerd</string>
<string name="pref_export">Exporteer instellingen</string>
<string name="pref_export_dialog">%1$s zal server- (inclusief wachtwoorden), zoeksite-, RSS- en systeeminstellingen exporten naar het JSON-tekstbestand: %2$s</string>
<string name="pref_export_success">Instellingen succesvol geëxporteerd</string>
<string name="pref_sendlog">Foutrapport verzenden</string>
<string name="pref_sendlog_info">Hulp vragen of een bug melden</string>
<string name="pref_installhelp">Bekijk installatieinstructies</string>
<string name="pref_installhelp_info">Beschikbaar op transdroid.org/download</string>
<string name="pref_changelog">Recente wijzigingen</string>
<string name="pref_about">Over %1$s</string>
<string-array name="pref_notifyinterval_types">
<item>1 minuut</item>
<item>10 minuten</item>
<item>30 minuten</item>
<item>1 uur</item>
<item>3 uur</item>
<item>12 uur</item>
<item>1 dag</item>
</string-array>
<string name="error_httperror">Verbindingsfout; controleer je internetverbinding</string>
<string name="error_jsonrequesterror">Interne fout bij het opzetten van de verbinding</string>
<string name="error_jsonresponseerror">Fout bij het verwerken van de serverreactie (controleer je instellingen)</string>
<string name="error_daemonnotconnected">De webinterface is niet verbonden met een actieve daemon</string>
<string name="error_401">Toegang geweiged (controleer je instellingen)</string>
<string name="error_torrentfile">Kan het .torrent-bestand niet lezen</string>
<string name="error_parsingrss">Fout bij het verwerken van de RSS-feed</string>
<string name="error_invalid_url_form">Dit is geen geldige URL</string>
<string name="error_invalid_search_url">De URL van je zoeksite is ongeldig:</string>
<string name="error_invalid_ip_or_hostname">Geen geldige IP of domeinnaam ingevoerd</string>
<string name="error_invalid_port_number">Het poortnummer is altijd numeriek</string>
<string name="error_invalid_directory">Een directory eindigd altijd op een / of \</string>
<string name="error_invalid_timeout">De timeout kan niet leeg zijn en is een positief getal</string>
<string name="error_no_url_enclosure">Het RSS-feeditem bevat geen URL-enclosure of -link naar een .torrent-file</string>
<string name="error_no_link">Het RSS-feeditem bevat geen link om te bezoeken</string>
<string name="error_norssfeed">De URL is geen (geldige) RSS-feed</string>
<string name="error_media_not_available">De SD-kaart is niet beschikbaar</string>
<string name="error_no_valid_settings_file">Het bestand lijkt geen %1$s-instellingen te bevatten</string>
<string name="error_file_not_found">Het bestand met instellingen kon niet worden gevonden</string>
<string name="error_cant_write_settings_file">Kan niet naar het bestand met instellingen schrijven</string>
<string name="error_notanumber">Kies een positief getal</string>
<string name="error_notalabel">Geen een geldige labelnaam op of kies uit de lijst</string>
<string name="error_stillloadingdetails">Even wachten tot de torrentdetails zijn geladen</string>
<string name="error_noftpapp">Geen app gevonden die %1$s kan downloaden</string>
<string name="update_app_newversion">Nieuwe versie van Transdroid beschikbaar</string>
<string name="update_search_newversion">Nieuwe versie van de Transdroid zoekmodule beschikbaar</string>
<string name="update_updateto">Je kunt nu updaten naar %1$s</string>
<string name="system_librarieslabel">Enkele libraries die in het project zijn gebruikt:</string>
<string name="system_description">Beheer je torrents vanaf je Androidapparaat</string>
</resources>

5
core/res/values/changelog.xml

@ -17,6 +17,11 @@
--> -->
<resources> <resources>
<string name="system_changelog"> <string name="system_changelog">
Transdroid 2.0.1\n
- Support for pull to refresh\n
- First Google Play release of the lite version as Transdrone\n
- First release as auto-update (now checked only once a day)\n
\n
Transdroid 2.0.0\n Transdroid 2.0.0\n
- Scrollable home screen widget (Android 3+)\n - Scrollable home screen widget (Android 3+)\n
- Allow changing of storage location (Deluge and Transmission)\n - Allow changing of storage location (Deluge and Transmission)\n

17
core/res/values/strings.xml

@ -25,8 +25,8 @@
<string name="action_search">Search</string> <string name="action_search">Search</string>
<string name="action_refresh">Refresh</string> <string name="action_refresh">Refresh</string>
<string name="action_rss">RSS</string> <string name="action_rss">RSS</string>
<string name="action_enableturtle">Enable turle mode</string> <string name="action_enableturtle">Enable turtle mode</string>
<string name="action_disableturtle">Disable turle mode</string> <string name="action_disableturtle">Disable turtle mode</string>
<string name="action_sort">Sort list</string> <string name="action_sort">Sort list</string>
<string name="action_sort_alpha">Name</string> <string name="action_sort_alpha">Name</string>
<string name="action_sort_status">Status</string> <string name="action_sort_status">Status</string>
@ -59,7 +59,7 @@
<string name="action_removesettings">Remove settings</string> <string name="action_removesettings">Remove settings</string>
<string name="action_visitwebsite">Visit transdroid.org</string> <string name="action_visitwebsite">Visit transdroid.org</string>
<string name="navigation_nosettings">Transdroid allows you to monitor and manage the torrent client you run at home or on your seedbox. Setting things up can be a bit tricky, but we offer step-by-step guides and promise it\'ll be worth it!</string> <string name="navigation_nosettings">%1$s allows you to monitor and manage the torrent client you run at home or on your seedbox. Setting things up can be a bit tricky, but we offer step-by-step guides and promise it\'ll be worth it!</string>
<string name="navigation_emptytorrents">Connected, but no torrent are active within the current filter</string> <string name="navigation_emptytorrents">Connected, but no torrent are active within the current filter</string>
<string name="navigation_emptydetails">Select a torrent to view its details</string> <string name="navigation_emptydetails">Select a torrent to view its details</string>
<string name="navigation_servers">SERVERS</string> <string name="navigation_servers">SERVERS</string>
@ -270,17 +270,17 @@
<string name="pref_usedarktheme">Use dark UI theme</string> <string name="pref_usedarktheme">Use dark UI theme</string>
<string name="pref_usedarktheme_info">Requires a restart to take effect</string> <string name="pref_usedarktheme_info">Requires a restart to take effect</string>
<string name="pref_import">Import settings</string> <string name="pref_import">Import settings</string>
<string name="pref_import_dialog">Transdroid will try to import server, web search, RSS and system settings from: %1$s</string> <string name="pref_import_dialog">%1$s will try to import server, web search, RSS and system settings from: %2$s</string>
<string name="pref_import_success">Settings successfully imported</string> <string name="pref_import_success">Settings successfully imported</string>
<string name="pref_export">Export settings</string> <string name="pref_export">Export settings</string>
<string name="pref_export_dialog">Transdroid will export server (including passwords), web search, RSS and system settings to the following plain text JSON file: %1$s</string> <string name="pref_export_dialog">%1$s will export server (including passwords), web search, RSS and system settings to the following plain text JSON file: %2$s</string>
<string name="pref_export_success">Settings successfully exported</string> <string name="pref_export_success">Settings successfully exported</string>
<string name="pref_sendlog">Send error log</string> <string name="pref_sendlog">Send error log</string>
<string name="pref_sendlog_info">Get support or report a bug</string> <string name="pref_sendlog_info">Get support or report a bug</string>
<string name="pref_installhelp">View install guides</string> <string name="pref_installhelp">View install guides</string>
<string name="pref_installhelp_info">Available at transdroid.org/download</string> <string name="pref_installhelp_info">Available at transdroid.org/download</string>
<string name="pref_changelog">Recent changes</string> <string name="pref_changelog">Recent changes</string>
<string name="pref_about">About Transdroid</string> <string name="pref_about">About %1$s</string>
<string-array name="pref_daemon_types" translatable="false"> <string-array name="pref_daemon_types" translatable="false">
<item>BitComet</item> <item>BitComet</item>
<item>Bitflu 1.2+</item> <item>Bitflu 1.2+</item>
@ -359,7 +359,7 @@
<string name="error_no_link">The RSS feed item does not provide a link to browse to</string> <string name="error_no_link">The RSS feed item does not provide a link to browse to</string>
<string name="error_norssfeed">URL is not a (valid) RSS feed</string> <string name="error_norssfeed">URL is not a (valid) RSS feed</string>
<string name="error_media_not_available">SD card not available to read/write</string> <string name="error_media_not_available">SD card not available to read/write</string>
<string name="error_no_valid_settings_file">File does not seem to contain Transdroid settings</string> <string name="error_no_valid_settings_file">File does not seem to contain %1$s settings</string>
<string name="error_file_not_found">The settings file could not be found</string> <string name="error_file_not_found">The settings file could not be found</string>
<string name="error_cant_write_settings_file">Can\'t write to the settings file</string> <string name="error_cant_write_settings_file">Can\'t write to the settings file</string>
<string name="error_notanumber">Please enter a positive number</string> <string name="error_notanumber">Please enter a positive number</string>
@ -371,11 +371,10 @@
<string name="update_search_newversion">New Transdroid search module available</string> <string name="update_search_newversion">New Transdroid search module available</string>
<string name="update_updateto">You can now update to %1$s</string> <string name="update_updateto">You can now update to %1$s</string>
<string name="system_name" translatable="false">Transdroid</string>
<string name="system_developer" translatable="false">\u00A9 Eric Kok, 2312 development</string> <string name="system_developer" translatable="false">\u00A9 Eric Kok, 2312 development</string>
<string name="system_license" translatable="false">Published under GNU General Public License v3</string> <string name="system_license" translatable="false">Published under GNU General Public License v3</string>
<string name="system_librarieslabel">Some code/libraries are used in the project:</string> <string name="system_librarieslabel">Some code/libraries are used in the project:</string>
<string name="system_libraries" translatable="false">ActionBarSherlock\n \u00A0 http://actionbarsherlock.com/\n \u00A0 Jake Wharton \n \u00A0 Apache License, Version 2.0\nAndroidAnnotations\n \u00A0 http://androidannotations.org/\n \u00A0 Pierre-Yves Ricau (eBusinessInformations) et al. \n \u00A0 Apache License, Version 2.0\nCrouton\n \u00A0 https://github.com/keyboardsurfer/Crouton\n \u00A0 Code: Benjamin Weiss (Neofonie Mobile Gmbh) et al. \n \u00A0 Idea: Cyril Mottier \n \u00A0 Apache License, Version 2.0\nBase16Encoder\n \u00A0 http://openjpa.apache.org/\n \u00A0 Marc Prud\'hommeaux \n \u00A0 Apache OpenJPA\n MultipartEntity \n \u00A0 Apache Software Foundation \n \u00A0 Apache License, Version 2.0\nRssParser (learning-android)\n \u00A0 http://github.com/digitalspaghetti/learning-android\n \u00A0 Tane Piper \n \u00A0 Public Domain\nBase64\n \u00A0 http://iharder.net/base64\n \u00A0 Robert Harder \n \u00A0 Public Domain\nandroid-xmlrpc\n \u00A0 http://code.google.com/p/android-xmlrpc/\n \u00A0 pskink et al. \n \u00A0 Apache License, Version 2.0\nandroid-ColorPickerPreference\n \u00A0 https://github.com/attenzione/android-ColorPickerPreference\n \u00A0 Daniel Nilsson and Sergey Margaritov \n \u00A0 Apache License, Version 2.0\nCheckableRelativeLayout\n \u00A0 http://www.marvinlabs.com/2010/10/custom-listview-ability-check-items/\n \u00A0 Cédric Caron (MarvinLabs)\n \u00A0 Public Domain\nFunnel icon\n \u00A0 http://thenounproject.com/noun/funnel/#icon-No5608\n \u00A0 Naomi Atkinson from The Noun Project\n \u00A0 Creative Commons Attribution 3.0</string> <string name="system_libraries" translatable="false">ActionBarSherlock\n \u00A0 http://actionbarsherlock.com/\n \u00A0 Jake Wharton \n \u00A0 Apache License, Version 2.0\nAndroidAnnotations\n \u00A0 http://androidannotations.org/\n \u00A0 Pierre-Yves Ricau (eBusinessInformations) et al. \n \u00A0 Apache License, Version 2.0\nActionBar-PullToRefresh\n \u00A0 https://github.com/chrisbanes/ActionBar-PullToRefresh\n \u00A0 Chris Banes \n \u00A0 Apache License, Version 2.0\nCrouton\n \u00A0 https://github.com/keyboardsurfer/Crouton\n \u00A0 Code: Benjamin Weiss (Neofonie Mobile Gmbh) et al. \n \u00A0 Idea: Cyril Mottier \n \u00A0 Apache License, Version 2.0\nBase16Encoder\n \u00A0 http://openjpa.apache.org/\n \u00A0 Marc Prud\'hommeaux \n \u00A0 Apache OpenJPA\n MultipartEntity \n \u00A0 Apache Software Foundation \n \u00A0 Apache License, Version 2.0\nRssParser (learning-android)\n \u00A0 http://github.com/digitalspaghetti/learning-android\n \u00A0 Tane Piper \n \u00A0 Public Domain\nBase64\n \u00A0 http://iharder.net/base64\n \u00A0 Robert Harder \n \u00A0 Public Domain\nandroid-xmlrpc\n \u00A0 http://code.google.com/p/android-xmlrpc/\n \u00A0 pskink et al. \n \u00A0 Apache License, Version 2.0\nandroid-ColorPickerPreference\n \u00A0 https://github.com/attenzione/android-ColorPickerPreference\n \u00A0 Daniel Nilsson and Sergey Margaritov \n \u00A0 Apache License, Version 2.0\nCheckableRelativeLayout\n \u00A0 http://www.marvinlabs.com/2010/10/custom-listview-ability-check-items/\n \u00A0 Cédric Caron (MarvinLabs)\n \u00A0 Public Domain\nFunnel icon\n \u00A0 http://thenounproject.com/noun/funnel/#icon-No5608\n \u00A0 Naomi Atkinson from The Noun Project\n \u00A0 Creative Commons Attribution 3.0</string>
<string name="system_description">Manage your torrents from your Android device</string> <string name="system_description">Manage your torrents from your Android device</string>
</resources> </resources>

3
core/res/xml/pref_system.xml

@ -52,7 +52,6 @@
android:title="@string/pref_changelog" /> android:title="@string/pref_changelog" />
<Preference <Preference
android:key="system_about" android:key="system_about" />
android:title="@string/pref_about" />
</PreferenceScreen> </PreferenceScreen>

33
core/src/org/transdroid/core/app/settings/SystemSettings.java

@ -16,9 +16,12 @@
*/ */
package org.transdroid.core.app.settings; package org.transdroid.core.app.settings;
import java.util.Date;
import org.androidannotations.annotations.EBean; import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.RootContext; import org.androidannotations.annotations.RootContext;
import org.androidannotations.annotations.EBean.Scope; import org.androidannotations.annotations.EBean.Scope;
import org.transdroid.core.service.AppUpdateService;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
@ -34,7 +37,7 @@ public class SystemSettings {
@RootContext @RootContext
protected Context context; protected Context context;
private SharedPreferences prefs; private SharedPreferences prefs;
protected SystemSettings(Context context) { protected SystemSettings(Context context) {
prefs = PreferenceManager.getDefaultSharedPreferences(context); prefs = PreferenceManager.getDefaultSharedPreferences(context);
} }
@ -46,5 +49,31 @@ public class SystemSettings {
public boolean useDarkTheme() { public boolean useDarkTheme() {
return prefs.getBoolean("system_usedarktheme", false); return prefs.getBoolean("system_usedarktheme", false);
} }
/**
* Returns the date when we last checked transdroid.org for the latest app version.
* @return The date/time when the {@link AppUpdateService} checked on the server for updates
*/
public Date getLastCheckedForAppUpdates() {
long lastChecked = prefs.getLong("system_lastappupdatecheck", -1L);
return lastChecked == -1 ? null : new Date(lastChecked);
}
/**
* Stores the date at which was last successfully, fully checked for new updates to the app.
* @param lastChecked The date/time at which the {@link AppUpdateService} last checked the server for updates
*/
public void setLastCheckedForAppUpdates(Date lastChecked) {
prefs.edit().putLong("system_lastappupdatecheck", lastChecked == null ? -1L : lastChecked.getTime()).commit();
}
/**
* Whether the custom app update checker should be used to check for new app and search module versions.
* @return True if it should be checked against transdroid.org if there are app updates (as opposed to using the
* Play Store for updates), false otherwise
*/
public static boolean enableUpdateChecker(Context context) {
return !context.getPackageName().equals("org.transdroid.lite");
}
} }

31
core/src/org/transdroid/core/gui/DetailsActivity.java

@ -32,6 +32,7 @@ import org.androidannotations.annotations.UiThread;
import org.transdroid.core.R; import org.transdroid.core.R;
import org.transdroid.core.app.settings.*; import org.transdroid.core.app.settings.*;
import org.transdroid.core.gui.lists.LocalTorrent; import org.transdroid.core.gui.lists.LocalTorrent;
import org.transdroid.core.gui.lists.NoProgressHeaderTransformer;
import org.transdroid.core.gui.log.Log; import org.transdroid.core.gui.log.Log;
import org.transdroid.core.gui.navigation.Label; import org.transdroid.core.gui.navigation.Label;
import org.transdroid.core.gui.navigation.NavigationHelper; import org.transdroid.core.gui.navigation.NavigationHelper;
@ -62,10 +63,15 @@ import org.transdroid.daemon.task.SetTrackersTask;
import org.transdroid.daemon.task.StartTask; import org.transdroid.daemon.task.StartTask;
import org.transdroid.daemon.task.StopTask; import org.transdroid.daemon.task.StopTask;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.OnRefreshListener;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.Options;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.View;
import android.widget.Toast; import android.widget.Toast;
import com.actionbarsherlock.app.SherlockFragmentActivity; import com.actionbarsherlock.app.SherlockFragmentActivity;
@ -97,6 +103,7 @@ public class DetailsActivity extends SherlockFragmentActivity implements Torrent
@Bean @Bean
protected ApplicationSettings applicationSettings; protected ApplicationSettings applicationSettings;
private IDaemonAdapter currentConnection = null; private IDaemonAdapter currentConnection = null;
private PullToRefreshAttacher pullToRefreshAttacher = null;
// Details view components // Details view components
@FragmentById(resName = "torrent_details") @FragmentById(resName = "torrent_details")
@ -148,6 +155,28 @@ public class DetailsActivity extends SherlockFragmentActivity implements Torrent
TorrentsActivity_.intent(this).flags(Intent.FLAG_ACTIVITY_CLEAR_TOP).start(); TorrentsActivity_.intent(this).flags(Intent.FLAG_ACTIVITY_CLEAR_TOP).start();
} }
/**
* Attaches some view (perhaps contained in a fragment) to this activity's pull to refresh support
* @param view The view to attach
*/
@Override
public void addRefreshableView(View view) {
if (pullToRefreshAttacher == null) {
// Still need to initialise the PullToRefreshAttacher
Options options = new PullToRefreshAttacher.Options();
options.headerTransformer = new NoProgressHeaderTransformer();
pullToRefreshAttacher = PullToRefreshAttacher.get(this, options);
}
pullToRefreshAttacher.addRefreshableView(view, new OnRefreshListener() {
@Override
public void onRefreshStarted(View view) {
// Just refresh the full screen, now that the user has pulled to refresh
pullToRefreshAttacher.setRefreshComplete();
refreshScreen();
}
});
}
@OptionsItem(resName = "action_refresh") @OptionsItem(resName = "action_refresh")
public void refreshScreen() { public void refreshScreen() {
fragmentDetails.updateIsLoading(true, null); fragmentDetails.updateIsLoading(true, null);
@ -330,7 +359,7 @@ public class DetailsActivity extends SherlockFragmentActivity implements Torrent
protected void onCommunicationError(DaemonTaskFailureResult result, boolean isCritical) { protected void onCommunicationError(DaemonTaskFailureResult result, boolean isCritical) {
Log.i(this, result.getException().toString()); Log.i(this, result.getException().toString());
String error = getString(LocalTorrent.getResourceForDaemonException(result.getException())); String error = getString(LocalTorrent.getResourceForDaemonException(result.getException()));
fragmentDetails.updateIsLoading(false, isCritical? error: null); fragmentDetails.updateIsLoading(false, isCritical ? error : null);
Crouton.showText(this, getString(LocalTorrent.getResourceForDaemonException(result.getException())), Crouton.showText(this, getString(LocalTorrent.getResourceForDaemonException(result.getException())),
NavigationHelper.CROUTON_ERROR_STYLE); NavigationHelper.CROUTON_ERROR_STYLE);
} }

5
core/src/org/transdroid/core/gui/DetailsFragment.java

@ -119,6 +119,11 @@ public class DetailsFragment extends SherlockFragment implements OnTrackersUpdat
detailsList.setAdapter(new DetailsAdapter(getActivity())); detailsList.setAdapter(new DetailsAdapter(getActivity()));
detailsList.setMultiChoiceModeListener(onDetailsSelected); detailsList.setMultiChoiceModeListener(onDetailsSelected);
detailsList.setFastScrollEnabled(true); detailsList.setFastScrollEnabled(true);
if (getActivity() != null && getActivity() instanceof RefreshableActivity) {
((RefreshableActivity) getActivity()).addRefreshableView(detailsList);
}
// Restore the fragment state (on orientation changes et al.)
if (torrent != null) if (torrent != null)
updateTorrent(torrent); updateTorrent(torrent);
if (torrentDetails != null) if (torrentDetails != null)

28
core/src/org/transdroid/core/gui/TorrentsActivity.java

@ -46,6 +46,7 @@ import org.apache.http.impl.cookie.BasicClientCookie;
import org.transdroid.core.R; import org.transdroid.core.R;
import org.transdroid.core.app.settings.*; import org.transdroid.core.app.settings.*;
import org.transdroid.core.gui.lists.LocalTorrent; import org.transdroid.core.gui.lists.LocalTorrent;
import org.transdroid.core.gui.lists.NoProgressHeaderTransformer;
import org.transdroid.core.gui.lists.SimpleListItem; import org.transdroid.core.gui.lists.SimpleListItem;
import org.transdroid.core.gui.log.*; import org.transdroid.core.gui.log.*;
import org.transdroid.core.gui.navigation.*; import org.transdroid.core.gui.navigation.*;
@ -92,6 +93,10 @@ import org.transdroid.daemon.task.StopTask;
import org.transdroid.daemon.util.DLog; import org.transdroid.daemon.util.DLog;
import org.transdroid.daemon.util.HttpHelper; import org.transdroid.daemon.util.HttpHelper;
import uk.co.senab.actionbarpulltorefresh.extras.actionbarsherlock.PullToRefreshAttacher;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.OnRefreshListener;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.Options;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.SearchManager; import android.app.SearchManager;
import android.content.ContentResolver; import android.content.ContentResolver;
@ -138,6 +143,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
@SystemService @SystemService
protected SearchManager searchManager; protected SearchManager searchManager;
private MenuItem searchMenu = null; private MenuItem searchMenu = null;
private PullToRefreshAttacher pullToRefreshAttacher = null;
// Settings // Settings
@Bean @Bean
@ -571,6 +577,28 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
startSearch(query, false, null, false); startSearch(query, false, null, false);
} }
/**
* Attaches some view (perhaps contained in a fragment) to this activity's pull to refresh support
* @param view The view to attach
*/
@Override
public void addRefreshableView(View view) {
if (pullToRefreshAttacher == null) {
// Still need to initialise the PullToRefreshAttacher
Options options = new PullToRefreshAttacher.Options();
options.headerTransformer = new NoProgressHeaderTransformer();
pullToRefreshAttacher = PullToRefreshAttacher.get(this, options);
}
pullToRefreshAttacher.addRefreshableView(view, new OnRefreshListener() {
@Override
public void onRefreshStarted(View view) {
// Just refresh the full screen, now that the user has pulled to refresh
pullToRefreshAttacher.setRefreshComplete();
refreshScreen();
}
});
}
@OptionsItem(resName = "action_refresh") @OptionsItem(resName = "action_refresh")
public void refreshScreen() { public void refreshScreen() {
fragmentTorrents.updateIsLoading(true); fragmentTorrents.updateIsLoading(true);

5
core/src/org/transdroid/core/gui/TorrentsFragment.java

@ -114,6 +114,11 @@ public class TorrentsFragment extends SherlockFragment implements OnLabelPickedL
torrentsList.setFastScrollEnabled(true); torrentsList.setFastScrollEnabled(true);
if (torrents != null) if (torrents != null)
updateTorrents(torrents, currentLabels); updateTorrents(torrents, currentLabels);
// Allow pulls on the list view to refresh the torrents
if (getActivity() != null && getActivity() instanceof RefreshableActivity) {
((RefreshableActivity) getActivity()).addRefreshableView(torrentsList);
}
nosettingsText.setText(getString(R.string.navigation_nosettings, getString(R.string.app_name)));
} }

17
core/src/org/transdroid/core/gui/lists/NoProgressHeaderTransformer.java

@ -0,0 +1,17 @@
package org.transdroid.core.gui.lists;
import org.transdroid.core.R;
import android.app.Activity;
import android.view.View;
import uk.co.senab.actionbarpulltorefresh.extras.actionbarsherlock.AbsDefaultHeaderTransformer;
public class NoProgressHeaderTransformer extends AbsDefaultHeaderTransformer {
@Override
public void onViewCreated(Activity activity, View headerView) {
super.onViewCreated(activity, headerView);
setProgressBarColor(activity.getResources().getColor(R.color.green));
}
}

10
core/src/org/transdroid/core/gui/navigation/NavigationHelper.java

@ -173,12 +173,12 @@ public class NavigationHelper {
* @return A best-guess, reasonably long name for the linked torrent * @return A best-guess, reasonably long name for the linked torrent
*/ */
public static String extractNameFromUri(Uri rawTorrentUri) { public static String extractNameFromUri(Uri rawTorrentUri) {
if (rawTorrentUri.getScheme() == null) { if (rawTorrentUri.getScheme() == null) {
// Probably an incorrect URI; just return the whole thing // Probably an incorrect URI; just return the whole thing
return rawTorrentUri.toString(); return rawTorrentUri.toString();
} }
if (rawTorrentUri.getScheme().equals("magnet")) { if (rawTorrentUri.getScheme().equals("magnet")) {
// Magnet links might have a dn (display name) parameter // Magnet links might have a dn (display name) parameter
String dn = getQueryParameter(rawTorrentUri, "dn"); String dn = getQueryParameter(rawTorrentUri, "dn");
@ -198,7 +198,7 @@ public class NavigationHelper {
return path; return path;
} }
} }
// No idea what to do with this; return as is // No idea what to do with this; return as is
return rawTorrentUri.toString(); return rawTorrentUri.toString();
} }
@ -208,9 +208,9 @@ public class NavigationHelper {
if (start >= 0) { if (start >= 0) {
int begin = start + (parameter + "=").length(); int begin = start + (parameter + "=").length();
int end = uri.toString().indexOf("&", begin); int end = uri.toString().indexOf("&", begin);
return uri.toString().substring(begin, end >= 0? end: uri.toString().length()); return uri.toString().substring(begin, end >= 0 ? end : uri.toString().length());
} }
return null; return null;
} }
} }

4
core/src/org/transdroid/core/gui/navigation/RefreshableActivity.java

@ -16,6 +16,8 @@
*/ */
package org.transdroid.core.gui.navigation; package org.transdroid.core.gui.navigation;
import android.view.View;
/** /**
* Interface to be implemented by any activity that allows its content to be refreshed; fragments can ask for * Interface to be implemented by any activity that allows its content to be refreshed; fragments can ask for
* user-initiated refreshes. * user-initiated refreshes.
@ -25,4 +27,6 @@ public interface RefreshableActivity {
public void refreshScreen(); public void refreshScreen();
public void addRefreshableView(View view);
} }

15
core/src/org/transdroid/core/gui/settings/SystemSettingsActivity.java

@ -26,6 +26,7 @@ import org.json.JSONException;
import org.transdroid.core.R; import org.transdroid.core.R;
import org.transdroid.core.app.settings.ApplicationSettings; import org.transdroid.core.app.settings.ApplicationSettings;
import org.transdroid.core.app.settings.SettingsPersistence; import org.transdroid.core.app.settings.SettingsPersistence;
import org.transdroid.core.app.settings.SystemSettings;
import org.transdroid.core.gui.log.ErrorLogSender; import org.transdroid.core.gui.log.ErrorLogSender;
import org.transdroid.core.gui.navigation.DialogHelper; import org.transdroid.core.gui.navigation.DialogHelper;
import org.transdroid.core.gui.navigation.NavigationHelper; import org.transdroid.core.gui.navigation.NavigationHelper;
@ -77,12 +78,17 @@ public class SystemSettingsActivity extends SherlockPreferenceActivity {
addPreferencesFromResource(R.xml.pref_system); addPreferencesFromResource(R.xml.pref_system);
// Handle outgoing links and preference changes // Handle outgoing links and preference changes
findPreference("system_checkupdates").setOnPreferenceClickListener(onCheckUpdatesClick); if (SystemSettings.enableUpdateChecker(this)) {
findPreference("system_checkupdates").setOnPreferenceClickListener(onCheckUpdatesClick);
} else {
getPreferenceScreen().removePreference(findPreference("system_checkupdates"));
}
findPreference("system_sendlog").setOnPreferenceClickListener(onSendLogClick); findPreference("system_sendlog").setOnPreferenceClickListener(onSendLogClick);
findPreference("system_installhelp").setOnPreferenceClickListener(onInstallHelpClick); findPreference("system_installhelp").setOnPreferenceClickListener(onInstallHelpClick);
findPreference("system_changelog").setOnPreferenceClickListener(onChangeLogClick); findPreference("system_changelog").setOnPreferenceClickListener(onChangeLogClick);
findPreference("system_importsettings").setOnPreferenceClickListener(onImportSettingsClick); findPreference("system_importsettings").setOnPreferenceClickListener(onImportSettingsClick);
findPreference("system_exportsettings").setOnPreferenceClickListener(onExportSettingsClick); findPreference("system_exportsettings").setOnPreferenceClickListener(onExportSettingsClick);
findPreference("system_about").setTitle(getString(R.string.pref_about, getString(R.string.app_name)));
findPreference("system_about").setOnPreferenceClickListener(onAboutClick); findPreference("system_about").setOnPreferenceClickListener(onAboutClick);
} }
@ -165,7 +171,7 @@ public class SystemSettingsActivity extends SherlockPreferenceActivity {
// @formatter:off // @formatter:off
return new AlertDialog.Builder(this) return new AlertDialog.Builder(this)
.setMessage( .setMessage(
getString(R.string.pref_import_dialog, SettingsPersistence.DEFAULT_SETTINGS_FILE.toString())) getString(R.string.pref_import_dialog, getString(R.string.app_name), SettingsPersistence.DEFAULT_SETTINGS_FILE.toString()))
.setPositiveButton(android.R.string.ok, importSettings) .setPositiveButton(android.R.string.ok, importSettings)
.setNegativeButton(android.R.string.cancel, null).create(); .setNegativeButton(android.R.string.cancel, null).create();
// @formatter:on // @formatter:on
@ -173,7 +179,7 @@ public class SystemSettingsActivity extends SherlockPreferenceActivity {
// @formatter:off // @formatter:off
return new AlertDialog.Builder(this) return new AlertDialog.Builder(this)
.setMessage( .setMessage(
getString(R.string.pref_export_dialog, SettingsPersistence.DEFAULT_SETTINGS_FILE.toString())) getString(R.string.pref_export_dialog, getString(R.string.app_name), SettingsPersistence.DEFAULT_SETTINGS_FILE.toString()))
.setPositiveButton(android.R.string.ok, exportSettings) .setPositiveButton(android.R.string.ok, exportSettings)
.setNegativeButton(android.R.string.cancel, null).create(); .setNegativeButton(android.R.string.cancel, null).create();
// @formatter:on // @formatter:on
@ -193,7 +199,8 @@ public class SystemSettingsActivity extends SherlockPreferenceActivity {
Crouton.showText(SystemSettingsActivity.this, R.string.error_file_not_found, Crouton.showText(SystemSettingsActivity.this, R.string.error_file_not_found,
NavigationHelper.CROUTON_ERROR_STYLE); NavigationHelper.CROUTON_ERROR_STYLE);
} catch (JSONException e) { } catch (JSONException e) {
Crouton.showText(SystemSettingsActivity.this, R.string.error_no_valid_settings_file, Crouton.showText(SystemSettingsActivity.this,
getString(R.string.error_no_valid_settings_file, getString(R.string.app_name)),
NavigationHelper.CROUTON_ERROR_STYLE); NavigationHelper.CROUTON_ERROR_STYLE);
} }
} }

19
core/src/org/transdroid/core/service/AppUpdateService.java

@ -18,6 +18,8 @@ package org.transdroid.core.service;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.Calendar;
import java.util.Date;
import java.util.Random; import java.util.Random;
import org.androidannotations.annotations.Bean; import org.androidannotations.annotations.Bean;
@ -74,6 +76,15 @@ public class AppUpdateService extends IntentService {
return; return;
} }
Date lastChecked = systemSettings.getLastCheckedForAppUpdates();
Calendar lastDay = Calendar.getInstance();
lastDay.add(Calendar.DAY_OF_MONTH, -1);
if (lastChecked != null && lastChecked.after(lastDay.getTime())) {
Log.d(this, "Ship the update service, as we already checked the last 24 hours (or to be exact at "
+ lastChecked.toString() + ").");
return;
}
DefaultHttpClient httpclient = new DefaultHttpClient(); DefaultHttpClient httpclient = new DefaultHttpClient();
Random random = new Random(); Random random = new Random();
@ -88,6 +99,8 @@ public class AppUpdateService extends IntentService {
// New version of the app? // New version of the app?
try { try {
PackageInfo appPackage = getPackageManager().getPackageInfo(getPackageName(), 0); PackageInfo appPackage = getPackageManager().getPackageInfo(getPackageName(), 0);
Log.d(this, "Local Transdroid is at " + appPackage.versionCode + " and the reported latest version is "
+ appVersion);
if (appPackage.versionCode < appVersion) { if (appPackage.versionCode < appVersion) {
// New version available! Notify the user. // New version available! Notify the user.
newNotification(getString(R.string.update_app_newversion), newNotification(getString(R.string.update_app_newversion),
@ -102,6 +115,8 @@ public class AppUpdateService extends IntentService {
// New version of the search module? // New version of the search module?
try { try {
PackageInfo searchPackage = getPackageManager().getPackageInfo("org.transdroid.search", 0); PackageInfo searchPackage = getPackageManager().getPackageInfo("org.transdroid.search", 0);
Log.d(this, "Local Transdroid Seach is at " + searchPackage.versionCode
+ " and the reported latest version is " + searchVersion);
if (searchPackage.versionCode < searchVersion) { if (searchPackage.versionCode < searchVersion) {
// New version available! Notify the user. // New version available! Notify the user.
newNotification(getString(R.string.update_search_newversion), newNotification(getString(R.string.update_search_newversion),
@ -114,6 +129,10 @@ public class AppUpdateService extends IntentService {
// install it (when the first search is initiated) // install it (when the first search is initiated)
} }
// Save that we successfully checked for app updates (and notified the user)
// This prevents checking again for 1 day
systemSettings.setLastCheckedForAppUpdates(new Date());
} catch (Exception e) { } catch (Exception e) {
// Cannot check right now for some reason; log and ignore // Cannot check right now for some reason; log and ignore
Log.d(this, "Cannot retrieve latest app or search module version code from the site: " + e.toString()); Log.d(this, "Cannot retrieve latest app or search module version code from the site: " + e.toString());

2
core/src/org/transdroid/core/service/BootReceiver.java

@ -69,7 +69,7 @@ public class BootReceiver extends BroadcastReceiver {
public static void startAppUpdatesService(Context context) { public static void startAppUpdatesService(Context context) {
SystemSettings systemSettings = SystemSettings_.getInstance_(context); SystemSettings systemSettings = SystemSettings_.getInstance_(context);
AlarmManager alarms = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); AlarmManager alarms = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
if (systemSettings.checkForUpdates() && piAppUpdates == null) { if (SystemSettings.enableUpdateChecker(context) && systemSettings.checkForUpdates() && piAppUpdates == null) {
Log.d(context, "Boot signal received, starting app update checker service"); Log.d(context, "Boot signal received, starting app update checker service");
// Schedule a daily, with the first being (somewhat) in 1 second from now // Schedule a daily, with the first being (somewhat) in 1 second from now

7
external/ActionBar-PullToRefresh-actionbarsherlock/AndroidManifest.xml vendored

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="uk.co.senab.actionbarpulltorefresh.extras.actionbarsherlock">
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="18" />
<application />
</manifest>

25
external/ActionBar-PullToRefresh-actionbarsherlock/build.gradle vendored

@ -0,0 +1,25 @@
apply plugin: 'android-library'
dependencies {
compile project(':library')
compile "com.android.support:support-v4:[18.0,)"
compile ("com.actionbarsherlock:actionbarsherlock:[4.4,)@aar") {
// Need to specifically exclude this as it is specified in ActionBarSherlock pom
exclude group: 'com.google.android', module: 'support-v4'
}
}
android {
compileSdkVersion 18
buildToolsVersion '17.0.0'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
apply from: '../../maven_push.gradle'

92
external/ActionBar-PullToRefresh-actionbarsherlock/build.xml vendored

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="ActionBar-PullToRefresh-actionbarsherlock" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />
<!-- if sdk.dir was not set from one of the property file, then
get it from the ANDROID_HOME env var.
This must be done before we load project.properties since
the proguard config can use sdk.dir -->
<property environment="env" />
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
<isset property="env.ANDROID_HOME" />
</condition>
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
unless="sdk.dir"
/>
<!--
Import per project custom build rules if present at the root of the project.
This is the place to put custom intermediary targets such as:
-pre-build
-pre-compile
-post-compile (This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
-post-build
-pre-clean
-->
<import file="custom_rules.xml" optional="true" />
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>

3
external/ActionBar-PullToRefresh-actionbarsherlock/gradle.properties vendored

@ -0,0 +1,3 @@
POM_NAME=ActionBar-PullToRefresh Extras: ActionBarSherlock
POM_ARTIFACT_ID=extra-abs
POM_PACKAGING=aar

20
external/ActionBar-PullToRefresh-actionbarsherlock/proguard-project.txt vendored

@ -0,0 +1,20 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

17
external/ActionBar-PullToRefresh-actionbarsherlock/project.properties vendored

@ -0,0 +1,17 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-18
android.library=true
android.library.reference.1=../ActionBar-PullToRefresh
android.library.reference.2=../JakeWharton-ActionBarSherlock/library

22
external/ActionBar-PullToRefresh-actionbarsherlock/res/anim/fade_in.xml vendored

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_shortAnimTime"
android:fromAlpha="0.0"
android:toAlpha="1.0" />

22
external/ActionBar-PullToRefresh-actionbarsherlock/res/anim/fade_out.xml vendored

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_shortAnimTime"
android:fromAlpha="1.0"
android:toAlpha="0.0" />

187
external/ActionBar-PullToRefresh-actionbarsherlock/src/uk/co/senab/actionbarpulltorefresh/extras/actionbarsherlock/AbsDefaultHeaderTransformer.java vendored

@ -0,0 +1,187 @@
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.co.senab.actionbarpulltorefresh.extras.actionbarsherlock;
import android.app.Activity;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import uk.co.senab.actionbarpulltorefresh.library.DefaultHeaderTransformer;
public class AbsDefaultHeaderTransformer extends DefaultHeaderTransformer {
private Animation mHeaderInAnimation, mHeaderOutAnimation;
@Override
public void onViewCreated(Activity activity, View headerView) {
super.onViewCreated(activity, headerView);
// Create animations for use later
mHeaderInAnimation = AnimationUtils.loadAnimation(activity, R.anim.fade_in);
mHeaderOutAnimation = AnimationUtils.loadAnimation(activity, R.anim.fade_out);
if (mHeaderOutAnimation != null || mHeaderInAnimation != null) {
final AnimationCallback callback = new AnimationCallback();
if (mHeaderOutAnimation != null) {
mHeaderOutAnimation.setAnimationListener(callback);
}
}
}
@Override
protected Drawable getActionBarBackground(Context context) {
// Super handles ICS+ anyway...
if (Build.VERSION.SDK_INT >= super.getMinimumApiLevel()) {
return super.getActionBarBackground(context);
}
// Get action bar style values...
TypedArray abStyle = obtainStyledAttrsFromThemeAttr(context, R.attr.actionBarStyle,
R.styleable.SherlockActionBar);
try {
return abStyle.getDrawable(R.styleable.SherlockActionBar_background);
} finally {
abStyle.recycle();
}
}
@Override
protected int getActionBarSize(Context context) {
// Super handles ICS+ anyway...
if (Build.VERSION.SDK_INT >= super.getMinimumApiLevel()) {
return super.getActionBarSize(context);
}
TypedArray values = context.obtainStyledAttributes(R.styleable.SherlockTheme);
try {
return values.getDimensionPixelSize(R.styleable.SherlockTheme_actionBarSize, 0);
} finally {
values.recycle();
}
}
@Override
protected int getActionBarTitleStyle(Context context) {
// Super handles ICS+ anyway...
if (Build.VERSION.SDK_INT >= super.getMinimumApiLevel()) {
return super.getActionBarTitleStyle(context);
}
// Get action bar style values...
TypedArray abStyle = obtainStyledAttrsFromThemeAttr(context, R.attr.actionBarStyle,
R.styleable.SherlockActionBar);
try {
return abStyle.getResourceId(R.styleable.SherlockActionBar_titleTextStyle, 0);
} finally {
abStyle.recycle();
}
}
@Override
public boolean showHeaderView() {
// Super handles ICS+ anyway...
if (Build.VERSION.SDK_INT >= super.getMinimumApiLevel()) {
return super.showHeaderView();
}
final View headerView = getHeaderView();
final boolean changeVis = headerView != null && headerView.getVisibility() != View.VISIBLE;
if (changeVis) {
// Show Header
if (mHeaderInAnimation != null) {
// AnimationListener will call HeaderViewListener
headerView.startAnimation(mHeaderInAnimation);
}
headerView.setVisibility(View.VISIBLE);
}
return changeVis;
}
@Override
public boolean hideHeaderView() {
// Super handles ICS+ anyway...
if (Build.VERSION.SDK_INT >= super.getMinimumApiLevel()) {
return super.hideHeaderView();
}
final View headerView = getHeaderView();
final boolean changeVis = headerView != null && headerView.getVisibility() != View.GONE;
if (changeVis) {
// Hide Header
if (mHeaderOutAnimation != null) {
// AnimationListener will call HeaderTransformer and
// HeaderViewListener
headerView.startAnimation(mHeaderOutAnimation);
} else {
// As we're not animating, hide the header + call the header
// transformer now
headerView.setVisibility(View.GONE);
onReset();
}
}
return changeVis;
}
@Override
public void onRefreshMinimized() {
// Super handles ICS+ anyway...
if (Build.VERSION.SDK_INT >= super.getMinimumApiLevel()) {
super.onRefreshMinimized();
return;
}
// Here we fade out most of the header, leaving just the progress bar
View contentLayout = getHeaderView().findViewById(R.id.ptr_content);
if (contentLayout != null) {
contentLayout.startAnimation(AnimationUtils
.loadAnimation(contentLayout.getContext(), R.anim.fade_out));
contentLayout.setVisibility(View.INVISIBLE);
}
}
@Override
protected int getMinimumApiLevel() {
return Build.VERSION_CODES.ECLAIR_MR1;
}
class AnimationCallback implements Animation.AnimationListener {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
if (animation == mHeaderOutAnimation) {
View headerView = getHeaderView();
if (headerView != null) {
headerView.setVisibility(View.GONE);
}
onReset();
}
}
@Override
public void onAnimationRepeat(Animation animation) {
}
}
}

75
external/ActionBar-PullToRefresh-actionbarsherlock/src/uk/co/senab/actionbarpulltorefresh/extras/actionbarsherlock/PullToRefreshAttacher.java vendored

@ -0,0 +1,75 @@
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.co.senab.actionbarpulltorefresh.extras.actionbarsherlock;
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.app.SherlockExpandableListActivity;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.app.SherlockListActivity;
import com.actionbarsherlock.app.SherlockPreferenceActivity;
import android.app.Activity;
import android.content.Context;
public class PullToRefreshAttacher extends
uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher {
public static PullToRefreshAttacher get(Activity activity) {
return get(activity, new Options());
}
public static PullToRefreshAttacher get(Activity activity, Options options) {
return new PullToRefreshAttacher(activity, options);
}
protected PullToRefreshAttacher(Activity activity, Options options) {
super(activity, options);
}
@Override
protected EnvironmentDelegate createDefaultEnvironmentDelegate() {
return new AbsEnvironmentDelegate();
}
@Override
protected HeaderTransformer createDefaultHeaderTransformer() {
return new AbsDefaultHeaderTransformer();
}
public static class AbsEnvironmentDelegate extends EnvironmentDelegate {
/**
* @return Context which should be used for inflating the header layout
*/
public Context getContextForInflater(Activity activity) {
if (activity instanceof SherlockActivity) {
return ((SherlockActivity) activity).getSupportActionBar().getThemedContext();
} else if (activity instanceof SherlockListActivity) {
return ((SherlockListActivity) activity).getSupportActionBar().getThemedContext();
} else if (activity instanceof SherlockFragmentActivity) {
return ((SherlockFragmentActivity) activity).getSupportActionBar()
.getThemedContext();
} else if (activity instanceof SherlockExpandableListActivity) {
return ((SherlockExpandableListActivity) activity).getSupportActionBar()
.getThemedContext();
} else if (activity instanceof SherlockPreferenceActivity) {
return ((SherlockPreferenceActivity) activity).getSupportActionBar()
.getThemedContext();
}
return super.getContextForInflater(activity);
}
}
}

7
external/ActionBar-PullToRefresh/AndroidManifest.xml vendored

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="uk.co.senab.actionbarpulltorefresh.library">
<uses-sdk android:targetSdkVersion="18" />
<application />
</manifest>

16
external/ActionBar-PullToRefresh/build.gradle vendored

@ -0,0 +1,16 @@
apply plugin: 'android-library'
android {
compileSdkVersion 18
buildToolsVersion '17.0.0'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
apply from: '../maven_push.gradle'

92
external/ActionBar-PullToRefresh/build.xml vendored

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="ActionBar-PullToRefresh" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />
<!-- if sdk.dir was not set from one of the property file, then
get it from the ANDROID_HOME env var.
This must be done before we load project.properties since
the proguard config can use sdk.dir -->
<property environment="env" />
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
<isset property="env.ANDROID_HOME" />
</condition>
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
unless="sdk.dir"
/>
<!--
Import per project custom build rules if present at the root of the project.
This is the place to put custom intermediary targets such as:
-pre-build
-pre-compile
-post-compile (This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
-post-build
-pre-clean
-->
<import file="custom_rules.xml" optional="true" />
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>

3
external/ActionBar-PullToRefresh/gradle.properties vendored

@ -0,0 +1,3 @@
POM_NAME=ActionBar-PullToRefresh Library
POM_ARTIFACT_ID=library
POM_PACKAGING=aar

20
external/ActionBar-PullToRefresh/proguard-project.txt vendored

@ -0,0 +1,20 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

15
external/ActionBar-PullToRefresh/project.properties vendored

@ -0,0 +1,15 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-18
android.library=true

BIN
external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progress_primary_holo.9.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

BIN
external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progressbar_indeterminate_holo1.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

BIN
external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progressbar_indeterminate_holo2.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

BIN
external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progressbar_indeterminate_holo3.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

BIN
external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progressbar_indeterminate_holo4.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

BIN
external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progressbar_indeterminate_holo5.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

BIN
external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progressbar_indeterminate_holo6.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

BIN
external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progressbar_indeterminate_holo7.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

BIN
external/ActionBar-PullToRefresh/res/drawable-hdpi/ptr_progressbar_indeterminate_holo8.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

BIN
external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progress_primary_holo.9.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

BIN
external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progressbar_indeterminate_holo1.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

BIN
external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progressbar_indeterminate_holo2.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

BIN
external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progressbar_indeterminate_holo3.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

BIN
external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progressbar_indeterminate_holo4.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

BIN
external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progressbar_indeterminate_holo5.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

BIN
external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progressbar_indeterminate_holo6.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

BIN
external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progressbar_indeterminate_holo7.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

BIN
external/ActionBar-PullToRefresh/res/drawable-xhdpi/ptr_progressbar_indeterminate_holo8.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

27
external/ActionBar-PullToRefresh/res/drawable/ptr_progress_horizontal_holo_center.xml vendored

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/progress">
<scale
android:scaleWidth="100%"
android:scaleGravity="center"
android:drawable="@drawable/ptr_progress_primary_holo" />
</item>
</layer-list>

45
external/ActionBar-PullToRefresh/res/drawable/ptr_progress_indeterminate_horizontal_holo.xml vendored

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2011, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item
android:drawable="@drawable/ptr_progressbar_indeterminate_holo1"
android:duration="50" />
<item
android:drawable="@drawable/ptr_progressbar_indeterminate_holo2"
android:duration="50" />
<item
android:drawable="@drawable/ptr_progressbar_indeterminate_holo3"
android:duration="50" />
<item
android:drawable="@drawable/ptr_progressbar_indeterminate_holo4"
android:duration="50" />
<item
android:drawable="@drawable/ptr_progressbar_indeterminate_holo5"
android:duration="50" />
<item
android:drawable="@drawable/ptr_progressbar_indeterminate_holo6"
android:duration="50" />
<item
android:drawable="@drawable/ptr_progressbar_indeterminate_holo7"
android:duration="50" />
<item
android:drawable="@drawable/ptr_progressbar_indeterminate_holo8"
android:duration="50" />
</animation-list>

45
external/ActionBar-PullToRefresh/res/layout/default_header.xml vendored

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:id="@id/ptr_content"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="?android:attr/colorBackground">
<TextView
android:id="@id/ptr_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center" />
</FrameLayout>
<ProgressBar
android:id="@id/ptr_progress"
android:layout_height="wrap_content"
android:layout_width="match_parent"
style="@style/Widget.PullToRefresh.ProgressBar.Horizontal.Center" />
</LinearLayout>

21
external/ActionBar-PullToRefresh/res/values-ar/pull_refresh_strings.xml vendored

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">اسحب للتحديث…</string>
<string name="pull_to_refresh_release_label">اترك للتحديث…</string>
<string name="pull_to_refresh_refreshing_label">تحميل…</string>
</resources>

21
external/ActionBar-PullToRefresh/res/values-cs/pull_refresh_strings.xml vendored

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">Tažením aktualizujete…</string>
<string name="pull_to_refresh_release_label">Uvolněním aktualizujete…</string>
<string name="pull_to_refresh_refreshing_label">Načítání…</string>
</resources>

21
external/ActionBar-PullToRefresh/res/values-de/pull_refresh_strings.xml vendored

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">Ziehen zum Aktualisieren…</string>
<string name="pull_to_refresh_release_label">Loslassen zum Aktualisieren…</string>
<string name="pull_to_refresh_refreshing_label">Laden…</string>
</resources>

22
external/ActionBar-PullToRefresh/res/values-es/pull_refresh_strings.xml vendored

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">Desliza el dedo hacia abajo para actualizar.</string>
<string name="pull_to_refresh_release_label">Soltar para actualizar…</string>
<string name="pull_to_refresh_refreshing_label">Cargando…</string>
</resources>

21
external/ActionBar-PullToRefresh/res/values-fi/pull_refresh_strings.xml vendored

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">Päivitä vetämällä alas…</string>
<string name="pull_to_refresh_release_label">Päivitä vapauttamalla…</string>
<string name="pull_to_refresh_refreshing_label">Päivitetään…</string>
</resources>

21
external/ActionBar-PullToRefresh/res/values-fr/pull_refresh_strings.xml vendored

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">Tirez pour rafraîchir…</string>
<string name="pull_to_refresh_release_label">Relâcher pour rafraîchir…</string>
<string name="pull_to_refresh_refreshing_label">Chargement…</string>
</resources>

22
external/ActionBar-PullToRefresh/res/values-he/pull_refresh_strings.xml vendored

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">משוך לרענון…</string>
<string name="pull_to_refresh_release_label">שחרר לרענון…</string>
<string name="pull_to_refresh_refreshing_label">טוען…</string>
</resources>

21
external/ActionBar-PullToRefresh/res/values-it/pull_refresh_strings.xml vendored

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">Tira per aggiornare…</string>
<string name="pull_to_refresh_release_label">Rilascia per aggionare…</string>
<string name="pull_to_refresh_refreshing_label">Caricamento…</string>
</resources>

21
external/ActionBar-PullToRefresh/res/values-iw/pull_refresh_strings.xml vendored

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">משוך לרענון…</string>
<string name="pull_to_refresh_release_label">שחרר לרענון…</string>
<string name="pull_to_refresh_refreshing_label">טוען…</string>
</resources>

22
external/ActionBar-PullToRefresh/res/values-ja/pull_refresh_strings.xml vendored

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">画面を引っ張って…</string>
<string name="pull_to_refresh_release_label">指を離して更新…</string>
<string name="pull_to_refresh_refreshing_label">読み込み中…</string>
</resources>

22
external/ActionBar-PullToRefresh/res/values-ko/pull_refresh_strings.xml vendored

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">당겨서 새로 고침…</string>
<string name="pull_to_refresh_release_label">놓아서 새로 고침…</string>
<string name="pull_to_refresh_refreshing_label">로드 중…</string>
</resources>

21
external/ActionBar-PullToRefresh/res/values-nl/pull_refresh_strings.xml vendored

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">Sleep om te vernieuwen…</string>
<string name="pull_to_refresh_release_label">Loslaten om te vernieuwen…</string>
<string name="pull_to_refresh_refreshing_label">Laden…</string>
</resources>

21
external/ActionBar-PullToRefresh/res/values-pl/pull_refresh_strings.xml vendored

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">Pociągnij, aby odświeżyć…</string>
<string name="pull_to_refresh_release_label">Puść, aby odświeżyć…</string>
<string name="pull_to_refresh_refreshing_label">Wczytywanie…</string>
</resources>

22
external/ActionBar-PullToRefresh/res/values-pt-rBR/pull_refresh_strings.xml vendored

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">Puxe para atualizar…</string>
<string name="pull_to_refresh_release_label">Libere para atualizar…</string>
<string name="pull_to_refresh_refreshing_label">Carregando…</string>
</resources>

21
external/ActionBar-PullToRefresh/res/values-pt/pull_refresh_strings.xml vendored

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">Puxe para atualizar…</string>
<string name="pull_to_refresh_release_label">Liberação para atualizar…</string>
<string name="pull_to_refresh_refreshing_label">A carregar…</string>
</resources>

21
external/ActionBar-PullToRefresh/res/values-ro/pull_refresh_strings.xml vendored

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">Trage pentru a reîmprospăta…</string>
<string name="pull_to_refresh_release_label">Eliberează pentru a reîmprospăta…</string>
<string name="pull_to_refresh_refreshing_label">Încărcare…</string>
</resources>

21
external/ActionBar-PullToRefresh/res/values-ru/pull_refresh_strings.xml vendored

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">потяните</string>
<string name="pull_to_refresh_release_label">отпустите</string>
<string name="pull_to_refresh_refreshing_label">обновление</string>
</resources>

23
external/ActionBar-PullToRefresh/res/values-sv/pull_refresh_strings.xml vendored

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">Dra nedåt om du vill uppdatera</string>
<string name="pull_to_refresh_release_label">Släpp om du vill uppdatera</string>
<string name="pull_to_refresh_refreshing_label">Uppdaterar…</string>
</resources>

22
external/ActionBar-PullToRefresh/res/values-zh/pull_refresh_strings.xml vendored

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">下拉刷新…</string>
<string name="pull_to_refresh_release_label">放开以刷新…</string>
<string name="pull_to_refresh_refreshing_label">正在载入…</string>
</resources>

48
external/ActionBar-PullToRefresh/res/values/attrs.xml vendored

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<!-- The attribute to set in your Application/Activity theme to reference your custom theme -->
<attr name="ptrHeaderStyle" format="reference" />
<declare-styleable name="PullToRefreshHeader">
<!-- A drawable to use as the background of the Header View -->
<attr name="ptrHeaderBackground" format="reference|color" />
<!-- The height of the Header View -->
<attr name="ptrHeaderHeight" format="reference|dimension" />
<!-- The Text Appearance of the Header View's Title text -->
<attr name="ptrHeaderTitleTextAppearance" format="reference" />
<!-- The color that the Progress Bar should be tinted with -->
<attr name="ptrProgressBarColor" format="reference|color" />
<!-- Text to show to prompt the user is pull (or keep pulling) -->
<attr name="ptrPullText" format="reference|string" />
<!-- Text to show to tell the user that a refresh is currently in progress -->
<attr name="ptrRefreshingText" format="reference|string" />
<!-- Text to show to tell the user has scrolled enough to refresh -->
<attr name="ptrReleaseText" format="reference|string" />
</declare-styleable>
</resources>

24
external/ActionBar-PullToRefresh/res/values/ids.xml vendored

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<item type="id" name="ptr_content" />
<item type="id" name="ptr_text" />
<item type="id" name="ptr_progress" />
</resources>

23
external/ActionBar-PullToRefresh/res/values/pull_refresh_strings.xml vendored

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="pull_to_refresh_pull_label">Pull to refresh…</string>
<string name="pull_to_refresh_release_label">Release to refresh…</string>
<string name="pull_to_refresh_refreshing_label">Loading…</string>
</resources>

29
external/ActionBar-PullToRefresh/res/values/styles.xml vendored

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2013 Chris Banes
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<style name="Widget.PullToRefresh.ProgressBar.Horizontal.Center"
parent="android:Widget.ProgressBar.Horizontal">
<item name="android:progressDrawable">@drawable/ptr_progress_horizontal_holo_center</item>
<item name="android:indeterminateDrawable">
@drawable/ptr_progress_indeterminate_horizontal_holo
</item>
<item name="android:minHeight">4dip</item>
<item name="android:maxHeight">4dip</item>
</style>
</resources>

397
external/ActionBar-PullToRefresh/src/uk/co/senab/actionbarpulltorefresh/library/DefaultHeaderTransformer.java vendored

@ -0,0 +1,397 @@
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.co.senab.actionbarpulltorefresh.library;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.graphics.PixelFormat;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Interpolator;
import android.widget.ProgressBar;
import android.widget.TextView;
import uk.co.senab.actionbarpulltorefresh.library.platform.SDK11;
/**
* Default Header Transformer.
*/
public class DefaultHeaderTransformer extends PullToRefreshAttacher.HeaderTransformer {
private View mHeaderView;
private ViewGroup mContentLayout;
private TextView mHeaderTextView;
private ProgressBar mHeaderProgressBar;
private CharSequence mPullRefreshLabel, mRefreshingLabel, mReleaseLabel;
private boolean mUseCustomProgressColor = false;
private int mProgressDrawableColor;
private long mAnimationDuration;
private final Interpolator mInterpolator = new AccelerateInterpolator();
protected DefaultHeaderTransformer() {
final int min = getMinimumApiLevel();
if (Build.VERSION.SDK_INT < min) {
throw new IllegalStateException("This HeaderTransformer is designed to run on SDK "
+ min
+ "+. If using ActionBarSherlock or ActionBarCompat you should use the appropriate provided extra.");
}
}
@Override
public void onViewCreated(Activity activity, View headerView) {
mHeaderView = headerView;
// Get ProgressBar and TextView
mHeaderProgressBar = (ProgressBar) headerView.findViewById(R.id.ptr_progress);
mHeaderTextView = (TextView) headerView.findViewById(R.id.ptr_text);
mContentLayout = (ViewGroup) headerView.findViewById(R.id.ptr_content);
// Default Labels to display
mPullRefreshLabel = activity.getString(R.string.pull_to_refresh_pull_label);
mRefreshingLabel = activity.getString(R.string.pull_to_refresh_refreshing_label);
mReleaseLabel = activity.getString(R.string.pull_to_refresh_release_label);
mAnimationDuration = activity.getResources()
.getInteger(android.R.integer.config_shortAnimTime);
// Setup the View styles
setupViewsFromStyles(activity, headerView);
// Apply any custom ProgressBar colors
applyProgressBarColor();
// FIXME: I do not like this call here
onReset();
}
@Override
public void onConfigurationChanged(Activity activity, Configuration newConfig) {
setupViewsFromStyles(activity, getHeaderView());
}
@Override
public void onReset() {
// Reset Progress Bar
if (mHeaderProgressBar != null) {
mHeaderProgressBar.setVisibility(View.GONE);
mHeaderProgressBar.setProgress(0);
mHeaderProgressBar.setIndeterminate(false);
}
// Reset Text View
if (mHeaderTextView != null) {
mHeaderTextView.setVisibility(View.VISIBLE);
mHeaderTextView.setText(mPullRefreshLabel);
}
// Reset the Content Layout
if (mContentLayout != null) {
mContentLayout.setVisibility(View.VISIBLE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
SDK11.setAlpha(mContentLayout, 1f);
}
}
}
@Override
public void onPulled(float percentagePulled) {
if (mHeaderProgressBar != null) {
mHeaderProgressBar.setVisibility(View.VISIBLE);
final float progress = mInterpolator.getInterpolation(percentagePulled);
mHeaderProgressBar.setProgress(Math.round(mHeaderProgressBar.getMax() * progress));
}
}
@Override
public void onRefreshStarted() {
if (mHeaderTextView != null) {
mHeaderTextView.setText(mRefreshingLabel);
}
if (mHeaderProgressBar != null) {
mHeaderProgressBar.setVisibility(View.VISIBLE);
mHeaderProgressBar.setIndeterminate(true);
}
}
@Override
public void onReleaseToRefresh() {
if (mHeaderTextView != null) {
mHeaderTextView.setText(mReleaseLabel);
}
if (mHeaderProgressBar != null) {
mHeaderProgressBar.setProgress(mHeaderProgressBar.getMax());
}
}
@Override
public void onRefreshMinimized() {
// Here we fade out most of the header, leaving just the progress bar
if (mContentLayout != null) {
ObjectAnimator.ofFloat(mContentLayout, "alpha", 1f, 0f).start();
}
}
public View getHeaderView() {
return mHeaderView;
}
@Override
public boolean showHeaderView() {
final boolean changeVis = mHeaderView.getVisibility() != View.VISIBLE;
if (changeVis) {
mHeaderView.setVisibility(View.VISIBLE);
AnimatorSet animSet = new AnimatorSet();
ObjectAnimator transAnim = ObjectAnimator.ofFloat(mContentLayout, "translationY",
-mContentLayout.getHeight(), 0f);
ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(mHeaderView, "alpha", 0f, 1f);
animSet.playTogether(transAnim, alphaAnim);
animSet.setDuration(mAnimationDuration);
animSet.start();
}
return changeVis;
}
@Override
public boolean hideHeaderView() {
final boolean changeVis = mHeaderView.getVisibility() != View.GONE;
if (changeVis) {
Animator animator;
if (mContentLayout.getAlpha() >= 0.5f) {
// If the content layout is showing, translate and fade out
animator = new AnimatorSet();
ObjectAnimator transAnim = ObjectAnimator.ofFloat(mContentLayout, "translationY",
0f, -mContentLayout.getHeight());
ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(mHeaderView, "alpha", 1f, 0f);
((AnimatorSet) animator).playTogether(transAnim, alphaAnim);
} else {
// If the content layout isn't showing (minimized), just fade out
animator = ObjectAnimator.ofFloat(mHeaderView, "alpha", 1f, 0f);
}
animator.setDuration(mAnimationDuration);
animator.addListener(new HideAnimationCallback());
animator.start();
}
return changeVis;
}
/**
* Set color to apply to the progress bar. Automatically enables usage of the custom color. Use
* {@link #setProgressBarColorEnabled(boolean)} to disable and re-enable the custom color usage.
* <p/>
* The best way to apply a color is to load the color from resources: {@code
* setProgressBarColor(getResources().getColor(R.color.your_color_name))}.
*
* @param color The color to use.
*/
public void setProgressBarColor(int color) {
mProgressDrawableColor = color;
setProgressBarColorEnabled(true);
}
/**
* Enable or disable the use of a custom progress bar color. You can set what color to use with
* {@link #setProgressBarColor(int)}, which also automatically enables custom color usage.
*/
public void setProgressBarColorEnabled(boolean enabled) {
mUseCustomProgressColor = enabled;
applyProgressBarColor();
}
/**
* Set Text to show to prompt the user is pull (or keep pulling).
*
* @param pullText - Text to display.
*/
public void setPullText(CharSequence pullText) {
mPullRefreshLabel = pullText;
if (mHeaderTextView != null) {
mHeaderTextView.setText(mPullRefreshLabel);
}
}
/**
* Set Text to show to tell the user that a refresh is currently in progress.
*
* @param refreshingText - Text to display.
*/
public void setRefreshingText(CharSequence refreshingText) {
mRefreshingLabel = refreshingText;
}
/**
* Set Text to show to tell the user has scrolled enough to refresh.
*
* @param releaseText - Text to display.
*/
public void setReleaseText(CharSequence releaseText) {
mReleaseLabel = releaseText;
}
private void setupViewsFromStyles(Activity activity, View headerView) {
final TypedArray styleAttrs = obtainStyledAttrsFromThemeAttr(activity,
R.attr.ptrHeaderStyle, R.styleable.PullToRefreshHeader);
// Retrieve the Action Bar size from the app theme or the Action Bar's style
if (mContentLayout != null) {
final int height = styleAttrs
.getDimensionPixelSize(R.styleable.PullToRefreshHeader_ptrHeaderHeight,
getActionBarSize(activity));
mContentLayout.getLayoutParams().height = height;
mContentLayout.requestLayout();
}
// Retrieve the Action Bar background from the app theme or the Action Bar's style (see #93)
Drawable bg = styleAttrs.hasValue(R.styleable.PullToRefreshHeader_ptrHeaderBackground)
? styleAttrs.getDrawable(R.styleable.PullToRefreshHeader_ptrHeaderBackground)
: getActionBarBackground(activity);
if (bg != null) {
mHeaderTextView.setBackgroundDrawable(bg);
// If we have an opaque background we can remove the background from the content layout
if (mContentLayout != null && bg.getOpacity() == PixelFormat.OPAQUE) {
mContentLayout.setBackgroundResource(0);
}
}
// Retrieve the Action Bar Title Style from the app theme or the Action Bar's style
Context abContext = headerView.getContext();
final int titleTextStyle = styleAttrs
.getResourceId(R.styleable.PullToRefreshHeader_ptrHeaderTitleTextAppearance,
getActionBarTitleStyle(abContext));
if (titleTextStyle != 0) {
mHeaderTextView.setTextAppearance(abContext, titleTextStyle);
}
// Retrieve the Progress Bar Color the style
if (styleAttrs.hasValue(R.styleable.PullToRefreshHeader_ptrProgressBarColor)) {
mUseCustomProgressColor = true;
mProgressDrawableColor = styleAttrs
.getColor(R.styleable.PullToRefreshHeader_ptrProgressBarColor, 0);
}
// Retrieve the text strings from the style (if they're set)
if (styleAttrs.hasValue(R.styleable.PullToRefreshHeader_ptrPullText)) {
mPullRefreshLabel = styleAttrs.getString(R.styleable.PullToRefreshHeader_ptrPullText);
}
if (styleAttrs.hasValue(R.styleable.PullToRefreshHeader_ptrRefreshingText)) {
mRefreshingLabel = styleAttrs
.getString(R.styleable.PullToRefreshHeader_ptrRefreshingText);
}
if (styleAttrs.hasValue(R.styleable.PullToRefreshHeader_ptrReleaseText)) {
mReleaseLabel = styleAttrs.getString(R.styleable.PullToRefreshHeader_ptrReleaseText);
}
styleAttrs.recycle();
}
private void applyProgressBarColor() {
if (mHeaderProgressBar != null) {
if (mUseCustomProgressColor) {
mHeaderProgressBar.getProgressDrawable()
.setColorFilter(mProgressDrawableColor, PorterDuff.Mode.SRC_ATOP);
mHeaderProgressBar.getIndeterminateDrawable()
.setColorFilter(mProgressDrawableColor, PorterDuff.Mode.SRC_ATOP);
} else {
mHeaderProgressBar.getProgressDrawable().clearColorFilter();
mHeaderProgressBar.getIndeterminateDrawable().clearColorFilter();
}
}
}
protected Drawable getActionBarBackground(Context context) {
int[] android_styleable_ActionBar = {android.R.attr.background};
// Now get the action bar style values...
TypedArray abStyle = obtainStyledAttrsFromThemeAttr(context, android.R.attr.actionBarStyle,
android_styleable_ActionBar);
try {
// background is the first attr in the array above so it's index is 0.
return abStyle.getDrawable(0);
} finally {
abStyle.recycle();
}
}
protected int getActionBarSize(Context context) {
int[] attrs = {android.R.attr.actionBarSize};
TypedArray values = context.getTheme().obtainStyledAttributes(attrs);
try {
return values.getDimensionPixelSize(0, 0);
} finally {
values.recycle();
}
}
protected int getActionBarTitleStyle(Context context) {
int[] android_styleable_ActionBar = {android.R.attr.titleTextStyle};
// Now get the action bar style values...
TypedArray abStyle = obtainStyledAttrsFromThemeAttr(context, android.R.attr.actionBarStyle,
android_styleable_ActionBar);
try {
// titleTextStyle is the first attr in the array above so it's index is 0.
return abStyle.getResourceId(0, 0);
} finally {
abStyle.recycle();
}
}
protected int getMinimumApiLevel() {
return Build.VERSION_CODES.ICE_CREAM_SANDWICH;
}
class HideAnimationCallback extends AnimatorListenerAdapter {
@Override
public void onAnimationEnd(Animator animation) {
View headerView = getHeaderView();
if (headerView != null) {
headerView.setVisibility(View.GONE);
}
onReset();
}
}
protected static TypedArray obtainStyledAttrsFromThemeAttr(Context context, int themeAttr,
int[] styleAttrs) {
// Need to get resource id of style pointed to from the theme attr
TypedValue outValue = new TypedValue();
context.getTheme().resolveAttribute(themeAttr, outValue, true);
final int styleResId = outValue.resourceId;
// Now return the values (from styleAttrs) from the style
return context.obtainStyledAttributes(styleResId, styleAttrs);
}
}

91
external/ActionBar-PullToRefresh/src/uk/co/senab/actionbarpulltorefresh/library/InstanceCreationUtils.java vendored

@ -0,0 +1,91 @@
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.co.senab.actionbarpulltorefresh.library;
import android.content.Context;
import android.util.Log;
import android.view.View;
import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import uk.co.senab.actionbarpulltorefresh.library.viewdelegates.AbsListViewDelegate;
import uk.co.senab.actionbarpulltorefresh.library.viewdelegates.ScrollYDelegate;
import uk.co.senab.actionbarpulltorefresh.library.viewdelegates.WebViewDelegate;
class InstanceCreationUtils {
private static final String LOG_TAG = "InstanceCreationUtils";
private static final Class<?>[] VIEW_DELEGATE_CONSTRUCTOR_SIGNATURE = new Class[]{};
private static final Class<?>[] TRANSFORMER_CONSTRUCTOR_SIGNATURE = new Class[]{};
private static final HashMap<Class, Class> BUILT_IN_DELEGATES;
static {
BUILT_IN_DELEGATES = new HashMap<Class, Class>();
BUILT_IN_DELEGATES.put(AbsListViewDelegate.SUPPORTED_VIEW_CLASS, AbsListViewDelegate.class);
BUILT_IN_DELEGATES.put(WebViewDelegate.SUPPORTED_VIEW_CLASS, WebViewDelegate.class);
}
static PullToRefreshAttacher.ViewDelegate getBuiltInViewDelegate(final View view) {
final Set<Map.Entry<Class, Class>> entries = BUILT_IN_DELEGATES.entrySet();
for (final Map.Entry<Class, Class> entry : entries) {
if (entry.getKey().isInstance(view)) {
return InstanceCreationUtils.newInstance(view.getContext(),
entry.getValue(), VIEW_DELEGATE_CONSTRUCTOR_SIGNATURE, null);
}
}
// Default is the ScrollYDelegate
return InstanceCreationUtils.newInstance(view.getContext(),
ScrollYDelegate.class, VIEW_DELEGATE_CONSTRUCTOR_SIGNATURE, null);
}
static <T> T instantiateViewDelegate(Context context, String className, Object[] arguments) {
try {
Class<?> clazz = context.getClassLoader().loadClass(className);
return newInstance(context, clazz, VIEW_DELEGATE_CONSTRUCTOR_SIGNATURE, arguments);
} catch (Exception e) {
Log.w(LOG_TAG, "Cannot instantiate class: " + className, e);
}
return null;
}
static <T> T instantiateTransformer(Context context, String className, Object[] arguments) {
try {
Class<?> clazz = context.getClassLoader().loadClass(className);
return newInstance(context, clazz, TRANSFORMER_CONSTRUCTOR_SIGNATURE, arguments);
} catch (Exception e) {
Log.w(LOG_TAG, "Cannot instantiate class: " + className, e);
}
return null;
}
private static <T> T newInstance(Context context, Class clazz, Class[] constructorSig,
Object[] arguments) {
try {
Constructor<?> constructor = clazz.getConstructor(constructorSig);
return (T) constructor.newInstance(arguments);
} catch (Exception e) {
Log.w(LOG_TAG, "Cannot instantiate class: " + clazz.getName(), e);
}
return null;
}
}

948
external/ActionBar-PullToRefresh/src/uk/co/senab/actionbarpulltorefresh/library/PullToRefreshAttacher.java vendored

@ -0,0 +1,948 @@
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.co.senab.actionbarpulltorefresh.library;
import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.Build;
import android.os.Handler;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import java.util.Set;
import java.util.WeakHashMap;
/**
* FIXME
*/
public class PullToRefreshAttacher implements View.OnTouchListener {
/* Default configuration values */
private static final int DEFAULT_HEADER_LAYOUT = R.layout.default_header;
private static final float DEFAULT_REFRESH_SCROLL_DISTANCE = 0.5f;
private static final boolean DEFAULT_REFRESH_ON_UP = false;
private static final int DEFAULT_REFRESH_MINIMIZED_DELAY = 1 * 1000;
private static final boolean DEFAULT_REFRESH_MINIMIZE = true;
private static final boolean DEBUG = false;
private static final String LOG_TAG = "PullToRefreshAttacher";
/* Member Variables */
private final EnvironmentDelegate mEnvironmentDelegate;
private final HeaderTransformer mHeaderTransformer;
private final Activity mActivity;
private final View mHeaderView;
private HeaderViewListener mHeaderViewListener;
private final int mTouchSlop;
private final float mRefreshScrollDistance;
private int mInitialMotionY, mLastMotionY, mPullBeginY;
private boolean mIsBeingDragged, mIsRefreshing, mHandlingTouchEventFromDown;
private final WeakHashMap<View, ViewParams> mRefreshableViews;
private boolean mEnabled = true;
private final boolean mRefreshOnUp;
private final int mRefreshMinimizeDelay;
private final boolean mRefreshMinimize;
private final Handler mHandler = new Handler();
/**
* Get a PullToRefreshAttacher for this Activity. If there is already a
* PullToRefreshAttacher attached to the Activity, the existing one is
* returned, otherwise a new instance is created. This version of the method
* will use default configuration options for everything.
*
* @param activity
* Activity to attach to.
* @return PullToRefresh attached to the Activity.
*/
public static PullToRefreshAttacher get(Activity activity) {
return get(activity, new Options());
}
/**
* Get a PullToRefreshAttacher for this Activity. If there is already a
* PullToRefreshAttacher attached to the Activity, the existing one is
* returned, otherwise a new instance is created.
*
* @param activity
* Activity to attach to.
* @param options
* Options used when creating the PullToRefreshAttacher.
* @return PullToRefresh attached to the Activity.
*/
public static PullToRefreshAttacher get(Activity activity, Options options) {
return new PullToRefreshAttacher(activity, options);
}
protected PullToRefreshAttacher(Activity activity, Options options) {
if (options == null) {
Log.i(LOG_TAG, "Given null options so using default options.");
options = new Options();
}
mActivity = activity;
mRefreshableViews = new WeakHashMap<View, ViewParams>();
// Copy necessary values from options
mRefreshScrollDistance = options.refreshScrollDistance;
mRefreshOnUp = options.refreshOnUp;
mRefreshMinimizeDelay = options.refreshMinimizeDelay;
mRefreshMinimize = options.refreshMinimize;
// EnvironmentDelegate
mEnvironmentDelegate = options.environmentDelegate != null ? options.environmentDelegate
: createDefaultEnvironmentDelegate();
// Header Transformer
mHeaderTransformer = options.headerTransformer != null ? options.headerTransformer
: createDefaultHeaderTransformer();
// Get touch slop for use later
mTouchSlop = ViewConfiguration.get(activity).getScaledTouchSlop();
// Get Window Decor View
final ViewGroup decorView = (ViewGroup) activity.getWindow()
.getDecorView();
// Check to see if there is already a Attacher view installed
if (decorView.getChildCount() == 1
&& decorView.getChildAt(0) instanceof DecorChildLayout) {
throw new IllegalStateException(
"You should only create one PullToRefreshAttacher per Activity");
}
// Create Header view and then add to Decor View
mHeaderView = LayoutInflater.from(
mEnvironmentDelegate.getContextForInflater(activity)).inflate(
options.headerLayout, decorView, false);
if (mHeaderView == null) {
throw new IllegalArgumentException(
"Must supply valid layout id for header.");
}
// Make Header View invisible so it still gets a layout pass
mHeaderView.setVisibility(View.INVISIBLE);
// Create DecorChildLayout which will move all of the system's decor
// view's children + the
// Header View to itself. See DecorChildLayout for more info.
DecorChildLayout decorContents = new DecorChildLayout(activity,
decorView, mHeaderView);
// Now add the DecorChildLayout to the decor view
decorView.addView(decorContents, ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
// Notify transformer
mHeaderTransformer.onViewCreated(activity, mHeaderView);
// TODO Remove the follow deprecated method call before v1.0
mHeaderTransformer.onViewCreated(mHeaderView);
}
/**
* Add a view which will be used to initiate refresh requests and a listener
* to be invoked when a refresh is started. This version of the method will
* try to find a handler for the view from the built-in view delegates.
*
* @param view
* View which will be used to initiate refresh requests.
* @param refreshListener
* Listener to be invoked when a refresh is started.
*/
public void addRefreshableView(View view, OnRefreshListener refreshListener) {
addRefreshableView(view, null, refreshListener);
}
/**
* Add a view which will be used to initiate refresh requests, along with a
* delegate which knows how to handle the given view, and a listener to be
* invoked when a refresh is started.
*
* @param view
* View which will be used to initiate refresh requests.
* @param viewDelegate
* delegate which knows how to handle <code>view</code>.
* @param refreshListener
* Listener to be invoked when a refresh is started.
*/
public void addRefreshableView(View view, ViewDelegate viewDelegate,
OnRefreshListener refreshListener) {
addRefreshableView(view, viewDelegate, refreshListener, true);
}
/**
* Add a view which will be used to initiate refresh requests, along with a
* delegate which knows how to handle the given view, and a listener to be
* invoked when a refresh is started.
*
* @param view
* View which will be used to initiate refresh requests.
* @param viewDelegate
* delegate which knows how to handle <code>view</code>.
* @param refreshListener
* Listener to be invoked when a refresh is started.
* @param setTouchListener
* Whether to set this as the
* {@link android.view.View.OnTouchListener}.
*/
void addRefreshableView(View view, ViewDelegate viewDelegate,
OnRefreshListener refreshListener, final boolean setTouchListener) {
// Check to see if view is null
if (view == null) {
Log.i(LOG_TAG, "Refreshable View is null.");
return;
}
if (refreshListener == null) {
throw new IllegalArgumentException(
"OnRefreshListener not given. Please provide one.");
}
// ViewDelegate
if (viewDelegate == null) {
viewDelegate = InstanceCreationUtils.getBuiltInViewDelegate(view);
if (viewDelegate == null) {
throw new IllegalArgumentException(
"No view handler found. Please provide one.");
}
}
// View to detect refreshes for
mRefreshableViews.put(view, new ViewParams(viewDelegate, refreshListener));
if (setTouchListener) {
view.setOnTouchListener(this);
}
}
/**
* Remove a view which was previously used to initiate refresh requests.
*
* @param view
* - View which will be used to initiate refresh requests.
*/
public void removeRefreshableView(View view) {
if (mRefreshableViews.containsKey(view)) {
mRefreshableViews.remove(view);
view.setOnTouchListener(null);
}
}
/**
* Clear all views which were previously used to initiate refresh requests.
*/
public void clearRefreshableViews() {
Set<View> views = mRefreshableViews.keySet();
for (View view : views) {
view.setOnTouchListener(null);
}
mRefreshableViews.clear();
}
/**
* This method should be called by your Activity's or Fragment's
* onConfigurationChanged method.
*
* @param newConfig The new configuration
*/
public void onConfigurationChanged(Configuration newConfig) {
mHeaderTransformer.onConfigurationChanged(mActivity, newConfig);
}
/**
* Manually set this Attacher's refreshing state. The header will be
* displayed or hidden as requested.
*
* @param refreshing
* - Whether the attacher should be in a refreshing state,
*/
public final void setRefreshing(boolean refreshing) {
setRefreshingInt(null, refreshing, false);
}
/**
* @return true if this Attacher is currently in a refreshing state.
*/
public final boolean isRefreshing() {
return mIsRefreshing;
}
/**
* @return true if this PullToRefresh is currently enabled (defaults to
* <code>true</code>)
*/
public boolean isEnabled() {
return mEnabled;
}
/**
* Allows the enable/disable of this PullToRefreshAttacher. If disabled when
* refreshing then the UI is automatically reset.
*
* @param enabled
* - Whether this PullToRefreshAttacher is enabled.
*/
public void setEnabled(boolean enabled) {
mEnabled = enabled;
if (!enabled) {
// If we're not enabled, reset any touch handling
resetTouch();
// If we're currently refreshing, reset the ptr UI
if (mIsRefreshing) {
reset(false);
}
}
}
/**
* Call this when your refresh is complete and this view should reset itself
* (header view will be hidden).
*
* This is the equivalent of calling <code>setRefreshing(false)</code>.
*/
public final void setRefreshComplete() {
setRefreshingInt(null, false, false);
}
/**
* Set a {@link HeaderViewListener} which is called when the visibility
* state of the Header View has changed.
*
* @param listener
*/
public final void setHeaderViewListener(HeaderViewListener listener) {
mHeaderViewListener = listener;
}
/**
* @return The Header View which is displayed when the user is pulling, or
* we are refreshing.
*/
public final View getHeaderView() {
return mHeaderView;
}
/**
* @return The HeaderTransformer currently used by this Attacher.
*/
public HeaderTransformer getHeaderTransformer() {
return mHeaderTransformer;
}
@Override
public final boolean onTouch(final View view, final MotionEvent event) {
// Just call onTouchEvent. It now handles the proper calling of onInterceptTouchEvent
onTouchEvent(view, event);
// Always return false as we only want to observe events
return false;
}
final boolean onInterceptTouchEvent(View view, MotionEvent event) {
if (DEBUG) {
Log.d(LOG_TAG, "onInterceptTouchEvent: " + event.toString());
}
// If we're not enabled or currently refreshing don't handle any touch
// events
if (!isEnabled() || isRefreshing()) {
return false;
}
final ViewParams params = mRefreshableViews.get(view);
if (params == null) {
return false;
}
if (DEBUG) Log.d(LOG_TAG, "onInterceptTouchEvent. Got ViewParams. " + view.toString());
switch (event.getAction()) {
case MotionEvent.ACTION_MOVE: {
// We're not currently being dragged so check to see if the user has
// scrolled enough
if (!mIsBeingDragged && mInitialMotionY > 0) {
final int y = (int) event.getY();
final int yDiff = y - mInitialMotionY;
if (yDiff > mTouchSlop) {
mIsBeingDragged = true;
onPullStarted(y);
} else if (yDiff < -mTouchSlop) {
resetTouch();
}
}
break;
}
case MotionEvent.ACTION_DOWN: {
// If we're already refreshing, ignore
if (canRefresh(true, params.onRefreshListener)
&& params.viewDelegate.isReadyForPull(view, event.getX(), event.getY())) {
mInitialMotionY = (int) event.getY();
}
break;
}
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP: {
resetTouch();
break;
}
}
if (DEBUG) Log.d(LOG_TAG, "onInterceptTouchEvent. Returning " + mIsBeingDragged);
return mIsBeingDragged;
}
final boolean onTouchEvent(View view, MotionEvent event) {
if (DEBUG) {
Log.d(LOG_TAG, "onTouchEvent: " + event.toString());
}
// If we're not enabled or currently refreshing don't handle any touch
// events
if (!isEnabled()) {
return false;
}
final ViewParams params = mRefreshableViews.get(view);
if (params == null) {
Log.i(LOG_TAG, "View does not have ViewParams");
return false;
}
// Record whether our handling is started from ACTION_DOWN
if (event.getAction() == MotionEvent.ACTION_DOWN) {
mHandlingTouchEventFromDown = true;
}
// If we're being called from ACTION_DOWN then we must call through to
// onInterceptTouchEvent until it sets mIsBeingDragged
if (mHandlingTouchEventFromDown && !mIsBeingDragged) {
onInterceptTouchEvent(view, event);
return true;
}
switch (event.getAction()) {
case MotionEvent.ACTION_MOVE: {
// If we're already refreshing ignore it
if (isRefreshing()) {
return false;
}
final int y = (int) event.getY();
if (mIsBeingDragged && y != mLastMotionY) {
final int yDx = y - mLastMotionY;
/**
* Check to see if the user is scrolling the right direction
* (down). We allow a small scroll up which is the check against
* negative touch slop.
*/
if (yDx >= -mTouchSlop) {
onPull(view, y);
// Only record the y motion if the user has scrolled down.
if (yDx > 0) {
mLastMotionY = y;
}
} else {
onPullEnded();
resetTouch();
}
}
break;
}
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP: {
checkScrollForRefresh(view);
if (mIsBeingDragged) {
onPullEnded();
}
resetTouch();
break;
}
}
return true;
}
void resetTouch() {
mIsBeingDragged = false;
mHandlingTouchEventFromDown = false;
mInitialMotionY = mLastMotionY = mPullBeginY = -1;
}
void onPullStarted(int y) {
if (DEBUG) {
Log.d(LOG_TAG, "onPullStarted");
}
showHeaderView();
mPullBeginY = y;
}
void onPull(View view, int y) {
if (DEBUG) {
Log.d(LOG_TAG, "onPull");
}
final float pxScrollForRefresh = getScrollNeededForRefresh(view);
final int scrollLength = y - mPullBeginY;
if (scrollLength < pxScrollForRefresh) {
mHeaderTransformer.onPulled(scrollLength / pxScrollForRefresh);
} else {
if (mRefreshOnUp) {
mHeaderTransformer.onReleaseToRefresh();
} else {
setRefreshingInt(view, true, true);
}
}
}
void onPullEnded() {
if (DEBUG) {
Log.d(LOG_TAG, "onPullEnded");
}
if (!mIsRefreshing) {
reset(true);
}
}
void showHeaderView() {
if (mHeaderTransformer.showHeaderView()) {
if (mHeaderViewListener != null) {
mHeaderViewListener.onStateChanged(mHeaderView,
HeaderViewListener.STATE_VISIBLE);
}
}
}
void hideHeaderView() {
if (mHeaderTransformer.hideHeaderView()) {
if (mHeaderViewListener != null) {
mHeaderViewListener.onStateChanged(mHeaderView,
HeaderViewListener.STATE_HIDDEN);
}
}
}
protected EnvironmentDelegate createDefaultEnvironmentDelegate() {
return new EnvironmentDelegate();
}
protected HeaderTransformer createDefaultHeaderTransformer() {
return new DefaultHeaderTransformer();
}
private boolean checkScrollForRefresh(View view) {
if (mIsBeingDragged && mRefreshOnUp && view != null) {
if (mLastMotionY - mPullBeginY >= getScrollNeededForRefresh(view)) {
setRefreshingInt(view, true, true);
return true;
}
}
return false;
}
private void setRefreshingInt(View view, boolean refreshing, boolean fromTouch) {
if (DEBUG) {
Log.d(LOG_TAG, "setRefreshingInt: " + refreshing);
}
// Check to see if we need to do anything
if (mIsRefreshing == refreshing) {
return;
}
resetTouch();
if (refreshing && canRefresh(fromTouch, getRefreshListenerForView(view))) {
startRefresh(view, fromTouch);
} else {
reset(fromTouch);
}
}
private OnRefreshListener getRefreshListenerForView(View view) {
if (view != null) {
ViewParams params = mRefreshableViews.get(view);
if (params != null) {
return params.onRefreshListener;
}
}
return null;
}
/**
* @param fromTouch
* - Whether this is being invoked from a touch event
* @return true if we're currently in a state where a refresh can be
* started.
*/
private boolean canRefresh(boolean fromTouch, OnRefreshListener listener) {
return !mIsRefreshing && (!fromTouch || listener != null);
}
private float getScrollNeededForRefresh(View view) {
return view.getHeight() * mRefreshScrollDistance;
}
private void reset(boolean fromTouch) {
// Update isRefreshing state
mIsRefreshing = false;
// Remove any minimize callbacks
if (mRefreshMinimize) {
mHandler.removeCallbacks(mRefreshMinimizeRunnable);
}
// Hide Header View
hideHeaderView();
}
private void startRefresh(View view, boolean fromTouch) {
// Update isRefreshing state
mIsRefreshing = true;
// Call OnRefreshListener if this call has originated from a touch event
if (fromTouch) {
OnRefreshListener listener = getRefreshListenerForView(view);
if (listener != null) {
listener.onRefreshStarted(view);
}
}
// Call Transformer
mHeaderTransformer.onRefreshStarted();
// Show Header View
showHeaderView();
// Post a runnable to minimize the refresh header
if (mRefreshMinimize) {
if (mRefreshMinimizeDelay > 0) {
mHandler.postDelayed(mRefreshMinimizeRunnable, mRefreshMinimizeDelay);
} else {
mHandler.post(mRefreshMinimizeRunnable);
}
}
}
/**
* Simple Listener to listen for any callbacks to Refresh.
*/
public interface OnRefreshListener {
/**
* Called when the user has initiated a refresh by pulling.
*
* @param view
* - View which the user has started the refresh from.
*/
public void onRefreshStarted(View view);
}
public interface HeaderViewListener {
/**
* The state when the header view is completely visible.
*/
public static int STATE_VISIBLE = 0;
/**
* The state when the header view is minimized. By default this means
* that the progress bar is still visible, but the rest of the view is
* hidden, showing the Action Bar behind.
* <p/>
* This will not be called in header minimization is disabled.
*/
public static int STATE_MINIMIZED = 1;
/**
* The state when the header view is completely hidden.
*/
public static int STATE_HIDDEN = 2;
/**
* Called when the visibility state of the Header View has changed.
*
* @param headerView
* HeaderView who's state has changed.
* @param state
* The new state. One of {@link #STATE_VISIBLE},
* {@link #STATE_MINIMIZED} and {@link #STATE_HIDDEN}
*/
public void onStateChanged(View headerView, int state);
}
/**
* HeaderTransformers are what controls and update the Header View to reflect the current state
* of the pull-to-refresh interaction. They are responsible for showing and hiding the header
* view, as well as update the state.
*/
public static abstract class HeaderTransformer {
/**
* Called whether the header view has been inflated from the resources
* defined in {@link Options#headerLayout}.
*
* @param activity The {@link Activity} that the header view is attached to.
* @param headerView The inflated header view.
*/
public void onViewCreated(Activity activity, View headerView) {}
/**
* @deprecated This will be removed before v1.0. Override
* {@link #onViewCreated(android.app.Activity, android.view.View)} instead.
*/
public void onViewCreated(View headerView) {}
/**
* Called when the header should be reset. You should update any child
* views to reflect this.
* <p/>
* You should <strong>not</strong> change the visibility of the header
* view.
*/
public void onReset() {}
/**
* Called the user has pulled on the scrollable view.
*
* @param percentagePulled value between 0.0f and 1.0f depending on how far the
* user has pulled.
*/
public void onPulled(float percentagePulled) {}
/**
* Called when a refresh has begun. Theoretically this call is similar
* to that provided from {@link OnRefreshListener} but is more suitable
* for header view updates.
*/
public void onRefreshStarted() {}
/**
* Called when a refresh can be initiated when the user ends the touch
* event. This is only called when {@link Options#refreshOnUp} is set to
* true.
*/
public void onReleaseToRefresh() {}
/**
* Called when the current refresh has taken longer than the time
* specified in {@link Options#refreshMinimizeDelay}.
*/
public void onRefreshMinimized() {}
/**
* Called when the Header View should be made visible, usually with an animation.
*
* @return true if the visibility has changed.
*/
public abstract boolean showHeaderView();
/**
* Called when the Header View should be made invisible, usually with an animation.
*
* @return true if the visibility has changed.
*/
public abstract boolean hideHeaderView();
/**
* Called when the Activity's configuration has changed.
*
* @param activity The {@link Activity} that the header view is attached to.
* @param newConfig New configuration.
*
* @see android.app.Activity#onConfigurationChanged(android.content.res.Configuration)
*/
public void onConfigurationChanged(Activity activity, Configuration newConfig) {}
}
/**
* ViewDelegates are what are used to de-couple the Attacher from the different types of
* scrollable views.
*/
public static abstract class ViewDelegate {
/**
* Allows you to provide support for View which do not have built-in
* support. In this method you should cast <code>view</code> to it's
* native class, and check if it is scrolled to the top.
*
* @param view
* The view which has should be checked against.
* @param x The X co-ordinate of the touch event
* @param y The Y co-ordinate of the touch event
* @return true if <code>view</code> is scrolled to the top.
*/
public abstract boolean isReadyForPull(View view, float x, float y);
}
/**
* This is used to provide platform and environment specific functionality for the Attacher.
*/
public static class EnvironmentDelegate {
/**
* @return Context which should be used for inflating the header layout
*/
public Context getContextForInflater(Activity activity) {
if (Build.VERSION.SDK_INT >= 14) {
return activity.getActionBar().getThemedContext();
} else {
return activity;
}
}
}
/**
* Allows you to specify a number of configuration options when instantiating a
* {@link PullToRefreshAttacher}. Used with {@link #get(Activity, Options) get()}.
*/
public static class Options {
/**
* EnvironmentDelegate instance which will be used. If null, we will
* create an instance of the default class.
*/
public EnvironmentDelegate environmentDelegate = null;
/**
* The layout resource ID which should be inflated to be displayed above
* the Action Bar
*/
public int headerLayout = DEFAULT_HEADER_LAYOUT;
/**
* The header transformer to be used to transfer the header view. If
* null, an instance of {@link DefaultHeaderTransformer} will be used.
*/
public HeaderTransformer headerTransformer = null;
/**
* The percentage of the refreshable view that needs to be scrolled
* before a refresh is initiated.
*/
public float refreshScrollDistance = DEFAULT_REFRESH_SCROLL_DISTANCE;
/**
* Whether a refresh should only be initiated when the user has finished
* the touch event.
*/
public boolean refreshOnUp = DEFAULT_REFRESH_ON_UP;
/**
* The delay after a refresh is started in which the header should be
* 'minimized'. By default, most of the header is faded out, leaving
* only the progress bar signifying that a refresh is taking place.
*/
public int refreshMinimizeDelay = DEFAULT_REFRESH_MINIMIZED_DELAY;
/**
* Enable or disable the header 'minimization', which by default means that the majority of
* the header is hidden, leaving only the progress bar still showing.
* <p/>
* If set to true, the header will be minimized after the delay set in
* {@link #refreshMinimizeDelay}. If set to false then the whole header will be displayed
* until the refresh is finished.
*/
public boolean refreshMinimize = DEFAULT_REFRESH_MINIMIZE;
}
/**
* This class allows us to insert a layer in between the system decor view
* and the actual decor. (e.g. Action Bar views). This is needed so we can
* receive a call to fitSystemWindows(Rect) so we can adjust the header view
* to fit the system windows too.
*/
final static class DecorChildLayout extends FrameLayout {
private final ViewGroup mHeaderViewWrapper;
DecorChildLayout(Context context, ViewGroup systemDecorView,
View headerView) {
super(context);
// Move all children from decor view to here
for (int i = 0, z = systemDecorView.getChildCount(); i < z; i++) {
View child = systemDecorView.getChildAt(i);
systemDecorView.removeView(child);
addView(child);
}
/**
* Wrap the Header View in a FrameLayout and add it to this view. It
* is wrapped so any inset changes do not affect the actual header
* view.
*/
mHeaderViewWrapper = new FrameLayout(context);
mHeaderViewWrapper.addView(headerView);
addView(mHeaderViewWrapper, ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
}
@Override
protected boolean fitSystemWindows(Rect insets) {
if (DEBUG) {
Log.d(LOG_TAG, "fitSystemWindows: " + insets.toString());
}
// Adjust the Header View's padding to take the insets into account
mHeaderViewWrapper.setPadding(insets.left, insets.top,
insets.right, insets.bottom);
// Call return super so that the rest of the
return super.fitSystemWindows(insets);
}
}
private static final class ViewParams {
final OnRefreshListener onRefreshListener;
final ViewDelegate viewDelegate;
ViewParams(ViewDelegate _viewDelegate,
OnRefreshListener _onRefreshListener) {
onRefreshListener = _onRefreshListener;
viewDelegate = _viewDelegate;
}
}
private final Runnable mRefreshMinimizeRunnable = new Runnable() {
@Override
public void run() {
mHeaderTransformer.onRefreshMinimized();
if (mHeaderViewListener != null) {
mHeaderViewListener.onStateChanged(mHeaderView,
HeaderViewListener.STATE_MINIMIZED);
}
}
};
}

133
external/ActionBar-PullToRefresh/src/uk/co/senab/actionbarpulltorefresh/library/PullToRefreshLayout.java vendored

@ -0,0 +1,133 @@
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.co.senab.actionbarpulltorefresh.library;
import android.content.Context;
import android.content.res.Configuration;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
/**
* FIXME
*/
public class PullToRefreshLayout extends FrameLayout {
private static final boolean DEBUG = false;
private static final String LOG_TAG = "PullToRefreshLayout";
private PullToRefreshAttacher mPullToRefreshAttacher;
private View mCurrentTouchTarget;
public PullToRefreshLayout(Context context) {
this(context, null);
}
public PullToRefreshLayout(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public PullToRefreshLayout(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
/**
* Set the {@link PullToRefreshAttacher} to be used with this layout. The view which is added
* to this layout will automatically be added as a refreshable-view in the attacher.
*/
public void setPullToRefreshAttacher(PullToRefreshAttacher attacher,
PullToRefreshAttacher.OnRefreshListener refreshListener) {
View view;
for (int i = 0, z = getChildCount(); i < z; i++) {
view = getChildAt(i);
if (mPullToRefreshAttacher != null) {
mPullToRefreshAttacher.removeRefreshableView(view);
}
if (attacher != null) {
if (DEBUG) Log.d(LOG_TAG, "Adding View to Attacher: " + view);
attacher.addRefreshableView(view, null, refreshListener, false);
}
}
mPullToRefreshAttacher = attacher;
}
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
if (DEBUG) Log.d(LOG_TAG, "onInterceptTouchEvent. " + event.toString());
if (mPullToRefreshAttacher != null && getChildCount() > 0) {
View target = getChildForTouchEvent(event);
if (target != null && mPullToRefreshAttacher.onInterceptTouchEvent(target, event)) {
mCurrentTouchTarget = target;
return true;
}
}
// Reset Current Touch Target
mCurrentTouchTarget = null;
return false;
}
@Override
public boolean onTouchEvent(MotionEvent event) {
if (DEBUG) Log.d(LOG_TAG, "onTouchEvent. " + event.toString());
if (mPullToRefreshAttacher != null) {
// This is an edge-case. If the ViewGroup does not contain a valid touch target then
// Android calls onTouchEvent after onInterceptTouchEvent with ACTION_DOWN event.
// If that happens then we need to find the visible view and pass it to the attacher as
// usual.
if (mCurrentTouchTarget == null && event.getAction() == MotionEvent.ACTION_DOWN) {
mCurrentTouchTarget = getChildForTouchEvent(event);
}
if (mCurrentTouchTarget != null) {
return mPullToRefreshAttacher.onTouchEvent(mCurrentTouchTarget, event);
}
}
// Reset Current Touch Target
mCurrentTouchTarget = null;
return super.onTouchEvent(event);
}
@Override
protected void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (mPullToRefreshAttacher != null) {
mPullToRefreshAttacher.onConfigurationChanged(newConfig);
}
}
private View getChildForTouchEvent(MotionEvent event) {
final float x = event.getX(), y = event.getY();
View child;
for (int z = getChildCount() - 1; z >= 0 ; z--) {
child = getChildAt(z);
if (child.isShown() && x >= child.getLeft() && x <= child.getRight()
&& y >= child.getTop() && y <= child.getBottom()) {
if (DEBUG) Log.d(LOG_TAG, "Got Child for Touch Event: " + child);
return child;
}
}
return null;
}
}

27
external/ActionBar-PullToRefresh/src/uk/co/senab/actionbarpulltorefresh/library/platform/SDK11.java vendored

@ -0,0 +1,27 @@
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.co.senab.actionbarpulltorefresh.library.platform;
import android.view.View;
public class SDK11 {
public static void setAlpha(View view, float alpha) {
view.setAlpha(alpha);
}
}

93
external/ActionBar-PullToRefresh/src/uk/co/senab/actionbarpulltorefresh/library/viewdelegates/AbsListViewDelegate.java vendored

@ -0,0 +1,93 @@
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.co.senab.actionbarpulltorefresh.library.viewdelegates;
import android.annotation.TargetApi;
import android.os.Build;
import android.view.View;
import android.widget.AbsListView;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher;
/**
* FIXME
*/
public class AbsListViewDelegate
extends PullToRefreshAttacher.ViewDelegate {
public static final Class SUPPORTED_VIEW_CLASS = AbsListView.class;
@Override
public boolean isReadyForPull(View view, final float x, final float y) {
boolean ready = false;
// First we check whether we're scrolled to the top
AbsListView absListView = (AbsListView) view;
if (absListView.getCount() == 0) {
ready = true;
} else if (absListView.getFirstVisiblePosition() == 0) {
final View firstVisibleChild = absListView.getChildAt(0);
ready = firstVisibleChild != null && firstVisibleChild.getTop() >= 0;
}
// Then we have to check whether the fas scroller is enabled, and check we're not starting
// the gesture from the scroller
if (ready && absListView.isFastScrollEnabled() && isFastScrollAlwaysVisible(absListView)) {
switch (getVerticalScrollbarPosition(absListView)) {
case View.SCROLLBAR_POSITION_RIGHT:
ready = x < absListView.getRight() - absListView.getVerticalScrollbarWidth();
break;
case View.SCROLLBAR_POSITION_LEFT:
ready = x > absListView.getVerticalScrollbarWidth();
break;
}
}
return ready;
}
int getVerticalScrollbarPosition(AbsListView absListView) {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB ?
CompatV11.getVerticalScrollbarPosition(absListView) :
Compat.getVerticalScrollbarPosition(absListView);
}
boolean isFastScrollAlwaysVisible(AbsListView absListView) {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB ?
CompatV11.isFastScrollAlwaysVisible(absListView) :
Compat.isFastScrollAlwaysVisible(absListView);
}
static class Compat {
static int getVerticalScrollbarPosition(AbsListView absListView) {
return View.SCROLLBAR_POSITION_RIGHT;
}
static boolean isFastScrollAlwaysVisible(AbsListView absListView) {
return false;
}
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
static class CompatV11 {
static int getVerticalScrollbarPosition(AbsListView absListView) {
return absListView.getVerticalScrollbarPosition();
}
static boolean isFastScrollAlwaysVisible(AbsListView absListView) {
return absListView.isFastScrollAlwaysVisible();
}
}
}

32
external/ActionBar-PullToRefresh/src/uk/co/senab/actionbarpulltorefresh/library/viewdelegates/ScrollYDelegate.java vendored

@ -0,0 +1,32 @@
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.co.senab.actionbarpulltorefresh.library.viewdelegates;
import android.view.View;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher;
/**
* FIXME
*/
public class ScrollYDelegate extends PullToRefreshAttacher.ViewDelegate {
@Override
public boolean isReadyForPull(View view, float x, float y) {
return view.getScrollY() <= 0;
}
}

35
external/ActionBar-PullToRefresh/src/uk/co/senab/actionbarpulltorefresh/library/viewdelegates/WebViewDelegate.java vendored

@ -0,0 +1,35 @@
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.co.senab.actionbarpulltorefresh.library.viewdelegates;
import android.view.View;
import android.webkit.WebView;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher;
/**
* FIXME
*/
public class WebViewDelegate extends PullToRefreshAttacher.ViewDelegate {
public static final Class SUPPORTED_VIEW_CLASS = WebView.class;
@Override
public boolean isReadyForPull(View view, float x, float y) {
return view.getScrollY() <= 0;
}
}

2
external/ColorPickerPreference/build.xml vendored

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project name="ColorPickerPreference" default="help"> <project name="ActionBar-PullToRefresh" default="help">
<!-- The local.properties file is created and updated by the 'android' tool. <!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into It contains the path to the SDK. It should *NOT* be checked into

6
full/AndroidManifest.xml

@ -17,8 +17,8 @@
--> -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.transdroid.full" package="org.transdroid.full"
android:versionCode="6" android:versionCode="7"
android:versionName="2.0" > android:versionName="2.0.1" >
<uses-sdk <uses-sdk
android:minSdkVersion="7" android:minSdkVersion="7"
@ -46,7 +46,7 @@
android:allowBackup="true" android:allowBackup="true"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher" android:icon="@drawable/ic_launcher"
android:label="@string/system_name" android:label="@string/app_name"
android:theme="@style/Theme.Sherlock" > android:theme="@style/Theme.Sherlock" >
<!-- Main activities --> <!-- Main activities -->

12
lite/AndroidManifest.xml

@ -17,8 +17,8 @@
--> -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.transdroid.lite" package="org.transdroid.lite"
android:versionCode="6" android:versionCode="7"
android:versionName="2.0" > android:versionName="2.0.1" >
<uses-sdk <uses-sdk
android:minSdkVersion="7" android:minSdkVersion="7"
@ -46,7 +46,7 @@
android:allowBackup="true" android:allowBackup="true"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher" android:icon="@drawable/ic_launcher"
android:label="@string/system_name" android:label="@string/app_name"
android:theme="@style/Theme.Sherlock" > android:theme="@style/Theme.Sherlock" >
<!-- Main activities --> <!-- Main activities -->
@ -62,9 +62,6 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<intent-filter> <intent-filter>
<action android:name="org.transdroid.ADD_MULTIPLE" /> <action android:name="org.transdroid.ADD_MULTIPLE" />
@ -181,15 +178,12 @@
<!-- Settings screens --> <!-- Settings screens -->
<activity android:name="org.transdroid.core.gui.settings.MainSettingsActivity_" /> <activity android:name="org.transdroid.core.gui.settings.MainSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.settings.ServerSettingsActivity_" /> <activity android:name="org.transdroid.core.gui.settings.ServerSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.settings.WebsearchSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.settings.RssfeedSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.settings.NotificationSettingsActivity_" /> <activity android:name="org.transdroid.core.gui.settings.NotificationSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.settings.SystemSettingsActivity_" /> <activity android:name="org.transdroid.core.gui.settings.SystemSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.navigation.DialogHelper_" /> <activity android:name="org.transdroid.core.gui.navigation.DialogHelper_" />
<!-- Background service --> <!-- Background service -->
<service android:name="org.transdroid.core.service.ServerCheckerService_" /> <service android:name="org.transdroid.core.service.ServerCheckerService_" />
<service android:name="org.transdroid.core.service.RssCheckerService_" />
<service android:name="org.transdroid.core.service.AppUpdateService_" /> <service android:name="org.transdroid.core.service.AppUpdateService_" />
<receiver android:name="org.transdroid.core.service.AlarmReceiver_" /> <receiver android:name="org.transdroid.core.service.AlarmReceiver_" />

2
lite/ant.properties

@ -0,0 +1,2 @@
key.store=/home/eric/Dev/erickok.keystore
key.alias=transdroid

92
lite/build.xml

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="Transdrone" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />
<!-- if sdk.dir was not set from one of the property file, then
get it from the ANDROID_HOME env var.
This must be done before we load project.properties since
the proguard config can use sdk.dir -->
<property environment="env" />
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
<isset property="env.ANDROID_HOME" />
</condition>
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
unless="sdk.dir"
/>
<!--
Import per project custom build rules if present at the root of the project.
This is the place to put custom intermediary targets such as:
-pre-build
-pre-compile
-post-compile (This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
-post-build
-pre-clean
-->
<import file="custom_rules.xml" optional="true" />
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>

2
lite/res/values/strings.xml

@ -16,6 +16,6 @@
--> -->
<resources> <resources>
<string name="app_name" translatable="false">Transdroid Lite</string> <string name="app_name" translatable="false">Transdrone</string>
</resources> </resources>

Loading…
Cancel
Save