Browse Source

Pushed minimum Andorid version to ICS (API level 15). Removed ActionBarSherlock and related resources. Fixes #68!. Also fixes other bugs with (mostly) the contextual action bar.

pull/148/merge
Eric Kok 11 years ago
parent
commit
8600fe8a97
  1. 8
      README.md
  2. 6
      core/AndroidManifest.xml
  3. 10
      core/project.properties
  4. BIN
      core/res/drawable-hdpi-v11/ic_stat_notification.png
  5. BIN
      core/res/drawable-hdpi/abc_list_focused_holo.9.png
  6. 0
      core/res/drawable-hdpi/abc_list_longpressed_holo.9.png
  7. 0
      core/res/drawable-hdpi/abc_list_pressed_holo_dark.9.png
  8. 0
      core/res/drawable-hdpi/abc_list_pressed_holo_light.9.png
  9. 0
      core/res/drawable-hdpi/abc_list_selector_disabled_holo_dark.9.png
  10. 0
      core/res/drawable-hdpi/abc_list_selector_disabled_holo_light.9.png
  11. BIN
      core/res/drawable-hdpi/ic_stat_notification.png
  12. BIN
      core/res/drawable-mdpi-v11/ic_stat_notification.png
  13. BIN
      core/res/drawable-mdpi/abc_list_focused_holo.9.png
  14. 0
      core/res/drawable-mdpi/abc_list_longpressed_holo.9.png
  15. 0
      core/res/drawable-mdpi/abc_list_pressed_holo_dark.9.png
  16. 0
      core/res/drawable-mdpi/abc_list_pressed_holo_light.9.png
  17. 0
      core/res/drawable-mdpi/abc_list_selector_disabled_holo_dark.9.png
  18. 0
      core/res/drawable-mdpi/abc_list_selector_disabled_holo_light.9.png
  19. BIN
      core/res/drawable-mdpi/ic_stat_notification.png
  20. BIN
      core/res/drawable-xhdpi-v11/ic_stat_notification.png
  21. BIN
      core/res/drawable-xhdpi/abc_list_focused_holo.9.png
  22. 0
      core/res/drawable-xhdpi/abc_list_longpressed_holo.9.png
  23. 0
      core/res/drawable-xhdpi/abc_list_pressed_holo_dark.9.png
  24. 0
      core/res/drawable-xhdpi/abc_list_pressed_holo_light.9.png
  25. 0
      core/res/drawable-xhdpi/abc_list_selector_disabled_holo_dark.9.png
  26. 0
      core/res/drawable-xhdpi/abc_list_selector_disabled_holo_light.9.png
  27. BIN
      core/res/drawable-xhdpi/ic_stat_notification.png
  28. BIN
      core/res/drawable-xxhdpi-v11/ic_stat_notification.png
  29. BIN
      core/res/drawable-xxhdpi/ic_stat_notification.png
  30. 4
      core/res/drawable/abc_list_selector_background_transition_holo_dark.xml
  31. 4
      core/res/drawable/abc_list_selector_background_transition_holo_light.xml
  32. 10
      core/res/drawable/selectable_background_holo_light.xml
  33. 2
      core/res/layout-w600dp/activity_search.xml
  34. 2
      core/res/layout-w600dp/activity_torrents.xml
  35. 2
      core/res/layout-w900dp/activity_torrents.xml
  36. 0
      core/res/layout/actionbar_donebutton.xml
  37. 2
      core/res/layout/actionbar_searchsite.xml
  38. 2
      core/res/layout/actionbar_serverstatus.xml
  39. 0
      core/res/layout/activity_widgetconfig.xml
  40. 2
      core/res/layout/fragment_details.xml
  41. 2
      core/res/layout/fragment_filters.xml
  42. 2
      core/res/layout/fragment_rssfeeds.xml
  43. 2
      core/res/layout/fragment_rssitems.xml
  44. 2
      core/res/layout/fragment_searchresults.xml
  45. 4
      core/res/layout/fragment_torrents.xml
  46. 0
      core/res/layout/list_item_widget_dark.xml
  47. 0
      core/res/layout/list_item_widget_light.xml
  48. 2
      core/res/layout/pref_withoverflow.xml
  49. 0
      core/res/layout/widget_torrents_dark.xml
  50. 0
      core/res/layout/widget_torrents_light.xml
  51. 23
      core/res/values-v11/bools.xml
  52. 67
      core/res/values-v11/styles_transdroid_dark.xml
  53. 42
      core/res/values-v11/styles_transdroid_light.xml
  54. 21
      core/res/values-v14/dimens.xml
  55. 70
      core/res/values-v14/styles_transdroid_dark.xml
  56. 44
      core/res/values-v14/styles_transdroid_light.xml
  57. 10
      core/res/values-v16/styles.xml
  58. 2
      core/res/values/bools.xml
  59. 2
      core/res/values/strings.xml
  60. 14
      core/res/values/styles.xml
  61. 35
      core/res/values/styles_transdroid_dark.xml
  62. 42
      core/res/values/styles_transdroid_light.xml
  63. 346
      core/src/com/actionbarsherlock/view/SherlockListView.java
  64. 13
      core/src/org/transdroid/core/gui/DetailsActivity.java
  65. 24
      core/src/org/transdroid/core/gui/DetailsFragment.java
  66. 4
      core/src/org/transdroid/core/gui/FilterEntryDialog.java
  67. 2
      core/src/org/transdroid/core/gui/ServerStatusView.java
  68. 58
      core/src/org/transdroid/core/gui/TorrentsActivity.java
  69. 32
      core/src/org/transdroid/core/gui/TorrentsFragment.java
  70. 4
      core/src/org/transdroid/core/gui/lists/NoProgressHeaderTransformer.java
  71. 14
      core/src/org/transdroid/core/gui/navigation/DialogHelper.java
  72. 4
      core/src/org/transdroid/core/gui/navigation/NavigationHelper.java
  73. 11
      core/src/org/transdroid/core/gui/navigation/SelectionManagerMode.java
  74. 2
      core/src/org/transdroid/core/gui/navigation/SetLabelDialog.java
  75. 2
      core/src/org/transdroid/core/gui/navigation/SetStorageLocationDialog.java
  76. 2
      core/src/org/transdroid/core/gui/navigation/SetTrackersDialog.java
  77. 2
      core/src/org/transdroid/core/gui/navigation/SetTransferRatesDialog.java
  78. 12
      core/src/org/transdroid/core/gui/rss/RssfeedsActivity.java
  79. 15
      core/src/org/transdroid/core/gui/rss/RssfeedsFragment.java
  80. 11
      core/src/org/transdroid/core/gui/rss/RssitemsActivity.java
  81. 22
      core/src/org/transdroid/core/gui/rss/RssitemsFragment.java
  82. 11
      core/src/org/transdroid/core/gui/search/BarcodeHelper.java
  83. 9
      core/src/org/transdroid/core/gui/search/FilePickerHelper.java
  84. 38
      core/src/org/transdroid/core/gui/search/SearchActivity.java
  85. 20
      core/src/org/transdroid/core/gui/search/SearchResultsFragment.java
  86. 4
      core/src/org/transdroid/core/gui/search/UrlEntryDialog.java
  87. 7
      core/src/org/transdroid/core/gui/settings/HelpSettingsActivity.java
  88. 5
      core/src/org/transdroid/core/gui/settings/KeyBoundPreferencesActivity.java
  89. 7
      core/src/org/transdroid/core/gui/settings/MainSettingsActivity.java
  90. 7
      core/src/org/transdroid/core/gui/settings/NotificationSettingsActivity.java
  91. 2
      core/src/org/transdroid/core/gui/settings/OverflowPreference.java
  92. 2
      core/src/org/transdroid/core/gui/settings/RssfeedSettingsActivity.java
  93. 2
      core/src/org/transdroid/core/gui/settings/ServerSettingsActivity.java
  94. 8
      core/src/org/transdroid/core/gui/settings/SystemSettingsActivity.java
  95. 2
      core/src/org/transdroid/core/gui/settings/WebsearchSettingsActivity.java
  96. 2
      core/src/org/transdroid/core/seedbox/SeedstuffSettingsActivity.java
  97. 2
      core/src/org/transdroid/core/seedbox/XirvikDediSettingsActivity.java
  98. 2
      core/src/org/transdroid/core/seedbox/XirvikSemiSettingsActivity.java
  99. 2
      core/src/org/transdroid/core/seedbox/XirvikSharedSettingsActivity.java
  100. 9
      core/src/org/transdroid/core/service/AppUpdateService.java
  101. Some files were not shown because too many files have changed in this diff Show More

8
README.md

@ -21,7 +21,7 @@ Please respect the coding standards for easier merging. master contains the curr
Code structure Code structure
============== ==============
Transdroid is currently developed in Eclipse, against Android 4.3 (API level 18). To support lite and full version of the app, the core UI is contained in a separate Android library project. The torrent client adapters are also in a seperate project, called Transdroid Connect, but this is a classic Java project. If the Connect project is updated, a fresh .jar needs to be exported to core/libs/transdroid.jar. In order to do so, run ant within the lib/ directory. Transdroid is currently developed in Eclipse, against Android 4.4 (API level 19) and since version 2.2.0 supporting ICS (API level 15) and up. To support lite and full version of the app, the core UI is contained in a separate Android library project. The torrent client adapters are also in a seperate project, called Transdroid Connect, but this is a classic Java project. If the Connect project is updated, a fresh .jar needs to be exported to core/libs/transdroid.jar. In order to do so, run ant (without parameters) within the lib/ directory.
* core - Contains the core Android library project with UI, services, resources, etc. * core - Contains the core Android library project with UI, services, resources, etc.
* full - Full app version (website release) through AndroidManifest.xml configuration * full - Full app version (website release) through AndroidManifest.xml configuration
@ -54,9 +54,6 @@ License
Some code/libraries/resources are used in the project: Some code/libraries/resources are used in the project:
* [ActionBarSherlock](http://actionbarsherlock.com/)
Jake Wharton
Apache License, Version 2.0
* [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
@ -85,9 +82,6 @@ Some code/libraries/resources are used in the project:
* [android-ColorPickerPreference](https://github.com/attenzione/android-ColorPickerPreference) * [android-ColorPickerPreference](https://github.com/attenzione/android-ColorPickerPreference)
Daniel Nilsson and Sergey Margaritov Daniel Nilsson and Sergey Margaritov
Apache License, Version 2.0 Apache License, Version 2.0
* [CheckableRelativeLayout](http://www.marvinlabs.com/2010/10/custom-listview-ability-check-items/)
Cédric Caron (MarvinLabs)
Public Domain
* [Funnel icon](http://thenounproject.com/noun/funnel/#icon-No5608) * [Funnel icon](http://thenounproject.com/noun/funnel/#icon-No5608)
Naomi Atkinson from The Noun Project Naomi Atkinson from The Noun Project
Creative Commons Attribution 3.0 Creative Commons Attribution 3.0

6
core/AndroidManifest.xml

@ -17,11 +17,11 @@
--> -->
<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="213" android:versionCode="214"
android:versionName="2.1.4" > android:versionName="2.2.0" >
<uses-sdk <uses-sdk
android:minSdkVersion="7" android:minSdkVersion="15"
android:targetSdkVersion="19" /> android:targetSdkVersion="19" />
</manifest> </manifest>

10
core/project.properties

@ -11,10 +11,8 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target. # Project target.
target=android-18 target=android-19
android.library.reference.1=../external/JakeWharton-ActionBarSherlock/library android.library.reference.1=../external/ColorPickerPreference
android.library.reference.2=../external/ColorPickerPreference android.library.reference.2=../external/Crouton/library
android.library=true android.library=true
android.library.reference.3=../external/Crouton/library android.library.reference.3=../external/ActionBar-PullToRefresh
android.library.reference.4=../external/ActionBar-PullToRefresh-actionbarsherlock
android.library.reference.5=../external/ActionBar-PullToRefresh

BIN
core/res/drawable-hdpi-v11/ic_stat_notification.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 942 B

BIN
core/res/drawable-hdpi/abc_list_focused_holo.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

0
external/JakeWharton-ActionBarSherlock/library/res/drawable-hdpi/abs__list_activated_holo.9.png → core/res/drawable-hdpi/abc_list_longpressed_holo.9.png

Before

Width:  |  Height:  |  Size: 154 B

After

Width:  |  Height:  |  Size: 154 B

0
external/JakeWharton-ActionBarSherlock/library/res/drawable-hdpi/abs__list_pressed_holo_dark.9.png → core/res/drawable-hdpi/abc_list_pressed_holo_dark.9.png

Before

Width:  |  Height:  |  Size: 159 B

After

Width:  |  Height:  |  Size: 159 B

0
external/JakeWharton-ActionBarSherlock/library/res/drawable-hdpi/abs__list_pressed_holo_light.9.png → core/res/drawable-hdpi/abc_list_pressed_holo_light.9.png

Before

Width:  |  Height:  |  Size: 159 B

After

Width:  |  Height:  |  Size: 159 B

0
external/JakeWharton-ActionBarSherlock/library/res/drawable-hdpi/abs__list_selector_disabled_holo_dark.9.png → core/res/drawable-hdpi/abc_list_selector_disabled_holo_dark.9.png

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 189 B

0
external/JakeWharton-ActionBarSherlock/library/res/drawable-hdpi/abs__list_selector_disabled_holo_light.9.png → core/res/drawable-hdpi/abc_list_selector_disabled_holo_light.9.png

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 189 B

BIN
core/res/drawable-hdpi/ic_stat_notification.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 942 B

BIN
core/res/drawable-mdpi-v11/ic_stat_notification.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 578 B

BIN
core/res/drawable-mdpi/abc_list_focused_holo.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

0
external/JakeWharton-ActionBarSherlock/library/res/drawable-mdpi/abs__list_activated_holo.9.png → core/res/drawable-mdpi/abc_list_longpressed_holo.9.png

Before

Width:  |  Height:  |  Size: 151 B

After

Width:  |  Height:  |  Size: 151 B

0
external/JakeWharton-ActionBarSherlock/library/res/drawable-mdpi/abs__list_pressed_holo_dark.9.png → core/res/drawable-mdpi/abc_list_pressed_holo_dark.9.png

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 158 B

0
external/JakeWharton-ActionBarSherlock/library/res/drawable-mdpi/abs__list_pressed_holo_light.9.png → core/res/drawable-mdpi/abc_list_pressed_holo_light.9.png

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 158 B

0
external/JakeWharton-ActionBarSherlock/library/res/drawable-mdpi/abs__list_selector_disabled_holo_dark.9.png → core/res/drawable-mdpi/abc_list_selector_disabled_holo_dark.9.png

Before

Width:  |  Height:  |  Size: 172 B

After

Width:  |  Height:  |  Size: 172 B

0
external/JakeWharton-ActionBarSherlock/library/res/drawable-mdpi/abs__list_selector_disabled_holo_light.9.png → core/res/drawable-mdpi/abc_list_selector_disabled_holo_light.9.png

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 171 B

BIN
core/res/drawable-mdpi/ic_stat_notification.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 632 B

After

Width:  |  Height:  |  Size: 578 B

BIN
core/res/drawable-xhdpi-v11/ic_stat_notification.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

BIN
core/res/drawable-xhdpi/abc_list_focused_holo.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

0
external/JakeWharton-ActionBarSherlock/library/res/drawable-xhdpi/abs__list_activated_holo.9.png → core/res/drawable-xhdpi/abc_list_longpressed_holo.9.png

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 158 B

0
external/JakeWharton-ActionBarSherlock/library/res/drawable-xhdpi/abs__list_pressed_holo_dark.9.png → core/res/drawable-xhdpi/abc_list_pressed_holo_dark.9.png

Before

Width:  |  Height:  |  Size: 163 B

After

Width:  |  Height:  |  Size: 163 B

0
external/JakeWharton-ActionBarSherlock/library/res/drawable-xhdpi/abs__list_pressed_holo_light.9.png → core/res/drawable-xhdpi/abc_list_pressed_holo_light.9.png

Before

Width:  |  Height:  |  Size: 163 B

After

Width:  |  Height:  |  Size: 163 B

0
external/JakeWharton-ActionBarSherlock/library/res/drawable-xhdpi/abs__list_selector_disabled_holo_dark.9.png → core/res/drawable-xhdpi/abc_list_selector_disabled_holo_dark.9.png

Before

Width:  |  Height:  |  Size: 190 B

After

Width:  |  Height:  |  Size: 190 B

0
external/JakeWharton-ActionBarSherlock/library/res/drawable-xhdpi/abs__list_selector_disabled_holo_light.9.png → core/res/drawable-xhdpi/abc_list_selector_disabled_holo_light.9.png

Before

Width:  |  Height:  |  Size: 188 B

After

Width:  |  Height:  |  Size: 188 B

BIN
core/res/drawable-xhdpi/ic_stat_notification.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
core/res/drawable-xxhdpi-v11/ic_stat_notification.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

BIN
core/res/drawable-xxhdpi/ic_stat_notification.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

4
external/JakeWharton-ActionBarSherlock/library/res/drawable/abs__list_selector_background_transition_holo_dark.xml → core/res/drawable/abc_list_selector_background_transition_holo_dark.xml

@ -15,6 +15,6 @@
--> -->
<transition xmlns:android="http://schemas.android.com/apk/res/android"> <transition xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/abs__list_pressed_holo_dark" /> <item android:drawable="@drawable/abc_list_pressed_holo_dark" />
<item android:drawable="@drawable/abs__list_longpressed_holo" /> <item android:drawable="@drawable/abc_list_longpressed_holo" />
</transition> </transition>

4
external/JakeWharton-ActionBarSherlock/library/res/drawable/abs__list_selector_background_transition_holo_light.xml → core/res/drawable/abc_list_selector_background_transition_holo_light.xml

@ -15,6 +15,6 @@
--> -->
<transition xmlns:android="http://schemas.android.com/apk/res/android"> <transition xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/abs__list_pressed_holo_light" /> <item android:drawable="@drawable/abc_list_pressed_holo_light" />
<item android:drawable="@drawable/abs__list_longpressed_holo" /> <item android:drawable="@drawable/abc_list_longpressed_holo" />
</transition> </transition>

10
external/JakeWharton-ActionBarSherlock/library/res/drawable/abs__item_background_holo_dark.xml → core/res/drawable/selectable_background_holo_light.xml

@ -17,10 +17,10 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. --> <!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/abs__list_selector_disabled_holo_dark" /> <item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/abc_list_selector_disabled_holo_light" />
<item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/abs__list_selector_disabled_holo_dark" /> <item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/abc_list_selector_disabled_holo_light" />
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/abs__list_selector_background_transition_holo_dark" /> <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/abc_list_selector_background_transition_holo_light" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/abs__list_selector_background_transition_holo_dark" /> <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/abc_list_selector_background_transition_holo_light" />
<item android:state_focused="true" android:drawable="@drawable/abs__list_focused_holo" /> <item android:state_focused="true" android:drawable="@drawable/abc_list_focused_holo" />
<item android:drawable="@android:color/transparent" /> <item android:drawable="@android:color/transparent" />
</selector> </selector>

2
core/res/layout-w600dp/activity_search.xml

@ -23,7 +23,7 @@
android:baselineAligned="false" android:baselineAligned="false"
tools:context=".SearchActivity" > tools:context=".SearchActivity" >
<com.actionbarsherlock.view.SherlockListView <ListView
android:id="@+id/searchsites_list" android:id="@+id/searchsites_list"
android:layout_width="0dip" android:layout_width="0dip"
android:layout_height="match_parent" android:layout_height="match_parent"

2
core/res/layout-w600dp/activity_torrents.xml

@ -8,7 +8,7 @@
android:baselineAligned="false" android:baselineAligned="false"
tools:context=".TorrentsActivity" > tools:context=".TorrentsActivity" >
<com.actionbarsherlock.view.SherlockListView <ListView
android:id="@+id/filters_list" android:id="@+id/filters_list"
android:layout_width="0dip" android:layout_width="0dip"
android:layout_height="match_parent" android:layout_height="match_parent"

2
core/res/layout-w900dp/activity_torrents.xml

@ -8,7 +8,7 @@
android:baselineAligned="false" android:baselineAligned="false"
tools:context=".TorrentsActivity" > tools:context=".TorrentsActivity" >
<com.actionbarsherlock.view.SherlockListView <ListView
android:id="@+id/filters_list" android:id="@+id/filters_list"
android:layout_width="0dip" android:layout_width="0dip"
android:layout_height="match_parent" android:layout_height="match_parent"

0
core/res/layout-v11/actionbar_donebutton.xml → core/res/layout/actionbar_donebutton.xml

2
core/res/layout/actionbar_searchsite.xml

@ -27,7 +27,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?attr/text_actionbar" android:textColor="?attr/text_actionbar"
android:textIsSelectable="false" android:textIsSelectable="false"
android:textSize="@dimen/abs__action_bar_title_text_size" android:textSize="18sp"
android:fontFamily="sans-serif-condensed" /> android:fontFamily="sans-serif-condensed" />
</FrameLayout> </FrameLayout>

2
core/res/layout/actionbar_serverstatus.xml

@ -17,7 +17,7 @@
--> -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_height="?attr/actionBarSize" android:layout_height="?android:attr/actionBarSize"
android:layout_width="match_parent" > android:layout_width="match_parent" >
<RelativeLayout <RelativeLayout

0
core/res/layout-v11/activity_widgetconfig.xml → core/res/layout/activity_widgetconfig.xml

2
core/res/layout/fragment_details.xml

@ -20,7 +20,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" > android:layout_height="match_parent" >
<com.actionbarsherlock.view.SherlockListView <ListView
android:id="@+id/details_list" android:id="@+id/details_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"

2
core/res/layout/fragment_filters.xml

@ -19,7 +19,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" > android:layout_height="match_parent" >
<com.actionbarsherlock.view.ListView <ListView
android:id="@+id/filters_list" android:id="@+id/filters_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"

2
core/res/layout/fragment_rssfeeds.xml

@ -19,7 +19,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" > android:layout_height="match_parent" >
<com.actionbarsherlock.view.SherlockListView <ListView
android:id="@+id/rssfeeds_list" android:id="@+id/rssfeeds_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"

2
core/res/layout/fragment_rssitems.xml

@ -19,7 +19,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" > android:layout_height="match_parent" >
<com.actionbarsherlock.view.SherlockListView <ListView
android:id="@+id/rssitems_list" android:id="@+id/rssitems_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"

2
core/res/layout/fragment_searchresults.xml

@ -19,7 +19,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" > android:layout_height="match_parent" >
<com.actionbarsherlock.view.SherlockListView <ListView
android:id="@+id/searchresults_list" android:id="@+id/searchresults_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"

4
core/res/layout/fragment_torrents.xml

@ -19,8 +19,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" > android:layout_height="match_parent" >
<com.actionbarsherlock.view.SherlockListView <ListView
android:id="@+id/torrent_list" android:id="@+id/torrents_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:choiceMode="multipleChoiceModal" android:choiceMode="multipleChoiceModal"

0
core/res/layout-v11/list_item_widget_dark.xml → core/res/layout/list_item_widget_dark.xml

0
core/res/layout-v11/list_item_widget_light.xml → core/res/layout/list_item_widget_light.xml

2
core/res/layout/pref_withoverflow.xml

@ -8,7 +8,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical" android:layout_gravity="right|center_vertical"
android:background="@drawable/abs__item_background_holo_light" android:background="@drawable/selectable_background_holo_light"
android:contentDescription="@string/pref_addseedbox" android:contentDescription="@string/pref_addseedbox"
android:padding="5dp" android:padding="5dp"
android:src="@drawable/ic_action_overflow" /> android:src="@drawable/ic_action_overflow" />

0
core/res/layout-v11/widget_torrents_dark.xml → core/res/layout/widget_torrents_dark.xml

0
core/res/layout-v11/widget_torrents_light.xml → core/res/layout/widget_torrents_light.xml

23
core/res/values-v11/bools.xml

@ -1,23 +0,0 @@
<?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>
<!-- Used to enable the scrolling widget on Honeycomb (API 11) and higher only -->
<bool name="widget_available">true</bool>
</resources>

67
core/res/values-v11/styles_transdroid_dark.xml

@ -1,67 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- File created by the Android Action Bar Style Generator
Copyright (C) 2012 readyState Software Ltd
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="Theme.Transdroid.Dark" parent="@style/Theme.Sherlock">
<item name="actionBarItemBackground">@drawable/selectable_background_transdroid</item>
<item name="popupMenuStyle">@style/PopupMenu.Transdroid.Dark</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Transdroid.Dark</item>
<item name="actionBarTabStyle">@style/ActionBarTabStyle.Transdroid.Dark</item>
<item name="actionDropDownStyle">@style/DropDownNav.Transdroid.Dark</item>
<item name="actionBarStyle">@style/ActionBar.Solid.Transdroid.Dark</item>
<item name="android:popupMenuStyle">@style/PopupMenu.Transdroid.Dark</item>
<item name="android:dropDownListViewStyle">@style/DropDownListView.Transdroid.Dark</item>
<item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Transdroid.Dark</item>
<item name="android:actionDropDownStyle">@style/ActionBarTabStyle.Transdroid.Dark</item>
<item name="android:actionBarStyle">@style/ActionBar.Solid.Transdroid.Dark</item>
<item name="android:panelBackground">@drawable/menu_hardkey_panel_transdroid</item>
</style>
<style name="ActionBar.Solid.Transdroid.Dark" parent="@style/Widget.Sherlock.ActionBar.Solid">
<item name="background">@drawable/ab_solid_transdroid</item>
<item name="backgroundStacked">@drawable/ab_stacked_solid_transdroid</item>
<item name="backgroundSplit">@drawable/ab_bottom_solid_transdroid</item>
<item name="android:background">@drawable/ab_solid_transdroid</item>
</style>
<style name="PopupMenu.Transdroid.Dark" parent="@style/Widget.Sherlock.ListPopupWindow">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid</item>
</style>
<style name="DropDownListView.Transdroid.Dark" parent="@style/Widget.Sherlock.ListView.DropDown">
<item name="android:listSelector">@drawable/selectable_background_transdroid</item>
</style>
<style name="ActionBarTabStyle.Transdroid.Dark" parent="@style/Widget.Sherlock.ActionBar.TabView">
<item name="background">@drawable/tab_indicator_ab_transdroid</item>
<item name="android:background">@drawable/tab_indicator_ab_transdroid</item>
</style>
<style name="DropDownNav.Transdroid.Dark" parent="@style/Widget.Sherlock.Spinner.DropDown.ActionBar">
<item name="background">@drawable/spinner_background_ab_transdroid</item>
<item name="android:background">@drawable/spinner_background_ab_transdroid</item>
<item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid</item>
<item name="android:dropDownSelector">@drawable/selectable_background_transdroid</item>
</style>
</resources>

42
core/res/values-v11/styles_transdroid_light.xml

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- File created by the Android Action Bar Style Generator
Copyright (C) 2011 The Android Open Source Project
Copyright (C) 2012 readyState Software Ltd
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 xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Theme.Transdroid.Light" parent="@style/Theme.Sherlock.Light">
<item name="android:popupMenuStyle">@style/PopupMenu.Transdroid2</item>
<item name="android:dropDownListViewStyle">@style/DropDownListView.Transdroid.Light</item>
<item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Transdroid.Light</item>
<item name="android:actionDropDownStyle">@style/DropDownNav.Transdroid.Light</item>
<item name="android:actionBarStyle">@style/ActionBar.Solid.Transdroid.Light</item>
<item name="android:actionModeBackground">@drawable/cab_background_top_transdroid2</item>
<item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Transdroid.Light</item>
</style>
<style name="ActionBar.Solid.Transdroid.Light" parent="@style/Widget.Sherlock.Light.ActionBar.Solid">
<item name="android:background">@drawable/ab_solid_transdroid2</item>
</style>
<style name="ActionBar.Transparent.Transdroid.Light" parent="@style/Widget.Sherlock.Light.ActionBar">
<item name="android:background">@drawable/ab_transparent_transdroid2</item>
</style>
</resources>

21
core/res/values-v14/dimens.xml

@ -1,21 +0,0 @@
<!--
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>
<dimen name="margin_widget">0dp</dimen>
</resources>

70
core/res/values-v14/styles_transdroid_dark.xml

@ -1,70 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- File created by the Android Action Bar Style Generator
Copyright (C) 2012 readyState Software Ltd
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="Theme.Transdroid.Dark" parent="@style/Theme.Sherlock">
<item name="actionBarItemBackground">@drawable/selectable_background_transdroid</item>
<item name="popupMenuStyle">@style/PopupMenu.Transdroid.Dark</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Transdroid.Dark</item>
<item name="actionBarTabStyle">@style/ActionBarTabStyle.Transdroid.Dark</item>
<item name="actionDropDownStyle">@style/DropDownNav.Transdroid.Dark</item>
<item name="actionBarStyle">@style/ActionBar.Solid.Transdroid.Dark</item>
<item name="android:actionBarItemBackground">@drawable/selectable_background_transdroid</item>
<item name="android:popupMenuStyle">@style/PopupMenu.Transdroid.Dark</item>
<item name="android:dropDownListViewStyle">@style/DropDownListView.Transdroid.Dark</item>
<item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Transdroid.Dark</item>
<item name="android:actionDropDownStyle">@style/DropDownNav.Transdroid.Dark</item>
<item name="android:actionBarStyle">@style/ActionBar.Solid.Transdroid.Dark</item>
<item name="android:panelBackground">@drawable/menu_hardkey_panel_transdroid</item>
</style>
<style name="ActionBar.Solid.Transdroid.Dark" parent="@style/Widget.Sherlock.ActionBar.Solid">
<item name="background">@drawable/ab_solid_transdroid</item>
<item name="backgroundStacked">@drawable/ab_stacked_solid_transdroid</item>
<item name="backgroundSplit">@drawable/ab_bottom_solid_transdroid</item>
<item name="android:background">@drawable/ab_solid_transdroid</item>
<item name="android:backgroundStacked">@drawable/ab_stacked_solid_transdroid</item>
<item name="android:backgroundSplit">@drawable/ab_bottom_solid_transdroid</item>
</style>
<style name="PopupMenu.Transdroid.Dark" parent="@style/Widget.Sherlock.ListPopupWindow">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid</item>
</style>
<style name="DropDownListView.Transdroid.Dark" parent="@style/Widget.Sherlock.ListView.DropDown">
<item name="android:listSelector">@drawable/selectable_background_transdroid</item>
</style>
<style name="ActionBarTabStyle.Transdroid.Dark" parent="@style/Widget.Sherlock.ActionBar.TabView">
<item name="background">@drawable/tab_indicator_ab_transdroid</item>
<item name="android:background">@drawable/tab_indicator_ab_transdroid</item>
</style>
<style name="DropDownNav.Transdroid.Dark" parent="@style/Widget.Sherlock.Spinner.DropDown.ActionBar">
<item name="background">@drawable/spinner_background_ab_transdroid</item>
<item name="android:background">@drawable/spinner_background_ab_transdroid</item>
<item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid</item>
<item name="android:dropDownSelector">@drawable/selectable_background_transdroid</item>
</style>
</resources>

44
core/res/values-v14/styles_transdroid_light.xml

@ -1,44 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- File created by the Android Action Bar Style Generator
Copyright (C) 2011 The Android Open Source Project
Copyright (C) 2012 readyState Software Ltd
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 xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Theme.Transdroid.Light" parent="@style/Theme.Sherlock.Light">
<item name="android:actionBarItemBackground">@drawable/selectable_background_transdroid2</item>
<item name="android:popupMenuStyle">@style/PopupMenu.Transdroid.Light</item>
<item name="android:dropDownListViewStyle">@style/DropDownListView.Transdroid.Light</item>
<item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Transdroid.Light</item>
<item name="android:actionDropDownStyle">@style/DropDownNav.Transdroid.Light</item>
<item name="android:actionBarStyle">@style/ActionBar.Solid.Transdroid.Light</item>
<item name="android:actionModeBackground">@drawable/cab_background_top_transdroid2</item>
<item name="android:actionModeSplitBackground">@drawable/cab_background_bottom_transdroid2</item>
<item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Transdroid.Light</item>
</style>
<style name="ActionBar.Solid.Transdroid.Light" parent="@style/Widget.Sherlock.Light.ActionBar.Solid">
<item name="android:background">@drawable/ab_solid_transdroid2</item>
<item name="android:backgroundStacked">@drawable/ab_stacked_solid_transdroid2</item>
<item name="android:backgroundSplit">@drawable/ab_bottom_solid_transdroid2</item>
</style>
<style name="ActionBar.Transparent.Transdroid.Light" parent="@style/Widget.Sherlock.Light.ActionBar">
<item name="android:background">@drawable/ab_transparent_transdroid2</item>
</style>
</resources>

10
core/res/values-v16/styles.xml

@ -16,18 +16,18 @@
--> -->
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="PopupMenu.Transdroid2" parent="@style/Widget.Sherlock.Light.ListPopupWindow"> <style name="PopupMenu.Transdroid2" parent="@android:style/Widget.Holo.Light.ListPopupWindow">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid2</item> <item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid2</item>
<item name="android:fontFamily">sans-serif</item> <item name="android:fontFamily">sans-serif</item>
</style> </style>
<style name="PopupMenu.Transdroid.Dark" parent="@style/Widget.Sherlock.ListPopupWindow"> <style name="PopupMenu.Transdroid.Dark" parent="@android:style/Widget.Holo.ListPopupWindow">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid</item> <item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid</item>
<item name="android:fontFamily">sans-serif</item> <item name="android:fontFamily">sans-serif</item>
</style> </style>
<!-- Taken from http://stackoverflow.com/questions/10020466/android-4-0-sub-title-section-label-styling --> <!-- Taken from http://stackoverflow.com/questions/10020466/android-4-0-sub-title-section-label-styling -->
<style name="SectionHeader" parent="android:Widget.Holo.Light.TextView"> <style name="SectionHeader" parent="@android:style/Widget.Holo.Light.TextView">
<item name="android:drawableBottom">@drawable/section_header</item> <item name="android:drawableBottom">@drawable/section_header</item>
<item name="android:drawablePadding">4dp</item> <item name="android:drawablePadding">4dp</item>
<item name="android:layout_marginTop">8dp</item> <item name="android:layout_marginTop">8dp</item>
@ -37,12 +37,12 @@
<item name="android:fontFamily">sans-serif</item> <item name="android:fontFamily">sans-serif</item>
</style> </style>
<style name="DefaultTextView" parent="android:Widget.Holo.Light.TextView"> <style name="DefaultTextView" parent="@android:style/Widget.Holo.Light.TextView">
<item name="android:textSize">@dimen/text_default</item> <item name="android:textSize">@dimen/text_default</item>
<item name="android:fontFamily">sans-serif-light</item> <item name="android:fontFamily">sans-serif-light</item>
</style> </style>
<style name="LabelTextView" parent="android:Widget.Holo.Light.TextView"> <style name="LabelTextView" parent="@android:style/Widget.Holo.Light.TextView">
<item name="android:textSize">@dimen/text_label</item> <item name="android:textSize">@dimen/text_label</item>
<item name="android:background">#333</item> <item name="android:background">#333</item>
<item name="android:textColor">#fff</item> <item name="android:textColor">#fff</item>

2
core/res/values/bools.xml

@ -19,8 +19,6 @@
<!-- Used to determine if a device is 'small', i.e. a phone; for reference: a Nexus 7's smallest width is 533dip --> <!-- Used to determine if a device is 'small', i.e. a phone; for reference: a Nexus 7's smallest width is 533dip -->
<bool name="show_dialog_fullscreen">true</bool> <bool name="show_dialog_fullscreen">true</bool>
<!-- Used to enable the scrolling widget on Honeycomb (API 11) and higher only -->
<bool name="widget_available">false</bool>
<!-- Used to enable checking for app updates in the background --> <!-- Used to enable checking for app updates in the background -->
<bool name="updatecheck_available">true</bool> <bool name="updatecheck_available">true</bool>
<!-- Used to enable the search UI --> <!-- Used to enable the search UI -->

2
core/res/values/strings.xml

@ -438,7 +438,7 @@
<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\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\naXMLRPC\n \u00A0 https://github.com/timroes/aXMLRPC\n \u00A0 Tim Roes \n \u00A0 MIT License\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">AndroidAnnotations\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\naXMLRPC\n \u00A0 https://github.com/timroes/aXMLRPC\n \u00A0 Tim Roes \n \u00A0 MIT License\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>

14
core/res/values/styles.xml

@ -96,8 +96,16 @@
<item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowBackground">@android:color/transparent</item>
</style> </style>
<style name="PopupMenu.Transdroid2" parent="@android:style/Widget.Holo.Light.ListPopupWindow">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid2</item>
</style>
<style name="PopupMenu.Transdroid.Dark" parent="@android:style/Widget.Holo.ListPopupWindow">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid</item>
</style>
<!-- Taken from http://stackoverflow.com/questions/10020466/android-4-0-sub-title-section-label-styling --> <!-- Taken from http://stackoverflow.com/questions/10020466/android-4-0-sub-title-section-label-styling -->
<style name="SectionHeader" parent="android:Widget.Holo.Light.TextView"> <style name="SectionHeader" parent="@android:style/Widget.Holo.Light.TextView">
<item name="android:drawableBottom">@drawable/section_header</item> <item name="android:drawableBottom">@drawable/section_header</item>
<item name="android:drawablePadding">4dp</item> <item name="android:drawablePadding">4dp</item>
<item name="android:layout_marginTop">8dp</item> <item name="android:layout_marginTop">8dp</item>
@ -106,11 +114,11 @@
<item name="android:textSize">14sp</item> <item name="android:textSize">14sp</item>
</style> </style>
<style name="DefaultTextView" parent="android:Widget.Holo.Light.TextView"> <style name="DefaultTextView" parent="@android:style/Widget.Holo.Light.TextView">
<item name="android:textSize">@dimen/text_default</item> <item name="android:textSize">@dimen/text_default</item>
</style> </style>
<style name="LabelTextView" parent="android:Widget.Holo.Light.TextView"> <style name="LabelTextView" parent="@android:style/Widget.Holo.Light.TextView">
<item name="android:textSize">@dimen/text_label</item> <item name="android:textSize">@dimen/text_label</item>
<item name="android:background">#333</item> <item name="android:background">#333</item>
<item name="android:textColor">#fff</item> <item name="android:textColor">#fff</item>

35
core/res/values/styles_transdroid_dark.xml

@ -18,40 +18,37 @@
<resources> <resources>
<style name="Theme.Transdroid.Dark" parent="@style/Theme.Sherlock"> <style name="Theme.Transdroid.Dark" parent="@android:style/Theme.Holo">
<item name="actionBarItemBackground">@drawable/selectable_background_transdroid</item> <item name="android:actionBarItemBackground">@drawable/selectable_background_transdroid</item>
<item name="popupMenuStyle">@style/PopupMenu.Transdroid.Dark</item> <item name="android:popupMenuStyle">@style/PopupMenu.Transdroid.Dark</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Transdroid.Dark</item> <item name="android:dropDownListViewStyle">@style/DropDownListView.Transdroid.Dark</item>
<item name="actionBarTabStyle">@style/ActionBarTabStyle.Transdroid.Dark</item> <item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Transdroid.Dark</item>
<item name="actionDropDownStyle">@style/DropDownNav.Transdroid.Dark</item> <item name="android:actionDropDownStyle">@style/DropDownNav.Transdroid.Dark</item>
<item name="actionBarStyle">@style/ActionBar.Solid.Transdroid.Dark</item> <item name="android:actionBarStyle">@style/ActionBar.Solid.Transdroid.Dark</item>
<item name="android:panelBackground">@drawable/menu_hardkey_panel_transdroid</item>
</style> </style>
<style name="ActionBar.Solid.Transdroid.Dark" parent="@style/Widget.Sherlock.ActionBar.Solid"> <style name="ActionBar.Solid.Transdroid.Dark" parent="@android:style/Widget.Holo.ActionBar.Solid">
<item name="background">@drawable/ab_solid_transdroid</item> <item name="android:background">@drawable/ab_solid_transdroid</item>
<item name="backgroundStacked">@drawable/ab_stacked_solid_transdroid</item> <item name="android:backgroundStacked">@drawable/ab_stacked_solid_transdroid</item>
<item name="backgroundSplit">@drawable/ab_bottom_solid_transdroid</item> <item name="android:backgroundSplit">@drawable/ab_bottom_solid_transdroid</item>
<item name="android:background">@drawable/ab_solid_transdroid</item> <item name="android:background">@drawable/ab_solid_transdroid</item>
</style> </style>
<style name="PopupMenu.Transdroid.Dark" parent="@style/Widget.Sherlock.ListPopupWindow"> <style name="PopupMenu.Transdroid.Dark" parent="@android:style/Widget.Holo.ListPopupWindow">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid</item> <item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid</item>
</style> </style>
<style name="DropDownListView.Transdroid.Dark" parent="@style/Widget.Sherlock.ListView.DropDown"> <style name="DropDownListView.Transdroid.Dark" parent="@android:style/Widget.Holo.ListView.DropDown">
<item name="android:listSelector">@drawable/selectable_background_transdroid</item> <item name="android:listSelector">@drawable/selectable_background_transdroid</item>
</style> </style>
<style name="ActionBarTabStyle.Transdroid.Dark" parent="@style/Widget.Sherlock.ActionBar.TabView"> <style name="ActionBarTabStyle.Transdroid.Dark" parent="@android:style/Widget.Holo.ActionBar.TabView">
<item name="background">@drawable/tab_indicator_ab_transdroid</item>
<item name="android:background">@drawable/tab_indicator_ab_transdroid</item> <item name="android:background">@drawable/tab_indicator_ab_transdroid</item>
</style> </style>
<style name="DropDownNav.Transdroid.Dark" parent="@style/Widget.Sherlock.Spinner.DropDown.ActionBar"> <style name="DropDownNav.Transdroid.Dark" parent="@android:style/Widget.Holo.Spinner">
<item name="background">@drawable/spinner_background_ab_transdroid</item>
<item name="android:background">@drawable/spinner_background_ab_transdroid</item> <item name="android:background">@drawable/spinner_background_ab_transdroid</item>
<item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid</item> <item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid</item>
<item name="android:dropDownSelector">@drawable/selectable_background_transdroid</item> <item name="android:dropDownSelector">@drawable/selectable_background_transdroid</item>

42
core/res/values/styles_transdroid_light.xml

@ -19,47 +19,47 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Theme.Transdroid.Light" parent="@style/Theme.Sherlock.Light"> <style name="Theme.Transdroid.Light" parent="@android:style/Theme.Holo.Light">
<item name="actionBarItemBackground">@drawable/selectable_background_transdroid2</item> <item name="android:actionBarItemBackground">@drawable/selectable_background_transdroid2</item>
<item name="popupMenuStyle">@style/PopupMenu.Transdroid.Light</item> <item name="android:popupMenuStyle">@style/PopupMenu.Transdroid.Light</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Transdroid.Light</item> <item name="android:dropDownListViewStyle">@style/DropDownListView.Transdroid.Light</item>
<item name="actionBarTabStyle">@style/ActionBarTabStyle.Transdroid.Light</item> <item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Transdroid.Light</item>
<item name="actionDropDownStyle">@style/DropDownNav.Transdroid.Light</item> <item name="android:actionDropDownStyle">@style/DropDownNav.Transdroid.Light</item>
<item name="actionBarStyle">@style/ActionBar.Solid.Transdroid.Light</item> <item name="android:actionBarStyle">@style/ActionBar.Solid.Transdroid.Light</item>
<item name="actionModeBackground">@drawable/cab_background_top_transdroid2</item> <item name="android:actionModeBackground">@drawable/cab_background_top_transdroid2</item>
<item name="actionModeSplitBackground">@drawable/cab_background_bottom_transdroid2</item> <item name="android:actionModeSplitBackground">@drawable/cab_background_bottom_transdroid2</item>
<item name="actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Transdroid.Light</item> <item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Transdroid.Light</item>
</style> </style>
<style name="ActionBar.Solid.Transdroid.Light" parent="@style/Widget.Sherlock.Light.ActionBar.Solid"> <style name="ActionBar.Solid.Transdroid.Light" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">
<item name="background">@drawable/ab_solid_transdroid2</item> <item name="android:background">@drawable/ab_solid_transdroid2</item>
<item name="backgroundStacked">@drawable/ab_stacked_solid_transdroid2</item> <item name="android:backgroundStacked">@drawable/ab_stacked_solid_transdroid2</item>
<item name="backgroundSplit">@drawable/ab_bottom_solid_transdroid2</item> <item name="android:backgroundSplit">@drawable/ab_bottom_solid_transdroid2</item>
</style> </style>
<style name="ActionBar.Transparent.Transdroid.Light" parent="@style/Widget.Sherlock.Light.ActionBar"> <style name="ActionBar.Transparent.Transdroid.Light" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="background">@drawable/ab_transparent_transdroid2</item> <item name="android:background">@drawable/ab_transparent_transdroid2</item>
</style> </style>
<style name="PopupMenu.Transdroid.Light" parent="@style/Widget.Sherlock.Light.ListPopupWindow"> <style name="PopupMenu.Transdroid.Light" parent="@android:style/Widget.Holo.Light.ListPopupWindow">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid2</item> <item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid2</item>
</style> </style>
<style name="DropDownListView.Transdroid.Light" parent="@style/Widget.Sherlock.Light.ListView.DropDown"> <style name="DropDownListView.Transdroid.Light" parent="@android:style/Widget.Holo.Light.ListView.DropDown">
<item name="android:listSelector">@drawable/selectable_background_transdroid2</item> <item name="android:listSelector">@drawable/selectable_background_transdroid2</item>
</style> </style>
<style name="ActionBarTabStyle.Transdroid.Light" parent="@style/Widget.Sherlock.Light.ActionBar.TabView"> <style name="ActionBarTabStyle.Transdroid.Light" parent="@android:style/Widget.Holo.Light.ActionBar.TabView">
<item name="android:background">@drawable/tab_indicator_ab_transdroid2</item> <item name="android:background">@drawable/tab_indicator_ab_transdroid2</item>
</style> </style>
<style name="DropDownNav.Transdroid.Light" parent="@style/Widget.Sherlock.Light.Spinner.DropDown.ActionBar"> <style name="DropDownNav.Transdroid.Light" parent="@android:style/Widget.Holo.Light.Spinner">
<item name="android:background">@drawable/spinner_background_ab_transdroid2</item> <item name="android:background">@drawable/spinner_background_ab_transdroid2</item>
<item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid2</item> <item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid2</item>
<item name="android:dropDownSelector">@drawable/selectable_background_transdroid2</item> <item name="android:dropDownSelector">@drawable/selectable_background_transdroid2</item>
</style> </style>
<style name="ActionButton.CloseMode.Transdroid.Light" parent="@style/Widget.Sherlock.Light.ActionButton.CloseMode"> <style name="ActionButton.CloseMode.Transdroid.Light" parent="@android:style/Widget.Holo.Light.ActionButton.CloseMode">
<item name="android:background">@drawable/btn_cab_done_transdroid2</item> <item name="android:background">@drawable/btn_cab_done_transdroid2</item>
</style> </style>

346
core/src/com/actionbarsherlock/view/SherlockListView.java

@ -1,346 +0,0 @@
/*
* Public Domain
* SherlockListView.java by tweakt
* https://snipt.net/tweakt/sherlocklistviewjava/
*/
package com.actionbarsherlock.view;
import android.annotation.TargetApi;
import android.content.Context;
import android.util.AttributeSet;
import android.util.SparseBooleanArray;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Checkable;
import android.widget.ListView;
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.ActionMode;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
/**
* Provides backwards compatible multiple choice ActionMode support on Froyo+ using ActionBarSherlock.
*/
public class SherlockListView extends ListView {
// API 11+ reference, but ok because the value will be inlined.
public static final int CHOICE_MODE_MULTIPLE_MODAL_COMPAT = CHOICE_MODE_MULTIPLE_MODAL;
/**
* Wrapper to intercept delegation of long click events, and pass to {@link #doLongPress}
*/
class OnItemLongClickListenerWrapper implements OnItemLongClickListener {
private OnItemLongClickListener wrapped;
public void setWrapped(OnItemLongClickListener listener) {
this.wrapped = listener;
}
@Override
public boolean onItemLongClick(AdapterView<?> view, View child, int position, long id) {
// this would be easier if AbsListView.performLongPress wasn't package
// protected :-(
boolean handled = doLongPress(child, position, id);
if (!handled && wrapped != null) {
return wrapped.onItemLongClick(view, child, position, id);
}
return true;
}
}
/**
* Hijack the onLongClickListener so we can intercept delegation.
*/
@Override
public void setOnItemLongClickListener(OnItemLongClickListener listener) {
if (longClickListenerWrapper == null) {
longClickListenerWrapper = new OnItemLongClickListenerWrapper();
}
longClickListenerWrapper.setWrapped(listener);
super.setOnItemLongClickListener(longClickListenerWrapper);
}
/**
* A MultiChoiceModeListener receives events for {@link AbsListView#CHOICE_MODE_MULTIPLE_MODAL}. It acts as the
* {@link ActionMode.Callback} for the selection mode and also receives
* {@link #onItemCheckedStateChanged(ActionMode, int, long, boolean)} events when the user selects and deselects
* list items.
*/
@SuppressWarnings("javadoc")
public interface MultiChoiceModeListenerCompat extends ActionMode.Callback {
/**
* Called when an item is checked or unchecked during selection mode.
* @param mode The {@link ActionMode} providing the selection mode
* @param position Adapter position of the item that was checked or unchecked
* @param id Adapter ID of the item that was checked or unchecked
* @param checked <code>true</code> if the item is now checked, <code>false</code> if the item is now unchecked.
*/
public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked);
}
class MultiChoiceModeWrapper implements MultiChoiceModeListenerCompat {
private MultiChoiceModeListenerCompat wrapped;
public void setWrapped(MultiChoiceModeListenerCompat wrapped) {
this.wrapped = wrapped;
}
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
if (wrapped == null) {
return false;
}
if (wrapped.onCreateActionMode(mode, menu)) {
// Initialize checked graphic state?
setLongClickable(false);
return true;
}
return false;
}
@Override
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
if (wrapped == null) {
return false;
}
return wrapped.onPrepareActionMode(mode, menu);
}
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
if (wrapped == null) {
return false;
}
return wrapped.onActionItemClicked(mode, item);
}
@Override
public void onDestroyActionMode(ActionMode mode) {
if (wrapped == null) {
return;
}
wrapped.onDestroyActionMode(mode);
actionMode = null;
// Ending selection mode means deselecting everything.
clearChoices();
checkedItemCount = 0;
updateOnScreenCheckedViews();
invalidateViews();
setLongClickable(true);
requestLayout();
invalidate();
}
@Override
public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) {
if (wrapped == null) {
return;
}
wrapped.onItemCheckedStateChanged(mode, position, id, checked);
// If there are no items selected we no longer need the selection mode.
if (checkedItemCount == 0) {
mode.finish();
}
}
}
private com.actionbarsherlock.view.ActionMode actionMode;
private OnItemLongClickListenerWrapper longClickListenerWrapper;
private MultiChoiceModeWrapper choiceModeListener;
private int choiceMode;
private int checkedItemCount;
public SherlockListView(Context context) {
super(context);
init(context);
}
public SherlockListView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public SherlockListView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(context);
}
void init(Context context) {
if (isInEditMode()) {
// Ignore when viewing in the UI designer
return;
}
if (!(context instanceof SherlockActivity || context instanceof SherlockFragmentActivity)) {
throw new IllegalStateException(
"This view must be hosted in a SherlockActivity or SherlockFragmentActivity");
}
setOnItemLongClickListener(null);
}
@Override
public void setChoiceMode(int mode) {
choiceMode = mode;
if (actionMode != null) {
actionMode.finish();
actionMode = null;
}
if (choiceMode != CHOICE_MODE_NONE) {
if (mode == CHOICE_MODE_MULTIPLE_MODAL_COMPAT) {
clearChoices();
checkedItemCount = 0;
setLongClickable(true);
updateOnScreenCheckedViews();
requestLayout();
invalidate();
mode = CHOICE_MODE_MULTIPLE;
}
super.setChoiceMode(mode);
}
}
@Override
public int getChoiceMode() {
return choiceMode;
}
public void setMultiChoiceModeListener(MultiChoiceModeListenerCompat listener) {
if (choiceModeListener == null) {
choiceModeListener = new MultiChoiceModeWrapper();
}
choiceModeListener.setWrapped(listener);
}
@Override
public boolean performItemClick(View view, int position, long id) {
boolean handled = false;
boolean dispatchItemClick = true;
boolean checkStateChanged = false;
if (choiceMode != CHOICE_MODE_NONE) {
handled = true;
if (choiceMode == CHOICE_MODE_MULTIPLE
|| (choiceMode == CHOICE_MODE_MULTIPLE_MODAL_COMPAT && actionMode != null)) {
boolean newValue = !getCheckedItemPositions().get(position);
setItemChecked(position, newValue);
if (actionMode != null) {
choiceModeListener.onItemCheckedStateChanged(actionMode, position, id, newValue);
dispatchItemClick = false;
}
checkStateChanged = true;
return false;
} else if (choiceMode == CHOICE_MODE_SINGLE) {
boolean newValue = !getCheckedItemPositions().get(position);
setItemChecked(position, newValue);
checkStateChanged = true;
}
if (checkStateChanged) {
updateOnScreenCheckedViews();
}
}
if (dispatchItemClick) {
handled |= super.performItemClick(view, position, id);
}
return handled;
}
/**
* Perform a quick, in-place update of the checked or activated state on all visible item views. This should only be
* called when a valid choice mode is active.
* <p>
* (Taken verbatim from AbsListView.java)
*/
@TargetApi(11)
private void updateOnScreenCheckedViews() {
final int firstPos = getFirstVisiblePosition();
final int count = getChildCount();
final boolean useActivated = getContext().getApplicationInfo().targetSdkVersion >= android.os.Build.VERSION_CODES.HONEYCOMB;
for (int i = 0; i < count; i++) {
final View child = getChildAt(i);
final int position = firstPos + i;
if (child instanceof Checkable) {
((Checkable) child).setChecked(getCheckedItemPositions().get(position));
} else if (useActivated) {
// TODO: Investigate the impact of this hack fix
// (API level < 11 devices still get to this code point when clicking teh CAB done button)
if (android.os.Build.VERSION.SDK_INT > 11) {
child.setActivated(getCheckedItemPositions().get(position));
}
}
}
}
public ActionMode startActionMode(ActionMode.Callback callback) {
if (actionMode != null) {
return actionMode;
}
Context context = getContext();
if (context instanceof SherlockActivity) {
actionMode = ((SherlockActivity) getContext()).startActionMode(callback);
} else if (context instanceof SherlockFragmentActivity) {
actionMode = ((SherlockFragmentActivity) context).startActionMode(callback);
} else {
throw new IllegalStateException(
"This view must be hosted in a SherlockActivity or SherlockFragmentActivity");
}
return actionMode;
}
boolean doLongPress(final View child, final int longPressPosition, final long longPressId) {
if (choiceMode == CHOICE_MODE_MULTIPLE_MODAL_COMPAT) {
if (actionMode == null && (actionMode = startActionMode(choiceModeListener)) != null) {
setItemChecked(longPressPosition, true);
}
return true;
}
return false;
}
/**
* Sets the checked state of the specified position. The is only valid if the choice mode has been set to
* {@link #CHOICE_MODE_SINGLE} or {@link #CHOICE_MODE_MULTIPLE}.
* @param position The item whose checked state is to be checked
* @param value The new checked state for the item
*/
@Override
public void setItemChecked(int position, boolean value) {
if (choiceMode == CHOICE_MODE_NONE) {
return;
}
SparseBooleanArray checkStates = getCheckedItemPositions();
// Start selection mode if needed. We don't need to if we're unchecking
// something.
if (value && choiceMode == CHOICE_MODE_MULTIPLE_MODAL_COMPAT && actionMode == null) {
actionMode = startActionMode(choiceModeListener);
}
if (choiceMode == CHOICE_MODE_MULTIPLE || choiceMode == CHOICE_MODE_MULTIPLE_MODAL) {
// boolean oldValue = checkStates.get(position);
checkStates.put(position, value);
if (value) {
checkedItemCount++;
} else {
checkedItemCount--;
}
if (actionMode != null) {
final long id = getAdapter().getItemId(position);
choiceModeListener.onItemCheckedStateChanged(actionMode, position, id, value);
}
} else {
if (value || isItemChecked(position)) {
checkStates.clear();
}
// this may end up selecting the value we just cleared but this way
// we ensure length of checkStates is 1, a fact getCheckedItemPosition
// relies on
if (value) {
checkStates.put(position, true);
}
}
requestLayout();
invalidate();
}
}

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

@ -67,16 +67,13 @@ import org.transdroid.daemon.task.StopTask;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher; import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.OnRefreshListener; import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.OnRefreshListener;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.Options; import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.Options;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.Activity;
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.view.View;
import android.widget.Toast; import android.widget.Toast;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import de.keyboardsurfer.android.widget.crouton.Crouton; import de.keyboardsurfer.android.widget.crouton.Crouton;
/** /**
@ -87,7 +84,7 @@ import de.keyboardsurfer.android.widget.crouton.Crouton;
*/ */
@EActivity(resName = "activity_details") @EActivity(resName = "activity_details")
@OptionsMenu(resName = "activity_details") @OptionsMenu(resName = "activity_details")
public class DetailsActivity extends SherlockFragmentActivity implements TorrentTasksExecutor, RefreshableActivity { public class DetailsActivity extends Activity implements TorrentTasksExecutor, RefreshableActivity {
@Extra @Extra
@InstanceState @InstanceState
@ -115,7 +112,7 @@ public class DetailsActivity extends SherlockFragmentActivity implements Torrent
// Set the theme according to the user preference // Set the theme according to the user preference
if (SystemSettings_.getInstance_(this).useDarkTheme()) { if (SystemSettings_.getInstance_(this).useDarkTheme()) {
setTheme(R.style.TransdroidTheme_Dark); setTheme(R.style.TransdroidTheme_Dark);
getSupportActionBar().setIcon(R.drawable.ic_activity_torrents); getActionBar().setIcon(R.drawable.ic_activity_torrents);
} }
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
} }
@ -130,8 +127,8 @@ public class DetailsActivity extends SherlockFragmentActivity implements Torrent
} }
// Simple action bar with up, torrent name as title and refresh button // Simple action bar with up, torrent name as title and refresh button
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(NavigationHelper.buildCondensedFontString(torrent.getName())); getActionBar().setTitle(NavigationHelper.buildCondensedFontString(torrent.getName()));
// Connect to the last used server // Connect to the last used server
ServerSetting lastUsed = applicationSettings.getLastUsedServer(); ServerSetting lastUsed = applicationSettings.getLastUsedServer();

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

@ -51,19 +51,17 @@ import org.transdroid.daemon.TorrentDetails;
import org.transdroid.daemon.TorrentFile; import org.transdroid.daemon.TorrentFile;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Fragment;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.view.ActionMode;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.AbsListView.MultiChoiceModeListener;
import android.widget.ListView;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView; import android.widget.TextView;
import com.actionbarsherlock.app.SherlockFragment;
import com.actionbarsherlock.view.ActionMode;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.SherlockListView;
import com.actionbarsherlock.view.SherlockListView.MultiChoiceModeListenerCompat;
import de.keyboardsurfer.android.widget.crouton.Crouton; import de.keyboardsurfer.android.widget.crouton.Crouton;
/** /**
@ -74,7 +72,7 @@ import de.keyboardsurfer.android.widget.crouton.Crouton;
*/ */
@EFragment(resName = "fragment_details") @EFragment(resName = "fragment_details")
@OptionsMenu(resName = "fragment_details") @OptionsMenu(resName = "fragment_details")
public class DetailsFragment extends SherlockFragment implements OnTrackersUpdatedListener, OnLabelPickedListener, public class DetailsFragment extends Fragment implements OnTrackersUpdatedListener, OnLabelPickedListener,
OnStorageLocationUpdatedListener { OnStorageLocationUpdatedListener {
// Local data // Local data
@ -96,7 +94,7 @@ public class DetailsFragment extends SherlockFragment implements OnTrackersUpdat
@ViewById(resName = "details_container") @ViewById(resName = "details_container")
protected View detailsContainer; protected View detailsContainer;
@ViewById(resName = "details_list") @ViewById(resName = "details_list")
protected SherlockListView detailsList; protected ListView detailsList;
@ViewById @ViewById
protected TextView emptyText, errorText; protected TextView emptyText, errorText;
@ViewById @ViewById
@ -152,7 +150,7 @@ public class DetailsFragment extends SherlockFragment implements OnTrackersUpdat
errorText.setVisibility(View.GONE); errorText.setVisibility(View.GONE);
loadingProgress.setVisibility(View.GONE); loadingProgress.setVisibility(View.GONE);
// Also update the available actions in the action bar // Also update the available actions in the action bar
getActivity().supportInvalidateOptionsMenu(); getActivity().invalidateOptionsMenu();
// Refresh the detailed statistics (errors) and list of files // Refresh the detailed statistics (errors) and list of files
torrentDetails = null; torrentDetails = null;
torrentFiles = null; torrentFiles = null;
@ -377,7 +375,7 @@ public class DetailsFragment extends SherlockFragment implements OnTrackersUpdat
} }
} }
private MultiChoiceModeListenerCompat onDetailsSelected = new MultiChoiceModeListenerCompat() { private MultiChoiceModeListener onDetailsSelected = new MultiChoiceModeListener() {
SelectionManagerMode selectionManagerMode; SelectionManagerMode selectionManagerMode;
@ -398,6 +396,8 @@ public class DetailsFragment extends SherlockFragment implements OnTrackersUpdat
((TorrentsActivity) getActivity()).stopRefresh = true; ((TorrentsActivity) getActivity()).stopRefresh = true;
((TorrentsActivity) getActivity()).stopAutoRefresh(); ((TorrentsActivity) getActivity()).stopAutoRefresh();
} }
menu.findItem(R.id.action_download).setVisible(
currentServerSettings != null && Daemon.supportsFilePaths(currentServerSettings.getType()));
return selectionManagerMode.onPrepareActionMode(mode, menu); return selectionManagerMode.onPrepareActionMode(mode, menu);
} }

4
core/src/org/transdroid/core/gui/FilterEntryDialog.java

@ -18,10 +18,10 @@ package org.transdroid.core.gui;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.DialogFragment;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnClickListener;
import android.support.v4.app.DialogFragment;
import android.text.InputType; import android.text.InputType;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.EditText; import android.widget.EditText;
@ -51,7 +51,7 @@ public class FilterEntryDialog {
} }
}).setNegativeButton(android.R.string.cancel, null).create(); }).setNegativeButton(android.R.string.cancel, null).create();
}; };
}.show(activity.getSupportFragmentManager(), "filterentry"); }.show(activity.getFragmentManager(), "filterentry");
} }
} }

2
core/src/org/transdroid/core/gui/ServerStatusView.java

@ -96,7 +96,7 @@ public class ServerStatusView extends RelativeLayout implements OnRatesPickedLis
private OnClickListener onStartDownPickerClicked = new OnClickListener() { private OnClickListener onStartDownPickerClicked = new OnClickListener() {
public void onClick(View v) { public void onClick(View v) {
new SetTransferRatesDialog().setOnRatesPickedListener(ServerStatusView.this).show( new SetTransferRatesDialog().setOnRatesPickedListener(ServerStatusView.this).show(
activity.getSupportFragmentManager(), "SetTransferRatesDialog"); activity.getFragmentManager(), "SetTransferRatesDialog");
} }
}; };

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

@ -51,6 +51,11 @@ 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.*;
import org.transdroid.core.gui.navigation.Label;
import org.transdroid.core.gui.navigation.NavigationFilter;
import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.core.gui.navigation.RefreshableActivity;
import org.transdroid.core.gui.navigation.StatusType;
import org.transdroid.core.gui.rss.*; import org.transdroid.core.gui.rss.*;
import org.transdroid.core.gui.search.BarcodeHelper; import org.transdroid.core.gui.search.BarcodeHelper;
import org.transdroid.core.gui.search.FilePickerHelper; import org.transdroid.core.gui.search.FilePickerHelper;
@ -95,10 +100,13 @@ 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;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.OnRefreshListener; import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.OnRefreshListener;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.Options; import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.Options;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.ActionBar;
import android.app.ActionBar.OnNavigationListener;
import android.app.Activity;
import android.app.SearchManager; import android.app.SearchManager;
import android.content.ContentResolver; import android.content.ContentResolver;
import android.content.Intent; import android.content.Intent;
@ -106,20 +114,15 @@ import android.net.Uri;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MenuItem.OnActionExpandListener;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import com.actionbarsherlock.app.ActionBar; import android.widget.SearchView;
import com.actionbarsherlock.app.ActionBar.OnNavigationListener;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.MenuItem.OnActionExpandListener;
import com.actionbarsherlock.view.SherlockListView;
import com.actionbarsherlock.widget.SearchView;
import de.keyboardsurfer.android.widget.crouton.Crouton; import de.keyboardsurfer.android.widget.crouton.Crouton;
/** /**
@ -131,7 +134,7 @@ import de.keyboardsurfer.android.widget.crouton.Crouton;
*/ */
@EActivity(resName = "activity_torrents") @EActivity(resName = "activity_torrents")
@OptionsMenu(resName = "activity_torrents") @OptionsMenu(resName = "activity_torrents")
public class TorrentsActivity extends SherlockFragmentActivity implements OnNavigationListener, TorrentTasksExecutor, public class TorrentsActivity extends Activity implements OnNavigationListener, TorrentTasksExecutor,
RefreshableActivity { RefreshableActivity {
private static final int RESULT_DETAILS = 0; private static final int RESULT_DETAILS = 0;
@ -142,7 +145,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
@Bean @Bean
protected ConnectivityHelper connectivityHelper; protected ConnectivityHelper connectivityHelper;
@ViewById @ViewById
protected SherlockListView filtersList; protected ListView filtersList;
protected FilterListAdapter navigationListAdapter = null; protected FilterListAdapter navigationListAdapter = null;
protected FilterListDropDownAdapter navigationSpinnerAdapter = null; protected FilterListDropDownAdapter navigationSpinnerAdapter = null;
protected ServerStatusView serverStatusView; protected ServerStatusView serverStatusView;
@ -185,7 +188,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
// Set the theme according to the user preference // Set the theme according to the user preference
if (SystemSettings_.getInstance_(this).useDarkTheme()) { if (SystemSettings_.getInstance_(this).useDarkTheme()) {
setTheme(R.style.TransdroidTheme_Dark); setTheme(R.style.TransdroidTheme_Dark);
getSupportActionBar().setIcon(R.drawable.ic_activity_torrents); getActionBar().setIcon(R.drawable.ic_activity_torrents);
} }
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
} }
@ -196,11 +199,12 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
// Set up navigation, with an action bar spinner, server status indicator and possibly (if room) with a filter // Set up navigation, with an action bar spinner, server status indicator and possibly (if room) with a filter
// list // list
serverStatusView = ServerStatusView_.build(this); serverStatusView = ServerStatusView_.build(this);
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); ActionBar actionBar = getActionBar();
getSupportActionBar().setHomeButtonEnabled(false); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
getSupportActionBar().setDisplayShowTitleEnabled(false); actionBar.setHomeButtonEnabled(false);
getSupportActionBar().setDisplayShowCustomEnabled(true); actionBar.setDisplayShowTitleEnabled(false);
getSupportActionBar().setCustomView(serverStatusView); actionBar.setDisplayShowCustomEnabled(true);
actionBar.setCustomView(serverStatusView);
navigationSpinnerAdapter = FilterListDropDownAdapter_.getInstance_(this); navigationSpinnerAdapter = FilterListDropDownAdapter_.getInstance_(this);
// Servers are always added to the action bar spinner // Servers are always added to the action bar spinner
navigationSpinnerAdapter.updateServers(applicationSettings.getAllServerSettings()); navigationSpinnerAdapter.updateServers(applicationSettings.getAllServerSettings());
@ -227,7 +231,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
if (currentFilter == null) { if (currentFilter == null) {
currentFilter = StatusType.getShowAllType(this); currentFilter = StatusType.getShowAllType(this);
} }
getSupportActionBar().setListNavigationCallbacks(navigationSpinnerAdapter, this); actionBar.setListNavigationCallbacks(navigationSpinnerAdapter, this);
// Log messages from the server daemons using our singleton logger // Log messages from the server daemons using our singleton logger
DLog.setLogger(Log_.getInstance_(this)); DLog.setLogger(Log_.getInstance_(this));
@ -255,7 +259,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
// Set this as selection in the action bar spinner; we can use the server setting key since we have stable ids // Set this as selection in the action bar spinner; we can use the server setting key since we have stable ids
// Note: skipNextOnNavigationItemSelectedCalls is used to prevent this event from triggering filterSelected // Note: skipNextOnNavigationItemSelectedCalls is used to prevent this event from triggering filterSelected
getSupportActionBar().setSelectedNavigationItem(lastUsed.getOrder() + 1); actionBar.setSelectedNavigationItem(lastUsed.getOrder() + 1);
// Connect to the last used server or a server that was explicitly supplied in the starting intent // Connect to the last used server or a server that was explicitly supplied in the starting intent
if (firstStart) { if (firstStart) {
@ -422,7 +426,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
menu.findItem(R.id.action_help).setVisible(true); menu.findItem(R.id.action_help).setVisible(true);
if (fragmentTorrents != null) if (fragmentTorrents != null)
fragmentTorrents.updateConnectionStatus(false, null); fragmentTorrents.updateConnectionStatus(false, null);
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
return true; return true;
} }
@ -441,7 +445,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
menu.findItem(R.id.action_help).setVisible(false); menu.findItem(R.id.action_help).setVisible(false);
if (fragmentTorrents != null) if (fragmentTorrents != null)
fragmentTorrents.updateConnectionStatus(true, currentConnection.getType()); fragmentTorrents.updateConnectionStatus(true, currentConnection.getType());
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
return true; return true;
} }
@ -543,11 +547,11 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
filtersList.setVisibility(hasServerSettings ? View.VISIBLE : View.GONE); filtersList.setVisibility(hasServerSettings ? View.VISIBLE : View.GONE);
if (fragmentDetails != null) { if (fragmentDetails != null) {
if (hasServerSettings) if (hasServerSettings)
getSupportFragmentManager().beginTransaction().show(fragmentDetails).commit(); getFragmentManager().beginTransaction().show(fragmentDetails).commit();
else else
getSupportFragmentManager().beginTransaction().hide(fragmentDetails).commit(); getFragmentManager().beginTransaction().hide(fragmentDetails).commit();
} }
supportInvalidateOptionsMenu(); invalidateOptionsMenu();
} }
@Override @Override
@ -1254,7 +1258,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
@UiThread @UiThread
protected void onTurtleModeRetrieved(boolean turtleModeEnabled) { protected void onTurtleModeRetrieved(boolean turtleModeEnabled) {
turleModeEnabled = turtleModeEnabled; turleModeEnabled = turtleModeEnabled;
supportInvalidateOptionsMenu(); invalidateOptionsMenu();
} }
} }

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

@ -44,17 +44,16 @@ import org.transdroid.daemon.Torrent;
import org.transdroid.daemon.TorrentsComparator; import org.transdroid.daemon.TorrentsComparator;
import org.transdroid.daemon.TorrentsSortBy; import org.transdroid.daemon.TorrentsSortBy;
import android.app.Fragment;
import android.view.ActionMode;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.AbsListView.MultiChoiceModeListener;
import android.widget.ListView;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView; import android.widget.TextView;
import com.actionbarsherlock.app.SherlockFragment;
import com.actionbarsherlock.view.ActionMode;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.SherlockListView;
import com.actionbarsherlock.view.SherlockListView.MultiChoiceModeListenerCompat;
/** /**
* Fragment that shows a list of torrents that are active on the server. It supports sorting and filtering and can show * Fragment that shows a list of torrents that are active on the server. It supports sorting and filtering and can show
* connection progress and issues. However, actual task starting and execution and overall navigation elements are part * connection progress and issues. However, actual task starting and execution and overall navigation elements are part
@ -62,7 +61,7 @@ import com.actionbarsherlock.view.SherlockListView.MultiChoiceModeListenerCompat
* @author Eric Kok * @author Eric Kok
*/ */
@EFragment(resName = "fragment_torrents") @EFragment(resName = "fragment_torrents")
public class TorrentsFragment extends SherlockFragment implements OnLabelPickedListener { public class TorrentsFragment extends Fragment implements OnLabelPickedListener {
// Local data // Local data
@Bean @Bean
@ -93,8 +92,8 @@ public class TorrentsFragment extends SherlockFragment implements OnLabelPickedL
protected Daemon daemonType; protected Daemon daemonType;
// Views // Views
@ViewById(resName = "torrent_list") @ViewById(resName = "torrents_list")
protected SherlockListView torrentsList; protected ListView torrentsList;
@ViewById @ViewById
protected TextView emptyText; protected TextView emptyText;
@ViewById @ViewById
@ -169,7 +168,6 @@ public class TorrentsFragment extends SherlockFragment implements OnLabelPickedL
this.currentTextFilter = null; this.currentTextFilter = null;
this.currentNavigationFilter = null; this.currentNavigationFilter = null;
} }
clearCheckedStates();
applyAllFilters(); applyAllFilters();
} }
@ -239,7 +237,7 @@ public class TorrentsFragment extends SherlockFragment implements OnLabelPickedL
updateViewVisibility(); updateViewVisibility();
} }
private MultiChoiceModeListenerCompat onTorrentsSelected = new MultiChoiceModeListenerCompat() { private MultiChoiceModeListener onTorrentsSelected = new MultiChoiceModeListener() {
SelectionManagerMode selectionManagerMode; SelectionManagerMode selectionManagerMode;
@ -361,9 +359,8 @@ public class TorrentsFragment extends SherlockFragment implements OnLabelPickedL
} }
} }
@ItemClick(resName = "torrent_list") @ItemClick(resName = "torrents_list")
protected void torrentsListClicked(Torrent torrent) { protected void torrentsListClicked(Torrent torrent) {
clearCheckedStates();
// Show the torrent details fragment // Show the torrent details fragment
((TorrentsActivity) getActivity()).openDetails(torrent); ((TorrentsActivity) getActivity()).openDetails(torrent);
} }
@ -375,13 +372,6 @@ public class TorrentsFragment extends SherlockFragment implements OnLabelPickedL
} }
} }
private void clearCheckedStates() {
// Remove any selection the user has made first
for (int i = 0; i < torrentsList.getAdapter().getCount(); i++) {
torrentsList.setItemChecked(i, false);
}
}
/** /**
* Updates the shown screen depending on whether we have a connection (so torrents can be shown) or not (in case we * Updates the shown screen depending on whether we have a connection (so torrents can be shown) or not (in case we
* need to show a message suggesting help). This should only ever be called on the UI thread. * need to show a message suggesting help). This should only ever be called on the UI thread.

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

@ -2,11 +2,11 @@ package org.transdroid.core.gui.lists;
import org.transdroid.core.R; import org.transdroid.core.R;
import uk.co.senab.actionbarpulltorefresh.library.DefaultHeaderTransformer;
import android.app.Activity; import android.app.Activity;
import android.view.View; import android.view.View;
import uk.co.senab.actionbarpulltorefresh.extras.actionbarsherlock.AbsDefaultHeaderTransformer;
public class NoProgressHeaderTransformer extends AbsDefaultHeaderTransformer { public class NoProgressHeaderTransformer extends DefaultHeaderTransformer {
@Override @Override
public void onViewCreated(Activity activity, View headerView) { public void onViewCreated(Activity activity, View headerView) {

14
core/src/org/transdroid/core/gui/navigation/DialogHelper.java

@ -27,13 +27,11 @@ import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.Window; import android.view.Window;
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
/** /**
* Helper class that show a dialog either as pop-up or as full screen activity. Should be used by calling * Helper class that show a dialog either as pop-up or as full screen activity. Should be used by calling
* {@link #showDialog(Context, DialogSpecification)} with in instance of the dialog specification that should be shown, * {@link #showDialog(Context, DialogSpecification)} with in instance of the dialog specification that should be shown,
@ -41,7 +39,7 @@ import com.actionbarsherlock.view.MenuItem;
* @author Eric Kok * @author Eric Kok
*/ */
@EActivity @EActivity
public class DialogHelper extends SherlockActivity { public class DialogHelper extends Activity {
@Extra @Extra
protected DialogSpecification dialog; protected DialogSpecification dialog;
@ -50,12 +48,12 @@ public class DialogHelper extends SherlockActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(dialog.getDialogLayoutId()); setContentView(dialog.getDialogLayoutId());
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
} }
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater menuInflater = getSupportMenuInflater(); MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(dialog.getDialogMenuId(), menu); menuInflater.inflate(dialog.getDialogMenuId(), menu);
return super.onCreateOptionsMenu(menu); return super.onCreateOptionsMenu(menu);
} }

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

@ -59,13 +59,13 @@ public class NavigationHelper {
* Use with {@link Crouton#showText(android.app.Activity, int, Style)} (and variants) to display error messages. * Use with {@link Crouton#showText(android.app.Activity, int, Style)} (and variants) to display error messages.
*/ */
public static Style CROUTON_ERROR_STYLE = new Style.Builder().setBackgroundColor(R.color.crouton_error) public static Style CROUTON_ERROR_STYLE = new Style.Builder().setBackgroundColor(R.color.crouton_error)
.setTextSize(13).setDuration(2500).build(); .setTextSize(13).build();
/** /**
* Use with {@link Crouton#showText(android.app.Activity, int, Style)} (and variants) to display info messages. * Use with {@link Crouton#showText(android.app.Activity, int, Style)} (and variants) to display info messages.
*/ */
public static Style CROUTON_INFO_STYLE = new Style.Builder().setBackgroundColor(R.color.crouton_info) public static Style CROUTON_INFO_STYLE = new Style.Builder().setBackgroundColor(R.color.crouton_info)
.setTextSize(13).setDuration(1500).build(); .setTextSize(13).build();
/** /**
* Returns (and initialises, if needed) an image cache that uses memory and (1MB) local storage. * Returns (and initialises, if needed) an image cache that uses memory and (1MB) local storage.

11
core/src/org/transdroid/core/gui/navigation/SelectionManagerMode.java

@ -20,21 +20,20 @@ import org.transdroid.core.gui.navigation.SelectionModificationSpinner.OnModific
import org.transdroid.daemon.Finishable; import org.transdroid.daemon.Finishable;
import android.util.SparseBooleanArray; import android.util.SparseBooleanArray;
import android.view.ActionMode;
import android.view.Menu;
import android.view.MenuItem;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.AbsListView.MultiChoiceModeListener;
import android.widget.ListView; import android.widget.ListView;
import com.actionbarsherlock.view.ActionMode;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.SherlockListView.MultiChoiceModeListenerCompat;
/** /**
* A helper to implement {@link ListView} selection modification behaviour with the {@link SelectionModificationSpinner} * A helper to implement {@link ListView} selection modification behaviour with the {@link SelectionModificationSpinner}
* by implementing the specific actions and providing a title based on the number of currently selected items. It is * by implementing the specific actions and providing a title based on the number of currently selected items. It is
* important that the provided list was instantiated already. * important that the provided list was instantiated already.
* @author Eric Kok * @author Eric Kok
*/ */
public class SelectionManagerMode implements MultiChoiceModeListenerCompat, OnModificationActionSelectedListener { public class SelectionManagerMode implements MultiChoiceModeListener, OnModificationActionSelectedListener {
private ListView managedList; private ListView managedList;
private int titleTemplateResource; private int titleTemplateResource;

2
core/src/org/transdroid/core/gui/navigation/SetLabelDialog.java

@ -25,10 +25,10 @@ import org.transdroid.core.gui.lists.SimpleListItem;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnClickListener;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.View; import android.view.View;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemClickListener;

2
core/src/org/transdroid/core/gui/navigation/SetStorageLocationDialog.java

@ -22,10 +22,10 @@ import org.transdroid.core.R;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnClickListener;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.View; import android.view.View;
import android.widget.EditText; import android.widget.EditText;

2
core/src/org/transdroid/core/gui/navigation/SetTrackersDialog.java

@ -24,10 +24,10 @@ import org.transdroid.core.R;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnClickListener;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.View; import android.view.View;
import android.widget.EditText; import android.widget.EditText;

2
core/src/org/transdroid/core/gui/navigation/SetTransferRatesDialog.java

@ -21,8 +21,8 @@ import java.security.InvalidParameterException;
import org.transdroid.core.R; import org.transdroid.core.R;
import android.app.Dialog; import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.Window; import android.view.Window;

12
core/src/org/transdroid/core/gui/rss/RssfeedsActivity.java

@ -36,18 +36,16 @@ import org.transdroid.core.rssparser.Channel;
import org.transdroid.core.rssparser.RssParser; import org.transdroid.core.rssparser.RssParser;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils; import android.text.TextUtils;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import de.keyboardsurfer.android.widget.crouton.Crouton; import de.keyboardsurfer.android.widget.crouton.Crouton;
@EActivity(resName = "activity_rssfeeds") @EActivity(resName = "activity_rssfeeds")
public class RssfeedsActivity extends SherlockFragmentActivity { public class RssfeedsActivity extends Activity {
// Settings and local data // Settings and local data
@Bean @Bean
@ -65,7 +63,7 @@ public class RssfeedsActivity extends SherlockFragmentActivity {
// Set the theme according to the user preference // Set the theme according to the user preference
if (SystemSettings_.getInstance_(this).useDarkTheme()) { if (SystemSettings_.getInstance_(this).useDarkTheme()) {
setTheme(R.style.TransdroidTheme_Dark); setTheme(R.style.TransdroidTheme_Dark);
getSupportActionBar().setIcon(R.drawable.ic_activity_torrents); getActionBar().setIcon(R.drawable.ic_activity_torrents);
} }
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
} }
@ -73,8 +71,8 @@ public class RssfeedsActivity extends SherlockFragmentActivity {
@AfterViews @AfterViews
protected void init() { protected void init() {
// Simple action bar with up button and correct title font // Simple action bar with up button and correct title font
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(NavigationHelper.buildCondensedFontString(getString(R.string.rss_feeds))); getActionBar().setTitle(NavigationHelper.buildCondensedFontString(getString(R.string.rss_feeds)));
} }
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @TargetApi(Build.VERSION_CODES.HONEYCOMB)

15
core/src/org/transdroid/core/gui/rss/RssfeedsFragment.java

@ -28,25 +28,24 @@ import org.androidannotations.annotations.ViewById;
import org.transdroid.core.R; import org.transdroid.core.R;
import org.transdroid.core.gui.settings.MainSettingsActivity_; import org.transdroid.core.gui.settings.MainSettingsActivity_;
import android.app.Fragment;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import com.actionbarsherlock.app.SherlockFragment;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.SherlockListView;
/** /**
* Fragment lists the RSS feeds the user wants to monitor and, if room, the list of items in a feed in a right pane. * Fragment lists the RSS feeds the user wants to monitor and, if room, the list of items in a feed in a right pane.
* @author Eric Kok * @author Eric Kok
*/ */
@EFragment(resName = "fragment_rssfeeds") @EFragment(resName = "fragment_rssfeeds")
@OptionsMenu(resName = "fragment_rssfeeds") @OptionsMenu(resName = "fragment_rssfeeds")
public class RssfeedsFragment extends SherlockFragment { public class RssfeedsFragment extends Fragment {
// Views // Views
@ViewById(resName = "rssfeeds_list") @ViewById(resName = "rssfeeds_list")
protected SherlockListView feedsList; protected ListView feedsList;
@Bean @Bean
protected RssfeedsAdapter rssfeedsAdapter; protected RssfeedsAdapter rssfeedsAdapter;
@ViewById @ViewById
@ -62,7 +61,7 @@ public class RssfeedsFragment extends SherlockFragment {
boolean hasSettings = !(loaders == null || loaders.size() == 0); boolean hasSettings = !(loaders == null || loaders.size() == 0);
feedsList.setVisibility(hasSettings ? View.VISIBLE: View.GONE); feedsList.setVisibility(hasSettings ? View.VISIBLE: View.GONE);
nosettingsText.setVisibility(hasSettings ? View.GONE: View.VISIBLE); nosettingsText.setVisibility(hasSettings ? View.GONE: View.VISIBLE);
getActivity().supportInvalidateOptionsMenu(); getActivity().invalidateOptionsMenu();
} }
@Override @Override

11
core/src/org/transdroid/core/gui/rss/RssitemsActivity.java

@ -28,14 +28,13 @@ import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.core.rssparser.Channel; import org.transdroid.core.rssparser.Channel;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.Activity;
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 com.actionbarsherlock.app.SherlockFragmentActivity;
@EActivity(resName = "activity_rssitems") @EActivity(resName = "activity_rssitems")
public class RssitemsActivity extends SherlockFragmentActivity { public class RssitemsActivity extends Activity {
@Extra @Extra
protected Channel rssfeed = null; protected Channel rssfeed = null;
@ -50,7 +49,7 @@ public class RssitemsActivity extends SherlockFragmentActivity {
// Set the theme according to the user preference // Set the theme according to the user preference
if (SystemSettings_.getInstance_(this).useDarkTheme()) { if (SystemSettings_.getInstance_(this).useDarkTheme()) {
setTheme(R.style.TransdroidTheme_Dark); setTheme(R.style.TransdroidTheme_Dark);
getSupportActionBar().setIcon(R.drawable.ic_activity_torrents); getActionBar().setIcon(R.drawable.ic_activity_torrents);
} }
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
} }
@ -65,8 +64,8 @@ public class RssitemsActivity extends SherlockFragmentActivity {
} }
// Simple action bar with up button and torrent name as title // Simple action bar with up button and torrent name as title
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(NavigationHelper.buildCondensedFontString(rssfeedName)); getActionBar().setTitle(NavigationHelper.buildCondensedFontString(rssfeedName));
// Get the intent extras and show them to the already loaded fragment // Get the intent extras and show them to the already loaded fragment
fragmentItems.update(rssfeed, false); fragmentItems.update(rssfeed, false);

22
core/src/org/transdroid/core/gui/rss/RssitemsFragment.java

@ -35,23 +35,21 @@ import org.transdroid.core.rssparser.Item;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.app.DialogFragment;
import android.app.Fragment;
import android.app.SearchManager; import android.app.SearchManager;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.ActionMode;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.AbsListView.MultiChoiceModeListener;
import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.actionbarsherlock.app.SherlockFragment;
import com.actionbarsherlock.view.ActionMode;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.SherlockListView;
import com.actionbarsherlock.view.SherlockListView.MultiChoiceModeListenerCompat;
import de.keyboardsurfer.android.widget.crouton.Crouton; import de.keyboardsurfer.android.widget.crouton.Crouton;
/** /**
@ -59,7 +57,7 @@ import de.keyboardsurfer.android.widget.crouton.Crouton;
* @author Eric Kok * @author Eric Kok
*/ */
@EFragment(resName = "fragment_rssitems") @EFragment(resName = "fragment_rssitems")
public class RssitemsFragment extends SherlockFragment { public class RssitemsFragment extends Fragment {
@InstanceState @InstanceState
protected Channel rssfeed = null; protected Channel rssfeed = null;
@ -68,7 +66,7 @@ public class RssitemsFragment extends SherlockFragment {
// Views // Views
@ViewById(resName = "rssitems_list") @ViewById(resName = "rssitems_list")
protected SherlockListView rssitemsList; protected ListView rssitemsList;
@Bean @Bean
protected RssitemsAdapter rssitemsAdapter; protected RssitemsAdapter rssitemsAdapter;
@ViewById @ViewById
@ -119,7 +117,7 @@ public class RssitemsFragment extends SherlockFragment {
startActivity(i); startActivity(i);
} }
private MultiChoiceModeListenerCompat onItemsSelected = new MultiChoiceModeListenerCompat() { private MultiChoiceModeListener onItemsSelected = new MultiChoiceModeListener() {
SelectionManagerMode selectionManagerMode; SelectionManagerMode selectionManagerMode;

11
core/src/org/transdroid/core/gui/search/BarcodeHelper.java

@ -20,16 +20,15 @@ import org.transdroid.core.R;
import org.transdroid.core.app.search.GoogleWebSearchBarcodeResolver; import org.transdroid.core.app.search.GoogleWebSearchBarcodeResolver;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.DialogFragment;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnClickListener;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.support.v4.app.DialogFragment;
import android.text.TextUtils; import android.text.TextUtils;
import com.actionbarsherlock.app.SherlockFragmentActivity;
public class BarcodeHelper { public class BarcodeHelper {
public static final int ACTIVITY_BARCODE = 0x0000c0de; // A 'random' ID to identify scan intents public static final int ACTIVITY_BARCODE = 0x0000c0de; // A 'random' ID to identify scan intents
@ -43,7 +42,7 @@ public class BarcodeHelper {
* the bar code scanner * the bar code scanner
*/ */
@SuppressLint("ValidFragment") @SuppressLint("ValidFragment")
public static void startBarcodeScanner(final SherlockFragmentActivity activity) { public static void startBarcodeScanner(final Activity activity) {
try { try {
// Start a bar code scanner that can handle the SCAN intent (specifically ZXing) // Start a bar code scanner that can handle the SCAN intent (specifically ZXing)
activity.startActivityForResult(new Intent("com.google.zxing.client.android.SCAN"), ACTIVITY_BARCODE); activity.startActivityForResult(new Intent("com.google.zxing.client.android.SCAN"), ACTIVITY_BARCODE);
@ -61,12 +60,12 @@ public class BarcodeHelper {
} }
}).setNegativeButton(android.R.string.no, null).create(); }).setNegativeButton(android.R.string.no, null).create();
}; };
}.show(activity.getSupportFragmentManager(), "installscanner"); }.show(activity.getFragmentManager(), "installscanner");
} }
} }
/** /**
* The activity that called {@link #startBarcodeScanner(SherlockFragmentActivity)} should call this after the scan * The activity that called {@link #startBarcodeScanner(Activity)} should call this after the scan
* result was returned. This will parse the scan data and return a query search query appropriate to the bar code. * result was returned. This will parse the scan data and return a query search query appropriate to the bar code.
* @param resultCode The raw result code as returned by the bar code scanner * @param resultCode The raw result code as returned by the bar code scanner
* @param data The raw data as returned from the bar code scanner * @param data The raw data as returned from the bar code scanner

9
core/src/org/transdroid/core/gui/search/FilePickerHelper.java

@ -19,14 +19,13 @@ package org.transdroid.core.gui.search;
import org.transdroid.core.R; import org.transdroid.core.R;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.DialogFragment;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnClickListener;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.support.v4.app.DialogFragment;
import com.actionbarsherlock.app.SherlockFragmentActivity;
public class FilePickerHelper { public class FilePickerHelper {
@ -40,7 +39,7 @@ public class FilePickerHelper {
* the file picker * the file picker
*/ */
@SuppressLint("ValidFragment") @SuppressLint("ValidFragment")
public static void startFilePicker(final SherlockFragmentActivity activity) { public static void startFilePicker(final Activity activity) {
try { try {
// Start a file manager that can handle the file/* file/* intents // Start a file manager that can handle the file/* file/* intents
activity.startActivityForResult(new Intent(Intent.ACTION_GET_CONTENT).setType("file/*"), activity.startActivityForResult(new Intent(Intent.ACTION_GET_CONTENT).setType("file/*"),
@ -65,7 +64,7 @@ public class FilePickerHelper {
} }
}).setNegativeButton(android.R.string.no, null).create(); }).setNegativeButton(android.R.string.no, null).create();
}; };
}.show(activity.getSupportFragmentManager(), "installfilemanager"); }.show(activity.getFragmentManager(), "installfilemanager");
} }
} }
} }

38
core/src/org/transdroid/core/gui/search/SearchActivity.java

@ -34,25 +34,24 @@ import org.transdroid.core.gui.*;
import org.transdroid.core.gui.navigation.NavigationHelper; import org.transdroid.core.gui.navigation.NavigationHelper;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.ActionBar;
import android.app.ActionBar.OnNavigationListener;
import android.app.Activity;
import android.app.SearchManager; import android.app.SearchManager;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.provider.SearchRecentSuggestions; import android.provider.SearchRecentSuggestions;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.SearchView;
import android.widget.TextView; import android.widget.TextView;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.ActionBar.OnNavigationListener;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.SherlockListView;
import com.actionbarsherlock.widget.SearchView;
/** /**
* An activity that shows search results to the user (after a query was supplied by the standard Android search manager) * An activity that shows search results to the user (after a query was supplied by the standard Android search manager)
* and either shows the list of search sites on the left (e.g. on tablets) or allows switching between search sites via * and either shows the list of search sites on the left (e.g. on tablets) or allows switching between search sites via
@ -61,12 +60,12 @@ import com.actionbarsherlock.widget.SearchView;
*/ */
@EActivity(resName = "activity_search") @EActivity(resName = "activity_search")
@OptionsMenu(resName = "activity_search") @OptionsMenu(resName = "activity_search")
public class SearchActivity extends SherlockFragmentActivity implements OnNavigationListener { public class SearchActivity extends Activity implements OnNavigationListener {
@FragmentById(resName = "searchresults_list") @FragmentById(resName = "searchresults_list")
protected SearchResultsFragment fragmentResults; protected SearchResultsFragment fragmentResults;
@ViewById @ViewById
protected SherlockListView searchsitesList; protected ListView searchsitesList;
@ViewById @ViewById
protected TextView installmoduleText; protected TextView installmoduleText;
@Bean @Bean
@ -90,7 +89,7 @@ public class SearchActivity extends SherlockFragmentActivity implements OnNaviga
// Set the theme according to the user preference // Set the theme according to the user preference
if (SystemSettings_.getInstance_(this).useDarkTheme()) { if (SystemSettings_.getInstance_(this).useDarkTheme()) {
setTheme(R.style.TransdroidTheme_Dark); setTheme(R.style.TransdroidTheme_Dark);
getSupportActionBar().setIcon(R.drawable.ic_activity_torrents); getActionBar().setIcon(R.drawable.ic_activity_torrents);
} }
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
} }
@ -120,7 +119,7 @@ public class SearchActivity extends SherlockFragmentActivity implements OnNaviga
} }
// Allow site selection via list (on large screens) or action bar spinner // Allow site selection via list (on large screens) or action bar spinner
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
if (searchsitesList != null) { if (searchsitesList != null) {
// The current layout has a dedicated list view to select the search site // The current layout has a dedicated list view to select the search site
SearchSitesAdapter searchSitesAdapter = SearchSitesAdapter_.getInstance_(this); SearchSitesAdapter searchSitesAdapter = SearchSitesAdapter_.getInstance_(this);
@ -132,13 +131,12 @@ public class SearchActivity extends SherlockFragmentActivity implements OnNaviga
searchsitesList.setItemChecked(lastUsedPosition, true); searchsitesList.setItemChecked(lastUsedPosition, true);
} else { } else {
// Use the action bar spinner to select sites // Use the action bar spinner to select sites
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
getSupportActionBar().setDisplayShowTitleEnabled(false); getActionBar().setDisplayShowTitleEnabled(false);
getSupportActionBar() getActionBar().setListNavigationCallbacks(new SearchSettingsDropDownAdapter(this, searchSites), this);
.setListNavigationCallbacks(new SearchSettingsDropDownAdapter(this, searchSites), this);
// Select the last used site; this also starts the search! // Select the last used site; this also starts the search!
if (lastUsedPosition >= 0) if (lastUsedPosition >= 0)
getSupportActionBar().setSelectedNavigationItem(lastUsedPosition); getActionBar().setSelectedNavigationItem(lastUsedPosition);
} }
} }
@ -172,9 +170,9 @@ public class SearchActivity extends SherlockFragmentActivity implements OnNaviga
if (searchsitesList != null) if (searchsitesList != null)
searchsitesList.setVisibility(searchInstalled ? View.VISIBLE : View.GONE); searchsitesList.setVisibility(searchInstalled ? View.VISIBLE : View.GONE);
if (searchInstalled) if (searchInstalled)
getSupportFragmentManager().beginTransaction().show(fragmentResults).commit(); getFragmentManager().beginTransaction().show(fragmentResults).commit();
else else
getSupportFragmentManager().beginTransaction().hide(fragmentResults).commit(); getFragmentManager().beginTransaction().hide(fragmentResults).commit();
installmoduleText.setVisibility(searchInstalled ? View.GONE : View.VISIBLE); installmoduleText.setVisibility(searchInstalled ? View.GONE : View.VISIBLE);
return true; return true;
@ -274,7 +272,7 @@ public class SearchActivity extends SherlockFragmentActivity implements OnNaviga
// Save the search site currently used to search for future usage // Save the search site currently used to search for future usage
applicationSettings.setLastUsedSearchSite(lastUsedSite); applicationSettings.setLastUsedSearchSite(lastUsedSite);
// Update the activity title (only shown on large devices) // Update the activity title (only shown on large devices)
getSupportActionBar().setTitle( getActionBar().setTitle(
NavigationHelper.buildCondensedFontString(getString(R.string.search_queryonsite, lastUsedQuery, NavigationHelper.buildCondensedFontString(getString(R.string.search_queryonsite, lastUsedQuery,
lastUsedSite.getName()))); lastUsedSite.getName())));
// Ask the results fragment to start a search for the specified query // Ask the results fragment to start a search for the specified query

20
core/src/org/transdroid/core/gui/search/SearchResultsFragment.java

@ -38,20 +38,18 @@ import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.core.gui.navigation.NavigationHelper_; import org.transdroid.core.gui.navigation.NavigationHelper_;
import org.transdroid.core.gui.navigation.SelectionManagerMode; import org.transdroid.core.gui.navigation.SelectionManagerMode;
import android.app.Fragment;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.view.ActionMode;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.AbsListView.MultiChoiceModeListener;
import android.widget.ListView;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.actionbarsherlock.app.SherlockFragment;
import com.actionbarsherlock.view.ActionMode;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.SherlockListView;
import com.actionbarsherlock.view.SherlockListView.MultiChoiceModeListenerCompat;
import de.keyboardsurfer.android.widget.crouton.Crouton; import de.keyboardsurfer.android.widget.crouton.Crouton;
/** /**
@ -59,7 +57,7 @@ import de.keyboardsurfer.android.widget.crouton.Crouton;
* @author Eric Kok * @author Eric Kok
*/ */
@EFragment(resName = "fragment_searchresults") @EFragment(resName = "fragment_searchresults")
public class SearchResultsFragment extends SherlockFragment { public class SearchResultsFragment extends Fragment {
@InstanceState @InstanceState
protected ArrayList<SearchResult> results = null; protected ArrayList<SearchResult> results = null;
@ -70,7 +68,7 @@ public class SearchResultsFragment extends SherlockFragment {
// Views // Views
@ViewById(resName = "searchresults_list") @ViewById(resName = "searchresults_list")
protected SherlockListView resultsList; protected ListView resultsList;
@Bean @Bean
protected SearchResultsAdapter resultsAdapter; protected SearchResultsAdapter resultsAdapter;
@ViewById @ViewById
@ -141,7 +139,7 @@ public class SearchResultsFragment extends SherlockFragment {
startActivity(i); startActivity(i);
} }
private MultiChoiceModeListenerCompat onItemsSelected = new MultiChoiceModeListenerCompat() { private MultiChoiceModeListener onItemsSelected = new MultiChoiceModeListener() {
SelectionManagerMode selectionManagerMode; SelectionManagerMode selectionManagerMode;

4
core/src/org/transdroid/core/gui/search/UrlEntryDialog.java

@ -22,13 +22,13 @@ import org.transdroid.core.gui.navigation.NavigationHelper;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.DialogFragment;
import android.content.ClipboardManager; import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnClickListener;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.support.v4.app.DialogFragment;
import android.text.InputType; import android.text.InputType;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
@ -76,7 +76,7 @@ public class UrlEntryDialog {
} }
}).setNegativeButton(android.R.string.cancel, null).create(); }).setNegativeButton(android.R.string.cancel, null).create();
}; };
}.show(activity.getSupportFragmentManager(), "urlentry"); }.show(activity.getFragmentManager(), "urlentry");
} }
} }

7
core/src/org/transdroid/core/gui/settings/HelpSettingsActivity.java

@ -34,11 +34,10 @@ import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.preference.Preference; import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener; import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceActivity;
import com.actionbarsherlock.app.SherlockPreferenceActivity;
@EActivity @EActivity
public class HelpSettingsActivity extends SherlockPreferenceActivity { public class HelpSettingsActivity extends PreferenceActivity {
protected static final int DIALOG_CHANGELOG = 0; protected static final int DIALOG_CHANGELOG = 0;
protected static final int DIALOG_ABOUT = 1; protected static final int DIALOG_ABOUT = 1;
@ -58,7 +57,7 @@ public class HelpSettingsActivity extends SherlockPreferenceActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
// Just load the system-related preferences from XML // Just load the system-related preferences from XML
addPreferencesFromResource(R.xml.pref_help); addPreferencesFromResource(R.xml.pref_help);

5
core/src/org/transdroid/core/gui/settings/KeyBoundPreferencesActivity.java

@ -28,12 +28,11 @@ import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference; import android.preference.EditTextPreference;
import android.preference.ListPreference; import android.preference.ListPreference;
import android.preference.Preference; import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.preference.PreferenceScreen; import android.preference.PreferenceScreen;
import android.text.method.PasswordTransformationMethod; import android.text.method.PasswordTransformationMethod;
import com.actionbarsherlock.app.SherlockPreferenceActivity;
/** /**
* Abstract activity that helps implement a preference screen for key-bound settings, i.e. settings of which there can * Abstract activity that helps implement a preference screen for key-bound settings, i.e. settings of which there can
* be multiple and which are identified by an ascending order number/unique key. A typical implementation calls * be multiple and which are identified by an ascending order number/unique key. A typical implementation calls
@ -44,7 +43,7 @@ import com.actionbarsherlock.app.SherlockPreferenceActivity;
* @author Eric Kok * @author Eric Kok
*/ */
@EActivity @EActivity
public abstract class KeyBoundPreferencesActivity extends SherlockPreferenceActivity { public abstract class KeyBoundPreferencesActivity extends PreferenceActivity {
@Extra @Extra
protected int key = -1; protected int key = -1;

7
core/src/org/transdroid/core/gui/settings/MainSettingsActivity.java

@ -51,17 +51,16 @@ import android.os.Bundle;
import android.preference.ListPreference; import android.preference.ListPreference;
import android.preference.Preference; import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener; import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceActivity;
import android.view.View; import android.view.View;
import com.actionbarsherlock.app.SherlockPreferenceActivity;
/** /**
* The main activity that provides access to all application settings. It shows the configured serves, web search sites * The main activity that provides access to all application settings. It shows the configured serves, web search sites
* and RSS feeds along with other general settings. * and RSS feeds along with other general settings.
* @author Eric Kok * @author Eric Kok
*/ */
@EActivity @EActivity
public class MainSettingsActivity extends SherlockPreferenceActivity { public class MainSettingsActivity extends PreferenceActivity {
protected static final int DIALOG_ADDSEEDBOX = 0; protected static final int DIALOG_ADDSEEDBOX = 0;
@ -84,7 +83,7 @@ public class MainSettingsActivity extends SherlockPreferenceActivity {
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
prefs = getPreferenceManager().getSharedPreferences(); prefs = getPreferenceManager().getSharedPreferences();
if (getPreferenceScreen() != null) if (getPreferenceScreen() != null)

7
core/src/org/transdroid/core/gui/settings/NotificationSettingsActivity.java

@ -29,11 +29,10 @@ import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceActivity;
import com.actionbarsherlock.app.SherlockPreferenceActivity;
@EActivity @EActivity
public class NotificationSettingsActivity extends SherlockPreferenceActivity implements public class NotificationSettingsActivity extends PreferenceActivity implements
OnSharedPreferenceChangeListener { OnSharedPreferenceChangeListener {
@Bean @Bean
@ -44,7 +43,7 @@ public class NotificationSettingsActivity extends SherlockPreferenceActivity imp
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
// Load the notification-related preferences from XML and update availability thereof // Load the notification-related preferences from XML and update availability thereof
addPreferencesFromResource(R.xml.pref_notifications); addPreferencesFromResource(R.xml.pref_notifications);

2
core/src/org/transdroid/core/gui/settings/OverflowPreference.java

@ -48,7 +48,7 @@ public class OverflowPreference extends Preference {
int top = layout.getPaddingTop(); int top = layout.getPaddingTop();
int right = layout.getPaddingRight(); int right = layout.getPaddingRight();
int left = layout.getPaddingLeft(); int left = layout.getPaddingLeft();
layout.setBackgroundResource(R.drawable.abs__item_background_holo_light); layout.setBackgroundResource(R.drawable.selectable_background_holo_light);
layout.setPadding(left, top, right, bottom); layout.setPadding(left, top, right, bottom);
layout.setOnClickListener(new OnClickListener() { layout.setOnClickListener(new OnClickListener() {
@Override @Override

2
core/src/org/transdroid/core/gui/settings/RssfeedSettingsActivity.java

@ -46,7 +46,7 @@ public class RssfeedSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen // Load the raw preferences to show in this screen
init(R.xml.pref_rssfeed, ApplicationSettings_.getInstance_(this).getMaxRssfeed()); init(R.xml.pref_rssfeed, ApplicationSettings_.getInstance_(this).getMaxRssfeed());

2
core/src/org/transdroid/core/gui/settings/ServerSettingsActivity.java

@ -52,7 +52,7 @@ public class ServerSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen // Load the raw preferences to show in this screen
init(R.xml.pref_server, ApplicationSettings_.getInstance_(this).getMaxNormalServer()); init(R.xml.pref_server, ApplicationSettings_.getInstance_(this).getMaxNormalServer());

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

@ -43,14 +43,12 @@ import android.os.Bundle;
import android.preference.CheckBoxPreference; import android.preference.CheckBoxPreference;
import android.preference.Preference; import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener; import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import com.actionbarsherlock.app.SherlockPreferenceActivity;
import de.keyboardsurfer.android.widget.crouton.Crouton; import de.keyboardsurfer.android.widget.crouton.Crouton;
@EActivity @EActivity
public class SystemSettingsActivity extends SherlockPreferenceActivity { public class SystemSettingsActivity extends PreferenceActivity {
protected static final int DIALOG_IMPORTSETTINGS = 0; protected static final int DIALOG_IMPORTSETTINGS = 0;
protected static final int DIALOG_EXPORTSETTINGS = 1; protected static final int DIALOG_EXPORTSETTINGS = 1;
@ -69,7 +67,7 @@ public class SystemSettingsActivity extends SherlockPreferenceActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
// Just load the system-related preferences from XML // Just load the system-related preferences from XML
addPreferencesFromResource(R.xml.pref_system); addPreferencesFromResource(R.xml.pref_system);

2
core/src/org/transdroid/core/gui/settings/WebsearchSettingsActivity.java

@ -46,7 +46,7 @@ public class WebsearchSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen // Load the raw preferences to show in this screen
init(R.xml.pref_websearch, ApplicationSettings_.getInstance_(this).getMaxWebsearch()); init(R.xml.pref_websearch, ApplicationSettings_.getInstance_(this).getMaxWebsearch());

2
core/src/org/transdroid/core/seedbox/SeedstuffSettingsActivity.java

@ -42,7 +42,7 @@ public class SeedstuffSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen // Load the raw preferences to show in this screen
init(R.xml.pref_seedbox_seedstuff, init(R.xml.pref_seedbox_seedstuff,

2
core/src/org/transdroid/core/seedbox/XirvikDediSettingsActivity.java

@ -42,7 +42,7 @@ public class XirvikDediSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen // Load the raw preferences to show in this screen
init(R.xml.pref_seedbox_xirvikdedi, init(R.xml.pref_seedbox_xirvikdedi,

2
core/src/org/transdroid/core/seedbox/XirvikSemiSettingsActivity.java

@ -42,7 +42,7 @@ public class XirvikSemiSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen // Load the raw preferences to show in this screen
init(R.xml.pref_seedbox_xirviksemi, init(R.xml.pref_seedbox_xirviksemi,

2
core/src/org/transdroid/core/seedbox/XirvikSharedSettingsActivity.java

@ -55,7 +55,7 @@ public class XirvikSharedSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen // Load the raw preferences to show in this screen
init(R.xml.pref_seedbox_xirvikshared, init(R.xml.pref_seedbox_xirvikshared,

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

@ -38,14 +38,14 @@ import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.daemon.util.HttpHelper; import org.transdroid.daemon.util.HttpHelper;
import android.app.IntentService; import android.app.IntentService;
import android.app.Notification;
import android.app.Notification.Builder;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManager.NameNotFoundException;
import android.net.Uri; import android.net.Uri;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationCompat.Builder;
@EService @EService
public class AppUpdateService extends IntentService { public class AppUpdateService extends IntentService {
@ -165,14 +165,15 @@ public class AppUpdateService extends IntentService {
return appVersion; return appVersion;
} }
@SuppressWarnings("deprecation")
private void newNotification(String ticker, String title, String text, String downloadUrl, int notifyID) { private void newNotification(String ticker, String title, String text, String downloadUrl, int notifyID) {
PendingIntent pi = PendingIntent.getActivity(this, notifyID, PendingIntent pi = PendingIntent.getActivity(this, notifyID,
new Intent(Intent.ACTION_VIEW, Uri.parse(downloadUrl)), Intent.FLAG_ACTIVITY_NEW_TASK); new Intent(Intent.ACTION_VIEW, Uri.parse(downloadUrl)), Intent.FLAG_ACTIVITY_NEW_TASK);
Builder builder = new NotificationCompat.Builder(this).setSmallIcon(R.drawable.ic_stat_notification) Builder builder = new Notification.Builder(this).setSmallIcon(R.drawable.ic_stat_notification)
.setTicker(ticker).setContentTitle(title).setContentText(text) .setTicker(ticker).setContentTitle(title).setContentText(text)
.setLights(notificationSettings.getDesiredLedColour(), 600, 1000) .setLights(notificationSettings.getDesiredLedColour(), 600, 1000)
.setSound(notificationSettings.getSound()).setAutoCancel(true).setContentIntent(pi); .setSound(notificationSettings.getSound()).setAutoCancel(true).setContentIntent(pi);
notificationManager.notify(notifyID, builder.build()); notificationManager.notify(notifyID, builder.getNotification());
} }
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save