diff --git a/lite/.classpath b/lite/.classpath index fa0fd3c0..350f40f7 100644 --- a/lite/.classpath +++ b/lite/.classpath @@ -9,5 +9,6 @@ + diff --git a/lite/AndroidManifest.xml b/lite/AndroidManifest.xml index ff80ba97..1b6f7500 100644 --- a/lite/AndroidManifest.xml +++ b/lite/AndroidManifest.xml @@ -14,7 +14,8 @@ android:label="@string/app_name" android:theme="@style/TransdroidTheme" > diff --git a/lite/res/drawable-hdpi/ab_bottom_solid_transdroid.9.png b/lite/res/drawable-hdpi/ab_bottom_solid_transdroid.9.png new file mode 100644 index 00000000..64793735 Binary files /dev/null and b/lite/res/drawable-hdpi/ab_bottom_solid_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/ab_solid_transdroid.9.png b/lite/res/drawable-hdpi/ab_solid_transdroid.9.png new file mode 100644 index 00000000..12ece624 Binary files /dev/null and b/lite/res/drawable-hdpi/ab_solid_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/ab_stacked_solid_transdroid.9.png b/lite/res/drawable-hdpi/ab_stacked_solid_transdroid.9.png new file mode 100644 index 00000000..005445ac Binary files /dev/null and b/lite/res/drawable-hdpi/ab_stacked_solid_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/ab_transparent_transdroid.9.png b/lite/res/drawable-hdpi/ab_transparent_transdroid.9.png new file mode 100644 index 00000000..fc241b9f Binary files /dev/null and b/lite/res/drawable-hdpi/ab_transparent_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/ic_action_labels.png b/lite/res/drawable-hdpi/ic_action_labels.png new file mode 100644 index 00000000..432e7c00 Binary files /dev/null and b/lite/res/drawable-hdpi/ic_action_labels.png differ diff --git a/lite/res/drawable-hdpi/ic_action_new.png b/lite/res/drawable-hdpi/ic_action_new.png new file mode 100644 index 00000000..ad8ada6b Binary files /dev/null and b/lite/res/drawable-hdpi/ic_action_new.png differ diff --git a/lite/res/drawable-hdpi/ic_action_pause.png b/lite/res/drawable-hdpi/ic_action_pause.png new file mode 100644 index 00000000..6b435bb0 Binary files /dev/null and b/lite/res/drawable-hdpi/ic_action_pause.png differ diff --git a/lite/res/drawable-hdpi/ic_action_refresh.png b/lite/res/drawable-hdpi/ic_action_refresh.png new file mode 100644 index 00000000..bb9d855f Binary files /dev/null and b/lite/res/drawable-hdpi/ic_action_refresh.png differ diff --git a/lite/res/drawable-hdpi/ic_action_remove.png b/lite/res/drawable-hdpi/ic_action_remove.png new file mode 100644 index 00000000..094eea58 Binary files /dev/null and b/lite/res/drawable-hdpi/ic_action_remove.png differ diff --git a/lite/res/drawable-hdpi/ic_action_resume.png b/lite/res/drawable-hdpi/ic_action_resume.png new file mode 100644 index 00000000..738aae1a Binary files /dev/null and b/lite/res/drawable-hdpi/ic_action_resume.png differ diff --git a/lite/res/drawable-hdpi/ic_action_rss.png b/lite/res/drawable-hdpi/ic_action_rss.png new file mode 100644 index 00000000..02ec51ef Binary files /dev/null and b/lite/res/drawable-hdpi/ic_action_rss.png differ diff --git a/lite/res/drawable-hdpi/ic_action_search.png b/lite/res/drawable-hdpi/ic_action_search.png new file mode 100644 index 00000000..f12e005e Binary files /dev/null and b/lite/res/drawable-hdpi/ic_action_search.png differ diff --git a/lite/res/drawable-hdpi/ic_action_sort_by_size.png b/lite/res/drawable-hdpi/ic_action_sort_by_size.png new file mode 100644 index 00000000..cbb5f451 Binary files /dev/null and b/lite/res/drawable-hdpi/ic_action_sort_by_size.png differ diff --git a/lite/res/drawable-hdpi/ic_action_start.png b/lite/res/drawable-hdpi/ic_action_start.png new file mode 100644 index 00000000..df8a2ca2 Binary files /dev/null and b/lite/res/drawable-hdpi/ic_action_start.png differ diff --git a/lite/res/drawable-hdpi/ic_action_stop.png b/lite/res/drawable-hdpi/ic_action_stop.png new file mode 100644 index 00000000..dd5d6a1c Binary files /dev/null and b/lite/res/drawable-hdpi/ic_action_stop.png differ diff --git a/lite/res/drawable-hdpi/ic_activity_torrents.png b/lite/res/drawable-hdpi/ic_activity_torrents.png new file mode 100644 index 00000000..63728265 Binary files /dev/null and b/lite/res/drawable-hdpi/ic_activity_torrents.png differ diff --git a/lite/res/drawable-hdpi/ic_empty_details.png b/lite/res/drawable-hdpi/ic_empty_details.png new file mode 100644 index 00000000..718615e5 Binary files /dev/null and b/lite/res/drawable-hdpi/ic_empty_details.png differ diff --git a/lite/res/drawable-hdpi/list_focused_transdroid.9.png b/lite/res/drawable-hdpi/list_focused_transdroid.9.png new file mode 100644 index 00000000..b342ccbb Binary files /dev/null and b/lite/res/drawable-hdpi/list_focused_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/menu_dropdown_panel_transdroid.9.png b/lite/res/drawable-hdpi/menu_dropdown_panel_transdroid.9.png new file mode 100644 index 00000000..bab5e3ba Binary files /dev/null and b/lite/res/drawable-hdpi/menu_dropdown_panel_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/menu_hardkey_panel_transdroid.9.png b/lite/res/drawable-hdpi/menu_hardkey_panel_transdroid.9.png new file mode 100644 index 00000000..40a8f3eb Binary files /dev/null and b/lite/res/drawable-hdpi/menu_hardkey_panel_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/progress_bg_transdroid.9.png b/lite/res/drawable-hdpi/progress_bg_transdroid.9.png new file mode 100644 index 00000000..3d5c707d Binary files /dev/null and b/lite/res/drawable-hdpi/progress_bg_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/progress_primary_transdroid.9.png b/lite/res/drawable-hdpi/progress_primary_transdroid.9.png new file mode 100644 index 00000000..44a3c436 Binary files /dev/null and b/lite/res/drawable-hdpi/progress_primary_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/progress_secondary_transdroid.9.png b/lite/res/drawable-hdpi/progress_secondary_transdroid.9.png new file mode 100644 index 00000000..32196b2b Binary files /dev/null and b/lite/res/drawable-hdpi/progress_secondary_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/spinner_ab_default_transdroid.9.png b/lite/res/drawable-hdpi/spinner_ab_default_transdroid.9.png new file mode 100644 index 00000000..4fd4aeba Binary files /dev/null and b/lite/res/drawable-hdpi/spinner_ab_default_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/spinner_ab_disabled_transdroid.9.png b/lite/res/drawable-hdpi/spinner_ab_disabled_transdroid.9.png new file mode 100644 index 00000000..d42c97b8 Binary files /dev/null and b/lite/res/drawable-hdpi/spinner_ab_disabled_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/spinner_ab_focused_transdroid.9.png b/lite/res/drawable-hdpi/spinner_ab_focused_transdroid.9.png new file mode 100644 index 00000000..4761bd26 Binary files /dev/null and b/lite/res/drawable-hdpi/spinner_ab_focused_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/spinner_ab_pressed_transdroid.9.png b/lite/res/drawable-hdpi/spinner_ab_pressed_transdroid.9.png new file mode 100644 index 00000000..bddc913e Binary files /dev/null and b/lite/res/drawable-hdpi/spinner_ab_pressed_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/tab_selected_focused_transdroid.9.png b/lite/res/drawable-hdpi/tab_selected_focused_transdroid.9.png new file mode 100644 index 00000000..36fec49a Binary files /dev/null and b/lite/res/drawable-hdpi/tab_selected_focused_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/tab_selected_pressed_transdroid.9.png b/lite/res/drawable-hdpi/tab_selected_pressed_transdroid.9.png new file mode 100644 index 00000000..aa07ad6f Binary files /dev/null and b/lite/res/drawable-hdpi/tab_selected_pressed_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/tab_selected_transdroid.9.png b/lite/res/drawable-hdpi/tab_selected_transdroid.9.png new file mode 100644 index 00000000..d59bde58 Binary files /dev/null and b/lite/res/drawable-hdpi/tab_selected_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/tab_unselected_focused_transdroid.9.png b/lite/res/drawable-hdpi/tab_unselected_focused_transdroid.9.png new file mode 100644 index 00000000..40613b47 Binary files /dev/null and b/lite/res/drawable-hdpi/tab_unselected_focused_transdroid.9.png differ diff --git a/lite/res/drawable-hdpi/tab_unselected_pressed_transdroid.9.png b/lite/res/drawable-hdpi/tab_unselected_pressed_transdroid.9.png new file mode 100644 index 00000000..ef83039c Binary files /dev/null and b/lite/res/drawable-hdpi/tab_unselected_pressed_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/ab_bottom_solid_transdroid.9.png b/lite/res/drawable-mdpi/ab_bottom_solid_transdroid.9.png new file mode 100644 index 00000000..135904dc Binary files /dev/null and b/lite/res/drawable-mdpi/ab_bottom_solid_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/ab_solid_transdroid.9.png b/lite/res/drawable-mdpi/ab_solid_transdroid.9.png new file mode 100644 index 00000000..fa3d4284 Binary files /dev/null and b/lite/res/drawable-mdpi/ab_solid_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/ab_stacked_solid_transdroid.9.png b/lite/res/drawable-mdpi/ab_stacked_solid_transdroid.9.png new file mode 100644 index 00000000..fd09cb18 Binary files /dev/null and b/lite/res/drawable-mdpi/ab_stacked_solid_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/ab_transparent_transdroid.9.png b/lite/res/drawable-mdpi/ab_transparent_transdroid.9.png new file mode 100644 index 00000000..8c3b514f Binary files /dev/null and b/lite/res/drawable-mdpi/ab_transparent_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/ic_action_labels.png b/lite/res/drawable-mdpi/ic_action_labels.png new file mode 100644 index 00000000..b85d7c58 Binary files /dev/null and b/lite/res/drawable-mdpi/ic_action_labels.png differ diff --git a/lite/res/drawable-mdpi/ic_action_new.png b/lite/res/drawable-mdpi/ic_action_new.png new file mode 100644 index 00000000..4d5d484b Binary files /dev/null and b/lite/res/drawable-mdpi/ic_action_new.png differ diff --git a/lite/res/drawable-mdpi/ic_action_pause.png b/lite/res/drawable-mdpi/ic_action_pause.png new file mode 100644 index 00000000..a5aee6f2 Binary files /dev/null and b/lite/res/drawable-mdpi/ic_action_pause.png differ diff --git a/lite/res/drawable-mdpi/ic_action_refresh.png b/lite/res/drawable-mdpi/ic_action_refresh.png new file mode 100644 index 00000000..bd611e8e Binary files /dev/null and b/lite/res/drawable-mdpi/ic_action_refresh.png differ diff --git a/lite/res/drawable-mdpi/ic_action_remove.png b/lite/res/drawable-mdpi/ic_action_remove.png new file mode 100644 index 00000000..3336760d Binary files /dev/null and b/lite/res/drawable-mdpi/ic_action_remove.png differ diff --git a/lite/res/drawable-mdpi/ic_action_resume.png b/lite/res/drawable-mdpi/ic_action_resume.png new file mode 100644 index 00000000..28e81379 Binary files /dev/null and b/lite/res/drawable-mdpi/ic_action_resume.png differ diff --git a/lite/res/drawable-mdpi/ic_action_rss.png b/lite/res/drawable-mdpi/ic_action_rss.png new file mode 100644 index 00000000..2de867b8 Binary files /dev/null and b/lite/res/drawable-mdpi/ic_action_rss.png differ diff --git a/lite/res/drawable-mdpi/ic_action_search.png b/lite/res/drawable-mdpi/ic_action_search.png new file mode 100644 index 00000000..587d9e0b Binary files /dev/null and b/lite/res/drawable-mdpi/ic_action_search.png differ diff --git a/lite/res/drawable-mdpi/ic_action_sort_by_size.png b/lite/res/drawable-mdpi/ic_action_sort_by_size.png new file mode 100644 index 00000000..aa921e76 Binary files /dev/null and b/lite/res/drawable-mdpi/ic_action_sort_by_size.png differ diff --git a/lite/res/drawable-mdpi/ic_action_start.png b/lite/res/drawable-mdpi/ic_action_start.png new file mode 100644 index 00000000..6a40cd5f Binary files /dev/null and b/lite/res/drawable-mdpi/ic_action_start.png differ diff --git a/lite/res/drawable-mdpi/ic_action_stop.png b/lite/res/drawable-mdpi/ic_action_stop.png new file mode 100644 index 00000000..20df4158 Binary files /dev/null and b/lite/res/drawable-mdpi/ic_action_stop.png differ diff --git a/lite/res/drawable-mdpi/ic_activity_torrents.png b/lite/res/drawable-mdpi/ic_activity_torrents.png new file mode 100644 index 00000000..ce606a71 Binary files /dev/null and b/lite/res/drawable-mdpi/ic_activity_torrents.png differ diff --git a/lite/res/drawable-mdpi/ic_empty_details.png b/lite/res/drawable-mdpi/ic_empty_details.png new file mode 100644 index 00000000..5bd58335 Binary files /dev/null and b/lite/res/drawable-mdpi/ic_empty_details.png differ diff --git a/lite/res/drawable-mdpi/list_focused_transdroid.9.png b/lite/res/drawable-mdpi/list_focused_transdroid.9.png new file mode 100644 index 00000000..cc6c75f9 Binary files /dev/null and b/lite/res/drawable-mdpi/list_focused_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/menu_dropdown_panel_transdroid.9.png b/lite/res/drawable-mdpi/menu_dropdown_panel_transdroid.9.png new file mode 100644 index 00000000..2b2458ef Binary files /dev/null and b/lite/res/drawable-mdpi/menu_dropdown_panel_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/menu_hardkey_panel_transdroid.9.png b/lite/res/drawable-mdpi/menu_hardkey_panel_transdroid.9.png new file mode 100644 index 00000000..19b2feb5 Binary files /dev/null and b/lite/res/drawable-mdpi/menu_hardkey_panel_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/progress_bg_transdroid.9.png b/lite/res/drawable-mdpi/progress_bg_transdroid.9.png new file mode 100644 index 00000000..9372a60f Binary files /dev/null and b/lite/res/drawable-mdpi/progress_bg_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/progress_primary_transdroid.9.png b/lite/res/drawable-mdpi/progress_primary_transdroid.9.png new file mode 100644 index 00000000..27192ef1 Binary files /dev/null and b/lite/res/drawable-mdpi/progress_primary_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/progress_secondary_transdroid.9.png b/lite/res/drawable-mdpi/progress_secondary_transdroid.9.png new file mode 100644 index 00000000..2b240eae Binary files /dev/null and b/lite/res/drawable-mdpi/progress_secondary_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/spinner_ab_default_transdroid.9.png b/lite/res/drawable-mdpi/spinner_ab_default_transdroid.9.png new file mode 100644 index 00000000..9aeafee2 Binary files /dev/null and b/lite/res/drawable-mdpi/spinner_ab_default_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/spinner_ab_disabled_transdroid.9.png b/lite/res/drawable-mdpi/spinner_ab_disabled_transdroid.9.png new file mode 100644 index 00000000..88dd4415 Binary files /dev/null and b/lite/res/drawable-mdpi/spinner_ab_disabled_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/spinner_ab_focused_transdroid.9.png b/lite/res/drawable-mdpi/spinner_ab_focused_transdroid.9.png new file mode 100644 index 00000000..63a0fda5 Binary files /dev/null and b/lite/res/drawable-mdpi/spinner_ab_focused_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/spinner_ab_pressed_transdroid.9.png b/lite/res/drawable-mdpi/spinner_ab_pressed_transdroid.9.png new file mode 100644 index 00000000..15652b11 Binary files /dev/null and b/lite/res/drawable-mdpi/spinner_ab_pressed_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/tab_selected_focused_transdroid.9.png b/lite/res/drawable-mdpi/tab_selected_focused_transdroid.9.png new file mode 100644 index 00000000..ac6ffee0 Binary files /dev/null and b/lite/res/drawable-mdpi/tab_selected_focused_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/tab_selected_pressed_transdroid.9.png b/lite/res/drawable-mdpi/tab_selected_pressed_transdroid.9.png new file mode 100644 index 00000000..690f41de Binary files /dev/null and b/lite/res/drawable-mdpi/tab_selected_pressed_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/tab_selected_transdroid.9.png b/lite/res/drawable-mdpi/tab_selected_transdroid.9.png new file mode 100644 index 00000000..1aa38d48 Binary files /dev/null and b/lite/res/drawable-mdpi/tab_selected_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/tab_unselected_focused_transdroid.9.png b/lite/res/drawable-mdpi/tab_unselected_focused_transdroid.9.png new file mode 100644 index 00000000..f9c9c6bd Binary files /dev/null and b/lite/res/drawable-mdpi/tab_unselected_focused_transdroid.9.png differ diff --git a/lite/res/drawable-mdpi/tab_unselected_pressed_transdroid.9.png b/lite/res/drawable-mdpi/tab_unselected_pressed_transdroid.9.png new file mode 100644 index 00000000..2acd0bbe Binary files /dev/null and b/lite/res/drawable-mdpi/tab_unselected_pressed_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/ab_bottom_solid_transdroid.9.png b/lite/res/drawable-xhdpi/ab_bottom_solid_transdroid.9.png new file mode 100644 index 00000000..abf5694b Binary files /dev/null and b/lite/res/drawable-xhdpi/ab_bottom_solid_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/ab_solid_transdroid.9.png b/lite/res/drawable-xhdpi/ab_solid_transdroid.9.png new file mode 100644 index 00000000..143a16f4 Binary files /dev/null and b/lite/res/drawable-xhdpi/ab_solid_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/ab_stacked_solid_transdroid.9.png b/lite/res/drawable-xhdpi/ab_stacked_solid_transdroid.9.png new file mode 100644 index 00000000..f9a1e1f2 Binary files /dev/null and b/lite/res/drawable-xhdpi/ab_stacked_solid_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/ab_transparent_transdroid.9.png b/lite/res/drawable-xhdpi/ab_transparent_transdroid.9.png new file mode 100644 index 00000000..24020e23 Binary files /dev/null and b/lite/res/drawable-xhdpi/ab_transparent_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/action_sort_by_size.png b/lite/res/drawable-xhdpi/action_sort_by_size.png new file mode 100644 index 00000000..cb2dff32 Binary files /dev/null and b/lite/res/drawable-xhdpi/action_sort_by_size.png differ diff --git a/lite/res/drawable-xhdpi/ic_action_labels.png b/lite/res/drawable-xhdpi/ic_action_labels.png new file mode 100644 index 00000000..8fdcd1a2 Binary files /dev/null and b/lite/res/drawable-xhdpi/ic_action_labels.png differ diff --git a/lite/res/drawable-xhdpi/ic_action_new.png b/lite/res/drawable-xhdpi/ic_action_new.png new file mode 100644 index 00000000..23b9a1c1 Binary files /dev/null and b/lite/res/drawable-xhdpi/ic_action_new.png differ diff --git a/lite/res/drawable-xhdpi/ic_action_pause.png b/lite/res/drawable-xhdpi/ic_action_pause.png new file mode 100644 index 00000000..333c1b24 Binary files /dev/null and b/lite/res/drawable-xhdpi/ic_action_pause.png differ diff --git a/lite/res/drawable-xhdpi/ic_action_refresh.png b/lite/res/drawable-xhdpi/ic_action_refresh.png new file mode 100644 index 00000000..a7fdc0df Binary files /dev/null and b/lite/res/drawable-xhdpi/ic_action_refresh.png differ diff --git a/lite/res/drawable-xhdpi/ic_action_remove.png b/lite/res/drawable-xhdpi/ic_action_remove.png new file mode 100644 index 00000000..f391760e Binary files /dev/null and b/lite/res/drawable-xhdpi/ic_action_remove.png differ diff --git a/lite/res/drawable-xhdpi/ic_action_resume.png b/lite/res/drawable-xhdpi/ic_action_resume.png new file mode 100644 index 00000000..fe6b5588 Binary files /dev/null and b/lite/res/drawable-xhdpi/ic_action_resume.png differ diff --git a/lite/res/drawable-xhdpi/ic_action_rss.png b/lite/res/drawable-xhdpi/ic_action_rss.png new file mode 100644 index 00000000..dcd88e1c Binary files /dev/null and b/lite/res/drawable-xhdpi/ic_action_rss.png differ diff --git a/lite/res/drawable-xhdpi/ic_action_search.png b/lite/res/drawable-xhdpi/ic_action_search.png new file mode 100644 index 00000000..3549f84d Binary files /dev/null and b/lite/res/drawable-xhdpi/ic_action_search.png differ diff --git a/lite/res/drawable-xhdpi/ic_action_start.png b/lite/res/drawable-xhdpi/ic_action_start.png new file mode 100644 index 00000000..51124993 Binary files /dev/null and b/lite/res/drawable-xhdpi/ic_action_start.png differ diff --git a/lite/res/drawable-xhdpi/ic_action_stop.png b/lite/res/drawable-xhdpi/ic_action_stop.png new file mode 100644 index 00000000..ee5eda25 Binary files /dev/null and b/lite/res/drawable-xhdpi/ic_action_stop.png differ diff --git a/lite/res/drawable-xhdpi/ic_activity_torrents.png b/lite/res/drawable-xhdpi/ic_activity_torrents.png new file mode 100644 index 00000000..25614e00 Binary files /dev/null and b/lite/res/drawable-xhdpi/ic_activity_torrents.png differ diff --git a/lite/res/drawable-xhdpi/ic_empty_details.png b/lite/res/drawable-xhdpi/ic_empty_details.png new file mode 100644 index 00000000..7b446989 Binary files /dev/null and b/lite/res/drawable-xhdpi/ic_empty_details.png differ diff --git a/lite/res/drawable-xhdpi/list_focused_transdroid.9.png b/lite/res/drawable-xhdpi/list_focused_transdroid.9.png new file mode 100644 index 00000000..368d15f6 Binary files /dev/null and b/lite/res/drawable-xhdpi/list_focused_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/menu_dropdown_panel_transdroid.9.png b/lite/res/drawable-xhdpi/menu_dropdown_panel_transdroid.9.png new file mode 100644 index 00000000..2974663c Binary files /dev/null and b/lite/res/drawable-xhdpi/menu_dropdown_panel_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/menu_hardkey_panel_transdroid.9.png b/lite/res/drawable-xhdpi/menu_hardkey_panel_transdroid.9.png new file mode 100644 index 00000000..97c03063 Binary files /dev/null and b/lite/res/drawable-xhdpi/menu_hardkey_panel_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/progress_bg_transdroid.9.png b/lite/res/drawable-xhdpi/progress_bg_transdroid.9.png new file mode 100644 index 00000000..8b4853aa Binary files /dev/null and b/lite/res/drawable-xhdpi/progress_bg_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/progress_primary_transdroid.9.png b/lite/res/drawable-xhdpi/progress_primary_transdroid.9.png new file mode 100644 index 00000000..b1c9444a Binary files /dev/null and b/lite/res/drawable-xhdpi/progress_primary_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/progress_secondary_transdroid.9.png b/lite/res/drawable-xhdpi/progress_secondary_transdroid.9.png new file mode 100644 index 00000000..48cc8e57 Binary files /dev/null and b/lite/res/drawable-xhdpi/progress_secondary_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/spinner_ab_default_transdroid.9.png b/lite/res/drawable-xhdpi/spinner_ab_default_transdroid.9.png new file mode 100644 index 00000000..14b1401d Binary files /dev/null and b/lite/res/drawable-xhdpi/spinner_ab_default_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/spinner_ab_disabled_transdroid.9.png b/lite/res/drawable-xhdpi/spinner_ab_disabled_transdroid.9.png new file mode 100644 index 00000000..c9dfbd60 Binary files /dev/null and b/lite/res/drawable-xhdpi/spinner_ab_disabled_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/spinner_ab_focused_transdroid.9.png b/lite/res/drawable-xhdpi/spinner_ab_focused_transdroid.9.png new file mode 100644 index 00000000..e4eddc17 Binary files /dev/null and b/lite/res/drawable-xhdpi/spinner_ab_focused_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/spinner_ab_pressed_transdroid.9.png b/lite/res/drawable-xhdpi/spinner_ab_pressed_transdroid.9.png new file mode 100644 index 00000000..95f9b4c6 Binary files /dev/null and b/lite/res/drawable-xhdpi/spinner_ab_pressed_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/tab_selected_focused_transdroid.9.png b/lite/res/drawable-xhdpi/tab_selected_focused_transdroid.9.png new file mode 100644 index 00000000..1c6ccb7b Binary files /dev/null and b/lite/res/drawable-xhdpi/tab_selected_focused_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/tab_selected_pressed_transdroid.9.png b/lite/res/drawable-xhdpi/tab_selected_pressed_transdroid.9.png new file mode 100644 index 00000000..bed352bd Binary files /dev/null and b/lite/res/drawable-xhdpi/tab_selected_pressed_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/tab_selected_transdroid.9.png b/lite/res/drawable-xhdpi/tab_selected_transdroid.9.png new file mode 100644 index 00000000..794323de Binary files /dev/null and b/lite/res/drawable-xhdpi/tab_selected_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/tab_unselected_focused_transdroid.9.png b/lite/res/drawable-xhdpi/tab_unselected_focused_transdroid.9.png new file mode 100644 index 00000000..564f40f5 Binary files /dev/null and b/lite/res/drawable-xhdpi/tab_unselected_focused_transdroid.9.png differ diff --git a/lite/res/drawable-xhdpi/tab_unselected_pressed_transdroid.9.png b/lite/res/drawable-xhdpi/tab_unselected_pressed_transdroid.9.png new file mode 100644 index 00000000..3f885d60 Binary files /dev/null and b/lite/res/drawable-xhdpi/tab_unselected_pressed_transdroid.9.png differ diff --git a/lite/res/drawable-xxhdpi/ic_activity_torrents.png b/lite/res/drawable-xxhdpi/ic_activity_torrents.png new file mode 100644 index 00000000..a4a1a817 Binary files /dev/null and b/lite/res/drawable-xxhdpi/ic_activity_torrents.png differ diff --git a/lite/res/drawable/pressed_background_transdroid.xml b/lite/res/drawable/pressed_background_transdroid.xml new file mode 100644 index 00000000..2b1eed9f --- /dev/null +++ b/lite/res/drawable/pressed_background_transdroid.xml @@ -0,0 +1,21 @@ + + + + + + diff --git a/lite/res/drawable/progress_horizontal_transdroid.xml b/lite/res/drawable/progress_horizontal_transdroid.xml new file mode 100644 index 00000000..585c2b73 --- /dev/null +++ b/lite/res/drawable/progress_horizontal_transdroid.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + diff --git a/lite/res/drawable/section_header.xml b/lite/res/drawable/section_header.xml new file mode 100644 index 00000000..d6094f63 --- /dev/null +++ b/lite/res/drawable/section_header.xml @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/lite/res/drawable/selectable_background_transdroid.xml b/lite/res/drawable/selectable_background_transdroid.xml new file mode 100644 index 00000000..de42f6a1 --- /dev/null +++ b/lite/res/drawable/selectable_background_transdroid.xml @@ -0,0 +1,24 @@ + + + + + + + + \ No newline at end of file diff --git a/lite/res/drawable/spinner_background_ab_transdroid.xml b/lite/res/drawable/spinner_background_ab_transdroid.xml new file mode 100644 index 00000000..32edfe7b --- /dev/null +++ b/lite/res/drawable/spinner_background_ab_transdroid.xml @@ -0,0 +1,27 @@ + + + + + + + + + diff --git a/lite/res/drawable/tab_indicator_ab_transdroid.xml b/lite/res/drawable/tab_indicator_ab_transdroid.xml new file mode 100644 index 00000000..5345f3e5 --- /dev/null +++ b/lite/res/drawable/tab_indicator_ab_transdroid.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/lite/res/layout-v14/actionbar_progressitem.xml b/lite/res/layout-v14/actionbar_progressitem.xml new file mode 100644 index 00000000..f6dfd64a --- /dev/null +++ b/lite/res/layout-v14/actionbar_progressitem.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/lite/res/layout-w600dp/activity_torrents.xml b/lite/res/layout-w600dp/activity_torrents.xml new file mode 100644 index 00000000..92b91914 --- /dev/null +++ b/lite/res/layout-w600dp/activity_torrents.xml @@ -0,0 +1,24 @@ + + + + + + + + + \ No newline at end of file diff --git a/lite/res/layout-w720dp/activity_torrents.xml b/lite/res/layout-w720dp/activity_torrents.xml new file mode 100644 index 00000000..19c5a3ad --- /dev/null +++ b/lite/res/layout-w720dp/activity_torrents.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/lite/res/layout/actionbar_progressitem.xml b/lite/res/layout/actionbar_progressitem.xml new file mode 100644 index 00000000..5123e8df --- /dev/null +++ b/lite/res/layout/actionbar_progressitem.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/lite/res/layout/activity_torrents.xml b/lite/res/layout/activity_torrents.xml index 02d672cc..6e9f0815 100644 --- a/lite/res/layout/activity_torrents.xml +++ b/lite/res/layout/activity_torrents.xml @@ -1,16 +1,15 @@ - + + + tools:context=".TorrentsActivity" > - + - \ No newline at end of file + \ No newline at end of file diff --git a/lite/res/layout/fragment_details.xml b/lite/res/layout/fragment_details.xml new file mode 100644 index 00000000..e5663b46 --- /dev/null +++ b/lite/res/layout/fragment_details.xml @@ -0,0 +1,22 @@ + + + + + + + + \ No newline at end of file diff --git a/lite/res/layout/fragment_details_header.xml b/lite/res/layout/fragment_details_header.xml new file mode 100644 index 00000000..56baea74 --- /dev/null +++ b/lite/res/layout/fragment_details_header.xml @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lite/res/layout/fragment_filters.xml b/lite/res/layout/fragment_filters.xml new file mode 100644 index 00000000..30906fa2 --- /dev/null +++ b/lite/res/layout/fragment_filters.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/lite/res/layout/fragment_torrents.xml b/lite/res/layout/fragment_torrents.xml new file mode 100644 index 00000000..3365978d --- /dev/null +++ b/lite/res/layout/fragment_torrents.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/lite/res/layout/list_item_filter.xml b/lite/res/layout/list_item_filter.xml new file mode 100644 index 00000000..92114e79 --- /dev/null +++ b/lite/res/layout/list_item_filter.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/lite/res/layout/list_item_separator.xml b/lite/res/layout/list_item_separator.xml new file mode 100644 index 00000000..8a48e729 --- /dev/null +++ b/lite/res/layout/list_item_separator.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/lite/res/menu/activity_torrents.xml b/lite/res/menu/activity_torrents.xml new file mode 100644 index 00000000..1832ea34 --- /dev/null +++ b/lite/res/menu/activity_torrents.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lite/res/menu/fragment_details.xml b/lite/res/menu/fragment_details.xml new file mode 100644 index 00000000..9e763198 --- /dev/null +++ b/lite/res/menu/fragment_details.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lite/res/menu/fragment_details_file.xml b/lite/res/menu/fragment_details_file.xml new file mode 100644 index 00000000..edc1931c --- /dev/null +++ b/lite/res/menu/fragment_details_file.xml @@ -0,0 +1,28 @@ + + + + + + + + + + \ No newline at end of file diff --git a/lite/res/menu/torrents.xml b/lite/res/menu/torrents.xml deleted file mode 100644 index a363b607..00000000 --- a/lite/res/menu/torrents.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - \ No newline at end of file diff --git a/lite/res/values-sw600dp/dimens.xml b/lite/res/values-sw600dp/dimens.xml deleted file mode 100644 index d7cc90c8..00000000 --- a/lite/res/values-sw600dp/dimens.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/lite/res/values-sw720dp-land/dimens.xml b/lite/res/values-sw720dp-land/dimens.xml deleted file mode 100644 index 1b9fc52c..00000000 --- a/lite/res/values-sw720dp-land/dimens.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - 128dp - - \ No newline at end of file diff --git a/lite/res/values-v11/styles.xml b/lite/res/values-v11/styles.xml deleted file mode 100644 index c478de08..00000000 --- a/lite/res/values-v11/styles.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/lite/res/values-v11/styles_transdroid.xml b/lite/res/values-v11/styles_transdroid.xml new file mode 100644 index 00000000..d3671383 --- /dev/null +++ b/lite/res/values-v11/styles_transdroid.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lite/res/values-v14/styles.xml b/lite/res/values-v14/styles.xml deleted file mode 100644 index 48e5ada1..00000000 --- a/lite/res/values-v14/styles.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/lite/res/values/colors.xml b/lite/res/values/colors.xml new file mode 100644 index 00000000..ba2e342f --- /dev/null +++ b/lite/res/values/colors.xml @@ -0,0 +1,4 @@ + + + #8acc12 + diff --git a/lite/res/values/colors_transdroid.xml b/lite/res/values/colors_transdroid.xml new file mode 100644 index 00000000..88ea9872 --- /dev/null +++ b/lite/res/values/colors_transdroid.xml @@ -0,0 +1,21 @@ + + + + + #CCaada62 + diff --git a/lite/res/values/dimens.xml b/lite/res/values/dimens.xml index 1afdbd6c..e6f730d4 100644 --- a/lite/res/values/dimens.xml +++ b/lite/res/values/dimens.xml @@ -1,7 +1,6 @@ - - 16dp - 16dp + 16dp + 8dp \ No newline at end of file diff --git a/lite/res/values/strings.xml b/lite/res/values/strings.xml index 25ae5b89..ce8d9e9b 100644 --- a/lite/res/values/strings.xml +++ b/lite/res/values/strings.xml @@ -1,8 +1,47 @@ - Transdroid Lite + Transdroid Lite + + Add + From file + From URL + Scan barcode + Search + Refresh + RSS + Enable turle mode + Disable turle mode + Sort list + Name + Status + Date done + Date added + Upload speed + Ratio + Filter list Settings - Hello world! - - \ No newline at end of file + + Start + Stop + Resume + Pause + Remove + Remove torrent + Remove and delete data + Set label + Update trackers + Off + Low + Normal + High + Remote play in VLC + Download using (S)FTP + + SERVERS + STATUS + LABELS + Connected, but no torrent are active on the server + Select a torrent to view its details + + diff --git a/lite/res/values/styles.xml b/lite/res/values/styles.xml index fdb33413..ae796309 100644 --- a/lite/res/values/styles.xml +++ b/lite/res/values/styles.xml @@ -1,15 +1,32 @@ - + - - + + + + \ No newline at end of file diff --git a/lite/res/values/styles_transdroid.xml b/lite/res/values/styles_transdroid.xml new file mode 100644 index 00000000..98e8c09c --- /dev/null +++ b/lite/res/values/styles_transdroid.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lite/src/com/commonsware/cwac/merge/MergeAdapter.java b/lite/src/com/commonsware/cwac/merge/MergeAdapter.java new file mode 100644 index 00000000..a713b862 --- /dev/null +++ b/lite/src/com/commonsware/cwac/merge/MergeAdapter.java @@ -0,0 +1,481 @@ +/*** + Copyright (c) 2008-2009 CommonsWare, LLC + Portions (c) 2009 Google, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); you may + not use this file except in compliance with the License. You may obtain + a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +package com.commonsware.cwac.merge; + +import android.database.DataSetObserver; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.ListAdapter; +import android.widget.SectionIndexer; +import java.util.ArrayList; +import java.util.List; +import com.commonsware.cwac.sacklist.SackOfViewsAdapter; + +/** + * Adapter that merges multiple child adapters and views + * into a single contiguous whole. + * + * Adapters used as pieces within MergeAdapter must have + * view type IDs monotonically increasing from 0. Ideally, + * adapters also have distinct ranges for their row ids, as + * returned by getItemId(). + * + */ +public class MergeAdapter extends BaseAdapter implements SectionIndexer { + protected PieceStateRoster pieces=new PieceStateRoster(); + + /** + * Stock constructor, simply chaining to the superclass. + */ + public MergeAdapter() { + super(); + } + + /** + * Adds a new adapter to the roster of things to appear in + * the aggregate list. + * + * @param adapter + * Source for row views for this section + */ + public void addAdapter(ListAdapter adapter) { + pieces.add(adapter); + adapter.registerDataSetObserver(new CascadeDataSetObserver()); + } + + /** + * Adds a new View to the roster of things to appear in + * the aggregate list. + * + * @param view + * Single view to add + */ + public void addView(View view) { + addView(view, false); + } + + /** + * Adds a new View to the roster of things to appear in + * the aggregate list. + * + * @param view + * Single view to add + * @param enabled + * false if views are disabled, true if enabled + */ + public void addView(View view, boolean enabled) { + ArrayList list=new ArrayList(1); + + list.add(view); + + addViews(list, enabled); + } + + /** + * Adds a list of views to the roster of things to appear + * in the aggregate list. + * + * @param views + * List of views to add + */ + public void addViews(List views) { + addViews(views, false); + } + + /** + * Adds a list of views to the roster of things to appear + * in the aggregate list. + * + * @param views + * List of views to add + * @param enabled + * false if views are disabled, true if enabled + */ + public void addViews(List views, boolean enabled) { + if (enabled) { + addAdapter(new EnabledSackAdapter(views)); + } + else { + addAdapter(new SackOfViewsAdapter(views)); + } + } + + /** + * Get the data item associated with the specified + * position in the data set. + * + * @param position + * Position of the item whose data we want + */ + @Override + public Object getItem(int position) { + for (ListAdapter piece : getPieces()) { + int size=piece.getCount(); + + if (position < size) { + return(piece.getItem(position)); + } + + position-=size; + } + + return(null); + } + + /** + * Get the adapter associated with the specified position + * in the data set. + * + * @param position + * Position of the item whose adapter we want + */ + public ListAdapter getAdapter(int position) { + for (ListAdapter piece : getPieces()) { + int size=piece.getCount(); + + if (position < size) { + return(piece); + } + + position-=size; + } + + return(null); + } + + /** + * How many items are in the data set represented by this + * Adapter. + */ + @Override + public int getCount() { + int total=0; + + for (ListAdapter piece : getPieces()) { + total+=piece.getCount(); + } + + return(total); + } + + /** + * Returns the number of types of Views that will be + * created by getView(). + */ + @Override + public int getViewTypeCount() { + int total=0; + + for (PieceState piece : pieces.getRawPieces()) { + total+=piece.adapter.getViewTypeCount(); + } + + return(Math.max(total, 1)); // needed for + // setListAdapter() before + // content add' + } + + /** + * Get the type of View that will be created by getView() + * for the specified item. + * + * @param position + * Position of the item whose data we want + */ + @Override + public int getItemViewType(int position) { + int typeOffset=0; + int result=-1; + + for (PieceState piece : pieces.getRawPieces()) { + if (piece.isActive) { + int size=piece.adapter.getCount(); + + if (position < size) { + result=typeOffset + piece.adapter.getItemViewType(position); + break; + } + + position-=size; + } + + typeOffset+=piece.adapter.getViewTypeCount(); + } + + return(result); + } + + /** + * Are all items in this ListAdapter enabled? If yes it + * means all items are selectable and clickable. + */ + @Override + public boolean areAllItemsEnabled() { + return(false); + } + + /** + * Returns true if the item at the specified position is + * not a separator. + * + * @param position + * Position of the item whose data we want + */ + @Override + public boolean isEnabled(int position) { + for (ListAdapter piece : getPieces()) { + int size=piece.getCount(); + + if (position < size) { + return(piece.isEnabled(position)); + } + + position-=size; + } + + return(false); + } + + /** + * Get a View that displays the data at the specified + * position in the data set. + * + * @param position + * Position of the item whose data we want + * @param convertView + * View to recycle, if not null + * @param parent + * ViewGroup containing the returned View + */ + @Override + public View getView(int position, View convertView, ViewGroup parent) { + for (ListAdapter piece : getPieces()) { + int size=piece.getCount(); + + if (position < size) { + + return(piece.getView(position, convertView, parent)); + } + + position-=size; + } + + return(null); + } + + /** + * Get the row id associated with the specified position + * in the list. + * + * @param position + * Position of the item whose data we want + */ + @Override + public long getItemId(int position) { + for (ListAdapter piece : getPieces()) { + int size=piece.getCount(); + + if (position < size) { + return(piece.getItemId(position)); + } + + position-=size; + } + + return(-1); + } + + @Override + public int getPositionForSection(int section) { + int position=0; + + for (ListAdapter piece : getPieces()) { + if (piece instanceof SectionIndexer) { + Object[] sections=((SectionIndexer)piece).getSections(); + int numSections=0; + + if (sections != null) { + numSections=sections.length; + } + + if (section < numSections) { + return(position + ((SectionIndexer)piece).getPositionForSection(section)); + } + else if (sections != null) { + section-=numSections; + } + } + + position+=piece.getCount(); + } + + return(0); + } + + @Override + public int getSectionForPosition(int position) { + int section=0; + + for (ListAdapter piece : getPieces()) { + int size=piece.getCount(); + + if (position < size) { + if (piece instanceof SectionIndexer) { + return(section + ((SectionIndexer)piece).getSectionForPosition(position)); + } + + return(0); + } + else { + if (piece instanceof SectionIndexer) { + Object[] sections=((SectionIndexer)piece).getSections(); + + if (sections != null) { + section+=sections.length; + } + } + } + + position-=size; + } + + return(0); + } + + @Override + public Object[] getSections() { + ArrayList sections=new ArrayList(); + + for (ListAdapter piece : getPieces()) { + if (piece instanceof SectionIndexer) { + Object[] curSections=((SectionIndexer)piece).getSections(); + + if (curSections != null) { + for (Object section : curSections) { + sections.add(section); + } + } + } + } + + if (sections.size() == 0) { + return(new String[0]); + } + + return(sections.toArray(new Object[0])); + } + + public void setActive(ListAdapter adapter, boolean isActive) { + pieces.setActive(adapter, isActive); + notifyDataSetChanged(); + } + + public void setActive(View v, boolean isActive) { + pieces.setActive(v, isActive); + notifyDataSetChanged(); + } + + protected List getPieces() { + return(pieces.getPieces()); + } + + private static class PieceState { + ListAdapter adapter; + boolean isActive=true; + + PieceState(ListAdapter adapter, boolean isActive) { + this.adapter=adapter; + this.isActive=isActive; + } + } + + private static class PieceStateRoster { + protected ArrayList pieces=new ArrayList(); + protected ArrayList active=null; + + void add(ListAdapter adapter) { + pieces.add(new PieceState(adapter, true)); + } + + void setActive(ListAdapter adapter, boolean isActive) { + for (PieceState state : pieces) { + if (state.adapter==adapter) { + state.isActive=isActive; + active=null; + break; + } + } + } + + void setActive(View v, boolean isActive) { + for (PieceState state : pieces) { + if (state.adapter instanceof SackOfViewsAdapter && + ((SackOfViewsAdapter)state.adapter).hasView(v)) { + state.isActive=isActive; + active=null; + break; + } + } + } + + List getRawPieces() { + return(pieces); + } + + List getPieces() { + if (active == null) { + active=new ArrayList(); + + for (PieceState state : pieces) { + if (state.isActive) { + active.add(state.adapter); + } + } + } + + return(active); + } + } + + private static class EnabledSackAdapter extends SackOfViewsAdapter { + public EnabledSackAdapter(List views) { + super(views); + } + + @Override + public boolean areAllItemsEnabled() { + return(true); + } + + @Override + public boolean isEnabled(int position) { + return(true); + } + } + + private class CascadeDataSetObserver extends DataSetObserver { + @Override + public void onChanged() { + notifyDataSetChanged(); + } + + @Override + public void onInvalidated() { + notifyDataSetInvalidated(); + } + } +} \ No newline at end of file diff --git a/lite/src/com/commonsware/cwac/sacklist/SackOfViewsAdapter.java b/lite/src/com/commonsware/cwac/sacklist/SackOfViewsAdapter.java new file mode 100644 index 00000000..2d248e58 --- /dev/null +++ b/lite/src/com/commonsware/cwac/sacklist/SackOfViewsAdapter.java @@ -0,0 +1,177 @@ +/*** + Copyright (c) 2008-2009 CommonsWare, LLC + Portions (c) 2009 Google, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); you may + not use this file except in compliance with the License. You may obtain + a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.commonsware.cwac.sacklist; + +import java.util.ArrayList; +import java.util.List; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; + +/** + * Adapter that simply returns row views from a list. + * + * If you supply a size, you must implement newView(), to + * create a required view. The adapter will then cache these + * views. + * + * If you supply a list of views in the constructor, that + * list will be used directly. If any elements in the list + * are null, then newView() will be called just for those + * slots. + * + * Subclasses may also wish to override areAllItemsEnabled() + * (default: false) and isEnabled() (default: false), if some + * of their rows should be selectable. + * + * It is assumed each view is unique, and therefore will not + * get recycled. + * + * Note that this adapter is not designed for long lists. It + * is more for screens that should behave like a list. This + * is particularly useful if you combine this with other + * adapters (e.g., SectionedAdapter) that might have an + * arbitrary number of rows, so it all appears seamless. + */ +public class SackOfViewsAdapter extends BaseAdapter { + private List views=null; + + /** + * Constructor creating an empty list of views, but with + * a specified count. Subclasses must override newView(). + */ + public SackOfViewsAdapter(int count) { + super(); + + views=new ArrayList(count); + + for (int i=0;i views) { + super(); + + this.views=views; + } + + /** + * Get the data item associated with the specified + * position in the data set. + * @param position Position of the item whose data we want + */ + @Override + public Object getItem(int position) { + return(views.get(position)); + } + + /** + * How many items are in the data set represented by this + * Adapter. + */ + @Override + public int getCount() { + return(views.size()); + } + + /** + * Returns the number of types of Views that will be + * created by getView(). + */ + @Override + public int getViewTypeCount() { + return(getCount()); + } + + /** + * Get the type of View that will be created by getView() + * for the specified item. + * @param position Position of the item whose data we want + */ + @Override + public int getItemViewType(int position) { + return(position); + } + + /** + * Are all items in this ListAdapter enabled? If yes it + * means all items are selectable and clickable. + */ + @Override + public boolean areAllItemsEnabled() { + return(false); + } + + /** + * Returns true if the item at the specified position is + * not a separator. + * @param position Position of the item whose data we want + */ + @Override + public boolean isEnabled(int position) { + return(false); + } + + /** + * Get a View that displays the data at the specified + * position in the data set. + * @param position Position of the item whose data we want + * @param convertView View to recycle, if not null + * @param parent ViewGroup containing the returned View + */ + @Override + public View getView(int position, View convertView, + ViewGroup parent) { + View result=views.get(position); + + if (result==null) { + result=newView(position, parent); + views.set(position, result); + } + + return(result); + } + + /** + * Get the row id associated with the specified position + * in the list. + * @param position Position of the item whose data we want + */ + @Override + public long getItemId(int position) { + return(position); + } + + public boolean hasView(View v) { + return(views.contains(v)); + } + + /** + * Create a new View to go into the list at the specified + * position. + * @param position Position of the item whose data we want + * @param parent ViewGroup containing the returned View + */ + protected View newView(int position, ViewGroup parent) { + throw new RuntimeException("You must override newView()!"); + } +} \ No newline at end of file diff --git a/lite/src/org/transdroid/lite/gui/DetailsFagment.java b/lite/src/org/transdroid/lite/gui/DetailsFagment.java new file mode 100644 index 00000000..38f2e74a --- /dev/null +++ b/lite/src/org/transdroid/lite/gui/DetailsFagment.java @@ -0,0 +1,45 @@ +package org.transdroid.lite.gui; + +import org.androidannotations.annotations.AfterViews; +import org.androidannotations.annotations.EFragment; +import org.androidannotations.annotations.FragmentArg; +import org.androidannotations.annotations.InstanceState; +import org.androidannotations.annotations.ViewById; +import org.transdroid.daemon.Torrent; +import org.transdroid.daemon.TorrentDetails; +import org.transdroid.lite.R; + +import android.view.View; +import android.widget.TextView; + +import com.actionbarsherlock.app.SherlockFragment; + +/** + * Fragment that shown detailed statistics about some torrent. These come from some already fetched {@link Torrent} + * object, but it also retrieves further detailed statistics. + * + * @author Eric Kok + */ +@EFragment(R.layout.fragment_details) +public class DetailsFagment extends SherlockFragment { + + @FragmentArg + @InstanceState + protected Torrent torrent = null; + @InstanceState + protected TorrentDetails torrentDetails; + + @ViewById + protected TextView emptyText; + + @AfterViews + protected void init() { + + if (torrent == null) { + // No torrent specified; show the placeholder layout only + emptyText.setVisibility(View.VISIBLE); + } + + } + +} diff --git a/lite/src/org/transdroid/lite/gui/Torrents.java b/lite/src/org/transdroid/lite/gui/Torrents.java deleted file mode 100644 index f3a1e05a..00000000 --- a/lite/src/org/transdroid/lite/gui/Torrents.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.transdroid.lite.gui; - -import org.androidannotations.annotations.EActivity; -import org.androidannotations.annotations.OptionsMenu; -import org.transdroid.lite.R; - -import com.actionbarsherlock.app.SherlockFragmentActivity; - -@EActivity(R.layout.activity_torrents) -@OptionsMenu(R.menu.torrents) -public class Torrents extends SherlockFragmentActivity { - -} diff --git a/lite/src/org/transdroid/lite/gui/TorrentsActivity.java b/lite/src/org/transdroid/lite/gui/TorrentsActivity.java new file mode 100644 index 00000000..248a7186 --- /dev/null +++ b/lite/src/org/transdroid/lite/gui/TorrentsActivity.java @@ -0,0 +1,82 @@ +package org.transdroid.lite.gui; + +import org.androidannotations.annotations.AfterViews; +import org.androidannotations.annotations.Bean; +import org.androidannotations.annotations.EActivity; +import org.androidannotations.annotations.FragmentById; +import org.androidannotations.annotations.FragmentByTag; +import org.androidannotations.annotations.ItemSelect; +import org.androidannotations.annotations.OptionsMenu; +import org.androidannotations.annotations.ViewById; +import org.transdroid.lite.R; +import org.transdroid.lite.gui.navigation.FilterAdapter; +import org.transdroid.lite.gui.navigation.FilterItem; +import org.transdroid.lite.gui.navigation.FilterSeparatorView; +import org.transdroid.lite.gui.navigation.NavigationHelper; + +import android.widget.ListView; + +import com.actionbarsherlock.app.ActionBar; +import com.actionbarsherlock.app.ActionBar.OnNavigationListener; +import com.actionbarsherlock.app.SherlockFragmentActivity; + +@EActivity(R.layout.activity_torrents) +@OptionsMenu(R.menu.activity_torrents) +public class TorrentsActivity extends SherlockFragmentActivity implements OnNavigationListener { + + // Navigation components + @Bean + protected NavigationHelper navigationHelper; + @ViewById + protected ListView filtersList; + protected FilterAdapter navigationListAdapter = null; + protected FilterAdapter navigationSpinnerAdapter = null; + + // Torrents list components + @FragmentById(R.id.torrent_list) + protected TorrentsFragment fragmentTorrents; + + // Details view components + @FragmentById(R.id.torrent_details) + protected DetailsFagment fragmentDetails; + + @AfterViews + protected void init() { + + // Set up navigation + getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); + getSupportActionBar().setHomeButtonEnabled(false); + navigationSpinnerAdapter = new FilterAdapter(this); + getSupportActionBar().setListNavigationCallbacks(navigationSpinnerAdapter, this); + if (filtersList != null) { + navigationListAdapter = new FilterAdapter(this); + filtersList.setAdapter(navigationListAdapter); + } + + // Load settings + + } + + @Override + public boolean onNavigationItemSelected(int itemPosition, long itemId) { + Object item = navigationSpinnerAdapter.getItem(itemPosition); + if (item instanceof FilterItem) { + // A filter item was selected form the navigation spinner + filterSelected(true, (FilterItem) item); + return true; + } + // A header was selected; no action + return false; + } + + /** + * A new filter was selected; update the view over the current data + * @param selected + * @param item + */ + @ItemSelect(R.id.filters_list) + protected void filterSelected(boolean selected, FilterItem item) { + // TODO: Update the view + } + +} diff --git a/lite/src/org/transdroid/lite/gui/TorrentsFragment.java b/lite/src/org/transdroid/lite/gui/TorrentsFragment.java new file mode 100644 index 00000000..f53a9e1d --- /dev/null +++ b/lite/src/org/transdroid/lite/gui/TorrentsFragment.java @@ -0,0 +1,11 @@ +package org.transdroid.lite.gui; + +import org.androidannotations.annotations.EFragment; +import org.transdroid.lite.R; + +import com.actionbarsherlock.app.SherlockFragment; + +@EFragment(R.layout.fragment_torrents) +public class TorrentsFragment extends SherlockFragment { + +} diff --git a/lite/src/org/transdroid/lite/gui/navigation/FilterAdapter.java b/lite/src/org/transdroid/lite/gui/navigation/FilterAdapter.java new file mode 100644 index 00000000..0ffb0b8e --- /dev/null +++ b/lite/src/org/transdroid/lite/gui/navigation/FilterAdapter.java @@ -0,0 +1,125 @@ +package org.transdroid.lite.gui.navigation; + +import java.util.List; + +import org.transdroid.lite.R; + +import android.content.Context; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; + +import com.commonsware.cwac.merge.MergeAdapter; + +/** + * List adapter that holds filter items, that is, servers, view types and labels. A header item is intersted where + * appropriate. + * @author Eric Kok + */ +public class FilterAdapter extends MergeAdapter { + + private Context context; + private FilterItemAdapter serverItems = null; + private FilterItemAdapter statusTypeItems = null; + private FilterItemAdapter labelItems = null; + + public FilterAdapter(Context context) { + this.context = context; + } + + /** + * Update the list of available servers. + * @param servers The new list of available servers + */ + public void updateServers(List servers) { + if (this.serverItems == null && servers != null) { + addView(FilterSeparatorView_.build(context).setText(context.getString(R.string.navigation_servers)), false); + this.serverItems = new FilterItemAdapter(context, servers); + addAdapter(serverItems); + } else if (this.serverItems != null && servers != null) { + this.serverItems.update(servers); + } else { + this.serverItems = null; + } + } + + /** + * Update the list of available status types. + * @param statusTypes The new list of available status types + */ + public void updateStatusTypes(List statusTypes) { + if (this.statusTypeItems == null && statusTypes != null) { + addView(FilterSeparatorView_.build(context).setText(context.getString(R.string.navigation_status)), false); + this.statusTypeItems = new FilterItemAdapter(context, statusTypes); + addAdapter(statusTypeItems); + } else if (this.statusTypeItems != null && statusTypes != null) { + this.statusTypeItems.update(statusTypes); + } else { + this.statusTypeItems = null; + } + } + + /** + * Update the list of available labels. + * @param labels The new list of available labels + */ + public void updateLabels(List labels) { + if (this.labelItems == null && labels != null) { + addView(FilterSeparatorView_.build(context).setText(context.getString(R.string.navigation_labels)), false); + this.labelItems = new FilterItemAdapter(context, labels); + addAdapter(labelItems); + } else if (this.serverItems != null && labels != null) { + this.labelItems.update(labels); + } else { + this.labelItems = null; + } + } + + protected class FilterItemAdapter extends BaseAdapter { + + private final Context context; + private List items; + + public FilterItemAdapter(Context context, List items) { + this.context = context; + this.items = items; + } + + /** + * Allows updating of the full data list underlying this adapter, replacing all items + * @param newItems The new list of filter items to display + */ + public void update(List newItems) { + this.items = newItems; + notifyDataSetChanged(); + } + + @Override + public int getCount() { + return items.size(); + } + + @Override + public FilterItem getItem(int position) { + return items.get(position); + } + + @Override + public long getItemId(int position) { + return position; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + FilterItemView filterItemView; + if (convertView == null) { + filterItemView = FilterItemView_.build(context); + } else { + filterItemView = (FilterItemView) convertView; + } + filterItemView.bind(getItem(position)); + return filterItemView; + } + + } +} diff --git a/lite/src/org/transdroid/lite/gui/navigation/FilterItem.java b/lite/src/org/transdroid/lite/gui/navigation/FilterItem.java new file mode 100644 index 00000000..81638d89 --- /dev/null +++ b/lite/src/org/transdroid/lite/gui/navigation/FilterItem.java @@ -0,0 +1,12 @@ +package org.transdroid.lite.gui.navigation; + +/** + * Represents a filter item as shown in the navigation list or spinner. + * + * @author Eric Kok + */ +public interface FilterItem { + + public String getName(); + +} diff --git a/lite/src/org/transdroid/lite/gui/navigation/FilterItemView.java b/lite/src/org/transdroid/lite/gui/navigation/FilterItemView.java new file mode 100644 index 00000000..e7f6dc82 --- /dev/null +++ b/lite/src/org/transdroid/lite/gui/navigation/FilterItemView.java @@ -0,0 +1,29 @@ +package org.transdroid.lite.gui.navigation; + +import org.androidannotations.annotations.EViewGroup; +import org.androidannotations.annotations.ViewById; +import org.transdroid.lite.R; + +import android.content.Context; +import android.widget.LinearLayout; +import android.widget.TextView; + +/** + * View that represents some {@link FilterItem} object and simple prints out the text (in proper style) + * @author Eric Kok + */ +@EViewGroup(R.layout.list_item_filter) +public class FilterItemView extends LinearLayout { + + @ViewById + protected TextView itemText; + + public FilterItemView(Context context) { + super(context); + } + + public void bind(FilterItem filterItem) { + itemText.setText(filterItem.getName()); + } + +} diff --git a/lite/src/org/transdroid/lite/gui/navigation/FilterSeparatorView.java b/lite/src/org/transdroid/lite/gui/navigation/FilterSeparatorView.java new file mode 100644 index 00000000..09368d89 --- /dev/null +++ b/lite/src/org/transdroid/lite/gui/navigation/FilterSeparatorView.java @@ -0,0 +1,42 @@ +package org.transdroid.lite.gui.navigation; + +import org.androidannotations.annotations.EViewGroup; +import org.androidannotations.annotations.ViewById; +import org.transdroid.lite.R; + +import android.content.Context; +import android.widget.LinearLayout; +import android.widget.TextView; + +/** + * A list item that shows a sub header or separator (in underlined Holo style). + * + * @author Eric Kok + */ +@EViewGroup(R.layout.list_item_separator) +public class FilterSeparatorView extends LinearLayout { + + protected String text; + + @ViewById + protected TextView separatorText; + + public FilterSeparatorView(Context context) { + super(context); + } + + public void bind(FilterItem filterItem) { + separatorText.setText(text); + } + + /** + * Sets the text that will be shown in this separator (sub header) + * @param text The new text to show + * @return Itself, for convenience of method chaining + */ + public FilterSeparatorView setText(String text) { + this.text = text; + return this; + } + +} diff --git a/lite/src/org/transdroid/lite/gui/navigation/NavigationHelper.java b/lite/src/org/transdroid/lite/gui/navigation/NavigationHelper.java new file mode 100644 index 00000000..dd2ec575 --- /dev/null +++ b/lite/src/org/transdroid/lite/gui/navigation/NavigationHelper.java @@ -0,0 +1,30 @@ +package org.transdroid.lite.gui.navigation; + +import org.androidannotations.annotations.EBean; +import org.androidannotations.annotations.RootContext; + +import android.annotation.TargetApi; +import android.content.Context; +import android.os.Build; + +@EBean +public class NavigationHelper { + + @RootContext + protected Context context; + + /** + * Whether the navigation of server types and labels as filter are shown in a separate fragment. + * @return True if navigation is in a separate fragment, false if the items are shown in the action bar spinner + */ + @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) + public boolean showFiltersInFragment() { + if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) { + if (context.getResources().getConfiguration().screenWidthDp >= 600) { + return true; + } + } + return false; + } + +}