aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2012-11-10 23:11:21 +0100
committerJorge Ruesga <jorge@ruesga.com>2012-11-11 20:30:06 +0100
commit554c4a75b3923f005115fca9f84174c841bea106 (patch)
tree47caf2803c8eb06a97340c1018b7d1419d22880a
parent17d3b81a120f00ecf6a76bd3b13720a912377b37 (diff)
downloadandroid_packages_apps_CMFileManager-554c4a75b3923f005115fca9f84174c841bea106.tar.gz
android_packages_apps_CMFileManager-554c4a75b3923f005115fca9f84174c841bea106.tar.bz2
android_packages_apps_CMFileManager-554c4a75b3923f005115fca9f84174c841bea106.zip
CMFileManager: Themes support + Dark theme
This change enabled the theme support, and added a new dark theme under the package CMFileManagerThemes. To compile under build system, it must be enabled in vendor/cm/config/common.mk or vendor/cm/config/themes_common.mk (this was requested in change http://review.cyanogenmod.org/#/c/26311/) Themes were enabled in a new settings option. Under this setting the application show the user the available themes installed in the system. -------------------- For build new themes, developers should: - Create a new package that contains an activity with: * Permission: com.cyanogenmod.filemanager.permissions.READ_THEME * Action: com.cyanogenmod.filemanager.actions.MAIN_THEME * Category: com.cyanogenmod.filemanager.categories.THEME - Define the themes_ids, themes_names and themes_descriptions arrays-strings definitions for the themes that the package support. - Create a xxx_theme.xml for every theme that the package support, where the xxx is the id of the theme. Put your resources in this file, prefixing the resource with the id of the theme (xxx_). For a list of all supported resources see theme.xml in res/values of CMFileManager project. ------------------- Other fixes: * Protect console buffers from NPE * Fix code style of xmls (layouts, drawables, ...) Patchset 2: Fixed code style and added Christian suggestion Patchset 3: Added forgotten READ_THEME permission check as described in the note above. Patchset 4: Use centerInside in theme preview for better image fit Change-Id: I4142da6d9ed1b06318e47ff9c05f9a874c62f3ae
-rw-r--r--AndroidManifest.xml35
-rw-r--r--CHANGELOG.md6
-rw-r--r--proguard.flags3
-rw-r--r--res/drawable-hdpi/divider_horizontal_bright_opaque.9.pngbin0 -> 106 bytes
-rw-r--r--res/drawable-hdpi/divider_vertical_bright_opaque.9.pngbin0 -> 106 bytes
-rw-r--r--res/drawable-hdpi/ic_ab_back_holo_light.pngbin0 -> 339 bytes
-rw-r--r--res/drawable-hdpi/progress_bg_holo_light.9.pngbin0 -> 175 bytes
-rw-r--r--res/drawable-hdpi/progress_primary_holo_light.9.pngbin0 -> 873 bytes
-rw-r--r--res/drawable-hdpi/progress_secondary_holo_light.9.pngbin0 -> 188 bytes
-rw-r--r--res/drawable-mdpi/divider_horizontal_bright_opaque.9.pngbin0 -> 106 bytes
-rw-r--r--res/drawable-mdpi/divider_vertical_bright_opaque.9.pngbin0 -> 106 bytes
-rw-r--r--res/drawable-mdpi/ic_ab_back_holo_light.pngbin0 -> 281 bytes
-rw-r--r--res/drawable-mdpi/progress_bg_holo_light.9.pngbin0 -> 161 bytes
-rw-r--r--res/drawable-mdpi/progress_primary_holo_light.9.pngbin0 -> 561 bytes
-rw-r--r--res/drawable-mdpi/progress_secondary_holo_light.9.pngbin0 -> 177 bytes
-rw-r--r--res/drawable-nodpi/bg_holo_background.9.pngbin0 -> 158 bytes
-rw-r--r--res/drawable-nodpi/bg_holo_popup_background.9.pngbin0 -> 166 bytes
-rw-r--r--res/drawable-nodpi/theme_no_preview.pngbin0 -> 3587 bytes
-rw-r--r--res/drawable-nodpi/theme_preview.pngbin0 -> 66556 bytes
-rw-r--r--res/drawable-xhdpi/divider_horizontal_bright_opaque.9.pngbin0 -> 106 bytes
-rw-r--r--res/drawable-xhdpi/divider_vertical_bright_opaque.9.pngbin0 -> 106 bytes
-rw-r--r--res/drawable-xhdpi/ic_ab_back_holo_light.pngbin0 -> 401 bytes
-rw-r--r--res/drawable-xhdpi/progress_bg_holo_light.9.pngbin0 -> 178 bytes
-rw-r--r--res/drawable-xhdpi/progress_primary_holo_light.9.pngbin0 -> 1285 bytes
-rw-r--r--res/drawable-xhdpi/progress_secondary_holo_light.9.pngbin0 -> 192 bytes
-rw-r--r--res/drawable/checkable_selector.xml32
-rw-r--r--res/drawable/fso_type_app.xml32
-rw-r--r--res/drawable/fso_type_audio.xml32
-rw-r--r--res/drawable/fso_type_binary.xml32
-rw-r--r--res/drawable/fso_type_calendar.xml32
-rw-r--r--res/drawable/fso_type_cdimage.xml32
-rw-r--r--res/drawable/fso_type_compress.xml32
-rw-r--r--res/drawable/fso_type_contact.xml32
-rw-r--r--res/drawable/fso_type_database.xml32
-rw-r--r--res/drawable/fso_type_document.xml32
-rw-r--r--res/drawable/fso_type_ebook.xml32
-rw-r--r--res/drawable/fso_type_email.xml32
-rw-r--r--res/drawable/fso_type_executable.xml32
-rw-r--r--res/drawable/fso_type_feed.xml32
-rw-r--r--res/drawable/fso_type_font.xml32
-rw-r--r--res/drawable/fso_type_image.xml32
-rw-r--r--res/drawable/fso_type_markup_document.xml32
-rw-r--r--res/drawable/fso_type_pdf.xml32
-rw-r--r--res/drawable/fso_type_presentation.xml32
-rw-r--r--res/drawable/fso_type_security.xml32
-rw-r--r--res/drawable/fso_type_shell.xml32
-rw-r--r--res/drawable/fso_type_source.xml32
-rw-r--r--res/drawable/fso_type_spreadsheet.xml32
-rw-r--r--res/drawable/fso_type_system.xml32
-rw-r--r--res/drawable/fso_type_text.xml32
-rw-r--r--res/drawable/fso_type_video.xml32
-rw-r--r--res/drawable/holo_button_selector.xml29
-rw-r--r--res/drawable/holo_list_selector_deselected.xml32
-rw-r--r--res/drawable/holo_list_selector_deseleted.xml32
-rw-r--r--res/drawable/holo_list_selector_selected.xml32
-rw-r--r--res/drawable/holo_popup_selector.xml32
-rw-r--r--res/drawable/holo_selection.xml32
-rw-r--r--res/drawable/holo_selector.xml32
-rw-r--r--res/drawable/holo_selector_nonfocusable.xml32
-rw-r--r--res/drawable/progress_horizontal_holo_light.xml32
-rw-r--r--res/layout-land/theme_view.xml74
-rw-r--r--res/layout/editor.xml3
-rw-r--r--res/layout/execution_dialog.xml5
-rw-r--r--res/layout/filesystem_info_dialog.xml20
-rw-r--r--res/layout/fso_properties_dialog.xml50
-rw-r--r--res/layout/menu_item.xml9
-rw-r--r--res/layout/menu_item_separator.xml7
-rw-r--r--res/layout/message_progress_dialog.xml2
-rw-r--r--res/layout/navigation.xml1
-rw-r--r--res/layout/navigation_view_details_item.xml2
-rw-r--r--res/layout/navigation_view_selectionbar.xml1
-rw-r--r--res/layout/navigation_view_simple_item.xml2
-rw-r--r--res/layout/option_list_item.xml5
-rw-r--r--res/layout/search_item.xml2
-rw-r--r--res/layout/theme_roulette.xml35
-rw-r--r--res/layout/theme_selector_preference.xml74
-rw-r--r--res/layout/theme_view.xml64
-rw-r--r--res/raw/changelog6
-rw-r--r--res/raw/mime_types.properties560
-rw-r--r--res/values/arrays.xml12
-rw-r--r--res/values/colors.xml4
-rw-r--r--res/values/dimen.xml6
-rw-r--r--res/values/strings.xml20
-rw-r--r--res/values/styles.xml15
-rw-r--r--res/values/theme.xml177
-rw-r--r--res/xml/preferences_headers.xml4
-rw-r--r--res/xml/preferences_search.xml1
-rw-r--r--res/xml/preferences_themes.xml33
-rw-r--r--src/com/cyanogenmod/filemanager/FileManagerApplication.java148
-rw-r--r--src/com/cyanogenmod/filemanager/activities/BookmarksActivity.java73
-rw-r--r--src/com/cyanogenmod/filemanager/activities/ChangeLogActivity.java54
-rw-r--r--src/com/cyanogenmod/filemanager/activities/EditorActivity.java76
-rw-r--r--src/com/cyanogenmod/filemanager/activities/HistoryActivity.java79
-rw-r--r--src/com/cyanogenmod/filemanager/activities/NavigationActivity.java103
-rw-r--r--src/com/cyanogenmod/filemanager/activities/PickerActivity.java73
-rw-r--r--src/com/cyanogenmod/filemanager/activities/SearchActivity.java130
-rw-r--r--src/com/cyanogenmod/filemanager/activities/ShortcutActivity.java51
-rw-r--r--src/com/cyanogenmod/filemanager/activities/preferences/SettingsPreferences.java131
-rw-r--r--src/com/cyanogenmod/filemanager/adapters/AssociationsAdapter.java7
-rw-r--r--src/com/cyanogenmod/filemanager/adapters/BookmarksAdapter.java23
-rw-r--r--src/com/cyanogenmod/filemanager/adapters/CheckableListAdapter.java15
-rw-r--r--src/com/cyanogenmod/filemanager/adapters/FileSystemObjectAdapter.java104
-rw-r--r--src/com/cyanogenmod/filemanager/adapters/HighlightedSimpleMenuListAdapter.java4
-rw-r--r--src/com/cyanogenmod/filemanager/adapters/HistoryAdapter.java26
-rw-r--r--src/com/cyanogenmod/filemanager/adapters/SearchResultAdapter.java24
-rw-r--r--src/com/cyanogenmod/filemanager/adapters/SimpleMenuListAdapter.java7
-rw-r--r--src/com/cyanogenmod/filemanager/adapters/TwoColumnsMenuListAdapter.java19
-rw-r--r--src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java21
-rw-r--r--src/com/cyanogenmod/filemanager/preferences/FileManagerSettings.java25
-rw-r--r--src/com/cyanogenmod/filemanager/tasks/FilesystemAsyncTask.java47
-rw-r--r--src/com/cyanogenmod/filemanager/ui/IconHolder.java19
-rw-r--r--src/com/cyanogenmod/filemanager/ui/ThemeManager.java629
-rw-r--r--src/com/cyanogenmod/filemanager/ui/dialogs/ActionsDialog.java16
-rw-r--r--src/com/cyanogenmod/filemanager/ui/dialogs/AssociationsDialog.java15
-rw-r--r--src/com/cyanogenmod/filemanager/ui/dialogs/ExecutionDialog.java32
-rw-r--r--src/com/cyanogenmod/filemanager/ui/dialogs/FilesystemInfoDialog.java89
-rw-r--r--src/com/cyanogenmod/filemanager/ui/dialogs/FsoPropertiesDialog.java103
-rw-r--r--src/com/cyanogenmod/filemanager/ui/dialogs/InitialDirectoryDialog.java16
-rw-r--r--src/com/cyanogenmod/filemanager/ui/dialogs/InputNameDialog.java13
-rw-r--r--src/com/cyanogenmod/filemanager/ui/dialogs/MessageProgressDialog.java10
-rw-r--r--src/com/cyanogenmod/filemanager/ui/policy/CompressActionPolicy.java8
-rw-r--r--src/com/cyanogenmod/filemanager/ui/policy/CopyMoveActionPolicy.java12
-rw-r--r--src/com/cyanogenmod/filemanager/ui/policy/DeleteActionPolicy.java4
-rw-r--r--src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java10
-rw-r--r--src/com/cyanogenmod/filemanager/ui/preferences/ThemeRoulette.java364
-rw-r--r--src/com/cyanogenmod/filemanager/ui/preferences/ThemeSelectorPreference.java317
-rw-r--r--src/com/cyanogenmod/filemanager/ui/preferences/ThemeView.java126
-rw-r--r--src/com/cyanogenmod/filemanager/ui/widgets/Breadcrumb.java4
-rw-r--r--src/com/cyanogenmod/filemanager/ui/widgets/BreadcrumbView.java42
-rw-r--r--src/com/cyanogenmod/filemanager/ui/widgets/DiskUsageGraph.java42
-rw-r--r--src/com/cyanogenmod/filemanager/ui/widgets/FlingerListView.java3
-rw-r--r--src/com/cyanogenmod/filemanager/ui/widgets/InlineAutocompleteTextView.java20
-rw-r--r--src/com/cyanogenmod/filemanager/ui/widgets/NavigationView.java48
-rw-r--r--src/com/cyanogenmod/filemanager/util/AndroidHelper.java26
-rw-r--r--src/com/cyanogenmod/filemanager/util/BookmarksHelper.java15
-rw-r--r--src/com/cyanogenmod/filemanager/util/DialogHelper.java38
-rw-r--r--src/com/cyanogenmod/filemanager/util/ExceptionUtil.java8
-rw-r--r--src/com/cyanogenmod/filemanager/util/MimeTypeHelper.java37
-rw-r--r--src/com/cyanogenmod/filemanager/util/SearchHelper.java8
-rw-r--r--themes/.gitignore8
-rw-r--r--themes/Android.mk28
-rw-r--r--themes/AndroidManifest.xml45
-rw-r--r--themes/CleanSpec.mk50
-rw-r--r--themes/README.md30
-rw-r--r--themes/proguard.flags28
-rw-r--r--themes/res/drawable-hdpi/btn_holo_dark_check_off_normal.pngbin0 -> 275 bytes
-rw-r--r--themes/res/drawable-hdpi/btn_holo_dark_check_on_normal.pngbin0 -> 447 bytes
-rw-r--r--themes/res/drawable-hdpi/btn_holo_dark_check_on_normal_inverted.pngbin0 -> 544 bytes
-rw-r--r--themes/res/drawable-hdpi/divider_horizontal_dark_opaque.9.pngbin0 -> 106 bytes
-rw-r--r--themes/res/drawable-hdpi/divider_vertical_dark_opaque.9.pngbin0 -> 106 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_accept.pngbin0 -> 532 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_bookmarks.pngbin0 -> 729 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_close.pngbin0 -> 634 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_config.pngbin0 -> 606 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_contextual_action.pngbin0 -> 611 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_expander_close.pngbin0 -> 405 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_expander_open.pngbin0 -> 408 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_filesystem.pngbin0 -> 363 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_fs_locked.pngbin0 -> 496 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_fs_unlocked.pngbin0 -> 468 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_fs_warning.pngbin0 -> 462 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_history.pngbin0 -> 1077 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_home.pngbin0 -> 2064 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_layout.pngbin0 -> 294 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_overflow.pngbin0 -> 574 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_save.pngbin0 -> 633 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_sdcard.pngbin0 -> 637 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_search.pngbin0 -> 969 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_sort_alphabetically.pngbin0 -> 1369 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_tab.pngbin0 -> 438 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_usb.pngbin0 -> 825 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_user_defined_bookmark.pngbin0 -> 798 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_holo_dark_view.pngbin0 -> 1587 bytes
-rw-r--r--themes/res/drawable-hdpi/ic_launcher.pngbin0 -> 4760 bytes
-rw-r--r--themes/res/drawable-hdpi/progress_bg_holo_dark.9.pngbin0 -> 178 bytes
-rw-r--r--themes/res/drawable-hdpi/progress_primary_holo_dark.9.pngbin0 -> 869 bytes
-rw-r--r--themes/res/drawable-hdpi/progress_secondary_holo_dark.9.pngbin0 -> 188 bytes
-rw-r--r--themes/res/drawable-mdpi/btn_holo_dark_check_off_normal.pngbin0 -> 403 bytes
-rw-r--r--themes/res/drawable-mdpi/btn_holo_dark_check_on_normal.pngbin0 -> 512 bytes
-rw-r--r--themes/res/drawable-mdpi/btn_holo_dark_check_on_normal_inverted.pngbin0 -> 507 bytes
-rw-r--r--themes/res/drawable-mdpi/divider_horizontal_dark_opaque.9.pngbin0 -> 106 bytes
-rw-r--r--themes/res/drawable-mdpi/divider_vertical_dark_opaque.9.pngbin0 -> 106 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_accept.pngbin0 -> 411 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_bookmarks.pngbin0 -> 501 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_close.pngbin0 -> 610 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_config.pngbin0 -> 480 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_contextual_action.pngbin0 -> 593 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_expander_close.pngbin0 -> 293 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_expander_open.pngbin0 -> 296 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_filesystem.pngbin0 -> 439 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_fs_locked.pngbin0 -> 369 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_fs_unlocked.pngbin0 -> 353 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_fs_warning.pngbin0 -> 317 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_history.pngbin0 -> 696 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_home.pngbin0 -> 1585 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_layout.pngbin0 -> 322 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_overflow.pngbin0 -> 548 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_save.pngbin0 -> 585 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_sdcard.pngbin0 -> 481 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_search.pngbin0 -> 626 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_sort_alphabetically.pngbin0 -> 823 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_tab.pngbin0 -> 367 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_usb.pngbin0 -> 561 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_user_defined_bookmark.pngbin0 -> 586 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_holo_dark_view.pngbin0 -> 946 bytes
-rw-r--r--themes/res/drawable-mdpi/ic_launcher.pngbin0 -> 2604 bytes
-rw-r--r--themes/res/drawable-mdpi/progress_bg_holo_dark.9.pngbin0 -> 168 bytes
-rw-r--r--themes/res/drawable-mdpi/progress_primary_holo_dark.9.pngbin0 -> 559 bytes
-rw-r--r--themes/res/drawable-mdpi/progress_secondary_holo_dark.9.pngbin0 -> 173 bytes
-rw-r--r--themes/res/drawable-nodpi/dark_background.9.pngbin0 -> 85 bytes
-rw-r--r--themes/res/drawable-nodpi/dark_popup_background.9.pngbin0 -> 165 bytes
-rw-r--r--themes/res/drawable-nodpi/dark_selectionbar.9.pngbin0 -> 171 bytes
-rw-r--r--themes/res/drawable-nodpi/dark_statusbar.9.pngbin0 -> 174 bytes
-rw-r--r--themes/res/drawable-nodpi/dark_theme_no_preview.pngbin0 -> 4111 bytes
-rw-r--r--themes/res/drawable-nodpi/dark_theme_preview.pngbin0 -> 64772 bytes
-rw-r--r--themes/res/drawable-nodpi/dark_titlebar.9.pngbin0 -> 179 bytes
-rw-r--r--themes/res/drawable-xhdpi/btn_holo_dark_check_off_normal.pngbin0 -> 399 bytes
-rw-r--r--themes/res/drawable-xhdpi/btn_holo_dark_check_on_normal.pngbin0 -> 574 bytes
-rw-r--r--themes/res/drawable-xhdpi/btn_holo_dark_check_on_normal_inverted.pngbin0 -> 726 bytes
-rw-r--r--themes/res/drawable-xhdpi/divider_horizontal_dark_opaque.9.pngbin0 -> 106 bytes
-rw-r--r--themes/res/drawable-xhdpi/divider_vertical_dark_opaque.9.pngbin0 -> 106 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_accept.pngbin0 -> 757 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_bookmarks.pngbin0 -> 840 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_close.pngbin0 -> 858 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_config.pngbin0 -> 625 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_contextual_action.pngbin0 -> 655 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_expander_close.pngbin0 -> 534 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_expander_open.pngbin0 -> 531 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_filesystem.pngbin0 -> 587 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_fs_locked.pngbin0 -> 585 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_fs_unlocked.pngbin0 -> 566 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_fs_warning.pngbin0 -> 574 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_history.pngbin0 -> 3039 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_home.pngbin0 -> 2253 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_layout.pngbin0 -> 254 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_overflow.pngbin0 -> 605 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_save.pngbin0 -> 782 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_sdcard.pngbin0 -> 775 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_search.pngbin0 -> 1320 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_sort_alphabetically.pngbin0 -> 1937 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_tab.pngbin0 -> 543 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_usb.pngbin0 -> 1092 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_user_defined_bookmark.pngbin0 -> 1016 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_holo_dark_view.pngbin0 -> 2168 bytes
-rw-r--r--themes/res/drawable-xhdpi/ic_launcher.pngbin0 -> 6620 bytes
-rw-r--r--themes/res/drawable-xhdpi/progress_bg_holo_dark.9.pngbin0 -> 181 bytes
-rw-r--r--themes/res/drawable-xhdpi/progress_primary_holo_dark.9.pngbin0 -> 1282 bytes
-rw-r--r--themes/res/drawable-xhdpi/progress_secondary_holo_dark.9.pngbin0 -> 192 bytes
-rw-r--r--themes/res/drawable/dark_checkable_selector.xml25
-rw-r--r--themes/res/drawable/dark_holo_button_selector.xml29
-rw-r--r--themes/res/drawable/dark_holo_list_selector_deselected.xml32
-rw-r--r--themes/res/drawable/dark_holo_list_selector_selected.xml32
-rw-r--r--themes/res/drawable/dark_holo_popup_selector.xml32
-rw-r--r--themes/res/drawable/dark_holo_selection.xml37
-rw-r--r--themes/res/drawable/dark_progress_horizontal_holo.xml32
-rw-r--r--themes/res/values/arrays.xml31
-rw-r--r--themes/res/values/dark_theme.xml171
-rw-r--r--themes/res/values/strings.xml32
-rw-r--r--themes/src/com/cyanogenmod/filemanager/themes/ThemeActivity.java41
259 files changed, 5182 insertions, 1170 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 20cbb9e1..bc947fdb 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cyanogenmod.filemanager"
- android:versionCode="100"
- android:versionName="1.0.0">
+ android:versionCode="101"
+ android:versionName="1.0.1">
<original-package android:name="com.cyanogenmod.filemanager" />
@@ -28,6 +28,7 @@
<uses-permission android:name="android.permission.SET_PREFERRED_APPLICATIONS" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="android.permission.NFC"/>
+ <uses-permission android:name="com.cyanogenmod.filemanager.permissions.READ_THEME"/>
<application
android:name="FileManagerApplication"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ce061b9b..c64271e6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,11 @@
CyanogenMod File Manager
========================
+Version 1.0.1
+-------------
+* NFC support
+* Themes support
+
Version 1.0.0
-------------
Initial release.
@@ -29,3 +34,4 @@ Features:
* Open and Open With
* Send to
* Internal editor
+
diff --git a/proguard.flags b/proguard.flags
index 6fa82ecd..6f046926 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -53,4 +53,7 @@
-keep public class * extends android.preference.PreferenceFragment {
public <init>(...);
}
+-keep public class * extends android.preference.Preference {
+ public <init>(...);
+}
diff --git a/res/drawable-hdpi/divider_horizontal_bright_opaque.9.png b/res/drawable-hdpi/divider_horizontal_bright_opaque.9.png
new file mode 100644
index 00000000..eb75a220
--- /dev/null
+++ b/res/drawable-hdpi/divider_horizontal_bright_opaque.9.png
Binary files differ
diff --git a/res/drawable-hdpi/divider_vertical_bright_opaque.9.png b/res/drawable-hdpi/divider_vertical_bright_opaque.9.png
new file mode 100644
index 00000000..eb75a220
--- /dev/null
+++ b/res/drawable-hdpi/divider_vertical_bright_opaque.9.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_ab_back_holo_light.png b/res/drawable-hdpi/ic_ab_back_holo_light.png
new file mode 100644
index 00000000..e77cecbe
--- /dev/null
+++ b/res/drawable-hdpi/ic_ab_back_holo_light.png
Binary files differ
diff --git a/res/drawable-hdpi/progress_bg_holo_light.9.png b/res/drawable-hdpi/progress_bg_holo_light.9.png
new file mode 100644
index 00000000..3f12166d
--- /dev/null
+++ b/res/drawable-hdpi/progress_bg_holo_light.9.png
Binary files differ
diff --git a/res/drawable-hdpi/progress_primary_holo_light.9.png b/res/drawable-hdpi/progress_primary_holo_light.9.png
new file mode 100644
index 00000000..2f76a226
--- /dev/null
+++ b/res/drawable-hdpi/progress_primary_holo_light.9.png
Binary files differ
diff --git a/res/drawable-hdpi/progress_secondary_holo_light.9.png b/res/drawable-hdpi/progress_secondary_holo_light.9.png
new file mode 100644
index 00000000..955b7080
--- /dev/null
+++ b/res/drawable-hdpi/progress_secondary_holo_light.9.png
Binary files differ
diff --git a/res/drawable-mdpi/divider_horizontal_bright_opaque.9.png b/res/drawable-mdpi/divider_horizontal_bright_opaque.9.png
new file mode 100644
index 00000000..eb75a220
--- /dev/null
+++ b/res/drawable-mdpi/divider_horizontal_bright_opaque.9.png
Binary files differ
diff --git a/res/drawable-mdpi/divider_vertical_bright_opaque.9.png b/res/drawable-mdpi/divider_vertical_bright_opaque.9.png
new file mode 100644
index 00000000..eb75a220
--- /dev/null
+++ b/res/drawable-mdpi/divider_vertical_bright_opaque.9.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_ab_back_holo_light.png b/res/drawable-mdpi/ic_ab_back_holo_light.png
new file mode 100644
index 00000000..41cb0bcb
--- /dev/null
+++ b/res/drawable-mdpi/ic_ab_back_holo_light.png
Binary files differ
diff --git a/res/drawable-mdpi/progress_bg_holo_light.9.png b/res/drawable-mdpi/progress_bg_holo_light.9.png
new file mode 100644
index 00000000..780b4b25
--- /dev/null
+++ b/res/drawable-mdpi/progress_bg_holo_light.9.png
Binary files differ
diff --git a/res/drawable-mdpi/progress_primary_holo_light.9.png b/res/drawable-mdpi/progress_primary_holo_light.9.png
new file mode 100644
index 00000000..6fb94457
--- /dev/null
+++ b/res/drawable-mdpi/progress_primary_holo_light.9.png
Binary files differ
diff --git a/res/drawable-mdpi/progress_secondary_holo_light.9.png b/res/drawable-mdpi/progress_secondary_holo_light.9.png
new file mode 100644
index 00000000..9104cf94
--- /dev/null
+++ b/res/drawable-mdpi/progress_secondary_holo_light.9.png
Binary files differ
diff --git a/res/drawable-nodpi/bg_holo_background.9.png b/res/drawable-nodpi/bg_holo_background.9.png
new file mode 100644
index 00000000..ca767e94
--- /dev/null
+++ b/res/drawable-nodpi/bg_holo_background.9.png
Binary files differ
diff --git a/res/drawable-nodpi/bg_holo_popup_background.9.png b/res/drawable-nodpi/bg_holo_popup_background.9.png
new file mode 100644
index 00000000..fe042415
--- /dev/null
+++ b/res/drawable-nodpi/bg_holo_popup_background.9.png
Binary files differ
diff --git a/res/drawable-nodpi/theme_no_preview.png b/res/drawable-nodpi/theme_no_preview.png
new file mode 100644
index 00000000..4e417030
--- /dev/null
+++ b/res/drawable-nodpi/theme_no_preview.png
Binary files differ
diff --git a/res/drawable-nodpi/theme_preview.png b/res/drawable-nodpi/theme_preview.png
new file mode 100644
index 00000000..f385813a
--- /dev/null
+++ b/res/drawable-nodpi/theme_preview.png
Binary files differ
diff --git a/res/drawable-xhdpi/divider_horizontal_bright_opaque.9.png b/res/drawable-xhdpi/divider_horizontal_bright_opaque.9.png
new file mode 100644
index 00000000..eb75a220
--- /dev/null
+++ b/res/drawable-xhdpi/divider_horizontal_bright_opaque.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/divider_vertical_bright_opaque.9.png b/res/drawable-xhdpi/divider_vertical_bright_opaque.9.png
new file mode 100644
index 00000000..eb75a220
--- /dev/null
+++ b/res/drawable-xhdpi/divider_vertical_bright_opaque.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_ab_back_holo_light.png b/res/drawable-xhdpi/ic_ab_back_holo_light.png
new file mode 100644
index 00000000..ef30e5fd
--- /dev/null
+++ b/res/drawable-xhdpi/ic_ab_back_holo_light.png
Binary files differ
diff --git a/res/drawable-xhdpi/progress_bg_holo_light.9.png b/res/drawable-xhdpi/progress_bg_holo_light.9.png
new file mode 100644
index 00000000..cbd19ac4
--- /dev/null
+++ b/res/drawable-xhdpi/progress_bg_holo_light.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/progress_primary_holo_light.9.png b/res/drawable-xhdpi/progress_primary_holo_light.9.png
new file mode 100644
index 00000000..e62123c4
--- /dev/null
+++ b/res/drawable-xhdpi/progress_primary_holo_light.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/progress_secondary_holo_light.9.png b/res/drawable-xhdpi/progress_secondary_holo_light.9.png
new file mode 100644
index 00000000..37c6d5ff
--- /dev/null
+++ b/res/drawable-xhdpi/progress_secondary_holo_light.9.png
Binary files differ
diff --git a/res/drawable/checkable_selector.xml b/res/drawable/checkable_selector.xml
index 93814c58..cac107b2 100644
--- a/res/drawable/checkable_selector.xml
+++ b/res/drawable/checkable_selector.xml
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
@@ -22,4 +22,4 @@
<item
android:drawable="@drawable/btn_holo_light_check_off_normal"/>
-</selector> \ No newline at end of file
+</selector>
diff --git a/res/drawable/fso_type_app.xml b/res/drawable/fso_type_app.xml
index cd571950..dfac60d0 100644
--- a/res/drawable/fso_type_app.xml
+++ b/res/drawable/fso_type_app.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_app"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_audio.xml b/res/drawable/fso_type_audio.xml
index 7dc83309..5ec1e778 100644
--- a/res/drawable/fso_type_audio.xml
+++ b/res/drawable/fso_type_audio.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_audio"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_binary.xml b/res/drawable/fso_type_binary.xml
index 2f48f644..089715f2 100644
--- a/res/drawable/fso_type_binary.xml
+++ b/res/drawable/fso_type_binary.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_binary"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_calendar.xml b/res/drawable/fso_type_calendar.xml
index f3fe3d68..318b05f9 100644
--- a/res/drawable/fso_type_calendar.xml
+++ b/res/drawable/fso_type_calendar.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_calendar"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_cdimage.xml b/res/drawable/fso_type_cdimage.xml
index c949daa0..a1ea80bf 100644
--- a/res/drawable/fso_type_cdimage.xml
+++ b/res/drawable/fso_type_cdimage.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_cdimage"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_compress.xml b/res/drawable/fso_type_compress.xml
index 701906f8..e64f5374 100644
--- a/res/drawable/fso_type_compress.xml
+++ b/res/drawable/fso_type_compress.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_compress"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_contact.xml b/res/drawable/fso_type_contact.xml
index d6c6d6ba..f87a7d5d 100644
--- a/res/drawable/fso_type_contact.xml
+++ b/res/drawable/fso_type_contact.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_contact"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_database.xml b/res/drawable/fso_type_database.xml
index 23e8e3ed..09ef9d47 100644
--- a/res/drawable/fso_type_database.xml
+++ b/res/drawable/fso_type_database.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_database"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_document.xml b/res/drawable/fso_type_document.xml
index 334c7eae..cd98ac53 100644
--- a/res/drawable/fso_type_document.xml
+++ b/res/drawable/fso_type_document.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_document"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_ebook.xml b/res/drawable/fso_type_ebook.xml
index 02ae0c57..73dcccb2 100644
--- a/res/drawable/fso_type_ebook.xml
+++ b/res/drawable/fso_type_ebook.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_ebook"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_email.xml b/res/drawable/fso_type_email.xml
index 393495e8..b945ead5 100644
--- a/res/drawable/fso_type_email.xml
+++ b/res/drawable/fso_type_email.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_email"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_executable.xml b/res/drawable/fso_type_executable.xml
index 1ea97357..da032284 100644
--- a/res/drawable/fso_type_executable.xml
+++ b/res/drawable/fso_type_executable.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_executable"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_feed.xml b/res/drawable/fso_type_feed.xml
index e70c4cce..06a05412 100644
--- a/res/drawable/fso_type_feed.xml
+++ b/res/drawable/fso_type_feed.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_feed"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_font.xml b/res/drawable/fso_type_font.xml
index 5ed448d5..a28e384d 100644
--- a/res/drawable/fso_type_font.xml
+++ b/res/drawable/fso_type_font.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_font"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_image.xml b/res/drawable/fso_type_image.xml
index c1ee8e77..1fbd6b80 100644
--- a/res/drawable/fso_type_image.xml
+++ b/res/drawable/fso_type_image.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_image"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_markup_document.xml b/res/drawable/fso_type_markup_document.xml
index 4b99ee69..e2c51095 100644
--- a/res/drawable/fso_type_markup_document.xml
+++ b/res/drawable/fso_type_markup_document.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_markup_document"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_pdf.xml b/res/drawable/fso_type_pdf.xml
index 76ac88b7..748fdaa8 100644
--- a/res/drawable/fso_type_pdf.xml
+++ b/res/drawable/fso_type_pdf.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_pdf"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_presentation.xml b/res/drawable/fso_type_presentation.xml
index bd6ef567..c1aed9d7 100644
--- a/res/drawable/fso_type_presentation.xml
+++ b/res/drawable/fso_type_presentation.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_presentation"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_security.xml b/res/drawable/fso_type_security.xml
index 48e3e999..aaabb529 100644
--- a/res/drawable/fso_type_security.xml
+++ b/res/drawable/fso_type_security.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_security"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_shell.xml b/res/drawable/fso_type_shell.xml
index ff69b465..d7e43907 100644
--- a/res/drawable/fso_type_shell.xml
+++ b/res/drawable/fso_type_shell.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_shell"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_source.xml b/res/drawable/fso_type_source.xml
index 143d43a6..32702700 100644
--- a/res/drawable/fso_type_source.xml
+++ b/res/drawable/fso_type_source.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_source"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_spreadsheet.xml b/res/drawable/fso_type_spreadsheet.xml
index cbf7a067..d53d292b 100644
--- a/res/drawable/fso_type_spreadsheet.xml
+++ b/res/drawable/fso_type_spreadsheet.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_spreadsheet"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_system.xml b/res/drawable/fso_type_system.xml
index 084467ec..4f17694c 100644
--- a/res/drawable/fso_type_system.xml
+++ b/res/drawable/fso_type_system.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_system"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_text.xml b/res/drawable/fso_type_text.xml
index 4f28b152..c5510645 100644
--- a/res/drawable/fso_type_text.xml
+++ b/res/drawable/fso_type_text.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_text"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/fso_type_video.xml b/res/drawable/fso_type_video.xml
index 7fecb88d..1b81c6f1 100644
--- a/res/drawable/fso_type_video.xml
+++ b/res/drawable/fso_type_video.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_video"/>
-</layer-list> \ No newline at end of file
+</layer-list>
diff --git a/res/drawable/holo_button_selector.xml b/res/drawable/holo_button_selector.xml
new file mode 100644
index 00000000..97ebf269
--- /dev/null
+++ b/res/drawable/holo_button_selector.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_enabled="true"
+ android:state_focused="true"/>
+ <item
+ android:drawable="@color/default_background"/>
+
+</selector>
diff --git a/res/drawable/holo_list_selector_deselected.xml b/res/drawable/holo_list_selector_deselected.xml
new file mode 100644
index 00000000..0a68e320
--- /dev/null
+++ b/res/drawable/holo_list_selector_deselected.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@color/blue_transparent"
+ android:state_selected="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_light"
+ android:state_enabled="true"
+ android:state_focused="true"/>
+ <item
+ android:drawable="@android:color/transparent"/>
+
+</selector>
diff --git a/res/drawable/holo_list_selector_deseleted.xml b/res/drawable/holo_list_selector_deseleted.xml
deleted file mode 100644
index f4c10147..00000000
--- a/res/drawable/holo_list_selector_deseleted.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
-<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
-
- <item
- android:drawable="@color/blue_transparent"
- android:state_selected="true"/>
- <item
- android:drawable="@android:color/holo_blue_dark"
- android:state_pressed="true"/>
- <item
- android:drawable="@android:color/holo_blue_light"
- android:state_enabled="true"
- android:state_focused="true"/>
- <item
- android:drawable="@color/default_background"/>
-
-</selector> \ No newline at end of file
diff --git a/res/drawable/holo_list_selector_selected.xml b/res/drawable/holo_list_selector_selected.xml
index f5b7cda2..b560c34b 100644
--- a/res/drawable/holo_list_selector_selected.xml
+++ b/res/drawable/holo_list_selector_selected.xml
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
<item
@@ -29,4 +29,4 @@
<item
android:drawable="@color/blue_transparent"/>
-</selector> \ No newline at end of file
+</selector>
diff --git a/res/drawable/holo_popup_selector.xml b/res/drawable/holo_popup_selector.xml
new file mode 100644
index 00000000..fcda638e
--- /dev/null
+++ b/res/drawable/holo_popup_selector.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@color/blue_transparent"
+ android:state_selected="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_light"
+ android:state_enabled="true"
+ android:state_focused="true"/>
+ <item
+ android:drawable="@drawable/bg_holo_popup_background"/>
+
+</selector>
diff --git a/res/drawable/holo_selection.xml b/res/drawable/holo_selection.xml
index 2be8ac50..8b13f21c 100644
--- a/res/drawable/holo_selection.xml
+++ b/res/drawable/holo_selection.xml
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
<item
@@ -34,4 +34,4 @@
<item
android:drawable="@android:color/transparent"/>
-</selector> \ No newline at end of file
+</selector>
diff --git a/res/drawable/holo_selector.xml b/res/drawable/holo_selector.xml
index 38575cf9..e9c03d5d 100644
--- a/res/drawable/holo_selector.xml
+++ b/res/drawable/holo_selector.xml
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
<item
@@ -26,4 +26,4 @@
<item
android:drawable="@android:color/transparent"/>
-</selector> \ No newline at end of file
+</selector>
diff --git a/res/drawable/holo_selector_nonfocusable.xml b/res/drawable/holo_selector_nonfocusable.xml
index e5ea90e4..ab161cdb 100644
--- a/res/drawable/holo_selector_nonfocusable.xml
+++ b/res/drawable/holo_selector_nonfocusable.xml
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- ** Copyright (C) 2012 The CyanogenMod Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
--->
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
<item
@@ -22,4 +22,4 @@
<item
android:drawable="@android:color/transparent"/>
-</selector> \ No newline at end of file
+</selector>
diff --git a/res/drawable/progress_horizontal_holo_light.xml b/res/drawable/progress_horizontal_holo_light.xml
new file mode 100644
index 00000000..3dfe3218
--- /dev/null
+++ b/res/drawable/progress_horizontal_holo_light.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:id="@android:id/background"
+ android:drawable="@drawable/progress_bg_holo_light" />
+
+ <item android:id="@android:id/secondaryProgress">
+ <scale android:scaleWidth="100%"
+ android:drawable="@drawable/progress_secondary_holo_light" />
+ </item>
+
+ <item android:id="@android:id/progress">
+ <scale android:scaleWidth="100%"
+ android:drawable="@drawable/progress_primary_holo_light" />
+ </item>
+
+</layer-list>
diff --git a/res/layout-land/theme_view.xml b/res/layout-land/theme_view.xml
new file mode 100644
index 00000000..93772ec1
--- /dev/null
+++ b/res/layout-land/theme_view.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<com.cyanogenmod.filemanager.ui.preferences.ThemeView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="1dp"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal">
+
+ <RelativeLayout
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="0.5">
+ <TextView
+ android:id="@+id/theme_name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:gravity="center"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:textAppearance="@style/primary_text_appearance" />
+
+ <TextView
+ android:id="@+id/theme_author"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/theme_name"
+ android:gravity="center"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:textAppearance="@style/primary_text_appearance_nohighlight" />
+
+ <TextView
+ android:id="@+id/theme_desc"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:gravity="center"
+ android:ellipsize="end"
+ android:singleLine="false"
+ android:maxLines="4"
+ android:textAppearance="@style/secondary_text_appearance" />
+ </RelativeLayout>
+
+ <ImageView
+ android:id="@+id/theme_preview"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="0.5"
+ android:padding="@dimen/default_margin"
+ android:layout_gravity="center"
+ android:scaleType="centerInside"
+ android:contentDescription="@null" />
+ </LinearLayout>
+
+</com.cyanogenmod.filemanager.ui.preferences.ThemeView>
diff --git a/res/layout/editor.xml b/res/layout/editor.xml
index d24f9fbb..af78d622 100644
--- a/res/layout/editor.xml
+++ b/res/layout/editor.xml
@@ -15,6 +15,7 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/editor_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -80,4 +81,4 @@
</RelativeLayout>
-</RelativeLayout> \ No newline at end of file
+</RelativeLayout>
diff --git a/res/layout/execution_dialog.xml b/res/layout/execution_dialog.xml
index 4831d9c5..b6adc0c8 100644
--- a/res/layout/execution_dialog.xml
+++ b/res/layout/execution_dialog.xml
@@ -26,6 +26,7 @@
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
+ android:id="@+id/execution_script_name_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -51,6 +52,7 @@
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
+ android:id="@+id/execution_time_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -70,6 +72,7 @@
android:textAppearance="@style/secondary_text_appearance" />
<TextView
+ android:id="@+id/execution_exitcode_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -109,4 +112,4 @@
</ScrollView>
-</LinearLayout> \ No newline at end of file
+</LinearLayout>
diff --git a/res/layout/filesystem_info_dialog.xml b/res/layout/filesystem_info_dialog.xml
index 00b5541b..b5c0aa81 100644
--- a/res/layout/filesystem_info_dialog.xml
+++ b/res/layout/filesystem_info_dialog.xml
@@ -26,6 +26,7 @@
android:orientation="vertical" >
<LinearLayout
+ android:id="@+id/filesystem_info_dialog_tabhost"
android:layout_width="match_parent"
android:layout_height="@dimen/default_row_height"
android:orientation="horizontal" >
@@ -42,7 +43,9 @@
android:textAllCaps="true"
android:textAppearance="@style/primary_text_appearance" />
- <include layout="@layout/horizontal_divider" />
+ <include
+ android:id="@+id/filesystem_info_dialog_tab_divider1"
+ layout="@layout/horizontal_divider" />
<TextView
android:id="@+id/filesystem_info_dialog_tab_disk_usage"
@@ -61,7 +64,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" >
- <include layout="@layout/vertical_divider" />
+ <include
+ android:id="@+id/filesystem_info_dialog_tab_divider2"
+ layout="@layout/vertical_divider" />
</LinearLayout>
</LinearLayout>
@@ -86,6 +91,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_status_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -109,6 +115,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_mount_point_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -132,6 +139,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_device_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -155,6 +163,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_type_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -178,6 +187,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_options_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -202,6 +212,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_dump_pass_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -270,6 +281,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_total_disk_usage_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -292,6 +304,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_used_disk_usage_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -314,6 +327,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_free_disk_usage_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -332,4 +346,4 @@
</TableLayout>
</LinearLayout>
-</RelativeLayout> \ No newline at end of file
+</RelativeLayout>
diff --git a/res/layout/fso_properties_dialog.xml b/res/layout/fso_properties_dialog.xml
index 13cd1260..65c962ff 100644
--- a/res/layout/fso_properties_dialog.xml
+++ b/res/layout/fso_properties_dialog.xml
@@ -25,6 +25,7 @@
android:layout_height="wrap_content" >
<LinearLayout
+ android:id="@+id/fso_properties_dialog_tabhost"
android:layout_width="match_parent"
android:layout_height="@dimen/default_row_height" >
@@ -40,7 +41,9 @@
android:textAllCaps="true"
android:textAppearance="@style/primary_text_appearance" />
- <include layout="@layout/horizontal_divider" />
+ <include
+ android:id="@+id/fso_properties_dialog_tab_divider1"
+ layout="@layout/horizontal_divider" />
<TextView
android:id="@+id/fso_properties_dialog_tab_permissions"
@@ -59,7 +62,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" >
- <include layout="@layout/vertical_divider" />
+ <include
+ android:id="@+id/fso_properties_dialog_tab_divider2"
+ layout="@layout/vertical_divider" />
</LinearLayout>
</TableLayout>
@@ -84,6 +89,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_name_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -107,6 +113,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_parent_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -131,6 +138,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_type_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -155,6 +163,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_category_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -180,6 +189,7 @@
android:visibility="gone" >
<TextView
+ android:id="@+id/fso_properties_link_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -203,6 +213,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_size_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -228,6 +239,7 @@
android:visibility="gone" >
<TextView
+ android:id="@+id/fso_properties_contains_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -251,6 +263,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_date_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -267,24 +280,6 @@
android:singleLine="false"
android:textAppearance="@style/secondary_text_appearance" />
</TableRow>
-
- <!-- Info message -->
- <TextView
- android:id="@+id/fso_properties_msg"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_marginLeft="@dimen/extra_large_margin"
- android:layout_marginRight="@dimen/extra_large_margin"
- android:contentDescription="@null"
- android:drawableLeft="@drawable/ic_holo_light_fs_warning"
- android:drawablePadding="@dimen/default_margin"
- android:gravity="left|center_vertical"
- android:singleLine="false"
- android:text="@null"
- android:textAppearance="@style/secondary_text_appearance"
- android:textSize="@dimen/note_text_size"
- android:visibility="gone" />
</TableLayout>
</ScrollView>
@@ -314,6 +309,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_owner_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -337,6 +333,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_group_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
@@ -361,7 +358,9 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" >
- <include layout="@layout/vertical_divider" />
+ <include
+ android:id="@+id/fso_properties_dialog_tab_divider3"
+ layout="@layout/vertical_divider" />
</LinearLayout>
<!-- Permissions -->
@@ -384,6 +383,7 @@
android:textAppearance="@style/primary_text_appearance" />
<TextView
+ android:id="@+id/fso_properties_permissions_special_label"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -393,6 +393,7 @@
android:textAppearance="@style/primary_text_appearance" />
<TextView
+ android:id="@+id/fso_properties_permissions_read_label"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -402,6 +403,7 @@
android:textAppearance="@style/primary_text_appearance" />
<TextView
+ android:id="@+id/fso_properties_permissions_write_label"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -411,6 +413,7 @@
android:textAppearance="@style/primary_text_appearance" />
<TextView
+ android:id="@+id/fso_properties_permissions_execute_label"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -426,6 +429,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_permissions_owner_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -469,6 +473,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_permissions_group_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -512,6 +517,7 @@
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_permissions_others_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -571,4 +577,4 @@
</LinearLayout>
</ScrollView>
-</RelativeLayout> \ No newline at end of file
+</RelativeLayout>
diff --git a/res/layout/menu_item.xml b/res/layout/menu_item.xml
index 5a9112b1..762ec28c 100644
--- a/res/layout/menu_item.xml
+++ b/res/layout/menu_item.xml
@@ -14,10 +14,13 @@
limitations under the License.
-->
+<!-- The layout_height must hardcode here from @dimen/default_row_height, because
+ it is not resolved in themed context, because theme context and app context are
+ not the same -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
- android:layout_height="@dimen/default_row_height"
- android:background="@drawable/holo_list_selector_deseleted" >
+ android:layout_height="48dp"
+ android:background="@drawable/holo_list_selector_deselected" >
<TextView
android:id="@+id/menu_item_text"
@@ -33,4 +36,4 @@
android:singleLine="true"
android:textAppearance="@style/primary_text_appearance_nohighlight" />
-</RelativeLayout> \ No newline at end of file
+</RelativeLayout>
diff --git a/res/layout/menu_item_separator.xml b/res/layout/menu_item_separator.xml
index 6c9010da..90d12e31 100644
--- a/res/layout/menu_item_separator.xml
+++ b/res/layout/menu_item_separator.xml
@@ -14,13 +14,16 @@
limitations under the License.
-->
+<!-- The layout_height must hardcode here from @dimen/vertical_divider_height, because
+ it is not resolved in themed context, because theme context and app context are
+ not the same -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
- android:layout_height="@dimen/vertical_divider_height">
+ android:layout_height="0.75dp">
<TextView
android:id="@+id/menu_item_text"
android:layout_width="match_parent"
android:layout_height="match_parent" />
-</RelativeLayout> \ No newline at end of file
+</RelativeLayout>
diff --git a/res/layout/message_progress_dialog.xml b/res/layout/message_progress_dialog.xml
index b30fb197..2665c9a0 100644
--- a/res/layout/message_progress_dialog.xml
+++ b/res/layout/message_progress_dialog.xml
@@ -57,6 +57,6 @@
android:text="@null"
android:textAppearance="@style/secondary_text_appearance"
android:textStyle="normal"
- android:layout_marginBottom="@dimen/extra_margin" />
+ android:paddingBottom="@dimen/extra_margin" />
</RelativeLayout>
diff --git a/res/layout/navigation.xml b/res/layout/navigation.xml
index d1ab805c..f77033c7 100644
--- a/res/layout/navigation.xml
+++ b/res/layout/navigation.xml
@@ -34,6 +34,7 @@
android:id="@+id/navigation_selectionbar"
android:layout_width="match_parent"
android:layout_height="@dimen/small_row_height"
+ android:background="@drawable/bg_holo_selectionbar"
android:visibility="invisible" />
<!-- StatusBar -->
diff --git a/res/layout/navigation_view_details_item.xml b/res/layout/navigation_view_details_item.xml
index 243fdeaa..0422155c 100644
--- a/res/layout/navigation_view_details_item.xml
+++ b/res/layout/navigation_view_details_item.xml
@@ -18,7 +18,7 @@
android:id="@+id/navigation_view_details_item"
android:layout_width="match_parent"
android:layout_height="@dimen/default_row_height"
- android:background="@drawable/holo_list_selector_deseleted" >
+ android:background="@drawable/holo_list_selector_deselected" >
<com.cyanogenmod.filemanager.ui.widgets.TransparentNonFocusableButtonItem
android:id="@+id/navigation_view_item_check"
diff --git a/res/layout/navigation_view_selectionbar.xml b/res/layout/navigation_view_selectionbar.xml
index 195f3c49..cc5bf05d 100644
--- a/res/layout/navigation_view_selectionbar.xml
+++ b/res/layout/navigation_view_selectionbar.xml
@@ -17,7 +17,6 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@drawable/bg_holo_selectionbar"
android:orientation="horizontal" >
<com.cyanogenmod.filemanager.ui.widgets.ButtonItem
diff --git a/res/layout/navigation_view_simple_item.xml b/res/layout/navigation_view_simple_item.xml
index 3ef98bb1..4e00fa01 100644
--- a/res/layout/navigation_view_simple_item.xml
+++ b/res/layout/navigation_view_simple_item.xml
@@ -18,7 +18,7 @@
android:id="@+id/navigation_view_details_item"
android:layout_width="match_parent"
android:layout_height="@dimen/default_row_height"
- android:background="@drawable/holo_list_selector_deseleted" >
+ android:background="@drawable/holo_list_selector_deselected" >
<com.cyanogenmod.filemanager.ui.widgets.TransparentNonFocusableButtonItem
android:id="@+id/navigation_view_item_check"
diff --git a/res/layout/option_list_item.xml b/res/layout/option_list_item.xml
index b87aa455..48f1c51d 100644
--- a/res/layout/option_list_item.xml
+++ b/res/layout/option_list_item.xml
@@ -14,9 +14,12 @@
limitations under the License.
-->
+<!-- The layout_height must hardcode here from @dimen/default_row_height, because
+ it is not resolved in themed context, because theme context and app context are
+ not the same -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
- android:layout_height="@dimen/default_row_height"
+ android:layout_height="48dp"
android:background="@drawable/holo_selector" >
<ImageView
diff --git a/res/layout/search_item.xml b/res/layout/search_item.xml
index af6e742e..23a70075 100644
--- a/res/layout/search_item.xml
+++ b/res/layout/search_item.xml
@@ -18,7 +18,7 @@
android:id="@+id/search_item"
android:layout_width="match_parent"
android:layout_height="@dimen/default_row_height"
- android:background="@drawable/holo_list_selector_deseleted" >
+ android:background="@drawable/holo_list_selector_deselected" >
<ImageView
android:id="@+id/search_item_icon"
diff --git a/res/layout/theme_roulette.xml b/res/layout/theme_roulette.xml
new file mode 100644
index 00000000..1590e6df
--- /dev/null
+++ b/res/layout/theme_roulette.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/theme_roulette_layout"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:orientation="horizontal">
+
+ <View
+ android:id="@+id/spacer1"
+ android:layout_width="1dp"
+ android:layout_height="match_parent" />
+
+ <!-- Roulette views goes here -->
+
+ <View
+ android:id="@+id/spacer2"
+ android:layout_width="1dp"
+ android:layout_height="match_parent" />
+
+</LinearLayout>
diff --git a/res/layout/theme_selector_preference.xml b/res/layout/theme_selector_preference.xml
new file mode 100644
index 00000000..d7118f4a
--- /dev/null
+++ b/res/layout/theme_selector_preference.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center_vertical"
+ android:padding="@dimen/extra_margin">
+
+ <!-- Required by Preference. Not used -->
+ <TextView android:id="@android:id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone" />
+
+ <!-- Required by Preference. Not used -->
+ <TextView android:id="@android:id/summary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone" />
+
+ <!-- Required by Preference. Not used -->
+ <LinearLayout android:id="@android:id/widget_frame"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone" />
+
+
+ <!-- THEME PREFERENCE LAYOUT -->
+
+ <Button
+ android:id="@+id/theme_button"
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/default_row_height"
+ android:layout_alignParentBottom="true"
+ android:layout_centerHorizontal="true"
+ android:layout_marginTop="@dimen/default_margin"
+ android:text="@string/pref_themes_set_theme"
+ android:enabled="false" />
+
+ <!-- Theme roulette -->
+ <com.cyanogenmod.filemanager.ui.preferences.ThemeRoulette
+ android:id="@+id/theme_roulette"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentTop="true"
+ android:layout_above="@id/theme_button"
+ android:scrollbars="none" />
+
+ <ProgressBar
+ android:id="@+id/theme_waiting"
+ android:layout_width="@dimen/default_row_height"
+ android:layout_height="@dimen/default_row_height"
+ android:layout_above="@id/theme_button"
+ android:layout_alignParentTop="true"
+ android:layout_centerInParent="true"
+ android:indeterminate="true"
+ android:indeterminateOnly="true"
+ android:visibility="gone" />
+
+</RelativeLayout>
diff --git a/res/layout/theme_view.xml b/res/layout/theme_view.xml
new file mode 100644
index 00000000..356d1070
--- /dev/null
+++ b/res/layout/theme_view.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<com.cyanogenmod.filemanager.ui.preferences.ThemeView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="1dp"
+ android:layout_height="match_parent">
+
+ <TextView
+ android:id="@+id/theme_name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:gravity="center"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:textAppearance="@style/primary_text_appearance" />
+
+ <TextView
+ android:id="@+id/theme_author"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/theme_name"
+ android:gravity="center"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:textAppearance="@style/primary_text_appearance_nohighlight" />
+
+ <TextView
+ android:id="@+id/theme_desc"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:gravity="center"
+ android:ellipsize="end"
+ android:singleLine="false"
+ android:maxLines="2"
+ android:textAppearance="@style/secondary_text_appearance" />
+
+ <ImageView
+ android:id="@+id/theme_preview"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_above="@id/theme_desc"
+ android:layout_below="@id/theme_author"
+ android:padding="@dimen/extra_large_margin"
+ android:layout_gravity="center"
+ android:scaleType="centerInside"
+ android:contentDescription="@null" />
+
+</com.cyanogenmod.filemanager.ui.preferences.ThemeView>
diff --git a/res/raw/changelog b/res/raw/changelog
index ce061b9b..c64271e6 100644
--- a/res/raw/changelog
+++ b/res/raw/changelog
@@ -1,6 +1,11 @@
CyanogenMod File Manager
========================
+Version 1.0.1
+-------------
+* NFC support
+* Themes support
+
Version 1.0.0
-------------
Initial release.
@@ -29,3 +34,4 @@ Features:
* Open and Open With
* Send to
* Internal editor
+
diff --git a/res/raw/mime_types.properties b/res/raw/mime_types.properties
index 1ec6a61c..4a8b0a4f 100644
--- a/res/raw/mime_types.properties
+++ b/res/raw/mime_types.properties
@@ -22,309 +22,309 @@
#
# Binary
-a = BINARY | application/octet-stream | fso_type_binary
-bin = BINARY | application/octet-stream | fso_type_binary
-class = BINARY | application/java-vm | fso_type_binary
-com = BINARY | application/x-msdownload | fso_type_binary
-dex = BINARY | application/octet-stream | fso_type_binary
-dump = BINARY | application/octet-stream | fso_type_binary
-exe = BINARY | application/x-msdownload | fso_type_binary
-dat = BINARY | application/octet-stream | fso_type_binary
-dll = BINARY | application/x-msdownload | fso_type_binary
-lib = BINARY | application/x-msdownload | fso_type_binary
-o = BINARY | application/octet-stream | fso_type_binary
-obj = BINARY | application/octet-stream | fso_type_binary
-pyc = BINARY | application/x-python-code | fso_type_binary
-pyo = BINARY | application/x-python-code | fso_type_binary
-ser = BINARY | application/java-serialized-object | fso_type_binary
-swf = BINARY | application/x-shockwave-flash | fso_type_binary
-so = BINARY | application/octet-stream | fso_type_binary
-dmg = BINARY | application/octet-stream | fso_type_cdimage
-cue = BINARY | application/octet-stream | fso_type_cdimage
-img = BINARY | application/octet-stream | fso_type_cdimage
-iso = BINARY | application/octet-stream | fso_type_cdimage
-msd = BINARY | application/octet-stream | fso_type_cdimage
-nrg = BINARY | application/octet-stream | fso_type_cdimage
-uif = BINARY | application/octet-stream | fso_type_cdimage
+a = BINARY | application/octet-stream | fso_type_binary_drawable
+bin = BINARY | application/octet-stream | fso_type_binary_drawable
+class = BINARY | application/java-vm | fso_type_binary_drawable
+com = BINARY | application/x-msdownload | fso_type_binary_drawable
+dex = BINARY | application/octet-stream | fso_type_binary_drawable
+dump = BINARY | application/octet-stream | fso_type_binary_drawable
+exe = BINARY | application/x-msdownload | fso_type_binary_drawable
+dat = BINARY | application/octet-stream | fso_type_binary_drawable
+dll = BINARY | application/x-msdownload | fso_type_binary_drawable
+lib = BINARY | application/x-msdownload | fso_type_binary_drawable
+o = BINARY | application/octet-stream | fso_type_binary_drawable
+obj = BINARY | application/octet-stream | fso_type_binary_drawable
+pyc = BINARY | application/x-python-code | fso_type_binary_drawable
+pyo = BINARY | application/x-python-code | fso_type_binary_drawable
+ser = BINARY | application/java-serialized-object | fso_type_binary_drawable
+swf = BINARY | application/x-shockwave-flash | fso_type_binary_drawable
+so = BINARY | application/octet-stream | fso_type_binary_drawable
+dmg = BINARY | application/octet-stream | fso_type_cdimage_drawable
+cue = BINARY | application/octet-stream | fso_type_cdimage_drawable
+img = BINARY | application/octet-stream | fso_type_cdimage_drawable
+iso = BINARY | application/octet-stream | fso_type_cdimage_drawable
+msd = BINARY | application/octet-stream | fso_type_cdimage_drawable
+nrg = BINARY | application/octet-stream | fso_type_cdimage_drawable
+uif = BINARY | application/octet-stream | fso_type_cdimage_drawable
# Text
-asm = TEXT | text/x-asm | fso_type_source
-c = TEXT | text/x-c | fso_type_source
-cc = TEXT | text/x-c | fso_type_source
-conf = TEXT | text/plain | fso_type_text
-cpp = TEXT | text/x-c | fso_type_source
-css = TEXT | text/css | fso_type_source
-csv = TEXT | text/csv | fso_type_text
-cxx = TEXT | text/x-c | fso_type_source
-def = TEXT | text/plain | fso_type_source
-dic = TEXT | text/x-c | fso_type_source
-diff = TEXT | text/plain | fso_type_text
-dtd = TEXT | application/xml-dtd | fso_type_markup_document
-f = TEXT | text/x-fortran | fso_type_source
-f77 = TEXT | text/x-fortran | fso_type_source
-f90 = TEXT | text/x-fortran | fso_type_source
-for = TEXT | text/x-fortran | fso_type_source
-h = TEXT | text/x-c | fso_type_source
-hh = TEXT | text/x-c | fso_type_source
-hpp = TEXT | text/x-c | fso_type_source
-htm = TEXT | text/html | fso_type_markup_document
-html = TEXT | text/html | fso_type_markup_document
-in = TEXT | text/plain | fso_type_text
-jad = TEXT | text/vnd.sun.j2me.app-descriptor | fso_type_source
-java = TEXT | text/x-java-source | fso_type_source
-jnlp = TEXT | application/x-java-jnlp-file | fso_type_source
-js = TEXT | application/javascript | fso_type_source
-json = TEXT | application/json | fso_type_source
-list = TEXT | text/plain | fso_type_text
-log = TEXT | text/plain | fso_type_text
-mathml= TEXT | application/mathml+xml | fso_type_markup_document
-mht = TEXT | message/rfc822 | fso_type_markup_document
-mhtml = TEXT | message/rfc822 | fso_type_markup_document
-mxml = TEXT | application/xv+xml | fso_type_markup_document
-p = TEXT | text/x-pascal | fso_type_source
-pas = TEXT | text/x-pascal | fso_type_source
-pl = TEXT | text/plain | fso_type_source
-prop = TEXT | text/plain | fso_type_text
-properties = TEXT| text/plain | fso_type_text
-py = TEXT | text/x-python | fso_type_source
-rc = TEXT | text/plain | fso_type_text
-rss = TEXT | application/rss+xml | fso_type_feed
-s = TEXT | text/x-asm | fso_type_source
-sgm = TEXT | text/sgml | fso_type_markup_document
-sgml = TEXT | text/sgml | fso_type_markup_document
-text = TEXT | text/plain | fso_type_text
-tsv = TEXT | text/tab-separated-values | fso_type_text
-txt = TEXT | text/plain | fso_type_text
-wsdl = TEXT | application/wsdl+xml | fso_type_markup_document
-xht = TEXT | application/xhtml+xml | fso_type_markup_document
-xhtml = TEXT | application/xhtml+xml | fso_type_markup_document
-xml = TEXT | text/plain | fso_type_markup_document
-xsl = TEXT | application/xml | fso_type_markup_document
-xslt = TEXT | application/xslt+xml | fso_type_markup_document
+asm = TEXT | text/x-asm | fso_type_source_drawable
+c = TEXT | text/x-c | fso_type_source_drawable
+cc = TEXT | text/x-c | fso_type_source_drawable
+conf = TEXT | text/plain | fso_type_text_drawable
+cpp = TEXT | text/x-c | fso_type_source_drawable
+css = TEXT | text/css | fso_type_source_drawable
+csv = TEXT | text/csv | fso_type_text_drawable
+cxx = TEXT | text/x-c | fso_type_source_drawable
+def = TEXT | text/plain | fso_type_source_drawable
+dic = TEXT | text/x-c | fso_type_source_drawable
+diff = TEXT | text/plain | fso_type_text_drawable
+dtd = TEXT | application/xml-dtd | fso_type_markup_document_drawable
+f = TEXT | text/x-fortran | fso_type_source_drawable
+f77 = TEXT | text/x-fortran | fso_type_source_drawable
+f90 = TEXT | text/x-fortran | fso_type_source_drawable
+for = TEXT | text/x-fortran | fso_type_source_drawable
+h = TEXT | text/x-c | fso_type_source_drawable
+hh = TEXT | text/x-c | fso_type_source_drawable
+hpp = TEXT | text/x-c | fso_type_source_drawable
+htm = TEXT | text/html | fso_type_markup_document_drawable
+html = TEXT | text/html | fso_type_markup_document_drawable
+in = TEXT | text/plain | fso_type_text_drawable
+jad = TEXT | text/vnd.sun.j2me.app-descriptor | fso_type_source_drawable
+java = TEXT | text/x-java-source | fso_type_source_drawable
+jnlp = TEXT | application/x-java-jnlp-file | fso_type_source_drawable
+js = TEXT | application/javascript | fso_type_source_drawable
+json = TEXT | application/json | fso_type_source_drawable
+list = TEXT | text/plain | fso_type_text_drawable
+log = TEXT | text/plain | fso_type_text_drawable
+mathml= TEXT | application/mathml+xml | fso_type_markup_document_drawable
+mht = TEXT | message/rfc822 | fso_type_markup_document_drawable
+mhtml = TEXT | message/rfc822 | fso_type_markup_document_drawable
+mxml = TEXT | application/xv+xml | fso_type_markup_document_drawable
+p = TEXT | text/x-pascal | fso_type_source_drawable
+pas = TEXT | text/x-pascal | fso_type_source_drawable
+pl = TEXT | text/plain | fso_type_source_drawable
+prop = TEXT | text/plain | fso_type_text_drawable
+properties = TEXT| text/plain | fso_type_text_drawable
+py = TEXT | text/x-python | fso_type_source_drawable
+rc = TEXT | text/plain | fso_type_text_drawable
+rss = TEXT | application/rss+xml | fso_type_feed_drawable
+s = TEXT | text/x-asm | fso_type_source_drawable
+sgm = TEXT | text/sgml | fso_type_markup_document_drawable
+sgml = TEXT | text/sgml | fso_type_markup_document_drawable
+text = TEXT | text/plain | fso_type_text_drawable
+tsv = TEXT | text/tab-separated-values | fso_type_text_drawable
+txt = TEXT | text/plain | fso_type_text_drawable
+wsdl = TEXT | application/wsdl+xml | fso_type_markup_document_drawable
+xht = TEXT | application/xhtml+xml | fso_type_markup_document_drawable
+xhtml = TEXT | application/xhtml+xml | fso_type_markup_document_drawable
+xml = TEXT | text/plain | fso_type_markup_document_drawable
+xsl = TEXT | application/xml | fso_type_markup_document_drawable
+xslt = TEXT | application/xslt+xml | fso_type_markup_document_drawable
# Document
-doc = DOCUMENT | application/msword | fso_type_document
-docx = DOCUMENT | application/vnd.openxmlformats-officedocument.wordprocessingml.document | fso_type_document
-fdf = DOCUMENT | application/vnd.fdf | fso_type_pdf
-pdf = DOCUMENT | application/pdf | fso_type_pdf
-ppt = DOCUMENT | application/vnd.ms-powerpoint | fso_type_presentation
-pptx = DOCUMENT | application/vnd.openxmlformats-officedocument.presentationml.presentation | fso_type_presentation
-odp = DOCUMENT | application/vnd.oasis.opendocument.presentation | fso_type_presentation
-ods = DOCUMENT | application/vnd.oasis.opendocument.spreadsheet | fso_type_spreadsheet
-odt = DOCUMENT | application/vnd.oasis.opendocument.text | fso_type_document
-rtf = DOCUMENT | application/rtf | fso_type_document
-xls = DOCUMENT | application/vnd.ms-excel | fso_type_spreadsheet
-xlsx = DOCUMENT | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | fso_type_spreadsheet
+doc = DOCUMENT | application/msword | fso_type_document_drawable
+docx = DOCUMENT | application/vnd.openxmlformats-officedocument.wordprocessingml.document | fso_type_document_drawable
+fdf = DOCUMENT | application/vnd.fdf | fso_type_pdf_drawable
+pdf = DOCUMENT | application/pdf | fso_type_pdf_drawable
+ppt = DOCUMENT | application/vnd.ms-powerpoint | fso_type_presentation_drawable
+pptx = DOCUMENT | application/vnd.openxmlformats-officedocument.presentationml.presentation | fso_type_presentation_drawable
+odp = DOCUMENT | application/vnd.oasis.opendocument.presentation | fso_type_presentation_drawable
+ods = DOCUMENT | application/vnd.oasis.opendocument.spreadsheet | fso_type_spreadsheet_drawable
+odt = DOCUMENT | application/vnd.oasis.opendocument.text | fso_type_document_drawable
+rtf = DOCUMENT | application/rtf | fso_type_document_drawable
+xls = DOCUMENT | application/vnd.ms-excel | fso_type_spreadsheet_drawable
+xlsx = DOCUMENT | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | fso_type_spreadsheet_drawable
# e-Book
-azw = EBOOK | application/octet-stream | fso_type_ebook
-djv = EBOOK | image/x-djvu | fso_type_ebook
-djvu = EBOOK | image/vnd.djvu | fso_type_ebook
-epub = EBOOK | application/epub+zip | fso_type_ebook
-kf8 = EBOOK | application/octet-stream | fso_type_ebook
-lit = EBOOK | application/x-ms-reader | fso_type_ebook
-lrf = EBOOK | application/x-sony-bbeb | fso_type_ebook
-lrx = EBOOK | application/x-sony-bbeb | fso_type_ebook
-ibooks= EBOOK | application/x-ibooks+zip | fso_type_ebook
+azw = EBOOK | application/octet-stream | fso_type_ebook_drawable
+djv = EBOOK | image/x-djvu | fso_type_ebook_drawable
+djvu = EBOOK | image/vnd.djvu | fso_type_ebook_drawable
+epub = EBOOK | application/epub+zip | fso_type_ebook_drawable
+kf8 = EBOOK | application/octet-stream | fso_type_ebook_drawable
+lit = EBOOK | application/x-ms-reader | fso_type_ebook_drawable
+lrf = EBOOK | application/x-sony-bbeb | fso_type_ebook_drawable
+lrx = EBOOK | application/x-sony-bbeb | fso_type_ebook_drawable
+ibooks= EBOOK | application/x-ibooks+zip | fso_type_ebook_drawable
# Internet document
-ics = MAIL | text/calendar | fso_type_calendar
-ifb = MAIL | text/calendar | fso_type_calendar
-eml = MAIL | message/rfc822 | fso_type_email
-msg = MAIL | application/vnd.ms-outlook | fso_type_email
-vcf = MAIL | text/x-vcard | fso_type_contact
-vcs = MAIL | text/x-vcalendar | fso_type_calendar
+ics = MAIL | text/calendar | fso_type_calendar_drawable
+ifb = MAIL | text/calendar | fso_type_calendar_drawable
+eml = MAIL | message/rfc822 | fso_type_email_drawable
+msg = MAIL | application/vnd.ms-outlook | fso_type_email_drawable
+vcf = MAIL | text/x-vcard | fso_type_contact_drawable
+vcs = MAIL | text/x-vcalendar | fso_type_calendar_drawable
# Compress
-ace = COMPRESS | application/x-ace-compressed | fso_type_compress
-bz = COMPRESS | application/x-bzip | fso_type_compress
-bz2 = COMPRESS | application/x-bzip2 | fso_type_compress
-cab = COMPRESS | application/vnd.ms-cab-compressed| fso_type_compress
-cpio = COMPRESS | application/x-cpio | fso_type_compress
-gz = COMPRESS | application/x-gzip | fso_type_compress
-lha = COMPRESS | application/octet-stream | fso_type_compress
-lrf = COMPRESS | application/octet-stream | fso_type_compress
-lzh = COMPRESS | application/octet-stream | fso_type_compress
-lzma = COMPRESS | application/x-lzma | fso_type_compress
-jar = COMPRESS | application/java-archive | fso_type_compress
-rar = COMPRESS | application/x-rar-compressed | fso_type_compress
-tar = COMPRESS | application/x-tar | fso_type_compress
-tar.bz2 = COMPRESS| application/x-bzip | fso_type_compress
-tar.gz = COMPRESS| application/x-gzip | fso_type_compress
-tar.lzma = COMPRESS| application/x-lzma | fso_type_compress
-tgz = COMPRESS | application/x-gzip | fso_type_compress
-xz = COMPRESS | application/x-xz | fso_type_compress
-zip = COMPRESS | application/zip | fso_type_compress
-Z = COMPRESS | application/x-compress | fso_type_compress
+ace = COMPRESS | application/x-ace-compressed | fso_type_compress_drawable
+bz = COMPRESS | application/x-bzip | fso_type_compress_drawable
+bz2 = COMPRESS | application/x-bzip2 | fso_type_compress_drawable
+cab = COMPRESS | application/vnd.ms-cab-compressed| fso_type_compress_drawable
+cpio = COMPRESS | application/x-cpio | fso_type_compress_drawable
+gz = COMPRESS | application/x-gzip | fso_type_compress_drawable
+lha = COMPRESS | application/octet-stream | fso_type_compress_drawable
+lrf = COMPRESS | application/octet-stream | fso_type_compress_drawable
+lzh = COMPRESS | application/octet-stream | fso_type_compress_drawable
+lzma = COMPRESS | application/x-lzma | fso_type_compress_drawable
+jar = COMPRESS | application/java-archive | fso_type_compress_drawable
+rar = COMPRESS | application/x-rar-compressed | fso_type_compress_drawable
+tar = COMPRESS | application/x-tar | fso_type_compress_drawable
+tar.bz2 = COMPRESS| application/x-bzip | fso_type_compress_drawable
+tar.gz = COMPRESS| application/x-gzip | fso_type_compress_drawable
+tar.lzma = COMPRESS| application/x-lzma | fso_type_compress_drawable
+tgz = COMPRESS | application/x-gzip | fso_type_compress_drawable
+xz = COMPRESS | application/x-xz | fso_type_compress_drawable
+zip = COMPRESS | application/zip | fso_type_compress_drawable
+Z = COMPRESS | application/x-compress | fso_type_compress_drawable
# Executable
-bat = EXEC | application/x-msdownload | fso_type_shell
-csh = EXEC | application/x-csh | fso_type_shell
-ksh = EXEC | text/plain | fso_type_shell
-sh = EXEC | application/x-sh | fso_type_shell
+bat = EXEC | application/x-msdownload | fso_type_shell_drawable
+csh = EXEC | application/x-csh | fso_type_shell_drawable
+ksh = EXEC | text/plain | fso_type_shell_drawable
+sh = EXEC | application/x-sh | fso_type_shell_drawable
# Database
-db = DATABASE | application/octet-stream | fso_type_database
-db3 = DATABASE | application/octet-stream | fso_type_database
-mdb = DATABASE | application/octet-stream | fso_type_database
+db = DATABASE | application/octet-stream | fso_type_database_drawable
+db3 = DATABASE | application/octet-stream | fso_type_database_drawable
+mdb = DATABASE | application/octet-stream | fso_type_database_drawable
# Font
-otf = FONT | application/x-font-otf | fso_type_font
-ttf = FONT | application/x-font-ttf | fso_type_font
-gsf = FONT | application/x-font-ghostscript | fso_type_font
-psf = FONT | application/x-font-linux-psf | fso_type_font
+otf = FONT | application/x-font-otf | fso_type_font_drawable
+ttf = FONT | application/x-font-ttf | fso_type_font_drawable
+gsf = FONT | application/x-font-ghostscript | fso_type_font_drawable
+psf = FONT | application/x-font-linux-psf | fso_type_font_drawable
# Image
-bmp = IMAGE | image/bmp | fso_type_image
-cgm = IMAGE | image/cgm | fso_type_image
-g3 = IMAGE | image/g3fax | fso_type_image
-gif = IMAGE | image/gif | fso_type_image
-ief = IMAGE | image/ief | fso_type_image
-jpe = IMAGE | image/jpeg | fso_type_image
-jpeg = IMAGE | image/jpeg | fso_type_image
-jpg = IMAGE | image/jpeg | fso_type_image
-png = IMAGE | image/png | fso_type_image
-btif = IMAGE | image/prs.btif | fso_type_image
-svg = IMAGE | image/svg+xml | fso_type_image
-svgz = IMAGE | image/svg+xml | fso_type_image
-tif = IMAGE | image/tiff | fso_type_image
-tiff = IMAGE | image/tiff | fso_type_image
-psd = IMAGE | image/vnd.adobe.photoshop | fso_type_image
-djv = IMAGE | image/vnd.djvu | fso_type_image
-djvu = IMAGE | image/vnd.djvu | fso_type_image
-dwg = IMAGE | image/vnd.dwg | fso_type_image
-dxf = IMAGE | image/vnd.dxf | fso_type_image
-fbs = IMAGE | image/vnd.fastbidsheet | fso_type_image
-fpx = IMAGE | image/vnd.fpx | fso_type_image
-fst = IMAGE | image/vnd.fst | fso_type_image
-mmr = IMAGE | image/vnd.fujixerox.edmics-mmr | fso_type_image
-rlc = IMAGE | image/vnd.fujixerox.edmics-rlc | fso_type_image
-mdi = IMAGE | image/vnd.ms-modi | fso_type_image
-npx = IMAGE | image/vnd.net-fpx | fso_type_image
-wbmp = IMAGE | image/vnd.wap.wbmp | fso_type_image
-xif = IMAGE | image/vnd.xiff | fso_type_image
-ras = IMAGE | image/x-cmu-raster | fso_type_image
-cmx = IMAGE | image/x-cmx | fso_type_image
-fh = IMAGE | image/x-freehand | fso_type_image
-fh4 = IMAGE | image/x-freehand | fso_type_image
-fh5 = IMAGE | image/x-freehand | fso_type_image
-fh7 = IMAGE | image/x-freehand | fso_type_image
-fhc = IMAGE | image/x-freehand | fso_type_image
-ico = IMAGE | image/x-icon | fso_type_image
-pcx = IMAGE | image/x-pcx | fso_type_image
-pct = IMAGE | image/x-pict | fso_type_image
-pic = IMAGE | image/x-pict | fso_type_image
-pnm = IMAGE | image/x-portable-anymap | fso_type_image
-pbm = IMAGE | image/x-portable-bitmap | fso_type_image
-pgm = IMAGE | image/x-portable-graymap | fso_type_image
-ppm = IMAGE | image/x-portable-pixmap | fso_type_image
-rgb = IMAGE | image/x-rgb | fso_type_image
-xbm = IMAGE | image/x-xbitmap | fso_type_image
-xpm = IMAGE | image/x-xpixmap | fso_type_image
-xwd = IMAGE | image/x-xwindowdump | fso_type_image
+bmp = IMAGE | image/bmp | fso_type_image_drawable
+cgm = IMAGE | image/cgm | fso_type_image_drawable
+g3 = IMAGE | image/g3fax | fso_type_image_drawable
+gif = IMAGE | image/gif | fso_type_image_drawable
+ief = IMAGE | image/ief | fso_type_image_drawable
+jpe = IMAGE | image/jpeg | fso_type_image_drawable
+jpeg = IMAGE | image/jpeg | fso_type_image_drawable
+jpg = IMAGE | image/jpeg | fso_type_image_drawable
+png = IMAGE | image/png | fso_type_image_drawable
+btif = IMAGE | image/prs.btif | fso_type_image_drawable
+svg = IMAGE | image/svg+xml | fso_type_image_drawable
+svgz = IMAGE | image/svg+xml | fso_type_image_drawable
+tif = IMAGE | image/tiff | fso_type_image_drawable
+tiff = IMAGE | image/tiff | fso_type_image_drawable
+psd = IMAGE | image/vnd.adobe.photoshop | fso_type_image_drawable
+djv = IMAGE | image/vnd.djvu | fso_type_image_drawable
+djvu = IMAGE | image/vnd.djvu | fso_type_image_drawable
+dwg = IMAGE | image/vnd.dwg | fso_type_image_drawable
+dxf = IMAGE | image/vnd.dxf | fso_type_image_drawable
+fbs = IMAGE | image/vnd.fastbidsheet | fso_type_image_drawable
+fpx = IMAGE | image/vnd.fpx | fso_type_image_drawable
+fst = IMAGE | image/vnd.fst | fso_type_image_drawable
+mmr = IMAGE | image/vnd.fujixerox.edmics-mmr | fso_type_image_drawable
+rlc = IMAGE | image/vnd.fujixerox.edmics-rlc | fso_type_image_drawable
+mdi = IMAGE | image/vnd.ms-modi | fso_type_image_drawable
+npx = IMAGE | image/vnd.net-fpx | fso_type_image_drawable
+wbmp = IMAGE | image/vnd.wap.wbmp | fso_type_image_drawable
+xif = IMAGE | image/vnd.xiff | fso_type_image_drawable
+ras = IMAGE | image/x-cmu-raster | fso_type_image_drawable
+cmx = IMAGE | image/x-cmx | fso_type_image_drawable
+fh = IMAGE | image/x-freehand | fso_type_image_drawable
+fh4 = IMAGE | image/x-freehand | fso_type_image_drawable
+fh5 = IMAGE | image/x-freehand | fso_type_image_drawable
+fh7 = IMAGE | image/x-freehand | fso_type_image_drawable
+fhc = IMAGE | image/x-freehand | fso_type_image_drawable
+ico = IMAGE | image/x-icon | fso_type_image_drawable
+pcx = IMAGE | image/x-pcx | fso_type_image_drawable
+pct = IMAGE | image/x-pict | fso_type_image_drawable
+pic = IMAGE | image/x-pict | fso_type_image_drawable
+pnm = IMAGE | image/x-portable-anymap | fso_type_image_drawable
+pbm = IMAGE | image/x-portable-bitmap | fso_type_image_drawable
+pgm = IMAGE | image/x-portable-graymap | fso_type_image_drawable
+ppm = IMAGE | image/x-portable-pixmap | fso_type_image_drawable
+rgb = IMAGE | image/x-rgb | fso_type_image_drawable
+xbm = IMAGE | image/x-xbitmap | fso_type_image_drawable
+xpm = IMAGE | image/x-xpixmap | fso_type_image_drawable
+xwd = IMAGE | image/x-xwindowdump | fso_type_image_drawable
# Audio
-adp = AUDIO | audio/adpcm | fso_type_audio
-au = AUDIO | audio/basic | fso_type_audio
-snd = AUDIO | audio/basic | fso_type_audio
-kar = AUDIO | audio/midi | fso_type_audio
-mid = AUDIO | audio/midi | fso_type_audio
-midi = AUDIO | audio/midi | fso_type_audio
-rmi = AUDIO | audio/midi | fso_type_audio
-mp4a = AUDIO | audio/mp4 | fso_type_audio
-m2a = AUDIO | audio/mpeg | fso_type_audio
-m3a = AUDIO | audio/mpeg | fso_type_audio
-mp2 = AUDIO | audio/mpeg | fso_type_audio
-mp2a = AUDIO | audio/mpeg | fso_type_audio
-mp3 = AUDIO | audio/mpeg | fso_type_audio
-mpga = AUDIO | audio/mpeg | fso_type_audio
-oga = AUDIO | audio/ogg | fso_type_audio
-ogg = AUDIO | audio/ogg | fso_type_audio
-spx = AUDIO | audio/ogg | fso_type_audio
-eol = AUDIO | audio/vnd.digital-winds | fso_type_audio
-dts = AUDIO | audio/vnd.dts | fso_type_audio
-dtshd = AUDIO | audio/vnd.dts.hd | fso_type_audio
-lvp = AUDIO | audio/vnd.lucent.voice | fso_type_audio
-pya = AUDIO | audio/vnd.ms-playready.media.pya | fso_type_audio
-ecelp4800 = AUDIO| audio/vnd.nuera.ecelp4800 | fso_type_audio
-ecelp7470 = AUDIO| audio/vnd.nuera.ecelp7470 | fso_type_audio
-ecelp9600 = AUDIO| audio/vnd.nuera.ecelp9600 | fso_type_audio
-aac = AUDIO | audio/x-aac | fso_type_audio
-aif = AUDIO | audio/x-aiff | fso_type_audio
-aifc = AUDIO | audio/x-aiff | fso_type_audio
-aiff = AUDIO | audio/x-aiff | fso_type_audio
-m3u = AUDIO | audio/x-mpegurl | fso_type_audio
-wax = AUDIO | audio/x-ms-wax | fso_type_audio
-wma = AUDIO | audio/x-ms-wma | fso_type_audio
-ra = AUDIO | audio/x-pn-realaudio | fso_type_audio
-ram = AUDIO | audio/x-pn-realaudio | fso_type_audio
-rmp = AUDIO | audio/x-pn-realaudio-plugin | fso_type_audio
-wav = AUDIO | audio/x-wav | fso_type_audio
+adp = AUDIO | audio/adpcm | fso_type_audio_drawable
+au = AUDIO | audio/basic | fso_type_audio_drawable
+snd = AUDIO | audio/basic | fso_type_audio_drawable
+kar = AUDIO | audio/midi | fso_type_audio_drawable
+mid = AUDIO | audio/midi | fso_type_audio_drawable
+midi = AUDIO | audio/midi | fso_type_audio_drawable
+rmi = AUDIO | audio/midi | fso_type_audio_drawable
+mp4a = AUDIO | audio/mp4 | fso_type_audio_drawable
+m2a = AUDIO | audio/mpeg | fso_type_audio_drawable
+m3a = AUDIO | audio/mpeg | fso_type_audio_drawable
+mp2 = AUDIO | audio/mpeg | fso_type_audio_drawable
+mp2a = AUDIO | audio/mpeg | fso_type_audio_drawable
+mp3 = AUDIO | audio/mpeg | fso_type_audio_drawable
+mpga = AUDIO | audio/mpeg | fso_type_audio_drawable
+oga = AUDIO | audio/ogg | fso_type_audio_drawable
+ogg = AUDIO | audio/ogg | fso_type_audio_drawable
+spx = AUDIO | audio/ogg | fso_type_audio_drawable
+eol = AUDIO | audio/vnd.digital-winds | fso_type_audio_drawable
+dts = AUDIO | audio/vnd.dts | fso_type_audio_drawable
+dtshd = AUDIO | audio/vnd.dts.hd | fso_type_audio_drawable
+lvp = AUDIO | audio/vnd.lucent.voice | fso_type_audio_drawable
+pya = AUDIO | audio/vnd.ms-playready.media.pya | fso_type_audio_drawable
+ecelp4800 = AUDIO| audio/vnd.nuera.ecelp4800 | fso_type_audio_drawable
+ecelp7470 = AUDIO| audio/vnd.nuera.ecelp7470 | fso_type_audio_drawable
+ecelp9600 = AUDIO| audio/vnd.nuera.ecelp9600 | fso_type_audio_drawable
+aac = AUDIO | audio/x-aac | fso_type_audio_drawable
+aif = AUDIO | audio/x-aiff | fso_type_audio_drawable
+aifc = AUDIO | audio/x-aiff | fso_type_audio_drawable
+aiff = AUDIO | audio/x-aiff | fso_type_audio_drawable
+m3u = AUDIO | audio/x-mpegurl | fso_type_audio_drawable
+wax = AUDIO | audio/x-ms-wax | fso_type_audio_drawable
+wma = AUDIO | audio/x-ms-wma | fso_type_audio_drawable
+ra = AUDIO | audio/x-pn-realaudio | fso_type_audio_drawable
+ram = AUDIO | audio/x-pn-realaudio | fso_type_audio_drawable
+rmp = AUDIO | audio/x-pn-realaudio-plugin | fso_type_audio_drawable
+wav = AUDIO | audio/x-wav | fso_type_audio_drawable
# Video
-3gp = VIDEO | video/3gpp | fso_type_video
-3g2 = VIDEO | video/3gpp2 | fso_type_video
-h261 = VIDEO | video/h261 | fso_type_video
-h263 = VIDEO | video/h263 | fso_type_video
-h264 = VIDEO | video/h264 | fso_type_video
-jpgv = VIDEO | video/jpeg | fso_type_video
-jpgm = VIDEO | video/jpm | fso_type_video
-jpm = VIDEO | video/jpm | fso_type_video
-mj2 = VIDEO | video/mj2 | fso_type_video
-mjp2 = VIDEO | video/mj2 | fso_type_video
-mp4 = VIDEO | video/mp4 | fso_type_video
-mp4v = VIDEO | video/mp4 | fso_type_video
-mpg4 = VIDEO | video/mp4 | fso_type_video
-m1v = VIDEO | video/mpeg | fso_type_video
-m2v = VIDEO | video/mpeg | fso_type_video
-mpa = VIDEO | video/mpeg | fso_type_video
-mpe = VIDEO | video/mpeg | fso_type_video
-mpeg = VIDEO | video/mpeg | fso_type_video
-mpg = VIDEO | video/mpeg | fso_type_video
-ogv = VIDEO | video/ogg | fso_type_video
-mov = VIDEO | video/quicktime | fso_type_video
-qt = VIDEO | video/quicktime | fso_type_video
-fvt = VIDEO | video/vnd.fvt | fso_type_video
-m4u = VIDEO | video/vnd.mpegurl | fso_type_video
-mxu = VIDEO | video/vnd.mpegurl | fso_type_video
-pyv = VIDEO | video/vnd.ms-playready.media.pyv | fso_type_video
-viv = VIDEO | video/vnd.vivo | fso_type_video
-f4v = VIDEO | video/x-f4v | fso_type_video
-fli = VIDEO | video/x-fli | fso_type_video
-flv = VIDEO | video/x-flv | fso_type_video
-m4v = VIDEO | video/x-m4v | fso_type_video
-asf = VIDEO | video/x-ms-asf | fso_type_video
-asx = VIDEO | video/x-ms-asf | fso_type_video
-avi = VIDEO | video/x-msvideo | fso_type_video
-wm = VIDEO | video/x-ms-wm | fso_type_video
-wmv = VIDEO | video/x-ms-wmv | fso_type_video
-wmx = VIDEO | video/x-ms-wmx | fso_type_video
-wvx = VIDEO | video/x-ms-wvx | fso_type_video
-movie = VIDEO | video/x-sgi-movie | fso_type_video
+3gp = VIDEO | video/3gpp | fso_type_video_drawable
+3g2 = VIDEO | video/3gpp2 | fso_type_video_drawable
+h261 = VIDEO | video/h261 | fso_type_video_drawable
+h263 = VIDEO | video/h263 | fso_type_video_drawable
+h264 = VIDEO | video/h264 | fso_type_video_drawable
+jpgv = VIDEO | video/jpeg | fso_type_video_drawable
+jpgm = VIDEO | video/jpm | fso_type_video_drawable
+jpm = VIDEO | video/jpm | fso_type_video_drawable
+mj2 = VIDEO | video/mj2 | fso_type_video_drawable
+mjp2 = VIDEO | video/mj2 | fso_type_video_drawable
+mp4 = VIDEO | video/mp4 | fso_type_video_drawable
+mp4v = VIDEO | video/mp4 | fso_type_video_drawable
+mpg4 = VIDEO | video/mp4 | fso_type_video_drawable
+m1v = VIDEO | video/mpeg | fso_type_video_drawable
+m2v = VIDEO | video/mpeg | fso_type_video_drawable
+mpa = VIDEO | video/mpeg | fso_type_video_drawable
+mpe = VIDEO | video/mpeg | fso_type_video_drawable
+mpeg = VIDEO | video/mpeg | fso_type_video_drawable
+mpg = VIDEO | video/mpeg | fso_type_video_drawable
+ogv = VIDEO | video/ogg | fso_type_video_drawable
+mov = VIDEO | video/quicktime | fso_type_video_drawable
+qt = VIDEO | video/quicktime | fso_type_video_drawable
+fvt = VIDEO | video/vnd.fvt | fso_type_video_drawable
+m4u = VIDEO | video/vnd.mpegurl | fso_type_video_drawable
+mxu = VIDEO | video/vnd.mpegurl | fso_type_video_drawable
+pyv = VIDEO | video/vnd.ms-playready.media.pyv | fso_type_video_drawable
+viv = VIDEO | video/vnd.vivo | fso_type_video_drawable
+f4v = VIDEO | video/x-f4v | fso_type_video_drawable
+fli = VIDEO | video/x-fli | fso_type_video_drawable
+flv = VIDEO | video/x-flv | fso_type_video_drawable
+m4v = VIDEO | video/x-m4v | fso_type_video_drawable
+asf = VIDEO | video/x-ms-asf | fso_type_video_drawable
+asx = VIDEO | video/x-ms-asf | fso_type_video_drawable
+avi = VIDEO | video/x-msvideo | fso_type_video_drawable
+wm = VIDEO | video/x-ms-wm | fso_type_video_drawable
+wmv = VIDEO | video/x-ms-wmv | fso_type_video_drawable
+wmx = VIDEO | video/x-ms-wmx | fso_type_video_drawable
+wvx = VIDEO | video/x-ms-wvx | fso_type_video_drawable
+movie = VIDEO | video/x-sgi-movie | fso_type_video_drawable
# Security
-asc = SECURITY | application/pgp-signature | fso_type_security
-cer = SECURITY | application/pkix-cert | fso_type_security
-crl = SECURITY | application/pkix-crl | fso_type_security
-crt = SECURITY | application/x-x509-ca-cert | fso_type_security
-der = SECURITY | application/x-x509-ca-cert | fso_type_security
-p12 = SECURITY | application/x-pkcs12 | fso_type_security
-p7b = SECURITY | application/x-pkcs7-certificates | fso_type_security
-p7c = SECURITY | application/pkcs7-mime | fso_type_security
-p7m = SECURITY | application/pkcs7-mime | fso_type_security
-p7r = SECURITY | application/x-pkcs7-certreqresp | fso_type_security
-p7s = SECURITY | application/pkcs7-signature | fso_type_security
-p10 = SECURITY | application/pkcs10 | fso_type_security
-pfx = SECURITY | application/x-pkcs12 | fso_type_security
-pki = SECURITY | application/pkixcmp | fso_type_security
-pgp = SECURITY | application/pgp-encrypted | fso_type_security
-sig = SECURITY | application/pgp-signature | fso_type_security
-spc = SECURITY | application/x-pkcs7-certificates | fso_type_security
+asc = SECURITY | application/pgp-signature | fso_type_security_drawable
+cer = SECURITY | application/pkix-cert | fso_type_security_drawable
+crl = SECURITY | application/pkix-crl | fso_type_security_drawable
+crt = SECURITY | application/x-x509-ca-cert | fso_type_security_drawable
+der = SECURITY | application/x-x509-ca-cert | fso_type_security_drawable
+p12 = SECURITY | application/x-pkcs12 | fso_type_security_drawable
+p7b = SECURITY | application/x-pkcs7-certificates | fso_type_security_drawable
+p7c = SECURITY | application/pkcs7-mime | fso_type_security_drawable
+p7m = SECURITY | application/pkcs7-mime | fso_type_security_drawable
+p7r = SECURITY | application/x-pkcs7-certreqresp | fso_type_security_drawable
+p7s = SECURITY | application/pkcs7-signature | fso_type_security_drawable
+p10 = SECURITY | application/pkcs10 | fso_type_security_drawable
+pfx = SECURITY | application/x-pkcs12 | fso_type_security_drawable
+pki = SECURITY | application/pkixcmp | fso_type_security_drawable
+pgp = SECURITY | application/pgp-encrypted | fso_type_security_drawable
+sig = SECURITY | application/pgp-signature | fso_type_security_drawable
+spc = SECURITY | application/x-pkcs7-certificates | fso_type_security_drawable
# Application
-apk = APP | application/vnd.android.package-archive | fso_type_app
-pkg = APP | application/octet-stream | fso_type_app
-deb = APP | application/x-debian-package | fso_type_app
-udeb = APP | application/x-debian-package | fso_type_app
-msi = APP | application/x-msdownload | fso_type_app
-rpm = APP | application/x-rpm | fso_type_app
+apk = APP | application/vnd.android.package-archive | fso_type_app_drawable
+pkg = APP | application/octet-stream | fso_type_app_drawable
+deb = APP | application/x-debian-package | fso_type_app_drawable
+udeb = APP | application/x-debian-package | fso_type_app_drawable
+msi = APP | application/x-msdownload | fso_type_app_drawable
+rpm = APP | application/x-rpm | fso_type_app_drawable
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 861c6b8c..803739c3 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The strings of the menu for navigation sort mode enumeration -->
@@ -86,4 +87,15 @@
<item>@string/compression_mode_bzip</item>
</string-array>
+ <!-- The default theme definition -->
+ <string-array name="themes_ids" translatable="false">
+ <item>light</item>
+ </string-array>
+ <string-array name="themes_names" translatable="false">
+ <item>@string/theme_default_name</item>
+ </string-array>
+ <string-array name="themes_descriptions" translatable="false">
+ <item>@string/theme_default_description</item>
+ </string-array>
+
</resources>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index b71e8f54..f272cb1e 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The default background color -->
@@ -45,6 +46,9 @@
<!-- Relevance * 75% ~ 100% -->
<color name="relevance_percentil_100">#be207da4</color>
+ <!-- A color for highlight text -->
+ <color name="search_highlight">#ffffff00</color>
+
<!-- Divider. Normal -->
<color name="divider_color">#90909090</color>
<!-- Divider. Light -->
diff --git a/res/values/dimen.xml b/res/values/dimen.xml
index a333966f..0278d310 100644
--- a/res/values/dimen.xml
+++ b/res/values/dimen.xml
@@ -103,4 +103,10 @@
<!-- The progress height -->
<dimen name="default_progress_height">32dp</dimen>
+ <!-- Theme button min width -->
+ <dimen name="themes_min_width_button">300dp</dimen>
+
+ <!-- Theme width -->
+ <dimen name="theme_max_width">300dip</dimen>
+
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2010a2a1..2db9749a 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- The name of the application -->
@@ -610,6 +611,8 @@
<string name="pref_general">General settings</string>
<!-- Preferences * Search title -->
<string name="pref_search">Search options</string>
+ <!-- Preferences * Themes title -->
+ <string name="pref_themes">Themes</string>
<!-- Preferences * About title -->
<string name="pref_about">About</string>
<!-- Preferences * About summary -->
@@ -686,10 +689,27 @@
<string name="pref_remove_saved_search_terms_summary">Tap to remove all the saved search terms</string>
<!-- Preferences * Search * Suggestions were truncated -->
<string name="pref_remove_saved_search_terms_msg">All saved search terms were removed.</string>
+ <!-- Preferences * Themes * Themes selection category -->
+ <string name="pref_themes_selection_category">Themes</string>
+ <!-- Preferences * Themes * Set theme button -->
+ <string name="pref_themes_set_theme">Set theme</string>
+ <!-- Preferences * Themes * No preview -->
+ <string name="pref_themes_no_preview">No preview\navailable</string>
+ <!-- Preferences * Themes * Confirmation message -->
+ <string name="pref_themes_confirmation">Theme was applied successfully.</string>
+ <!-- Preferences * Themes * Theme not found message -->
+ <string name="pref_themes_not_found">Theme not found.</string>
<!-- Preferences * Debug * Capture debug traces -->
<string name="pref_debug_traces">Log debugging information</string>
+ <!-- Themes * Default theme name -->
+ <string name="theme_default_name">Light Theme</string>
+ <!-- Themes * Default theme description -->
+ <string name="theme_default_description">A light theme for CyanogenMod File Manager.</string>
+ <!-- Themes * Default theme author -->
+ <string name="themes_author">CyanogenMod</string>
+
<!-- Security * Extract relative or absolute files -->
<string name="security_warning_extract">Warning!\n\n
Extracting an archive file with relative or absolute paths may cause damage to your device
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 988a8bf1..f34d2901 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -13,12 +13,17 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+
<resources xmlns:android="http://schemas.android.com/apk/res/android">
- <!-- The default theme -->
+ <!-- Base themes -->
<style name="FileManager.Theme.Holo.Light" parent="@android:style/Theme.Holo.Light">
<item name="android:windowBackground">@color/default_background</item>
<item name="android:actionBarStyle">@style/FileManager.Widget.ActionBar.White</item>
+ <item name="android:homeAsUpIndicator">@drawable/ic_ab_back_holo_light</item>
+ </style>
+ <style name="FileManager.Theme.Holo" parent="@android:style/Theme.Holo">
+ <item name="android:homeAsUpIndicator">@drawable/ic_ab_back_holo_light</item>
</style>
<!-- A theme with overlay -->
@@ -30,11 +35,9 @@
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
-
- <!-- A theme with overlay -->
- <style name="FileManager.Theme.Holo.Light.Transparent" parent="@style/FileManager.Theme.Holo.Light">
+ <style name="FileManager.Theme.Holo.Overlay" parent="@style/FileManager.Theme.Holo">
<item name="android:windowIsTranslucent">true</item>
- <item name="android:windowBackground">@android:color/transparent</item>
+ <item name="android:windowBackground">@color/black_transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
@@ -56,7 +59,7 @@
<item name="android:textStyle">bold</item>
</style>
- <!-- The text appearance for principal information (text that need to be highligthed) -->
+ <!-- The text appearance for principal information (text that need to be highlighted) -->
<style name="primary_text_appearance">
<item name="android:textSize">@dimen/primary_text_size</item>
<item name="android:textColor">@color/black_transparent</item>
diff --git a/res/values/theme.xml b/res/values/theme.xml
new file mode 100644
index 00000000..56f9c2b6
--- /dev/null
+++ b/res/values/theme.xml
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<!--
+ The default light theme for CMFileManager. This is the default theme
+ of the app, only has the definitions and comments of every customizable
+ part of the app. Developers MUST take this theme as the base for building
+ new themes for CMFileManager.
+ Developers MUST replace the "light" prefix of every resource for the identifier
+ of the theme.
+ -->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- The base theme used to customize some (non-themeables) widgets like dialogs
+ 2 possibles values:
+ * holo: @android:style/Theme.Holo
+ * holo_light: @android:style/Theme.Holo.Light
+ -->
+ <string name="base_theme">holo_light</string>
+
+ <!-- The image preview -->
+ <drawable name="theme_preview_drawable">@drawable/theme_preview</drawable>
+ <drawable name="theme_no_preview_drawable">@drawable/theme_no_preview</drawable>
+
+ <!-- The drawable for the title bar -->
+ <drawable name="titlebar_drawable">@drawable/bg_holo_titlebar</drawable>
+
+ <!-- The background drawable -->
+ <drawable name="background_drawable">@drawable/bg_holo_background</drawable>
+
+ <!-- The drawable for the status bar -->
+ <drawable name="statusbar_drawable">@drawable/bg_holo_statusbar</drawable>
+
+ <!-- The drawable for the selection bar -->
+ <drawable name="selectionbar_drawable">@drawable/bg_holo_selectionbar</drawable>
+
+ <!-- The drawable for the overflow action bar button -->
+ <drawable name="ab_overflow_drawable">@drawable/ic_holo_light_overflow</drawable>
+ <!-- The drawable for the actions action bar button -->
+ <drawable name="ab_actions_drawable">@drawable/ic_holo_light_contextual_action</drawable>
+ <!-- The drawable for the search action bar button -->
+ <drawable name="ab_search_drawable">@drawable/ic_holo_light_search</drawable>
+ <!-- The drawable for the bookmarks action bar button -->
+ <drawable name="ab_bookmarks_drawable">@drawable/ic_holo_light_bookmarks</drawable>
+ <!-- The drawable for the history action bar button -->
+ <drawable name="ab_history_drawable">@drawable/ic_holo_light_history</drawable>
+ <!-- The drawable for the sort mode of expander bar -->
+ <drawable name="ab_sort_mode_drawable">@drawable/ic_holo_light_sort_alphabetically</drawable>
+ <!-- The drawable for the layout mode of expander bar -->
+ <drawable name="ab_layout_mode_drawable">@drawable/ic_holo_light_layout</drawable>
+ <!-- The drawable for the view options of expander bar -->
+ <drawable name="ab_view_options_drawable">@drawable/ic_holo_light_view</drawable>
+ <!-- The drawable for the selection done button -->
+ <drawable name="ab_selection_done_drawable">@drawable/ic_holo_light_accept</drawable>
+ <!-- The drawable for the save action bar button -->
+ <drawable name="ab_save_drawable">@drawable/ic_holo_light_save</drawable>
+ <!-- The drawable for the tab action bar button -->
+ <drawable name="ab_tab_drawable">@drawable/ic_holo_light_tab</drawable>
+
+ <!-- The close action drawable from the expander bar -->
+ <drawable name="expander_close_drawable">@drawable/ic_holo_light_expander_close</drawable>
+ <!-- The open action drawable from the expander bar -->
+ <drawable name="expander_open_drawable">@drawable/ic_holo_light_expander_open</drawable>
+
+ <!-- The text color of TextView controls -->
+ <color name="text_color">@color/black_transparent</color>
+ <!-- The text color of Dialog -->
+ <color name="dialog_text_color">@android:color/holo_blue_dark</color>
+
+ <!-- The highlight color for terms found in the search result -->
+ <color name="search_highlight_color">@color/search_highlight</color>
+
+ <!-- The breadcrumb divider drawable -->
+ <drawable name="breadcrumb_divider_drawable">@drawable/ic_holo_light_breadcrumb_divider</drawable>
+
+ <!-- FileSystem locked drawable -->
+ <drawable name="filesystem_locked_drawable">@drawable/ic_holo_light_fs_locked</drawable>
+ <!-- FileSystem unlocked drawable -->
+ <drawable name="filesystem_unlocked_drawable">@drawable/ic_holo_light_fs_unlocked</drawable>
+ <!-- FileSystem warning drawable -->
+ <drawable name="filesystem_warning_drawable">@drawable/ic_holo_light_fs_warning</drawable>
+
+ <!-- The popup menu checkable selector drawable -->
+ <drawable name="popup_checkable_selector_drawable">@drawable/checkable_selector</drawable>
+ <!-- The menu checkable selector drawable -->
+ <drawable name="menu_checkable_selector_drawable">@drawable/holo_popup_selector</drawable>
+ <!-- The checkable item selector drawable -->
+ <drawable name="selection_drawable">@drawable/holo_selection</drawable>
+
+ <!-- Selectors -->
+ <drawable name="selectors_deselected_drawable">@drawable/holo_list_selector_deselected</drawable>
+ <drawable name="selectors_selected_drawable">@drawable/holo_list_selector_selected</drawable>
+ <drawable name="selectors_button_drawable">@drawable/holo_button_selector</drawable>
+
+ <!-- Checkboxes -->
+ <drawable name="checkbox_deselected_drawable">@drawable/btn_holo_light_check_off_normal</drawable>
+ <drawable name="checkbox_selected_drawable">@drawable/btn_holo_light_check_on_normal</drawable>
+
+ <!-- Dividers -->
+ <drawable name="horizontal_divider_drawable">@drawable/divider_horizontal_bright_opaque</drawable>
+ <drawable name="vertical_divider_drawable">@drawable/divider_vertical_bright_opaque</drawable>
+ <color name="horizontal_divider_color">@color/divider_color_light</color>
+ <color name="vertical_divider_color">@color/divider_color</color>
+
+ <!-- Icons -->
+ <drawable name="ic_close_drawable">@drawable/ic_holo_light_close</drawable>
+ <drawable name="ic_config_drawable">@drawable/ic_holo_light_config</drawable>
+ <drawable name="ic_home_drawable">@drawable/ic_holo_light_home</drawable>
+ <drawable name="ic_filesystem_drawable">@drawable/ic_holo_light_filesystem</drawable>
+ <drawable name="ic_sdcard_drawable">@drawable/ic_holo_light_sdcard</drawable>
+ <drawable name="ic_usb_drawable">@drawable/ic_holo_light_usb</drawable>
+ <drawable name="ic_user_defined_bookmark_drawable">@drawable/ic_holo_light_user_defined_bookmark</drawable>
+ <drawable name="ic_history_search_drawable">@drawable/ic_holo_light_history_search</drawable>
+
+ <!-- Disk usage graph -->
+ <color name="disk_usage_total_color">@color/disk_usage_total</color>
+ <color name="disk_usage_used_color">@color/disk_usage_used</color>
+ <color name="disk_usage_used_warning_color">@color/disk_usage_used_warning</color>
+
+ <!-- Disk usage filters -->
+ <color name="disk_usage_filter_normal_color">@color/disk_usage_color_filter_normal</color>
+ <color name="disk_usage_filter_warning_color">@color/disk_usage_color_filter_warning</color>
+
+ <!-- ProgressBar -->
+ <drawable name="horizontal_progress_bar">@drawable/progress_horizontal_holo_light</drawable>
+
+ <!-- Autocomplete -->
+ <color name="autocomplete_fg_color">@color/black_transparent</color>
+ <color name="autocomplete_bg_color">@android:color/darker_gray</color>
+
+ <!-- Console -->
+ <color name="console_bg_color">@color/console_bg</color>
+ <color name="console_fg_color">@color/console_fg</color>
+
+ <!-- Fso Icons -->
+ <drawable name="ic_fso_folder_drawable">@drawable/ic_fso_folder</drawable>
+ <drawable name="ic_fso_default_drawable">@drawable/ic_fso_default</drawable>
+ <drawable name="fso_type_app_drawable">@drawable/fso_type_app</drawable>
+ <drawable name="fso_type_audio_drawable">@drawable/fso_type_audio</drawable>
+ <drawable name="fso_type_binary_drawable">@drawable/fso_type_binary</drawable>
+ <drawable name="fso_type_calendar_drawable">@drawable/fso_type_calendar</drawable>
+ <drawable name="fso_type_cdimage_drawable">@drawable/fso_type_cdimage</drawable>
+ <drawable name="fso_type_compress_drawable">@drawable/fso_type_compress</drawable>
+ <drawable name="fso_type_contact_drawable">@drawable/fso_type_contact</drawable>
+ <drawable name="fso_type_database_drawable">@drawable/fso_type_database</drawable>
+ <drawable name="fso_type_document_drawable">@drawable/fso_type_document</drawable>
+ <drawable name="fso_type_ebook_drawable">@drawable/fso_type_ebook</drawable>
+ <drawable name="fso_type_email_drawable">@drawable/fso_type_email</drawable>
+ <drawable name="fso_type_executable_drawable">@drawable/fso_type_executable</drawable>
+ <drawable name="fso_type_feed_drawable">@drawable/fso_type_feed</drawable>
+ <drawable name="fso_type_font_drawable">@drawable/fso_type_font</drawable>
+ <drawable name="fso_type_image_drawable">@drawable/fso_type_image</drawable>
+ <drawable name="fso_type_markup_document_drawable">@drawable/fso_type_markup_document</drawable>
+ <drawable name="fso_type_pdf_drawable">@drawable/fso_type_pdf</drawable>
+ <drawable name="fso_type_presentation_drawable">@drawable/fso_type_presentation</drawable>
+ <drawable name="fso_type_security_drawable">@drawable/fso_type_security</drawable>
+ <drawable name="fso_type_shell_drawable">@drawable/fso_type_shell</drawable>
+ <drawable name="fso_type_source_drawable">@drawable/fso_type_source</drawable>
+ <drawable name="fso_type_spreadsheet_drawable">@drawable/fso_type_spreadsheet</drawable>
+ <drawable name="fso_type_system_drawable">@drawable/fso_type_system</drawable>
+ <drawable name="fso_type_text_drawable">@drawable/fso_type_text</drawable>
+ <drawable name="fso_type_video_drawable">@drawable/fso_type_video</drawable>
+
+</resources>
diff --git a/res/xml/preferences_headers.xml b/res/xml/preferences_headers.xml
index 0bbb6c51..3cbe0020 100644
--- a/res/xml/preferences_headers.xml
+++ b/res/xml/preferences_headers.xml
@@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
<header
android:fragment="com.cyanogenmod.filemanager.activities.preferences.SettingsPreferences$GeneralPreferenceFragment"
@@ -21,6 +22,9 @@
android:fragment="com.cyanogenmod.filemanager.activities.preferences.SettingsPreferences$SearchPreferenceFragment"
android:title="@string/pref_search" />
<header
+ android:fragment="com.cyanogenmod.filemanager.activities.preferences.SettingsPreferences$ThemesPreferenceFragment"
+ android:title="@string/pref_themes" />
+ <header
android:title="@string/pref_about"
android:summary="@null" />
</preference-headers>
diff --git a/res/xml/preferences_search.xml b/res/xml/preferences_search.xml
index 1baf5133..9bbdea77 100644
--- a/res/xml/preferences_search.xml
+++ b/res/xml/preferences_search.xml
@@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
diff --git a/res/xml/preferences_themes.xml b/res/xml/preferences_themes.xml
new file mode 100644
index 00000000..d4b30400
--- /dev/null
+++ b/res/xml/preferences_themes.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <!-- Search Results -->
+ <PreferenceCategory
+ android:key="themes_selection"
+ android:title="@string/pref_themes_selection_category">
+
+ <!-- Themes selector -->
+ <com.cyanogenmod.filemanager.ui.preferences.ThemeSelectorPreference
+ android:key="cm_filemanager_theme"
+ android:persistent="true"
+ android:defaultValue="com.cyanogenmod.filemanager:light" />
+
+ </PreferenceCategory>
+
+</PreferenceScreen>
diff --git a/src/com/cyanogenmod/filemanager/FileManagerApplication.java b/src/com/cyanogenmod/filemanager/FileManagerApplication.java
index 00859861..d3ecf9f9 100644
--- a/src/com/cyanogenmod/filemanager/FileManagerApplication.java
+++ b/src/com/cyanogenmod/filemanager/FileManagerApplication.java
@@ -22,7 +22,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
import android.util.Log;
import com.cyanogenmod.filemanager.console.Console;
@@ -34,7 +33,8 @@ import com.cyanogenmod.filemanager.preferences.AccessMode;
import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.ObjectStringIdentifier;
import com.cyanogenmod.filemanager.preferences.Preferences;
-import com.cyanogenmod.filemanager.util.ExceptionUtil;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.FileHelper;
import com.cyanogenmod.filemanager.util.MimeTypeHelper;
@@ -67,31 +67,78 @@ public final class FileManagerApplication extends Application {
private static boolean sIsDebuggable = false;
private static boolean sIsDeviceRooted = false;
- private final BroadcastReceiver mOnSettingChangeReceiver = new BroadcastReceiver() {
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
- if (intent != null &&
- intent.getAction().compareTo(FileManagerSettings.INTENT_SETTING_CHANGED) == 0) {
-
- // The settings has changed
- String key = intent.getStringExtra(FileManagerSettings.EXTRA_SETTING_CHANGED_KEY);
- if (key != null &&
- key.compareTo(FileManagerSettings.SETTINGS_SHOW_TRACES.getId()) == 0) {
-
- // The debug traces setting has changed. Notify to consoles
- Console c = null;
- try {
- c = getBackgroundConsole();
- } catch (Exception e) {/**NON BLOCK**/}
- if (c != null) {
- c.reloadTrace();
- }
- try {
- c = ConsoleBuilder.getConsole(context, false);
+ if (intent != null) {
+ if (intent.getAction().compareTo(
+ FileManagerSettings.INTENT_SETTING_CHANGED) == 0) {
+
+ // The settings has changed
+ String key =
+ intent.getStringExtra(FileManagerSettings.EXTRA_SETTING_CHANGED_KEY);
+ if (key != null &&
+ key.compareTo(FileManagerSettings.SETTINGS_SHOW_TRACES.getId()) == 0) {
+
+ // The debug traces setting has changed. Notify to consoles
+ Console c = null;
+ try {
+ c = getBackgroundConsole();
+ } catch (Exception e) {/**NON BLOCK**/}
if (c != null) {
c.reloadTrace();
}
- } catch (Throwable _throw) {/**NON BLOCK**/}
+ try {
+ c = ConsoleBuilder.getConsole(context, false);
+ if (c != null) {
+ c.reloadTrace();
+ }
+ } catch (Throwable _throw) {/**NON BLOCK**/}
+ }
+ }
+ }
+ }
+ };
+
+ // A broadcast receiver for detect the uninstall of apk with themes
+ private final BroadcastReceiver mUninstallReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null) {
+ if (intent.getAction().compareTo(Intent.ACTION_PACKAGE_REMOVED) == 0 ||
+ intent.getAction().compareTo(Intent.ACTION_PACKAGE_FULLY_REMOVED) == 0) {
+ // Check that the remove package is not the current theme
+ if (intent.getData() != null) {
+ // Get the package name and remove the schema
+ String apkPackage = intent.getData().toString();
+ apkPackage = apkPackage.substring("package:".length()); //$NON-NLS-1$
+
+ Theme currentTheme = ThemeManager.getCurrentTheme(context);
+ if (currentTheme.getPackage().compareTo(apkPackage) == 0) {
+ // The apk that contains the current theme was remove, change
+ // to default theme
+ String composedId =
+ (String)FileManagerSettings.SETTINGS_THEME.getDefaultValue();
+ ThemeManager.setCurrentTheme(getApplicationContext(), composedId);
+ try {
+ Preferences.savePreference(
+ FileManagerSettings.SETTINGS_THEME, composedId, true);
+ } catch (Throwable ex) {
+ Log.w(TAG, "can't save theme preference", ex); //$NON-NLS-1$
+ }
+
+ // Notify the changes to activities
+ try {
+ Intent broadcastIntent =
+ new Intent(FileManagerSettings.INTENT_THEME_CHANGED);
+ broadcastIntent.putExtra(
+ FileManagerSettings.EXTRA_THEME_ID, composedId);
+ sendBroadcast(broadcastIntent);
+ } catch (Throwable ex) {
+ Log.w(TAG, "notify of theme change failed", ex); //$NON-NLS-1$
+ }
+ }
+ }
}
}
}
@@ -119,7 +166,12 @@ public final class FileManagerApplication extends Application {
Log.d(TAG, "onTerminate"); //$NON-NLS-1$
}
try {
- unregisterReceiver(this.mOnSettingChangeReceiver);
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+ try {
+ unregisterReceiver(this.mUninstallReceiver);
} catch (Throwable ex) {
/**NON BLOCK**/
}
@@ -155,10 +207,17 @@ public final class FileManagerApplication extends Application {
new File(getString(R.string.su_binary)).exists() &&
getSystemProperty("ro.cm.version") != null; //$NON-NLS-1$
- // Register the broadcast receiver
+ // Register the notify broadcast receiver
IntentFilter filter = new IntentFilter();
filter.addAction(FileManagerSettings.INTENT_SETTING_CHANGED);
- registerReceiver(this.mOnSettingChangeReceiver, filter);
+ registerReceiver(this.mNotificationReceiver, filter);
+
+ // Register the uninstall broadcast receiver
+ IntentFilter unfilter = new IntentFilter();
+ unfilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
+ unfilter.addAction(Intent.ACTION_PACKAGE_FULLY_REMOVED);
+ unfilter.addDataScheme("package"); //$NON-NLS-1$
+ registerReceiver(this.mUninstallReceiver, unfilter);
}
/**
@@ -169,6 +228,24 @@ public final class FileManagerApplication extends Application {
FileHelper.ROOT_DIRECTORY = getString(R.string.root_dir);
Preferences.loadDefaults();
+ // Allocate the default and current themes
+ String defaultValue = ((String)FileManagerSettings.
+ SETTINGS_THEME.getDefaultValue());
+ String value = Preferences.getSharedPreferences().getString(
+ FileManagerSettings.SETTINGS_THEME.getId(),
+ defaultValue);
+ ThemeManager.getDefaultTheme(getApplicationContext());
+ if (!ThemeManager.setCurrentTheme(getApplicationContext(), value)) {
+ //The current theme was not found. Mark the default setting as default theme
+ ThemeManager.setCurrentTheme(getApplicationContext(), defaultValue);
+ try {
+ Preferences.savePreference(
+ FileManagerSettings.SETTINGS_THEME, defaultValue, true);
+ } catch (Throwable ex) {
+ Log.w(TAG, "can't save theme preference", ex); //$NON-NLS-1$
+ }
+ }
+
//Create a console for background tasks
allocBackgroundConsole(getApplicationContext());
@@ -312,27 +389,6 @@ public final class FileManagerApplication extends Application {
}
/**
- * Method that check if the app is signed with the platform signature
- *
- * @param ctx The current context
- * @return boolean If the app is signed with the platform signature
- */
- public static boolean isAppPlatformSignature(Context ctx) {
- // TODO This need to be improved, checking if the app is really with the platform signature
- try {
- // For now only check that the app is installed in system directory
- PackageManager pm = ctx.getPackageManager();
- String appDir = pm.getApplicationInfo(ctx.getPackageName(), 0).sourceDir;
- String systemDir = ctx.getString(R.string.system_dir);
- return appDir.startsWith(systemDir);
-
- } catch (Exception e) {
- ExceptionUtil.translateException(ctx, e, true, false);
- }
- return false;
- }
-
- /**
* Method that returns the access mode of the application
*
* @return boolean If the access mode of the application
diff --git a/src/com/cyanogenmod/filemanager/activities/BookmarksActivity.java b/src/com/cyanogenmod/filemanager/activities/BookmarksActivity.java
index 5436c698..d14988c8 100644
--- a/src/com/cyanogenmod/filemanager/activities/BookmarksActivity.java
+++ b/src/com/cyanogenmod/filemanager/activities/BookmarksActivity.java
@@ -18,8 +18,10 @@ package com.cyanogenmod.filemanager.activities;
import android.app.ActionBar;
import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.Context;
import android.content.Intent;
-import android.content.pm.ActivityInfo;
+import android.content.IntentFilter;
import android.content.res.Configuration;
import android.content.res.XmlResourceParser;
import android.database.Cursor;
@@ -49,11 +51,12 @@ import com.cyanogenmod.filemanager.preferences.AccessMode;
import com.cyanogenmod.filemanager.preferences.Bookmarks;
import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.Preferences;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.dialogs.InitialDirectoryDialog;
import com.cyanogenmod.filemanager.ui.widgets.FlingerListView;
import com.cyanogenmod.filemanager.ui.widgets.FlingerListView.OnItemFlingerListener;
import com.cyanogenmod.filemanager.ui.widgets.FlingerListView.OnItemFlingerResponder;
-import com.cyanogenmod.filemanager.util.AndroidHelper;
import com.cyanogenmod.filemanager.util.CommandHelper;
import com.cyanogenmod.filemanager.util.DialogHelper;
import com.cyanogenmod.filemanager.util.ExceptionUtil;
@@ -128,6 +131,17 @@ public class BookmarksActivity extends Activity implements OnItemClickListener,
}
};
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null) {
+ if (intent.getAction().compareTo(FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ applyTheme();
+ }
+ }
+ }
+ };
+
// Bookmark list XML tags
private static final String TAG_BOOKMARKS = "Bookmarks"; //$NON-NLS-1$
private static final String TAG_BOOKMARK = "bookmark"; //$NON-NLS-1$
@@ -145,9 +159,14 @@ public class BookmarksActivity extends Activity implements OnItemClickListener,
@Override
protected void onCreate(Bundle state) {
if (DEBUG) {
- Log.d(TAG, "NavigationActivity.onCreate"); //$NON-NLS-1$
+ Log.d(TAG, "BookmarksActivity.onCreate"); //$NON-NLS-1$
}
+ // Register the broadcast receiver
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
+
// Is ChRooted?
this.mChRooted = FileManagerApplication.getAccessMode().compareTo(AccessMode.SAFE) == 0;
@@ -161,6 +180,9 @@ public class BookmarksActivity extends Activity implements OnItemClickListener,
initTitleActionBar();
initBookmarks();
+ // Apply the theme
+ applyTheme();
+
//Save state
super.onCreate(state);
}
@@ -169,6 +191,26 @@ public class BookmarksActivity extends Activity implements OnItemClickListener,
* {@inheritDoc}
*/
@Override
+ protected void onDestroy() {
+ if (DEBUG) {
+ Log.d(TAG, "BookmarksActivity.onDestroy"); //$NON-NLS-1$
+ }
+
+ // Unregister the receiver
+ try {
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+
+ //All destroy. Continue
+ super.onDestroy();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
protected void onPause() {
//Set out transition
overridePendingTransition(R.anim.hold_in, R.anim.translate_to_left_out);
@@ -198,7 +240,6 @@ public class BookmarksActivity extends Activity implements OnItemClickListener,
title.setText(R.string.bookmarks);
title.setContentDescription(getString(R.string.bookmarks));
getActionBar().setCustomView(customTitle);
-
}
/**
@@ -558,4 +599,28 @@ public class BookmarksActivity extends Activity implements OnItemClickListener,
}
return bookmarks;
}
+
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+
+ //- ActionBar
+ theme.setTitlebarDrawable(this, getActionBar(), "titlebar_drawable"); //$NON-NLS-1$
+ View v = getActionBar().getCustomView().findViewById(R.id.customtitle_title);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ // -View
+ theme.setBackgroundDrawable(
+ this, this.mBookmarksListView, "background_drawable"); //$NON-NLS-1$
+ if (((BookmarksAdapter)this.mBookmarksListView.getAdapter()) != null) {
+ ((BookmarksAdapter)this.mBookmarksListView.getAdapter()).notifyThemeChanged();
+ ((BookmarksAdapter)this.mBookmarksListView.getAdapter()).notifyDataSetChanged();
+ }
+ this.mBookmarksListView.setDivider(
+ theme.getDrawable(this, "horizontal_divider_drawable")); //$NON-NLS-1$
+ this.mBookmarksListView.invalidate();
+ }
}
diff --git a/src/com/cyanogenmod/filemanager/activities/ChangeLogActivity.java b/src/com/cyanogenmod/filemanager/activities/ChangeLogActivity.java
index 76edbb68..889b6512 100644
--- a/src/com/cyanogenmod/filemanager/activities/ChangeLogActivity.java
+++ b/src/com/cyanogenmod/filemanager/activities/ChangeLogActivity.java
@@ -18,13 +18,20 @@ package com.cyanogenmod.filemanager.activities;
import android.app.Activity;
import android.app.AlertDialog;
+import android.content.BroadcastReceiver;
+import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnDismissListener;
+import android.content.Intent;
+import android.content.IntentFilter;
import android.os.Bundle;
import android.util.Log;
import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.DialogHelper;
import java.io.InputStream;
@@ -38,6 +45,17 @@ public class ChangeLogActivity extends Activity implements OnCancelListener, OnD
private static boolean DEBUG = false;
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null) {
+ if (intent.getAction().compareTo(FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ applyTheme();
+ }
+ }
+ }
+ };
+
/**
* {@inheritDoc}
*/
@@ -47,6 +65,11 @@ public class ChangeLogActivity extends Activity implements OnCancelListener, OnD
Log.d(TAG, "ChangeLogActivity.onCreate"); //$NON-NLS-1$
}
+ // Register the broadcast receiver
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
+
//Save state
super.onCreate(state);
@@ -54,6 +77,26 @@ public class ChangeLogActivity extends Activity implements OnCancelListener, OnD
}
/**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onDestroy() {
+ if (DEBUG) {
+ Log.d(TAG, "ChangeLogActivity.onDestroy"); //$NON-NLS-1$
+ }
+
+ // Unregister the receiver
+ try {
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+
+ //All destroy. Continue
+ super.onDestroy();
+ }
+
+ /**
* Initialize the activity. This method handles the passed intent, opens
* the appropriate activity and ends.
*/
@@ -80,7 +123,7 @@ public class ChangeLogActivity extends Activity implements OnCancelListener, OnD
R.string.changelog_title, sb.toString(), false);
dialog.setOnCancelListener(this);
dialog.setOnDismissListener(this);
- dialog.show();
+ DialogHelper.delegateDialogShow(this, dialog);
} catch (Exception e) {
Log.e(TAG, "Failed to read changelog file", e); //$NON-NLS-1$
@@ -111,4 +154,13 @@ public class ChangeLogActivity extends Activity implements OnCancelListener, OnD
finish();
}
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+ }
+
}
diff --git a/src/com/cyanogenmod/filemanager/activities/EditorActivity.java b/src/com/cyanogenmod/filemanager/activities/EditorActivity.java
index 9896ef46..9e679668 100644
--- a/src/com/cyanogenmod/filemanager/activities/EditorActivity.java
+++ b/src/com/cyanogenmod/filemanager/activities/EditorActivity.java
@@ -19,10 +19,12 @@ package com.cyanogenmod.filemanager.activities;
import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
+import android.content.BroadcastReceiver;
+import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
-import android.content.pm.ActivityInfo;
+import android.content.IntentFilter;
import android.content.res.Configuration;
import android.os.AsyncTask;
import android.os.Bundle;
@@ -34,6 +36,7 @@ import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
+import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.TextView.BufferType;
@@ -47,8 +50,9 @@ import com.cyanogenmod.filemanager.console.InsufficientPermissionsException;
import com.cyanogenmod.filemanager.console.RelaunchableException;
import com.cyanogenmod.filemanager.model.FileSystemObject;
import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.widgets.ButtonItem;
-import com.cyanogenmod.filemanager.util.AndroidHelper;
import com.cyanogenmod.filemanager.util.CommandHelper;
import com.cyanogenmod.filemanager.util.DialogHelper;
import com.cyanogenmod.filemanager.util.ExceptionUtil;
@@ -66,6 +70,17 @@ public class EditorActivity extends Activity implements TextWatcher {
private static boolean DEBUG = false;
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null) {
+ if (intent.getAction().compareTo(FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ applyTheme();
+ }
+ }
+ }
+ };
+
private static final char[] VALID_NON_PRINTABLE_CHARS = {' ', '\t', '\r', '\n'};
/**
@@ -266,6 +281,11 @@ public class EditorActivity extends Activity implements TextWatcher {
Log.d(TAG, "EditorActivity.onCreate"); //$NON-NLS-1$
}
+ // Register the broadcast receiver
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
+
//Set the main layout of the activity
setContentView(R.layout.editor);
@@ -278,7 +298,14 @@ public class EditorActivity extends Activity implements TextWatcher {
//Initialize
initTitleActionBar();
initLayout();
+
+ // Apply the theme
+ applyTheme();
+
+ // Initialize the console
initializeConsole();
+
+ // Read the file
readFile();
//Save state
@@ -289,6 +316,26 @@ public class EditorActivity extends Activity implements TextWatcher {
* {@inheritDoc}
*/
@Override
+ protected void onDestroy() {
+ if (DEBUG) {
+ Log.d(TAG, "EditorActivity.onDestroy"); //$NON-NLS-1$
+ }
+
+ // Unregister the receiver
+ try {
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+
+ //All destroy. Continue
+ super.onDestroy();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
@@ -699,7 +746,7 @@ public class EditorActivity extends Activity implements TextWatcher {
}
}
});
- alert.show();
+ DialogHelper.delegateDialogShow(EditorActivity.this, alert);
}
});
}
@@ -756,7 +803,7 @@ public class EditorActivity extends Activity implements TextWatcher {
}
}
});
- dlg.show();
+ DialogHelper.delegateDialogShow(this, dlg);
return;
}
setResult(Activity.RESULT_OK);
@@ -780,4 +827,25 @@ public class EditorActivity extends Activity implements TextWatcher {
return TextUtils.isGraphic(c);
}
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+
+ //- ActionBar
+ theme.setTitlebarDrawable(this, getActionBar(), "titlebar_drawable"); //$NON-NLS-1$
+ View v = getActionBar().getCustomView().findViewById(R.id.customtitle_title);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_button1);
+ theme.setImageDrawable(this, (ImageView)v, "ab_save_drawable"); //$NON-NLS-1$
+ // -View
+ v = findViewById(R.id.editor_layout);
+ theme.setBackgroundDrawable(this, v, "background_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.editor);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ }
+
}
diff --git a/src/com/cyanogenmod/filemanager/activities/HistoryActivity.java b/src/com/cyanogenmod/filemanager/activities/HistoryActivity.java
index bc604caa..817028f6 100644
--- a/src/com/cyanogenmod/filemanager/activities/HistoryActivity.java
+++ b/src/com/cyanogenmod/filemanager/activities/HistoryActivity.java
@@ -18,8 +18,10 @@ package com.cyanogenmod.filemanager.activities;
import android.app.ActionBar;
import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.Context;
import android.content.Intent;
-import android.content.pm.ActivityInfo;
+import android.content.IntentFilter;
import android.content.res.Configuration;
import android.os.AsyncTask;
import android.os.Bundle;
@@ -29,6 +31,7 @@ import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
+import android.widget.ImageView;
import android.widget.ListPopupWindow;
import android.widget.ListView;
import android.widget.TextView;
@@ -38,6 +41,9 @@ import com.cyanogenmod.filemanager.adapters.HighlightedSimpleMenuListAdapter;
import com.cyanogenmod.filemanager.adapters.HistoryAdapter;
import com.cyanogenmod.filemanager.adapters.SimpleMenuListAdapter;
import com.cyanogenmod.filemanager.model.History;
+import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.widgets.ButtonItem;
import com.cyanogenmod.filemanager.util.AndroidHelper;
import com.cyanogenmod.filemanager.util.DialogHelper;
@@ -56,6 +62,17 @@ public class HistoryActivity extends Activity implements OnItemClickListener {
private static boolean DEBUG = false;
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null) {
+ if (intent.getAction().compareTo(FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ applyTheme();
+ }
+ }
+ }
+ };
+
/**
* @hide
*/
@@ -83,9 +100,14 @@ public class HistoryActivity extends Activity implements OnItemClickListener {
@Override
protected void onCreate(Bundle state) {
if (DEBUG) {
- Log.d(TAG, "NavigationActivity.onCreate"); //$NON-NLS-1$
+ Log.d(TAG, "HistoryActivity.onCreate"); //$NON-NLS-1$
}
+ // Register the broadcast receiver
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
+
this.mIsEmpty = false;
this.mIsClearHistory = false;
@@ -99,6 +121,9 @@ public class HistoryActivity extends Activity implements OnItemClickListener {
initTitleActionBar();
initHistory();
+ // Apply the theme
+ applyTheme();
+
//Save state
super.onCreate(state);
}
@@ -107,6 +132,26 @@ public class HistoryActivity extends Activity implements OnItemClickListener {
* {@inheritDoc}
*/
@Override
+ protected void onDestroy() {
+ if (DEBUG) {
+ Log.d(TAG, "HistoryActivity.onDestroy"); //$NON-NLS-1$
+ }
+
+ // Unregister the receiver
+ try {
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+
+ //All destroy. Continue
+ super.onDestroy();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
@@ -172,6 +217,8 @@ public class HistoryActivity extends Activity implements OnItemClickListener {
// Retrieve the loading view
final View waiting = findViewById(R.id.history_waiting);
+ this.mListView = (ListView)findViewById(R.id.history_listview);
+
// Load the history in background
AsyncTask<Void, Void, Boolean> task = new AsyncTask<Void, Void, Boolean>() {
Exception mCause;
@@ -192,9 +239,6 @@ public class HistoryActivity extends Activity implements OnItemClickListener {
//Show inverted history
final List<History> adapterList = new ArrayList<History>(this.mHistory);
Collections.reverse(adapterList);
-
- HistoryActivity.this.mListView =
- (ListView)findViewById(R.id.history_listview);
HistoryActivity.this.mAdapter =
new HistoryAdapter(HistoryActivity.this, adapterList);
@@ -341,4 +385,29 @@ public class HistoryActivity extends Activity implements OnItemClickListener {
});
popup.show();
}
+
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+
+ //- ActionBar
+ theme.setTitlebarDrawable(this, getActionBar(), "titlebar_drawable"); //$NON-NLS-1$
+ View v = getActionBar().getCustomView().findViewById(R.id.customtitle_title);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_button1);
+ theme.setImageDrawable(this, (ImageView)v, "ab_overflow_drawable"); //$NON-NLS-1$
+ // -View
+ theme.setBackgroundDrawable(this, this.mListView, "background_drawable"); //$NON-NLS-1$
+ if (this.mAdapter != null) {
+ this.mAdapter.notifyThemeChanged();
+ this.mAdapter.notifyDataSetChanged();
+ }
+ this.mListView.setDivider(
+ theme.getDrawable(this, "horizontal_divider_drawable")); //$NON-NLS-1$
+ this.mListView.invalidate();
+ }
}
diff --git a/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java b/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java
index d76f360f..77107dea 100644
--- a/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java
+++ b/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java
@@ -27,8 +27,6 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.net.Uri;
-import android.nfc.NdefMessage;
-import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;
import android.nfc.NfcEvent;
import android.os.Bundle;
@@ -43,9 +41,11 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
+import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListPopupWindow;
import android.widget.PopupWindow;
+import android.widget.TextView;
import android.widget.Toast;
import com.cyanogenmod.filemanager.FileManagerApplication;
@@ -72,6 +72,8 @@ import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.NavigationLayoutMode;
import com.cyanogenmod.filemanager.preferences.ObjectIdentifier;
import com.cyanogenmod.filemanager.preferences.Preferences;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.dialogs.ActionsDialog;
import com.cyanogenmod.filemanager.ui.dialogs.FilesystemInfoDialog;
import com.cyanogenmod.filemanager.ui.dialogs.FilesystemInfoDialog.OnMountListener;
@@ -173,7 +175,7 @@ public class NavigationActivity extends Activity
// exit, and the toast is shown again after the first tap.
private static final int RELEASE_EXIT_CHECK_TIMEOUT = 3500;
- private final BroadcastReceiver mOnSettingChangeReceiver = new BroadcastReceiver() {
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent != null) {
@@ -246,6 +248,9 @@ public class NavigationActivity extends Activity
} catch (Exception e) {
ExceptionUtil.translateException(context, e, true, false);
}
+ } else if (intent.getAction().compareTo(
+ FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ applyTheme();
}
}
}
@@ -293,7 +298,8 @@ public class NavigationActivity extends Activity
IntentFilter filter = new IntentFilter();
filter.addAction(FileManagerSettings.INTENT_SETTING_CHANGED);
filter.addAction(FileManagerSettings.INTENT_FILE_CHANGED);
- registerReceiver(this.mOnSettingChangeReceiver, filter);
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
//Set the main layout of the activity
setContentView(R.layout.navigation);
@@ -304,8 +310,8 @@ public class NavigationActivity extends Activity
mNfcAdapter.setBeamPushUrisCallback(new NfcAdapter.CreateBeamUrisCallback() {
@Override
public Uri[] createBeamUris(NfcEvent event) {
- List<FileSystemObject> selectedFiles = getNavigationView(NavigationActivity.
- this.mCurrentNavigationView).getSelectedFiles();
+ List<FileSystemObject> selectedFiles =
+ getCurrentNavigationView().getSelectedFiles();
if (selectedFiles.size() > 0) {
List<Uri> fileUri = new ArrayList<Uri>();
for (FileSystemObject f : selectedFiles) {
@@ -323,9 +329,6 @@ public class NavigationActivity extends Activity
}, this);
}
- // Show welcome message
- showWelcomeMsg();
-
//Initialize activity
init();
@@ -344,6 +347,12 @@ public class NavigationActivity extends Activity
}
this.mOrientation = orientation;
+ // Apply the theme
+ applyTheme();
+
+ // Show welcome message
+ showWelcomeMsg();
+
this.mHandler = new Handler();
this.mHandler.post(new Runnable() {
@Override
@@ -395,7 +404,7 @@ public class NavigationActivity extends Activity
// Unregister the receiver
try {
- unregisterReceiver(this.mOnSettingChangeReceiver);
+ unregisterReceiver(this.mNotificationReceiver);
} catch (Throwable ex) {
/**NON BLOCK**/
}
@@ -446,7 +455,7 @@ public class NavigationActivity extends Activity
AlertDialog dialog = DialogHelper.createAlertDialog(
this, R.drawable.ic_launcher,
R.string.welcome_title, getString(R.string.welcome_msg), false);
- dialog.show();
+ DialogHelper.delegateDialogShow(this, dialog);
// Don't display again this dialog
try {
@@ -867,9 +876,9 @@ public class NavigationActivity extends Activity
//Navigate to previous history
back();
} else {
- // I don't know is the search view was changed, so do a refresh
+ // I don't know is the search view was changed, so try to do a refresh
// of the navigation view
- getCurrentNavigationView().refresh();
+ getCurrentNavigationView().refresh(true);
}
}
break;
@@ -1111,7 +1120,7 @@ public class NavigationActivity extends Activity
this,
R.string.filesystem_info_warning_title,
R.string.filesystem_info_warning_msg);
- alert.show();
+ DialogHelper.delegateDialogShow(this, alert);
return;
}
@@ -1437,7 +1446,7 @@ public class NavigationActivity extends Activity
}
}
});
- dialog.show();
+ DialogHelper.delegateDialogShow(this, dialog);
}
/**
@@ -1502,6 +1511,8 @@ public class NavigationActivity extends Activity
* Method that reconfigures the layout for better fit in portrait and landscape modes
*/
private void onLayoutChanged() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+
// Apply only when the orientation was changed
int orientation = getResources().getConfiguration().orientation;
if (this.mOrientation == orientation) return;
@@ -1541,6 +1552,9 @@ public class NavigationActivity extends Activity
statusBar.setLayoutParams(params);
newParent.addView(statusBar);
+ // Apply theme
+ theme.setBackgroundDrawable(this, statusBar, "titlebar_drawable"); //$NON-NLS-1$
+
// Hide holder
View holder = findViewById(R.id.navigation_statusbar_portrait_holder);
holder.setVisibility(View.GONE);
@@ -1554,7 +1568,8 @@ public class NavigationActivity extends Activity
}
// Add to the new location
- ViewGroup newParent = (ViewGroup)findViewById(R.id.navigation_statusbar_portrait_holder);
+ ViewGroup newParent = (ViewGroup)findViewById(
+ R.id.navigation_statusbar_portrait_holder);
LinearLayout.LayoutParams params =
new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
@@ -1562,9 +1577,65 @@ public class NavigationActivity extends Activity
statusBar.setLayoutParams(params);
newParent.addView(statusBar);
+ // Apply theme
+ theme.setBackgroundDrawable(this, statusBar, "statusbar_drawable"); //$NON-NLS-1$
+
// Show holder
newParent.setVisibility(View.VISIBLE);
}
}
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ int orientation = getResources().getConfiguration().orientation;
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+
+ //- ActionBar
+ theme.setTitlebarDrawable(this, getActionBar(), "titlebar_drawable"); //$NON-NLS-1$
+ //- StatusBar
+ View v = findViewById(R.id.navigation_statusbar);
+ if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
+ theme.setBackgroundDrawable(this, v, "titlebar_drawable"); //$NON-NLS-1$
+ } else {
+ theme.setBackgroundDrawable(this, v, "statusbar_drawable"); //$NON-NLS-1$
+ }
+ v = findViewById(R.id.ab_overflow);
+ theme.setImageDrawable(this, (ImageView)v, "ab_overflow_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_actions);
+ theme.setImageDrawable(this, (ImageView)v, "ab_actions_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_search);
+ theme.setImageDrawable(this, (ImageView)v, "ab_search_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_bookmarks);
+ theme.setImageDrawable(this, (ImageView)v, "ab_bookmarks_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_history);
+ theme.setImageDrawable(this, (ImageView)v, "ab_history_drawable"); //$NON-NLS-1$
+ //- Expanders
+ v = findViewById(R.id.ab_configuration);
+ theme.setImageDrawable(this, (ImageView)v, "expander_open_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_close);
+ theme.setImageDrawable(this, (ImageView)v, "expander_close_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_sort_mode);
+ theme.setImageDrawable(this, (ImageView)v, "ab_sort_mode_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_layout_mode);
+ theme.setImageDrawable(this, (ImageView)v, "ab_layout_mode_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_view_options);
+ theme.setImageDrawable(this, (ImageView)v, "ab_view_options_drawable"); //$NON-NLS-1$
+ //- SelectionBar
+ v = findViewById(R.id.navigation_selectionbar);
+ theme.setBackgroundDrawable(this, v, "selectionbar_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_selection_done);
+ theme.setImageDrawable(this, (ImageView)v, "ab_selection_done_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.navigation_status_selection_label);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ //- NavigationView
+ int cc = this.mNavigationViews.length;
+ for (int i = 0; i < cc; i++) {
+ getNavigationView(i).applyTheme();
+ }
+ }
+
}
diff --git a/src/com/cyanogenmod/filemanager/activities/PickerActivity.java b/src/com/cyanogenmod/filemanager/activities/PickerActivity.java
index a65c0e2f..d40dcba6 100644
--- a/src/com/cyanogenmod/filemanager/activities/PickerActivity.java
+++ b/src/com/cyanogenmod/filemanager/activities/PickerActivity.java
@@ -18,10 +18,13 @@ package com.cyanogenmod.filemanager.activities;
import android.app.Activity;
import android.app.AlertDialog;
+import android.content.BroadcastReceiver;
+import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnDismissListener;
import android.content.Intent;
+import android.content.IntentFilter;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
@@ -44,6 +47,8 @@ import com.cyanogenmod.filemanager.console.ConsoleBuilder;
import com.cyanogenmod.filemanager.model.FileSystemObject;
import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.Preferences;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.widgets.Breadcrumb;
import com.cyanogenmod.filemanager.ui.widgets.ButtonItem;
import com.cyanogenmod.filemanager.ui.widgets.NavigationView;
@@ -68,6 +73,17 @@ public class PickerActivity extends Activity
private static boolean DEBUG = false;
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null) {
+ if (intent.getAction().compareTo(FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ applyTheme();
+ }
+ }
+ }
+ };
+
private String mMimeType;
private FileSystemObject mFso; // The picked item
private AlertDialog mDialog;
@@ -87,6 +103,11 @@ public class PickerActivity extends Activity
Log.d(TAG, "PickerActivity.onCreate"); //$NON-NLS-1$
}
+ // Register the broadcast receiver
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
+
// Initialize the activity
init();
@@ -98,6 +119,26 @@ public class PickerActivity extends Activity
* {@inheritDoc}
*/
@Override
+ protected void onDestroy() {
+ if (DEBUG) {
+ Log.d(TAG, "PickerActivity.onDestroy"); //$NON-NLS-1$
+ }
+
+ // Unregister the receiver
+ try {
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+
+ //All destroy. Continue
+ super.onDestroy();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
measureHeight();
@@ -150,6 +191,9 @@ public class PickerActivity extends Activity
this.mNavigationView.setOnFilePickedListener(this);
this.mNavigationView.setBreadcrumb(breadcrumb);
+ // Apply the current theme
+ applyTheme();
+
// Create the dialog
this.mDialog = DialogHelper.createDialog(
this, R.drawable.ic_launcher, R.string.picker_title, this.mRootView);
@@ -165,7 +209,7 @@ public class PickerActivity extends Activity
this.mDialog.setCancelable(true);
this.mDialog.setOnCancelListener(this);
this.mDialog.setOnDismissListener(this);
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this, this.mDialog);
// Set content description of storage volume button
ButtonItem fs = (ButtonItem)this.mRootView.findViewById(R.id.ab_filesystem_info);
@@ -225,19 +269,6 @@ public class PickerActivity extends Activity
* {@inheritDoc}
*/
@Override
- protected void onDestroy() {
- if (DEBUG) {
- Log.d(TAG, "PickerActivity.onDestroy"); //$NON-NLS-1$
- }
-
- //All destroy. Continue
- super.onDestroy();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public void onDismiss(DialogInterface dialog) {
if (this.mFso != null) {
Intent result = new Intent();
@@ -321,7 +352,6 @@ public class PickerActivity extends Activity
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
popup.dismiss();
if (volumes != null) {
-
PickerActivity.this.
mNavigationView.changeCurrentDir(volumes[position].getPath());
}
@@ -329,4 +359,17 @@ public class PickerActivity extends Activity
});
popup.show();
}
+
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+
+ // View
+ theme.setBackgroundDrawable(this, this.mRootView, "background_drawable"); //$NON-NLS-1$
+ this.mNavigationView.applyTheme();
+ }
}
diff --git a/src/com/cyanogenmod/filemanager/activities/SearchActivity.java b/src/com/cyanogenmod/filemanager/activities/SearchActivity.java
index 9f2136c1..2c706fc6 100644
--- a/src/com/cyanogenmod/filemanager/activities/SearchActivity.java
+++ b/src/com/cyanogenmod/filemanager/activities/SearchActivity.java
@@ -25,7 +25,6 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
-import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Parcelable;
@@ -40,6 +39,7 @@ import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemLongClickListener;
+import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.ProgressBar;
@@ -67,6 +67,8 @@ import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.Preferences;
import com.cyanogenmod.filemanager.providers.RecentSearchesContentProvider;
import com.cyanogenmod.filemanager.tasks.SearchResultDrawingAsyncTask;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.dialogs.ActionsDialog;
import com.cyanogenmod.filemanager.ui.dialogs.MessageProgressDialog;
import com.cyanogenmod.filemanager.ui.policy.DeleteActionPolicy;
@@ -75,7 +77,6 @@ import com.cyanogenmod.filemanager.ui.widgets.ButtonItem;
import com.cyanogenmod.filemanager.ui.widgets.FlingerListView;
import com.cyanogenmod.filemanager.ui.widgets.FlingerListView.OnItemFlingerListener;
import com.cyanogenmod.filemanager.ui.widgets.FlingerListView.OnItemFlingerResponder;
-import com.cyanogenmod.filemanager.util.AndroidHelper;
import com.cyanogenmod.filemanager.util.CommandHelper;
import com.cyanogenmod.filemanager.util.DialogHelper;
import com.cyanogenmod.filemanager.util.ExceptionUtil;
@@ -117,29 +118,39 @@ public class SearchActivity extends Activity
//Minimum characters to allow query
private static final int MIN_CHARS_SEARCH = 3;
- private final BroadcastReceiver mOnSettingChangeReceiver = new BroadcastReceiver() {
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
- if (intent != null &&
- intent.getAction().compareTo(FileManagerSettings.INTENT_SETTING_CHANGED) == 0) {
-
- // The settings has changed
- String key = intent.getStringExtra(FileManagerSettings.EXTRA_SETTING_CHANGED_KEY);
- if (key != null) {
- if (SearchActivity.this.mSearchListView.getAdapter() != null &&
- (key.compareTo(
- FileManagerSettings.SETTINGS_HIGHLIGHT_TERMS.getId()) == 0 ||
- key.compareTo(
- FileManagerSettings.SETTINGS_SHOW_RELEVANCE_WIDGET.getId()) == 0 ||
- key.compareTo(
- FileManagerSettings.SETTINGS_SORT_SEARCH_RESULTS_MODE.getId()) == 0)) {
-
- // Recreate the adapter
- int pos = SearchActivity.this.mSearchListView.getFirstVisiblePosition();
- drawResults();
- SearchActivity.this.mSearchListView.setSelection(pos);
- return;
+ if (intent != null) {
+ if (intent.getAction().compareTo(
+ FileManagerSettings.INTENT_SETTING_CHANGED) == 0) {
+
+ // The settings has changed
+ String key = intent.getStringExtra(
+ FileManagerSettings.EXTRA_SETTING_CHANGED_KEY);
+ if (key != null) {
+ if (SearchActivity.this.mSearchListView.getAdapter() != null &&
+ (key.compareTo(
+ FileManagerSettings.
+ SETTINGS_HIGHLIGHT_TERMS.getId()) == 0 ||
+ key.compareTo(
+ FileManagerSettings.
+ SETTINGS_SHOW_RELEVANCE_WIDGET.getId()) == 0 ||
+ key.compareTo(
+ FileManagerSettings.
+ SETTINGS_SORT_SEARCH_RESULTS_MODE.getId()) == 0)) {
+
+ // Recreate the adapter
+ int pos = SearchActivity.
+ this.mSearchListView.getFirstVisiblePosition();
+ drawResults();
+ SearchActivity.this.mSearchListView.setSelection(pos);
+ return;
+ }
}
+ } else if (intent.getAction().compareTo(
+ FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ applyTheme();
}
}
}
@@ -254,7 +265,7 @@ public class SearchActivity extends Activity
@Override
protected void onCreate(Bundle state) {
if (DEBUG) {
- Log.d(TAG, "NavigationActivity.onCreate"); //$NON-NLS-1$
+ Log.d(TAG, "SearchActivity.onCreate"); //$NON-NLS-1$
}
// Check if app is running in chrooted mode
@@ -263,7 +274,8 @@ public class SearchActivity extends Activity
// Register the broadcast receiver
IntentFilter filter = new IntentFilter();
filter.addAction(FileManagerSettings.INTENT_SETTING_CHANGED);
- registerReceiver(this.mOnSettingChangeReceiver, filter);
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
//Set in transition
overridePendingTransition(R.anim.translate_to_right_in, R.anim.hold_out);
@@ -279,6 +291,10 @@ public class SearchActivity extends Activity
//Initialize action bars and search
initTitleActionBar();
initComponents();
+
+ // Apply current theme
+ applyTheme();
+
if (this.mRestoreState != null) {
//Restore activity from cached data
loadFromCacheData();
@@ -300,6 +316,26 @@ public class SearchActivity extends Activity
* {@inheritDoc}
*/
@Override
+ protected void onDestroy() {
+ if (DEBUG) {
+ Log.d(TAG, "SearchActivity.onDestroy"); //$NON-NLS-1$
+ }
+
+ // Unregister the receiver
+ try {
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+
+ //All destroy. Continue
+ super.onDestroy();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
@@ -329,17 +365,6 @@ public class SearchActivity extends Activity
* {@inheritDoc}
*/
@Override
- protected void onDestroy() {
- super.onDestroy();
- try {
- unregisterReceiver(this.mOnSettingChangeReceiver);
- } catch (Throwable ex) {/**NON BLOCK**/}
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
protected void onSaveInstanceState(Bundle outState) {
if (DEBUG) {
Log.d(TAG, "SearchActivity.onSaveInstanceState"); //$NON-NLS-1$
@@ -549,7 +574,7 @@ public class SearchActivity extends Activity
back(true, null, false);
}
});
- dialog.show();
+ DialogHelper.delegateDialogShow(this, dialog);
}
/**
@@ -1167,5 +1192,38 @@ public class SearchActivity extends Activity
Integer.valueOf(progress));
SearchActivity.this.mDialog.setProgress(Html.fromHtml(msg));
}
+
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+
+ //- ActionBar
+ theme.setTitlebarDrawable(this, getActionBar(), "titlebar_drawable"); //$NON-NLS-1$
+ View v = getActionBar().getCustomView().findViewById(R.id.customtitle_title);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_button1);
+ theme.setImageDrawable(this, (ImageView)v, "ic_config_drawable"); //$NON-NLS-1$
+ // ContentView
+ theme.setBackgroundDrawable(
+ this, getWindow().getDecorView(), "background_drawable"); //$NON-NLS-1$
+ //- StatusBar
+ v = findViewById(R.id.search_status);
+ theme.setBackgroundDrawable(this, v, "statusbar_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.search_status_found_items);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = findViewById(R.id.search_status_query_terms);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ //ListView
+ if (this.mSearchListView.getAdapter() != null) {
+ ((SearchResultAdapter)this.mSearchListView.getAdapter()).notifyDataSetChanged();
+ }
+ this.mSearchListView.setDivider(
+ theme.getDrawable(this, "horizontal_divider_drawable")); //$NON-NLS-1$
+ this.mSearchListView.invalidate();
+ }
}
diff --git a/src/com/cyanogenmod/filemanager/activities/ShortcutActivity.java b/src/com/cyanogenmod/filemanager/activities/ShortcutActivity.java
index 6c87189e..4578ce6b 100644
--- a/src/com/cyanogenmod/filemanager/activities/ShortcutActivity.java
+++ b/src/com/cyanogenmod/filemanager/activities/ShortcutActivity.java
@@ -17,10 +17,13 @@
package com.cyanogenmod.filemanager.activities;
import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnDismissListener;
import android.content.Intent;
+import android.content.IntentFilter;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
@@ -28,6 +31,9 @@ import android.widget.Toast;
import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.console.ConsoleBuilder;
import com.cyanogenmod.filemanager.model.FileSystemObject;
+import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.policy.IntentsActionPolicy;
import com.cyanogenmod.filemanager.util.CommandHelper;
import com.cyanogenmod.filemanager.util.DialogHelper;
@@ -42,6 +48,17 @@ public class ShortcutActivity extends Activity implements OnCancelListener, OnDi
private static boolean DEBUG = false;
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null) {
+ if (intent.getAction().compareTo(FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ applyTheme();
+ }
+ }
+ }
+ };
+
/**
* Constant for extra information about the type of the shortcut.<br/>
* <br/>
@@ -76,6 +93,11 @@ public class ShortcutActivity extends Activity implements OnCancelListener, OnDi
Log.d(TAG, "ShortcutActivity.onCreate"); //$NON-NLS-1$
}
+ // Register the broadcast receiver
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
+
//Save state
super.onCreate(state);
@@ -83,6 +105,26 @@ public class ShortcutActivity extends Activity implements OnCancelListener, OnDi
}
/**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onDestroy() {
+ if (DEBUG) {
+ Log.d(TAG, "ShortcutActivity.onDestroy"); //$NON-NLS-1$
+ }
+
+ // Unregister the receiver
+ try {
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+
+ //All destroy. Continue
+ super.onDestroy();
+ }
+
+ /**
* Initialize the activity. This method handles the passed intent, opens
* the appropriate activity and ends.
*/
@@ -190,4 +232,13 @@ public class ShortcutActivity extends Activity implements OnCancelListener, OnDi
finish();
}
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+ }
+
}
diff --git a/src/com/cyanogenmod/filemanager/activities/preferences/SettingsPreferences.java b/src/com/cyanogenmod/filemanager/activities/preferences/SettingsPreferences.java
index 896859af..438e8c10 100644
--- a/src/com/cyanogenmod/filemanager/activities/preferences/SettingsPreferences.java
+++ b/src/com/cyanogenmod/filemanager/activities/preferences/SettingsPreferences.java
@@ -18,7 +18,10 @@ package com.cyanogenmod.filemanager.activities.preferences;
import android.app.ActionBar;
import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.Context;
import android.content.Intent;
+import android.content.IntentFilter;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
@@ -43,6 +46,9 @@ import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.ObjectStringIdentifier;
import com.cyanogenmod.filemanager.preferences.Preferences;
import com.cyanogenmod.filemanager.providers.RecentSearchesContentProvider;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
+import com.cyanogenmod.filemanager.ui.preferences.ThemeSelectorPreference;
import com.cyanogenmod.filemanager.util.DialogHelper;
import java.util.List;
@@ -52,19 +58,62 @@ import java.util.List;
*/
public class SettingsPreferences extends PreferenceActivity {
+ private static final String TAG = "SettingsPreferences"; //$NON-NLS-1$
+
private static final boolean DEBUG = false;
- private static final String LOG_TAG = "SettingsPreferences"; //$NON-NLS-1$
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null) {
+ if (intent.getAction().compareTo(FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ finish();
+ }
+ }
+ }
+ };
/**
* {@inheritDoc}
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
+ if (DEBUG) {
+ Log.d(TAG, "SettingsPreferences.onCreate"); //$NON-NLS-1$
+ }
+
+ // Register the broadcast receiver
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
//Initialize action bars
initTitleActionBar();
+
+ // Apply the theme
+ applyTheme();
+
+ super.onCreate(savedInstanceState);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onDestroy() {
+ if (DEBUG) {
+ Log.d(TAG, "SettingsPreferences.onDestroy"); //$NON-NLS-1$
+ }
+
+ // Unregister the receiver
+ try {
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+
+ //All destroy. Continue
+ super.onDestroy();
}
/**
@@ -142,7 +191,7 @@ public class SettingsPreferences extends PreferenceActivity {
String key = preference.getKey();
if (DEBUG) {
- Log.d(LOG_TAG,
+ Log.d(TAG,
String.format("New value for %s: %s", //$NON-NLS-1$
key,
String.valueOf(newValue)));
@@ -293,7 +342,7 @@ public class SettingsPreferences extends PreferenceActivity {
public boolean onPreferenceChange(Preference preference, Object newValue) {
String key = preference.getKey();
if (DEBUG) {
- Log.d(LOG_TAG,
+ Log.d(TAG,
String.format("New value for %s: %s", //$NON-NLS-1$
key,
String.valueOf(newValue)));
@@ -415,4 +464,78 @@ public class SettingsPreferences extends PreferenceActivity {
}
}
+ /**
+ * A class that manages the theme selection
+ */
+ public static class ThemesPreferenceFragment extends PreferenceFragment {
+
+ private ThemeSelectorPreference mThemeSelector;
+
+ private final OnPreferenceChangeListener mOnChangeListener =
+ new OnPreferenceChangeListener() {
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ String key = preference.getKey();
+ if (DEBUG) {
+ Log.d(TAG,
+ String.format("New value for %s: %s", //$NON-NLS-1$
+ key,
+ String.valueOf(newValue)));
+ }
+
+ // Notify to all activities that the theme has changed
+ Intent intent = new Intent(FileManagerSettings.INTENT_THEME_CHANGED);
+ intent.putExtra(FileManagerSettings.EXTRA_THEME_ID, (String)newValue);
+ getActivity().sendBroadcast(intent);
+
+ //Wait for allow activities to apply the theme, prior to finish settings
+ try {
+ Thread.sleep(250L);
+ } catch (Throwable e) {/**NON BLOCK**/}
+ getActivity().finish();
+ return true;
+ }
+ };
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ // Change the preference manager
+ getPreferenceManager().setSharedPreferencesName(Preferences.SETTINGS_FILENAME);
+ getPreferenceManager().setSharedPreferencesMode(MODE_PRIVATE);
+
+ // Add the preferences
+ addPreferencesFromResource(R.xml.preferences_themes);
+
+ // Theme selector
+ this.mThemeSelector =
+ (ThemeSelectorPreference)findPreference(
+ FileManagerSettings.SETTINGS_THEME.getId());
+ this.mThemeSelector.setOnPreferenceChangeListener(this.mOnChangeListener);
+ }
+ }
+
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+
+ //- ActionBar
+ theme.setTitlebarDrawable(this, getActionBar(), "titlebar_drawable"); //$NON-NLS-1$
+ View v = getActionBar().getCustomView().findViewById(R.id.customtitle_title);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ // -View
+ theme.setBackgroundDrawable(
+ this,
+ this.getWindow().getDecorView(),
+ "background_drawable"); //$NON-NLS-1$
+ }
+
}
diff --git a/src/com/cyanogenmod/filemanager/adapters/AssociationsAdapter.java b/src/com/cyanogenmod/filemanager/adapters/AssociationsAdapter.java
index 06065716..1daaf715 100644
--- a/src/com/cyanogenmod/filemanager/adapters/AssociationsAdapter.java
+++ b/src/com/cyanogenmod/filemanager/adapters/AssociationsAdapter.java
@@ -28,6 +28,8 @@ import android.widget.ImageView;
import android.widget.TextView;
import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import java.util.List;
@@ -149,6 +151,11 @@ public class AssociationsAdapter
viewHolder.mIvIcon = (ImageView)v.findViewById(RESOURCE_ITEM_ICON);
viewHolder.mTvName = (TextView)v.findViewById(RESOURCE_ITEM_NAME);
v.setTag(viewHolder);
+
+ // Apply theme
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setBackgroundDrawable(getContext(), v, "selection_drawable"); //$NON-NLS-1$
+ theme.setTextColor(getContext(), viewHolder.mTvName, "text_color"); //$NON-NLS-1$
}
//Retrieve data holder
diff --git a/src/com/cyanogenmod/filemanager/adapters/BookmarksAdapter.java b/src/com/cyanogenmod/filemanager/adapters/BookmarksAdapter.java
index 88ef2ffa..a60ccd3b 100644
--- a/src/com/cyanogenmod/filemanager/adapters/BookmarksAdapter.java
+++ b/src/com/cyanogenmod/filemanager/adapters/BookmarksAdapter.java
@@ -31,6 +31,8 @@ import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.model.Bookmark;
import com.cyanogenmod.filemanager.model.Bookmark.BOOKMARK_TYPE;
import com.cyanogenmod.filemanager.ui.IconHolder;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.BookmarksHelper;
import java.util.List;
@@ -148,12 +150,13 @@ public class BookmarksAdapter extends ArrayAdapter<Bookmark> {
if (bookmark.mType.compareTo(BOOKMARK_TYPE.HOME) == 0) {
this.mData[i].mDwAction =
this.mIconHolder.getDrawable(
- getContext(), R.drawable.ic_holo_light_config);
+ getContext(), "ic_config_drawable"); //$NON-NLS-1$
this.mData[i].mActionCd =
getContext().getString(R.string.bookmarks_button_config_cd);
} else if (bookmark.mType.compareTo(BOOKMARK_TYPE.USER_DEFINED) == 0) {
this.mData[i].mDwAction =
- this.mIconHolder.getDrawable(getContext(), R.drawable.ic_holo_light_close);
+ this.mIconHolder.getDrawable(getContext(),
+ "ic_close_drawable"); //$NON-NLS-1$
this.mData[i].mActionCd =
getContext().getString(R.string.bookmarks_button_remove_bookmark_cd);
}
@@ -180,6 +183,15 @@ public class BookmarksAdapter extends ArrayAdapter<Bookmark> {
viewHolder.mBtAction = (ImageButton)v.findViewById(RESOURCE_ITEM_ACTION);
viewHolder.mBtAction.setTag(Integer.valueOf(position));
v.setTag(viewHolder);
+
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setBackgroundDrawable(
+ getContext(), v, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(
+ getContext(), viewHolder.mTvName, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(
+ getContext(), viewHolder.mTvPath, "text_color"); //$NON-NLS-1$
}
//Retrieve data holder
@@ -202,4 +214,11 @@ public class BookmarksAdapter extends ArrayAdapter<Bookmark> {
return v;
}
+ /**
+ * Method that should be invoked when the theme of the app was changed
+ */
+ public void notifyThemeChanged() {
+ // Empty icon holder
+ this.mIconHolder = new IconHolder();
+ }
}
diff --git a/src/com/cyanogenmod/filemanager/adapters/CheckableListAdapter.java b/src/com/cyanogenmod/filemanager/adapters/CheckableListAdapter.java
index 47a210b5..e9960ac4 100644
--- a/src/com/cyanogenmod/filemanager/adapters/CheckableListAdapter.java
+++ b/src/com/cyanogenmod/filemanager/adapters/CheckableListAdapter.java
@@ -25,6 +25,8 @@ import android.widget.ImageView;
import android.widget.TextView;
import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import java.util.List;
@@ -114,12 +116,23 @@ public class CheckableListAdapter extends ArrayAdapter<CheckableListAdapter.Chec
if (v == null) {
//Create the view holder
LayoutInflater li =
- (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = li.inflate(R.layout.option_list_item, parent, false);
ViewHolder viewHolder = new CheckableListAdapter.ViewHolder();
viewHolder.mTvTitle = (TextView)v.findViewById(RESOURCE_ITEM_NAME);
viewHolder.mDwCheck = (ImageView)v.findViewById(RESOURCE_ITEM_CHECK);
v.setTag(viewHolder);
+
+ // Apply theme
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setBackgroundDrawable(
+ getContext(), v,
+ "menu_checkable_selector_drawable"); //$NON-NLS-1$
+ theme.setTextColor(
+ getContext(), viewHolder.mTvTitle, "text_color"); //$NON-NLS-1$
+ theme.setImageDrawable(
+ getContext(), viewHolder.mDwCheck,
+ "popup_checkable_selector_drawable"); //$NON-NLS-1$
}
//Retrieve the item
diff --git a/src/com/cyanogenmod/filemanager/adapters/FileSystemObjectAdapter.java b/src/com/cyanogenmod/filemanager/adapters/FileSystemObjectAdapter.java
index ec653891..bc25c5cc 100644
--- a/src/com/cyanogenmod/filemanager/adapters/FileSystemObjectAdapter.java
+++ b/src/com/cyanogenmod/filemanager/adapters/FileSystemObjectAdapter.java
@@ -32,6 +32,8 @@ import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.model.FileSystemObject;
import com.cyanogenmod.filemanager.model.ParentDirectory;
import com.cyanogenmod.filemanager.ui.IconHolder;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.FileHelper;
import com.cyanogenmod.filemanager.util.MimeTypeHelper;
@@ -150,10 +152,8 @@ public class FileSystemObjectAdapter
* Method that loads the default icons (known icons and more common icons).
*/
private void loadDefaultIcons() {
- this.mIconHolder.getDrawable(getContext(), R.drawable.btn_holo_light_check_on_normal);
- this.mIconHolder.getDrawable(getContext(), R.drawable.btn_holo_light_check_off_normal);
- this.mIconHolder.getDrawable(getContext(), R.drawable.ic_fso_default);
- this.mIconHolder.getDrawable(getContext(), R.drawable.ic_fso_folder);
+ this.mIconHolder.getDrawable(getContext(), "ic_fso_folder_drawable"); //$NON-NLS-1$
+ this.mIconHolder.getDrawable(getContext(), "ic_fso_default_drawable"); //$NON-NLS-1$
}
/**
@@ -197,6 +197,7 @@ public class FileSystemObjectAdapter
* Method that process the data before use {@link #getView} method.
*/
private void processData() {
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
Resources res = getContext().getResources();
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
this.mData = new DataHolder[getCount()];
@@ -218,11 +219,15 @@ public class FileSystemObjectAdapter
//Build the data holder
this.mData[i] = new FileSystemObjectAdapter.DataHolder();
this.mData[i].mSelected = this.mSelectedItems.contains(fso);
- this.mData[i].mDwCheck = (this.mData[i].mSelected)
- ? this.mIconHolder.getDrawable(
- getContext(), R.drawable.btn_holo_light_check_on_normal)
- : this.mIconHolder.getDrawable(
- getContext(), R.drawable.btn_holo_light_check_off_normal);
+ if (this.mData[i].mSelected) {
+ this.mData[i].mDwCheck =
+ theme.getDrawable(
+ getContext(), "checkbox_selected_drawable"); //$NON-NLS-1$
+ } else {
+ this.mData[i].mDwCheck =
+ theme.getDrawable(
+ getContext(), "checkbox_deselected_drawable"); //$NON-NLS-1$
+ }
this.mData[i].mDwIcon = this.mIconHolder.getDrawable(
getContext(),
MimeTypeHelper.getIcon(getContext(), fso));
@@ -266,6 +271,21 @@ public class FileSystemObjectAdapter
//Retrieve the view holder
ViewHolder viewHolder = (ViewHolder)v.getTag();
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setBackgroundDrawable(
+ getContext(), v, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(
+ getContext(), viewHolder.mTvName, "text_color"); //$NON-NLS-1$
+ if (viewHolder.mTvSummary != null) {
+ theme.setTextColor(
+ getContext(), viewHolder.mTvSummary, "text_color"); //$NON-NLS-1$
+ }
+ if (viewHolder.mTvSize != null) {
+ theme.setTextColor(
+ getContext(), viewHolder.mTvSize, "text_color"); //$NON-NLS-1$
+ }
+
//Set the data
viewHolder.mIvIcon.setImageDrawable(dataHolder.mDwIcon);
viewHolder.mTvName.setText(dataHolder.mName);
@@ -281,10 +301,15 @@ public class FileSystemObjectAdapter
FileHelper.PARENT_DIRECTORY) == 0 ? View.INVISIBLE : View.VISIBLE);
viewHolder.mBtCheck.setImageDrawable(dataHolder.mDwCheck);
viewHolder.mBtCheck.setTag(Integer.valueOf(position));
- v.setBackgroundResource(
- dataHolder.mSelected
- ? R.drawable.holo_list_selector_selected
- : R.drawable.holo_list_selector_deseleted);
+
+ // Apply theme
+ if (dataHolder.mSelected) {
+ theme.setBackgroundDrawable(
+ getContext(), v, "selectors_selected_drawable"); //$NON-NLS-1$
+ } else {
+ theme.setBackgroundDrawable(
+ getContext(), v, "selectors_deselected_drawable"); //$NON-NLS-1$
+ }
}
//Return the view
@@ -328,6 +353,7 @@ public class FileSystemObjectAdapter
*/
private void toggleSelection(View v, FileSystemObject fso) {
if (this.mData != null) {
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
int cc = this.mData.length;
for (int i = 0; i < cc; i++) {
DataHolder data = this.mData[i];
@@ -337,17 +363,29 @@ public class FileSystemObjectAdapter
if (v != null) {
((View)v.getParent()).setSelected(data.mSelected);
}
- data.mDwCheck = data.mSelected
- ? this.mIconHolder.getDrawable(
- getContext(), R.drawable.btn_holo_light_check_on_normal)
- : this.mIconHolder.getDrawable(
- getContext(), R.drawable.btn_holo_light_check_off_normal);
+ if (data.mSelected) {
+ data.mDwCheck =
+ theme.getDrawable(
+ getContext(), "checkbox_selected_drawable"); //$NON-NLS-1$
+ } else {
+ data.mDwCheck =
+ theme.getDrawable(
+ getContext(),
+ "checkbox_deselected_drawable"); //$NON-NLS-1$
+ }
if (v != null) {
((ImageView)v).setImageDrawable(data.mDwCheck);
- ((View)v.getParent()).setBackgroundResource(
- data.mSelected
- ? R.drawable.holo_list_selector_selected
- : R.drawable.holo_list_selector_deseleted);
+ if (data.mSelected) {
+ theme.setBackgroundDrawable(
+ getContext(),
+ (View)v.getParent(),
+ "selectors_selected_drawable"); //$NON-NLS-1$
+ } else {
+ theme.setBackgroundDrawable(
+ getContext(),
+ (View)v.getParent(),
+ "selectors_deselected_drawable"); //$NON-NLS-1$
+ }
}
//Add or remove from the global selected items
@@ -401,6 +439,7 @@ public class FileSystemObjectAdapter
*/
private void doSelectDeselectAllVisibleItems(boolean select) {
if (this.mData != null && this.mData.length > 0) {
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
int cc = this.mData.length;
for (int i = 0; i < cc; i++) {
DataHolder data = this.mData[i];
@@ -409,11 +448,15 @@ public class FileSystemObjectAdapter
continue;
}
data.mSelected = select;
- data.mDwCheck = data.mSelected
- ? this.mIconHolder.getDrawable(
- getContext(), R.drawable.btn_holo_light_check_on_normal)
- : this.mIconHolder.getDrawable(
- getContext(), R.drawable.btn_holo_light_check_off_normal);
+ if (data.mSelected) {
+ data.mDwCheck =
+ theme.getDrawable(
+ getContext(), "checkbox_selected_drawable"); //$NON-NLS-1$
+ } else {
+ data.mDwCheck =
+ theme.getDrawable(
+ getContext(), "checkbox_deselected_drawable"); //$NON-NLS-1$
+ }
//Add or remove from the global selected items
FileSystemObject fso = getItem(i);
@@ -477,5 +520,12 @@ public class FileSystemObjectAdapter
}
}
+ /**
+ * Method that should be invoked when the theme of the app was changed
+ */
+ public void notifyThemeChanged() {
+ // Empty icon holder
+ this.mIconHolder = new IconHolder();
+ }
}
diff --git a/src/com/cyanogenmod/filemanager/adapters/HighlightedSimpleMenuListAdapter.java b/src/com/cyanogenmod/filemanager/adapters/HighlightedSimpleMenuListAdapter.java
index f2b50442..ee3e6fdb 100644
--- a/src/com/cyanogenmod/filemanager/adapters/HighlightedSimpleMenuListAdapter.java
+++ b/src/com/cyanogenmod/filemanager/adapters/HighlightedSimpleMenuListAdapter.java
@@ -22,6 +22,8 @@ import android.view.ViewGroup;
import android.widget.TextView;
import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
/**
* An implementation of {@link SimpleMenuListAdapter} with highlighted text
@@ -62,9 +64,11 @@ public class HighlightedSimpleMenuListAdapter extends SimpleMenuListAdapter {
// Highlight the text
View v = super.getView(position, convertView, parent);
if (v != null) {
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
TextView tvText = (TextView)v.findViewById(R.id.menu_item_text);
if (tvText != null) {
tvText.setTextAppearance(this.mContext, R.style.primary_text_appearance);
+ theme.setTextColor(this.mContext, tvText, "text_color"); //$NON-NLS-1$
}
}
//Return the view
diff --git a/src/com/cyanogenmod/filemanager/adapters/HistoryAdapter.java b/src/com/cyanogenmod/filemanager/adapters/HistoryAdapter.java
index bceb0653..0a604ca6 100644
--- a/src/com/cyanogenmod/filemanager/adapters/HistoryAdapter.java
+++ b/src/com/cyanogenmod/filemanager/adapters/HistoryAdapter.java
@@ -30,6 +30,8 @@ import com.cyanogenmod.filemanager.model.History;
import com.cyanogenmod.filemanager.parcelables.NavigationViewInfoParcelable;
import com.cyanogenmod.filemanager.parcelables.SearchInfoParcelable;
import com.cyanogenmod.filemanager.ui.IconHolder;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import java.util.List;
@@ -134,11 +136,12 @@ public class HistoryAdapter extends ArrayAdapter<History> {
this.mData[i] = new HistoryAdapter.DataHolder();
if (history.getItem() instanceof NavigationViewInfoParcelable) {
this.mData[i].mDwIcon =
- this.mIconHolder.getDrawable(getContext(), R.drawable.ic_fso_folder);
+ this.mIconHolder.getDrawable(
+ getContext(), "ic_fso_folder_drawable"); //$NON-NLS-1$
} else if (history.getItem() instanceof SearchInfoParcelable) {
this.mData[i].mDwIcon =
this.mIconHolder.getDrawable(
- getContext(), R.drawable.ic_holo_light_history_search);
+ getContext(), "ic_history_search_drawable"); //$NON-NLS-1$
}
this.mData[i].mName = history.getItem().getTitle();
if (this.mData[i].mName == null || this.mData[i].mName.trim().length() == 0) {
@@ -169,6 +172,17 @@ public class HistoryAdapter extends ArrayAdapter<History> {
viewHolder.mTvDirectory = (TextView)v.findViewById(RESOURCE_ITEM_DIRECTORY);
viewHolder.mTvPosition = (TextView)v.findViewById(RESOURCE_ITEM_POSITION);
v.setTag(viewHolder);
+
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setBackgroundDrawable(
+ getContext(), v, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(
+ getContext(), viewHolder.mTvName, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(
+ getContext(), viewHolder.mTvDirectory, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(
+ getContext(), viewHolder.mTvPosition, "text_color"); //$NON-NLS-1$
}
//Retrieve data holder
@@ -187,4 +201,12 @@ public class HistoryAdapter extends ArrayAdapter<History> {
return v;
}
+ /**
+ * Method that should be invoked when the theme of the app was changed
+ */
+ public void notifyThemeChanged() {
+ // Empty icon holder
+ this.mIconHolder = new IconHolder();
+ }
+
}
diff --git a/src/com/cyanogenmod/filemanager/adapters/SearchResultAdapter.java b/src/com/cyanogenmod/filemanager/adapters/SearchResultAdapter.java
index c3bf55e1..7a8027e9 100644
--- a/src/com/cyanogenmod/filemanager/adapters/SearchResultAdapter.java
+++ b/src/com/cyanogenmod/filemanager/adapters/SearchResultAdapter.java
@@ -32,6 +32,8 @@ import com.cyanogenmod.filemanager.model.SearchResult;
import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.Preferences;
import com.cyanogenmod.filemanager.ui.IconHolder;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.widgets.RelevanceView;
import com.cyanogenmod.filemanager.util.MimeTypeHelper;
import com.cyanogenmod.filemanager.util.SearchHelper;
@@ -132,8 +134,8 @@ public class SearchResultAdapter extends ArrayAdapter<SearchResult> {
* Method that loads the default icons (known icons and more common icons).
*/
private void loadDefaultIcons() {
- this.mIconHolder.getDrawable(getContext(), R.drawable.ic_fso_default);
- this.mIconHolder.getDrawable(getContext(), R.drawable.ic_fso_folder);
+ this.mIconHolder.getDrawable(getContext(), "ic_fso_folder_drawable"); //$NON-NLS-1$
+ this.mIconHolder.getDrawable(getContext(), "ic_fso_default_drawable"); //$NON-NLS-1$
}
/**
@@ -158,6 +160,10 @@ public class SearchResultAdapter extends ArrayAdapter<SearchResult> {
* Method that process the data before use {@link #getView} method.
*/
private void processData() {
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ int highlightedColor =
+ theme.getColor(getContext(), "search_highlight_color"); //$NON-NLS-1$
+
this.mData = new DataHolder[getCount()];
int cc = getCount();
for (int i = 0; i < cc; i++) {
@@ -170,7 +176,8 @@ public class SearchResultAdapter extends ArrayAdapter<SearchResult> {
this.mIconHolder.getDrawable(
getContext(), MimeTypeHelper.getIcon(getContext(), result.getFso()));
if (this.mHighlightTerms) {
- this.mData[i].mName = SearchHelper.getHighlightedName(result, this.mQueries);
+ this.mData[i].mName =
+ SearchHelper.getHighlightedName(result, this.mQueries, highlightedColor);
} else {
this.mData[i].mName = SearchHelper.getNonHighlightedName(result);
}
@@ -235,6 +242,17 @@ public class SearchResultAdapter extends ArrayAdapter<SearchResult> {
viewHolder.mTvParentDir = (TextView)v.findViewById(RESOURCE_ITEM_PARENT_DIR);
viewHolder.mWgRelevance = (RelevanceView)v.findViewById(RESOURCE_ITEM_RELEVANCE);
v.setTag(viewHolder);
+
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setBackgroundDrawable(
+ getContext(), v, "selectors_deselected_drawable"); //$NON-NLS-1$
+ theme.setTextColor(
+ getContext(), viewHolder.mTvName, "text_color"); //$NON-NLS-1$
+ if (viewHolder.mTvParentDir != null) {
+ theme.setTextColor(
+ getContext(), viewHolder.mTvParentDir, "text_color"); //$NON-NLS-1$
+ }
}
//Retrieve data holder
diff --git a/src/com/cyanogenmod/filemanager/adapters/SimpleMenuListAdapter.java b/src/com/cyanogenmod/filemanager/adapters/SimpleMenuListAdapter.java
index 0dcd5661..6b93b11a 100644
--- a/src/com/cyanogenmod/filemanager/adapters/SimpleMenuListAdapter.java
+++ b/src/com/cyanogenmod/filemanager/adapters/SimpleMenuListAdapter.java
@@ -28,6 +28,8 @@ import android.widget.TextView;
import com.android.internal.view.menu.MenuBuilder;
import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
/**
* An implementation of {@link BaseAdapter} that is associated with a
@@ -124,6 +126,7 @@ public class SimpleMenuListAdapter extends BaseAdapter {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
//Recovers the menu item
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
MenuItem menuItem = getItem(position);
//Is a separator?
@@ -133,11 +136,15 @@ public class SimpleMenuListAdapter extends BaseAdapter {
} else {
v = this.mInflater.inflate(R.layout.menu_item, parent, false);
}
+ theme.setBackgroundDrawable(
+ this.mContext, v,
+ "menu_checkable_selector_drawable"); //$NON-NLS-1$
//Set the text if has title
if (menuItem.getTitle() != null && menuItem.getTitle().length() > 0) {
TextView tvText = (TextView)v.findViewById(R.id.menu_item_text);
tvText.setText(menuItem.getTitle());
+ theme.setTextColor(this.mContext, tvText, "text_color"); //$NON-NLS-1$
}
v.setEnabled(menuItem.isEnabled());
v.setVisibility(menuItem.isVisible() ? View.VISIBLE : View.GONE);
diff --git a/src/com/cyanogenmod/filemanager/adapters/TwoColumnsMenuListAdapter.java b/src/com/cyanogenmod/filemanager/adapters/TwoColumnsMenuListAdapter.java
index 819fb963..37bbe645 100644
--- a/src/com/cyanogenmod/filemanager/adapters/TwoColumnsMenuListAdapter.java
+++ b/src/com/cyanogenmod/filemanager/adapters/TwoColumnsMenuListAdapter.java
@@ -29,6 +29,8 @@ import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.TextView;
import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
/**
* An implementation of {@link SimpleMenuListAdapter} for showing
@@ -40,6 +42,8 @@ public class TwoColumnsMenuListAdapter extends SimpleMenuListAdapter
private OnItemClickListener mOnItemClickListener;
private OnItemLongClickListener mOnItemLongClickListener;
+ private final Context mContext;
+
/**
* Constructor of <code>TwoColumnsMenuListAdapter</code>.
*
@@ -48,6 +52,7 @@ public class TwoColumnsMenuListAdapter extends SimpleMenuListAdapter
*/
public TwoColumnsMenuListAdapter(Context context, int menuResourceId) {
super(context, menuResourceId);
+ this.mContext = context;
//Separators are not support in this kind of adapter
removeSeparators();
@@ -62,8 +67,10 @@ public class TwoColumnsMenuListAdapter extends SimpleMenuListAdapter
* @param menuResourceId The resource identifier
* @param menuGroupResourceId The menu group resource identifier
*/
- public TwoColumnsMenuListAdapter(Context context, int menuResourceId, int menuGroupResourceId) {
+ public TwoColumnsMenuListAdapter(
+ Context context, int menuResourceId, int menuGroupResourceId) {
super(context, menuResourceId, menuGroupResourceId);
+ this.mContext = context;
//Separators are not support in this kind of adapter
removeSeparators();
@@ -206,6 +213,16 @@ public class TwoColumnsMenuListAdapter extends SimpleMenuListAdapter
tvText2.setOnLongClickListener(null);
}
+ // Divider
+ TextView divider = (TextView)((ViewGroup)v).getChildAt(1);
+
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
+ theme.setBackgroundDrawable(this.mContext, v, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(this.mContext, tvText1, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(this.mContext, tvText2, "text_color"); //$NON-NLS-1$
+ theme.setBackgroundDrawable(this.mContext, divider, "vertical_divider_drawable"); //$NON-NLS-1$
+
//Return the view
return v;
}
diff --git a/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java b/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java
index f5924847..86542ce6 100644
--- a/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java
+++ b/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java
@@ -704,9 +704,12 @@ public abstract class ShellConsole extends Console implements Program.ProgramLis
sb = new StringBuffer(ShellConsole.this.mSbIn.toString());
if (async) {
synchronized (ShellConsole.this.mPartialSync) {
- ((AsyncResultProgram)ShellConsole.
- this.mActiveCommand).
- onRequestStartParsePartialResult();
+ AsyncResultProgram p =
+ ((AsyncResultProgram)ShellConsole.
+ this.mActiveCommand);
+ if (p != null) {
+ p.onRequestStartParsePartialResult();
+ }
}
}
} else {
@@ -724,7 +727,9 @@ public abstract class ShellConsole extends Console implements Program.ProgramLis
AsyncResultProgram program =
((AsyncResultProgram)ShellConsole.this.mActiveCommand);
String partial = sb.toString();
- program.onRequestParsePartialResult(partial);
+ if (program != null) {
+ program.onRequestParsePartialResult(partial);
+ }
ShellConsole.this.toStdIn(partial);
// Reset the temp buffer
@@ -821,7 +826,9 @@ public abstract class ShellConsole extends Console implements Program.ProgramLis
if (ShellConsole.this.mStarted && async) {
AsyncResultProgram program =
((AsyncResultProgram)ShellConsole.this.mActiveCommand);
- program.parsePartialErrResult(new String(new char[]{(char)r}));
+ if (program != null) {
+ program.parsePartialErrResult(new String(new char[]{(char)r}));
+ }
}
toStdErr(sb.toString());
@@ -851,7 +858,9 @@ public abstract class ShellConsole extends Console implements Program.ProgramLis
if (async) {
AsyncResultProgram program =
((AsyncResultProgram)ShellConsole.this.mActiveCommand);
- program.parsePartialErrResult(s);
+ if (program != null) {
+ program.parsePartialErrResult(s);
+ }
}
toStdErr(s);
diff --git a/src/com/cyanogenmod/filemanager/preferences/FileManagerSettings.java b/src/com/cyanogenmod/filemanager/preferences/FileManagerSettings.java
index e161084d..a414f9f4 100644
--- a/src/com/cyanogenmod/filemanager/preferences/FileManagerSettings.java
+++ b/src/com/cyanogenmod/filemanager/preferences/FileManagerSettings.java
@@ -127,9 +127,14 @@ public enum FileManagerSettings {
* When to show debug traces
* @hide
*/
- SETTINGS_SHOW_TRACES("cm_filemanager_show_debug_traces", Boolean.FALSE); //$NON-NLS-1$
-
+ SETTINGS_SHOW_TRACES("cm_filemanager_show_debug_traces", Boolean.FALSE), //$NON-NLS-1$
+ /**
+ * The current theme to use in the app
+ * @hide
+ */
+ SETTINGS_THEME("cm_filemanager_theme", //$NON-NLS-1$
+ "com.cyanogenmod.filemanager:light"); //$NON-NLS-1$
/**
* A broadcast intent that is sent when a setting was changed
@@ -138,6 +143,12 @@ public enum FileManagerSettings {
"com.cyanogenmod.filemanager.INTENT_SETTING_CHANGED"; //$NON-NLS-1$
/**
+ * A broadcast intent that is sent when a theme was changed
+ */
+ public final static String INTENT_THEME_CHANGED =
+ "com.cyanogenmod.filemanager.INTENT_THEME_CHANGED"; //$NON-NLS-1$
+
+ /**
* A broadcast intent that is sent when a file was changed
*/
public final static String INTENT_FILE_CHANGED =
@@ -153,6 +164,16 @@ public enum FileManagerSettings {
*/
public final static String EXTRA_FILE_CHANGED_KEY = "file"; //$NON-NLS-1$
+ /**
+ * The extra key with the file key that was changed
+ */
+ public final static String EXTRA_THEME_PACKAGE = "package"; //$NON-NLS-1$
+
+ /**
+ * The extra key with the identifier of theme that was changed
+ */
+ public final static String EXTRA_THEME_ID = "id"; //$NON-NLS-1$
+
diff --git a/src/com/cyanogenmod/filemanager/tasks/FilesystemAsyncTask.java b/src/com/cyanogenmod/filemanager/tasks/FilesystemAsyncTask.java
index 81be9035..dceeed5f 100644
--- a/src/com/cyanogenmod/filemanager/tasks/FilesystemAsyncTask.java
+++ b/src/com/cyanogenmod/filemanager/tasks/FilesystemAsyncTask.java
@@ -17,7 +17,6 @@
package com.cyanogenmod.filemanager.tasks;
import android.content.Context;
-import android.content.res.Resources;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffColorFilter;
import android.os.AsyncTask;
@@ -25,9 +24,10 @@ import android.util.Log;
import android.widget.ImageView;
import android.widget.ProgressBar;
-import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.model.DiskUsage;
import com.cyanogenmod.filemanager.model.MountPoint;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.MountPointHelper;
/**
@@ -40,6 +40,10 @@ public class FilesystemAsyncTask extends AsyncTask<String, Integer, Boolean> {
/**
* @hide
*/
+ final Context mContext;
+ /**
+ * @hide
+ */
final ImageView mMountPointInfo;
/**
* @hide
@@ -55,10 +59,6 @@ public class FilesystemAsyncTask extends AsyncTask<String, Integer, Boolean> {
* @hide
*/
static int sColorFilterNormal;
- /**
- * @hide
- */
- static int sColorFilterWarning;
/**
* Constructor of <code>FilesystemAsyncTask</code>.
@@ -72,17 +72,11 @@ public class FilesystemAsyncTask extends AsyncTask<String, Integer, Boolean> {
Context context, ImageView mountPointInfo,
ProgressBar diskUsageInfo, int freeDiskSpaceWarningLevel) {
super();
+ this.mContext = context;
this.mMountPointInfo = mountPointInfo;
this.mDiskUsageInfo = diskUsageInfo;
this.mFreeDiskSpaceWarningLevel = freeDiskSpaceWarningLevel;
this.mRunning = false;
-
- if (sColorFilterNormal == 0 || sColorFilterWarning == 0) {
- Resources res = context.getResources();
- sColorFilterNormal = res.getColor(R.color.disk_usage_color_filter_normal);
- sColorFilterWarning = res.getColor(R.color.disk_usage_color_filter_warning);
- }
-
}
/**
@@ -118,8 +112,11 @@ public class FilesystemAsyncTask extends AsyncTask<String, Integer, Boolean> {
this.mMountPointInfo.post(new Runnable() {
@Override
public void run() {
- FilesystemAsyncTask.this.mMountPointInfo.setImageResource(
- R.drawable.ic_holo_light_fs_warning);
+ Theme theme = ThemeManager.getCurrentTheme(FilesystemAsyncTask.this.mContext);
+ theme.setImageDrawable(
+ FilesystemAsyncTask.this.mContext,
+ FilesystemAsyncTask.this.mMountPointInfo,
+ "filesystem_warning_drawable"); //$NON-NLS-1$
FilesystemAsyncTask.this.mMountPointInfo.setTag(null);
}
});
@@ -131,10 +128,15 @@ public class FilesystemAsyncTask extends AsyncTask<String, Integer, Boolean> {
this.mMountPointInfo.post(new Runnable() {
@Override
public void run() {
- FilesystemAsyncTask.this.mMountPointInfo.setImageResource(
+ String resource =
MountPointHelper.isReadOnly(mp)
- ? R.drawable.ic_holo_light_fs_locked
- : R.drawable.ic_holo_light_fs_unlocked);
+ ? "filesystem_locked_drawable" //$NON-NLS-1$
+ : "filesystem_unlocked_drawable"; //$NON-NLS-1$
+ Theme theme = ThemeManager.getCurrentTheme(FilesystemAsyncTask.this.mContext);
+ theme.setImageDrawable(
+ FilesystemAsyncTask.this.mContext,
+ FilesystemAsyncTask.this.mMountPointInfo,
+ resource);
FilesystemAsyncTask.this.mMountPointInfo.setTag(mp);
}
});
@@ -166,10 +168,15 @@ public class FilesystemAsyncTask extends AsyncTask<String, Integer, Boolean> {
}
// Advise about diskusage (>=mFreeDiskSpaceWarningLevel) with other color
+ Theme theme = ThemeManager.getCurrentTheme(FilesystemAsyncTask.this.mContext);
int filter =
usage >= FilesystemAsyncTask.this.mFreeDiskSpaceWarningLevel ?
- sColorFilterWarning :
- sColorFilterNormal;
+ theme.getColor(
+ FilesystemAsyncTask.this.mContext,
+ "disk_usage_filter_warning_color") : //$NON-NLS-1$
+ theme.getColor(
+ FilesystemAsyncTask.this.mContext,
+ "disk_usage_filter_normal_color"); //$NON-NLS-1$
FilesystemAsyncTask.this.mDiskUsageInfo.
getProgressDrawable().setColorFilter(
new PorterDuffColorFilter(filter, Mode.MULTIPLY));
diff --git a/src/com/cyanogenmod/filemanager/ui/IconHolder.java b/src/com/cyanogenmod/filemanager/ui/IconHolder.java
index 14f62176..df60a81f 100644
--- a/src/com/cyanogenmod/filemanager/ui/IconHolder.java
+++ b/src/com/cyanogenmod/filemanager/ui/IconHolder.java
@@ -17,23 +17,26 @@
package com.cyanogenmod.filemanager.ui;
import android.content.Context;
-import android.content.res.Resources;
import android.graphics.drawable.Drawable;
-import android.util.SparseArray;
+
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
+
+import java.util.HashMap;
+import java.util.Map;
/**
* A class that holds icons for a more efficient access.
*/
public class IconHolder {
- private final SparseArray<Drawable> mIcons;
+ private final Map<String, Drawable> mIcons;
/**
* Constructor of <code>IconHolder</code>.
*/
public IconHolder() {
super();
- this.mIcons = new SparseArray<Drawable>();
+ this.mIcons = new HashMap<String, Drawable>();
}
/**
@@ -44,15 +47,15 @@ public class IconHolder {
* @param resid The resource identifier
* @return Drawable The drawable icon reference
*/
- public Drawable getDrawable(Context context, final int resid) {
+ public Drawable getDrawable(Context context, final String resid) {
//Check if the icon exists in the cache
- if (this.mIcons.indexOfKey(resid) > 0) {
+ if (this.mIcons.containsKey(resid)) {
return this.mIcons.get(resid);
}
//Load the drawable, cache and returns reference
- Resources res = context.getResources();
- Drawable dw = res.getDrawable(resid);
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ Drawable dw = theme.getDrawable(context, resid);
this.mIcons.put(resid, dw);
return dw;
}
diff --git a/src/com/cyanogenmod/filemanager/ui/ThemeManager.java b/src/com/cyanogenmod/filemanager/ui/ThemeManager.java
new file mode 100644
index 00000000..d1fd30df
--- /dev/null
+++ b/src/com/cyanogenmod/filemanager/ui/ThemeManager.java
@@ -0,0 +1,629 @@
+/*
+ * Copyright (C) 2012 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.cyanogenmod.filemanager.ui;
+
+import android.app.ActionBar;
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A class that manage the use of themes inside the application.
+ */
+public final class ThemeManager {
+
+ private static final String TAG = "ThemeManager"; //$NON-NLS-1$
+
+ private static boolean DEBUG = false;
+
+ /**
+ * The permission that MUST have the activity that holds the themes
+ */
+ public static final String PERMISSION_READ_THEME =
+ "com.cyanogenmod.filemanager.permissions.READ_THEME"; //$NON-NLS-1$
+
+ /**
+ * The action that MUST have all app that want to register as a theme for this app
+ */
+ public static final String ACTION_MAIN_THEME =
+ "com.cyanogenmod.filemanager.actions.MAIN_THEME"; //$NON-NLS-1$
+
+ /**
+ * The category that MUST have all app that want to register as a theme for this app
+ */
+ public static final String CATEGORY_THEME =
+ "com.cyanogenmod.filemanager.categories.THEME"; //$NON-NLS-1$
+
+ private static final String RESOURCE_THEMES_IDS = "themes_ids"; //$NON-NLS-1$
+ private static final String RESOURCE_THEMES_NAMES = "themes_names"; //$NON-NLS-1$
+ private static final String RESOURCE_THEMES_DESCRIPTIONS = "themes_descriptions"; //$NON-NLS-1$
+ private static final String RESOURCE_THEMES_AUTHOR = "themes_author"; //$NON-NLS-1$
+
+ /**
+ * @hide
+ */
+ static Theme mDefaultTheme;
+ private static Theme mCurrentTheme;
+
+ /**
+ * Method that returns the current theme
+ *
+ * @param ctx The current context
+ * @return Theme The current theme
+ */
+ public static synchronized Theme getCurrentTheme(Context ctx) {
+ if (mCurrentTheme == null) {
+ // Use the default theme
+ mCurrentTheme = getDefaultTheme(ctx);
+ }
+ return mCurrentTheme;
+ }
+
+ /**
+ * Method that returns the default theme
+ *
+ * @param ctx The current context
+ * @return Theme The default theme
+ */
+ public static synchronized Theme getDefaultTheme(Context ctx) {
+ if (mDefaultTheme == null) {
+ // Use the default theme
+ mDefaultTheme = new Theme();
+ String themeSettings = (String)FileManagerSettings.SETTINGS_THEME.getDefaultValue();
+ mDefaultTheme.mPackage =
+ themeSettings.substring(0, themeSettings.indexOf(":")); //$NON-NLS-1$
+ mDefaultTheme.mId =
+ themeSettings.substring(themeSettings.indexOf(":") + 1); //$NON-NLS-1$
+ mDefaultTheme.mName = ctx.getString(R.string.theme_default_name);
+ mDefaultTheme.mDescription = ctx.getString(R.string.theme_default_description);
+ mDefaultTheme.mAuthor = ctx.getString(R.string.themes_author);
+
+ mDefaultTheme.mContext = ctx;
+ mDefaultTheme.mResources = ctx.getResources();
+ }
+ return mDefaultTheme;
+ }
+
+ /**
+ * A method for set the current theme that should be applied to the UI.
+ *
+ * @param ctx The current context (of this application)
+ * @param theme The theme of the app (package:id)
+ * @return boolean If the theme was set
+ */
+ public static synchronized boolean setCurrentTheme(Context ctx, String theme) {
+ // Retrieve the available themes
+ List<Theme> themes = getAvailableThemes(ctx);
+ String themePackage = theme.substring(0, theme.indexOf(":")); //$NON-NLS-1$
+ String themeId = theme.substring(theme.indexOf(":") + 1); //$NON-NLS-1$
+ int cc = themes.size();
+ for (int i = 0; i < cc; i++) {
+ Theme t = themes.get(i);
+ if (t.mPackage.compareTo(themePackage) == 0 && t.mId.compareTo(themeId) == 0) {
+ // We have the theme. Save it and notify
+ mCurrentTheme = t;
+
+ Intent intent = new Intent(FileManagerSettings.INTENT_THEME_CHANGED);
+ intent.putExtra(FileManagerSettings.EXTRA_THEME_PACKAGE, t.mPackage);
+ intent.putExtra(FileManagerSettings.EXTRA_THEME_ID, t.mId);
+ ctx.sendBroadcast(intent);
+ return true;
+ }
+ }
+
+ // Not found
+ return false;
+ }
+
+ /**
+ * Method that returns the list of available themes for the file manager app.
+ *
+ * @param ctx The current context
+ * @return List<Theme> List of themes
+ */
+ public static List<Theme> getAvailableThemes(Context ctx) {
+ Intent intent = new Intent(ACTION_MAIN_THEME);
+ intent.addCategory(CATEGORY_THEME);
+ if (DEBUG) {
+ intent.addFlags(Intent.FLAG_DEBUG_LOG_RESOLUTION);
+ }
+
+ // Obtain the list of packages that matches with theme requirements for register as
+ // a file manager theme
+ PackageManager pm = ctx.getPackageManager();
+ List<ResolveInfo> result =
+ pm.queryIntentActivities(intent, 0);
+
+ // Read now the information about the themes
+ List<Theme> themes = new ArrayList<Theme>();
+ int cc = result.size();
+ for (int i = 0; i < cc; i++) {
+ try {
+ ResolveInfo info = result.get(i);
+ String appPackage = info.activityInfo.packageName;
+
+ // Check permission for read theme
+ String appPermission = info.activityInfo.permission;
+ if (appPermission == null || appPermission.compareTo(PERMISSION_READ_THEME) != 0) {
+ Log.w(TAG, String.format(
+ "\"%s\" hasn't READ_THEME permission. Ignored.", //$NON-NLS-1$
+ appPackage));
+ continue;
+ }
+
+ Resources appResources = pm.getResourcesForApplication(appPackage);
+ if (appResources != null) {
+ // We need the ids, names, descriptions and author of every
+ // theme in the application
+
+ //- Identifiers
+ int identifiers =
+ appResources.getIdentifier(
+ RESOURCE_THEMES_IDS,
+ "array", //$NON-NLS-1$
+ appPackage);
+ if (identifiers == 0) continue;
+ String[] ids = appResources.getStringArray(identifiers);
+
+ //- Name
+ int namesId =
+ appResources.getIdentifier(
+ RESOURCE_THEMES_NAMES,
+ "array", //$NON-NLS-1$
+ appPackage);
+ if (namesId == 0) continue;
+ String[] names = appResources.getStringArray(namesId);
+
+ //- Descriptions
+ int descriptionsId =
+ appResources.getIdentifier(
+ RESOURCE_THEMES_DESCRIPTIONS,
+ "array", //$NON-NLS-1$
+ appPackage);
+ if (descriptionsId == 0) continue;
+ String[] descriptions = appResources.getStringArray(descriptionsId);
+
+ //- Author
+ int authorId =
+ appResources.getIdentifier(
+ RESOURCE_THEMES_AUTHOR,
+ "string", //$NON-NLS-1$
+ appPackage);
+ if (authorId == 0) continue;
+ String author = appResources.getString(authorId);
+
+ // Get the resources and the context
+ Context context = ctx.createPackageContext(
+ appPackage, Context.CONTEXT_RESTRICTED);
+ Resources resources = pm.getResourcesForApplication(appPackage);
+
+ // Add every theme found
+ for (int j = 0; j < names.length; j++) {
+ Theme theme = new Theme();
+ theme.mPackage = appPackage;
+ theme.mId = ids[j];
+ theme.mName = names[j];
+ theme.mDescription = descriptions[j];
+ theme.mAuthor = author;
+ theme.mContext = context;
+ theme.mResources = resources;
+ themes.add(theme);
+
+ if (DEBUG) {
+ Log.v(TAG, String.format("Found theme: %s", theme)); //$NON-NLS-1$
+ }
+ }
+ }
+
+ } catch (Exception e) {/**NON BLOCK**/}
+ }
+
+ // Return the themes found
+ themes.add(0, getDefaultTheme(ctx));
+ return themes;
+ }
+
+ /**
+ * Method that returns if the theme is the default theme
+ *
+ * @param theme The theme to check
+ * @return boolean Id the current theme is the default theme
+ */
+ public static boolean isDefaultTheme(Theme theme) {
+ String themeSettings = (String)FileManagerSettings.SETTINGS_THEME.getDefaultValue();
+ String defaultPackage =
+ themeSettings.substring(0, themeSettings.indexOf(":")); //$NON-NLS-1$
+ String defaultId =
+ themeSettings.substring(themeSettings.indexOf(":") + 1); //$NON-NLS-1$
+ return theme.mPackage.compareTo(defaultPackage) == 0 &&
+ theme.mId.compareTo(defaultId) == 0;
+ }
+
+
+ /**
+ * A class that represents a theme for the file manager app.
+ */
+ public static class Theme implements Comparable<Theme> {
+
+ String mPackage;
+ String mId;
+ String mName;
+ String mDescription;
+ String mAuthor;
+
+ Context mContext;
+ Resources mResources;
+
+ /**
+ * Constructor of <code>Theme</code>
+ */
+ Theme() {
+ super();
+ }
+
+ /**
+ * Method that returns the composed identifier
+ *
+ * @return String The composed identifier
+ */
+ public String getComposedId() {
+ return String.format("%s:%s", this.mPackage, this.mId); //$NON-NLS-1$
+ }
+
+ /**
+ * Method that returns the package name of the apk that contains the theme
+ *
+ * @return String The package name of the apk that contains the theme
+ */
+ public String getPackage() {
+ return this.mPackage;
+ }
+
+ /**
+ * Method that returns the id of the theme inside the themes apk
+ *
+ * @return String The id of the theme inside the themes apk
+ */
+ public String getId() {
+ return this.mId;
+ }
+
+ /**
+ * Method that returns the name of the theme
+ *
+ * @return String The name of the theme
+ */
+ public String getName() {
+ return this.mName;
+ }
+
+ /**
+ * Method that returns the description of the theme
+ *
+ * @return String The description of the theme
+ */
+ public String getDescription() {
+ return this.mDescription;
+ }
+
+ /**
+ * Method that returns the author of the theme
+ *
+ * @return String The author of the theme
+ */
+ public String getAuthor() {
+ return this.mAuthor;
+ }
+
+ /**
+ * Method that returns the preview image of the current theme
+ *
+ * @param ctx The current context
+ * @return Drawable The drawable
+ */
+ public Drawable getPreviewImage(Context ctx) {
+ String resId = "theme_preview_drawable"; //$NON-NLS-1$
+ if (this.compareTo(ThemeManager.getDefaultTheme(ctx)) != 0) {
+ resId =
+ String.format(
+ "%s_%s", //$NON-NLS-1$
+ this.mId,
+ "theme_preview_drawable"); //$NON-NLS-1$
+ }
+ int id = this.mResources.getIdentifier(resId, "drawable", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ return this.mResources.getDrawable(id);
+ }
+ return null;
+ }
+
+ /**
+ * Method that returns the preview image of the current theme
+ *
+ * @param ctx The current context
+ * @return Drawable The drawable
+ */
+ public Drawable getNoPreviewImage(Context ctx) {
+ String resId =
+ String.format(
+ "%s_%s", //$NON-NLS-1$
+ this.mId,
+ "theme_no_preview_drawable"); //$NON-NLS-1$
+ int id = this.mResources.getIdentifier(resId, "drawable", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ return this.mResources.getDrawable(id);
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ "theme_no_preview_drawable", //$NON-NLS-1$
+ "drawable", //$NON-NLS-1$
+ mDefaultTheme.mPackage);
+ return mDefaultTheme.mResources.getDrawable(id);
+ }
+
+ /**
+ * Method that sets the base theme of the current context
+ *
+ * @param ctx The current context
+ * @param overlay Indicates if the theme should be the overlay one
+ */
+ public void setBaseTheme(Context ctx, boolean overlay) {
+ String resId =
+ String.format("%s_%s", this.mId, "base_theme"); //$NON-NLS-1$ //$NON-NLS-2$
+ int id = this.mResources.getIdentifier(resId, "string", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ String base = this.mResources.getString(id, "holo_light"); //$NON-NLS-1$
+ int themeId = base.compareTo("holo") == 0 ? //$NON-NLS-1$
+ R.style.FileManager_Theme_Holo :
+ R.style.FileManager_Theme_Holo_Light;
+ if (overlay) {
+ themeId = base.compareTo("holo") == 0 ? //$NON-NLS-1$
+ R.style.FileManager_Theme_Holo_Overlay :
+ R.style.FileManager_Theme_Holo_Light_Overlay;
+ }
+ ctx.setTheme(themeId);
+ return;
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ "base_theme", "string", mDefaultTheme.mPackage); //$NON-NLS-1$ //$NON-NLS-2$
+ String base = this.mResources.getString(id, "holo_light"); //$NON-NLS-1$
+ int themeId = base.compareTo("holo") == 0 ? //$NON-NLS-1$
+ R.style.FileManager_Theme_Holo :
+ R.style.FileManager_Theme_Holo_Light;
+ if (overlay) {
+ themeId = base.compareTo("holo") == 0 ? //$NON-NLS-1$
+ R.style.FileManager_Theme_Holo_Overlay :
+ R.style.FileManager_Theme_Holo_Light_Overlay;
+ }
+ ctx.setTheme(themeId);
+ }
+
+ /**
+ * Method that sets the titlebar drawable of an ActionBar
+ *
+ * @param ctx The current context
+ * @param actionBar The action bar
+ * @param resource The string resource
+ */
+ public void setTitlebarDrawable(Context ctx, ActionBar actionBar, String resource) {
+ String resId = String.format("%s_%s", this.mId, resource); //$NON-NLS-1$
+ int id = this.mResources.getIdentifier(resId, "drawable", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ actionBar.setBackgroundDrawable(this.mResources.getDrawable(id));
+ return;
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ resource, "drawable", mDefaultTheme.mPackage); //$NON-NLS-1$
+ actionBar.setBackgroundDrawable(mDefaultTheme.mResources.getDrawable(id));
+ }
+
+ /**
+ * Method that sets the background drawable of a View
+ *
+ * @param ctx The current context
+ * @param view The view which apply the style
+ * @param resource The string resource
+ */
+ public void setBackgroundDrawable(Context ctx, View view, String resource) {
+ String resId = String.format("%s_%s", this.mId, resource); //$NON-NLS-1$
+ int id = this.mResources.getIdentifier(resId, "drawable", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ view.setBackground(this.mResources.getDrawable(id));
+ return;
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ resource, "drawable", mDefaultTheme.mPackage); //$NON-NLS-1$
+ view.setBackground(mDefaultTheme.mResources.getDrawable(id));
+ }
+
+ /**
+ * Method that sets the image drawable of a ImageView
+ *
+ * @param ctx The current context
+ * @param view The view which apply the style
+ * @param resource The string resource
+ */
+ public void setImageDrawable(Context ctx, ImageView view, String resource) {
+ String resId = String.format("%s_%s", this.mId, resource); //$NON-NLS-1$
+ int id = this.mResources.getIdentifier(resId, "drawable", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ view.setImageDrawable(this.mResources.getDrawable(id));
+ return;
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ resource, "drawable", mDefaultTheme.mPackage); //$NON-NLS-1$
+ view.setImageDrawable(mDefaultTheme.mResources.getDrawable(id));
+ }
+
+ /**
+ * Method that returns an image drawable of the current theme
+ *
+ * @param ctx The current context
+ * @param resource The string resource
+ * @return Drawable The drawable
+ */
+ public Drawable getDrawable(Context ctx, String resource) {
+ String resId = String.format("%s_%s", this.mId, resource); //$NON-NLS-1$
+ int id = this.mResources.getIdentifier(resId, "drawable", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ return this.mResources.getDrawable(id);
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ resource, "drawable", mDefaultTheme.mPackage); //$NON-NLS-1$
+ return mDefaultTheme.mResources.getDrawable(id);
+ }
+
+ /**
+ * Method that sets the text color of a TextView
+ *
+ * @param ctx The current context
+ * @param view The view which apply the style
+ * @param resource The string resource
+ */
+ public void setTextColor(Context ctx, TextView view, String resource) {
+ String resId = String.format("%s_%s", this.mId, resource); //$NON-NLS-1$
+ int id = this.mResources.getIdentifier(resId, "color", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ view.setTextColor(this.mResources.getColor(id));
+ return;
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ resource, "color", mDefaultTheme.mPackage); //$NON-NLS-1$
+ view.setTextColor(mDefaultTheme.mResources.getColor(id));
+ }
+
+ /**
+ * Method that returns a color from the theme
+ *
+ * @param ctx The current context
+ * @param resource The string resource
+ * @return int The color reference
+ */
+ public int getColor(Context ctx, String resource) {
+ String resId = String.format("%s_%s", this.mId, resource); //$NON-NLS-1$
+ int id = this.mResources.getIdentifier(resId, "color", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ return this.mResources.getColor(id);
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ resource, "color", mDefaultTheme.mPackage); //$NON-NLS-1$
+ return mDefaultTheme.mResources.getColor(id);
+ }
+
+ /**
+ * Method that sets the background color of a View
+ *
+ * @param ctx The current context
+ * @param view The view which apply the style
+ * @param resource The string resource
+ */
+ public void setBackgroundColor(Context ctx, View view, String resource) {
+ String resId = String.format("%s_%s", this.mId, resource); //$NON-NLS-1$
+ int id = this.mResources.getIdentifier(resId, "color", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ view.setBackgroundColor(this.mResources.getColor(id));
+ return;
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ resource, "color", mDefaultTheme.mPackage); //$NON-NLS-1$
+ view.setBackgroundColor(mDefaultTheme.mResources.getColor(id));
+ }
+
+ /**
+ * Method that set the style of the dialog.
+ *
+ * @param ctx The current context
+ * @param dialog The dialog which apply the style
+ */
+ @SuppressWarnings("deprecation")
+ public void setDialogStyle(Context ctx, AlertDialog dialog) {
+ applyButtonStyle(ctx, dialog.getButton(DialogInterface.BUTTON1));
+ applyButtonStyle(ctx, dialog.getButton(DialogInterface.BUTTON2));
+ applyButtonStyle(ctx, dialog.getButton(DialogInterface.BUTTON3));
+ applyButtonStyle(ctx, dialog.getButton(DialogInterface.BUTTON_NEGATIVE));
+ applyButtonStyle(ctx, dialog.getButton(DialogInterface.BUTTON_NEUTRAL));
+ applyButtonStyle(ctx, dialog.getButton(DialogInterface.BUTTON_POSITIVE));
+ }
+
+ /**
+ * Method that apply the current style to a button
+ *
+ * @param ctx The current context
+ * @param button The button which apply the style
+ */
+ private void applyButtonStyle(Context ctx, Button button) {
+ if (button != null) {
+ setBackgroundDrawable(ctx, button, "selectors_button_drawable"); //$NON-NLS-1$
+ setTextColor(ctx, button, "text_color"); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String toString() {
+ return "Theme [Package=" + this.mPackage + //$NON-NLS-1$
+ ", Id=" + this.mId + //$NON-NLS-1$
+ ", Name=" + this.mName //$NON-NLS-1$
+ + ", Description=" + this.mDescription //$NON-NLS-1$
+ + ", Author=" + this.mAuthor + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int compareTo(Theme another) {
+ return getComposedId().compareTo(another.getComposedId());
+ }
+ }
+
+}
diff --git a/src/com/cyanogenmod/filemanager/ui/dialogs/ActionsDialog.java b/src/com/cyanogenmod/filemanager/ui/dialogs/ActionsDialog.java
index c1804c96..01ee26f5 100644
--- a/src/com/cyanogenmod/filemanager/ui/dialogs/ActionsDialog.java
+++ b/src/com/cyanogenmod/filemanager/ui/dialogs/ActionsDialog.java
@@ -40,6 +40,8 @@ import com.cyanogenmod.filemanager.listeners.OnSelectionListener;
import com.cyanogenmod.filemanager.model.FileSystemObject;
import com.cyanogenmod.filemanager.model.SystemFile;
import com.cyanogenmod.filemanager.preferences.AccessMode;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.policy.BookmarksActionPolicy;
import com.cyanogenmod.filemanager.ui.policy.CompressActionPolicy;
import com.cyanogenmod.filemanager.ui.policy.CopyMoveActionPolicy;
@@ -137,6 +139,12 @@ public class ActionsDialog implements OnItemClickListener, OnItemLongClickListen
this.mListView.setLayoutParams(params);
this.mListView.setAdapter(adapter);
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setBackgroundDrawable(context, this.mListView, "background_drawable"); //$NON-NLS-1$
+ this.mListView.setDivider(
+ theme.getDrawable(context, "horizontal_divider_drawable")); //$NON-NLS-1$
+
//Create the dialog
this.mDialog = DialogHelper.createDialog(
context,
@@ -174,7 +182,7 @@ public class ActionsDialog implements OnItemClickListener, OnItemLongClickListen
TwoColumnsMenuListAdapter adapter =
(TwoColumnsMenuListAdapter)this.mListView.getAdapter();
configureMenu(adapter.getMenu());
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this.mContext, this.mDialog);
}
/**
@@ -414,7 +422,8 @@ public class ActionsDialog implements OnItemClickListener, OnItemLongClickListen
@Override
public void onCancel(DialogInterface dialog) {
//Show the menu again
- ActionsDialog.this.mDialog.show();
+ DialogHelper.delegateDialogShow(
+ ActionsDialog.this.mContext, ActionsDialog.this.mDialog);
}
});
inputNameDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@@ -457,7 +466,8 @@ public class ActionsDialog implements OnItemClickListener, OnItemLongClickListen
@Override
public void onCancel(DialogInterface dialog) {
//Show the menu again
- ActionsDialog.this.mDialog.show();
+ DialogHelper.delegateDialogShow(
+ ActionsDialog.this.mContext, ActionsDialog.this.mDialog);
}
});
inputNameDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
diff --git a/src/com/cyanogenmod/filemanager/ui/dialogs/AssociationsDialog.java b/src/com/cyanogenmod/filemanager/ui/dialogs/AssociationsDialog.java
index cb82de32..37004331 100644
--- a/src/com/cyanogenmod/filemanager/ui/dialogs/AssociationsDialog.java
+++ b/src/com/cyanogenmod/filemanager/ui/dialogs/AssociationsDialog.java
@@ -40,10 +40,12 @@ import android.widget.GridView;
import android.widget.ListAdapter;
import android.widget.Toast;
-import com.cyanogenmod.filemanager.FileManagerApplication;
import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.adapters.AssociationsAdapter;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.policy.IntentsActionPolicy;
+import com.cyanogenmod.filemanager.util.AndroidHelper;
import com.cyanogenmod.filemanager.util.DialogHelper;
import com.cyanogenmod.filemanager.util.ExceptionUtil;
@@ -126,7 +128,7 @@ public class AssociationsDialog implements OnItemClickListener {
private void init(int icon, String title, String action,
OnCancelListener onCancelListener, OnDismissListener onDismissListener) {
boolean isPlatformSigned =
- FileManagerApplication.isAppPlatformSignature(this.mContext);
+ AndroidHelper.isAppPlatformSignature(this.mContext);
//Create the layout, and retrieve the views
LayoutInflater li =
@@ -144,6 +146,11 @@ public class AssociationsDialog implements OnItemClickListener {
dialogTitle = this.mContext.getString(R.string.associations_dialog_title);
}
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
+ theme.setBackgroundDrawable(this.mContext, v, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(this.mContext, this.mRemember, "text_color"); //$NON-NLS-1$
+
//Create the dialog
this.mDialog = DialogHelper.createDialog(
this.mContext,
@@ -198,7 +205,7 @@ public class AssociationsDialog implements OnItemClickListener {
* Method that shows the dialog.
*/
public void show() {
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this.mContext, this.mDialog);
// Set user preferences
this.mDialog.getButton(DialogInterface.BUTTON_POSITIVE).setEnabled(false);
@@ -412,7 +419,7 @@ public class AssociationsDialog implements OnItemClickListener {
// Ignore it if the preferred can be saved. Only notify the user and open the
// intent
boolean isPlatformSigned =
- FileManagerApplication.isAppPlatformSignature(this.mContext);
+ AndroidHelper.isAppPlatformSignature(this.mContext);
if (isPlatformSigned && this.mAllowPreferred) {
if (filter != null && !isPreferredSelected()) {
try {
diff --git a/src/com/cyanogenmod/filemanager/ui/dialogs/ExecutionDialog.java b/src/com/cyanogenmod/filemanager/ui/dialogs/ExecutionDialog.java
index 1ba3adba..5bc8ed48 100644
--- a/src/com/cyanogenmod/filemanager/ui/dialogs/ExecutionDialog.java
+++ b/src/com/cyanogenmod/filemanager/ui/dialogs/ExecutionDialog.java
@@ -23,6 +23,7 @@ import android.os.AsyncTask;
import android.text.Layout;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
+import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
@@ -31,6 +32,8 @@ import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.commands.AsyncResultExecutable;
import com.cyanogenmod.filemanager.commands.ExecExecutable;
import com.cyanogenmod.filemanager.model.FileSystemObject;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.DialogHelper;
import com.cyanogenmod.filemanager.util.FixedQueue;
import com.cyanogenmod.filemanager.util.FixedQueue.EmptyQueueException;
@@ -143,15 +146,30 @@ public class ExecutionDialog implements DialogInterface.OnClickListener {
LayoutInflater li =
(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ViewGroup layout = (ViewGroup)li.inflate(R.layout.execution_dialog, null);
+ View tvScriptNameLabel = layout.findViewById(R.id.execution_script_name_label);
TextView tvScriptName = (TextView)layout.findViewById(R.id.execution_script_name);
tvScriptName.setText(fso.getFullPath());
+ View tvTimeLabel = layout.findViewById(R.id.execution_time_label);
this.mTvTime = (TextView)layout.findViewById(R.id.execution_time);
this.mTvTime.setText("-"); //$NON-NLS-1$
+ View tvExitCodeLabel = layout.findViewById(R.id.execution_exitcode_label);
this.mTvExitCode = (TextView)layout.findViewById(R.id.execution_exitcode);
this.mTvExitCode.setText("-"); //$NON-NLS-1$
this.mTvOutput = (TextView)layout.findViewById(R.id.execution_output);
this.mTvOutput.setMovementMethod(new ScrollingMovementMethod());
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setBackgroundDrawable(context, layout, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(context, (TextView)tvScriptNameLabel, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(context, tvScriptName, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(context, (TextView)tvTimeLabel, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(context, this.mTvTime, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(context, (TextView)tvExitCodeLabel, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(context, this.mTvExitCode, "text_color"); //$NON-NLS-1$
+ theme.setBackgroundColor(context, this.mTvOutput, "console_bg_color"); //$NON-NLS-1$
+ theme.setTextColor(context, this.mTvOutput, "console_fg_color"); //$NON-NLS-1$
+
//Create the dialog
String title = context.getString(R.string.execution_console_title);
this.mDialog = DialogHelper.createDialog(
@@ -162,16 +180,6 @@ public class ExecutionDialog implements DialogInterface.OnClickListener {
this.mDialog.setButton(
DialogInterface.BUTTON_NEUTRAL, context.getString(android.R.string.cancel), this);
- // Is cancellable
- this.mDialog.setCancelable(false);
- this.mTvOutput.post(new Runnable() {
- @Override
- public void run() {
- ExecutionDialog.this.mDialog.getButton(
- DialogInterface.BUTTON_NEUTRAL).setEnabled(false);
- }
- });
-
// Start the drawing task
this.mConsoleDrawTask.execute();
}
@@ -198,7 +206,9 @@ public class ExecutionDialog implements DialogInterface.OnClickListener {
* Method that shows the dialog.
*/
public void show() {
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this.mContext, this.mDialog);
+ this.mDialog.setCancelable(false);
+ this.mDialog.getButton(DialogInterface.BUTTON_NEUTRAL).setEnabled(false);
}
/**
diff --git a/src/com/cyanogenmod/filemanager/ui/dialogs/FilesystemInfoDialog.java b/src/com/cyanogenmod/filemanager/ui/dialogs/FilesystemInfoDialog.java
index a172b48e..19ca2934 100644
--- a/src/com/cyanogenmod/filemanager/ui/dialogs/FilesystemInfoDialog.java
+++ b/src/com/cyanogenmod/filemanager/ui/dialogs/FilesystemInfoDialog.java
@@ -34,6 +34,8 @@ import com.cyanogenmod.filemanager.model.MountPoint;
import com.cyanogenmod.filemanager.preferences.AccessMode;
import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.Preferences;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.widgets.DiskUsageGraph;
import com.cyanogenmod.filemanager.util.CommandHelper;
import com.cyanogenmod.filemanager.util.DialogHelper;
@@ -71,6 +73,7 @@ public class FilesystemInfoDialog implements OnClickListener {
private final Context mContext;
private final AlertDialog mDialog;
+ private final View mContentView;
private View mInfoViewTab;
private View mDiskUsageViewTab;
private View mInfoView;
@@ -110,28 +113,31 @@ public class FilesystemInfoDialog implements OnClickListener {
//Inflate the content
LayoutInflater li =
(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- View contentView = li.inflate(R.layout.filesystem_info_dialog, null);
+ this.mContentView = li.inflate(R.layout.filesystem_info_dialog, null);
+
+ // Apply the current theme
+ applyTheme();
//Create the dialog
this.mDialog = DialogHelper.createDialog(
context,
0,
R.string.filesystem_info_dialog_title,
- contentView);
+ this.mContentView);
this.mDialog.setButton(
DialogInterface.BUTTON_NEGATIVE,
this.mContext.getString(android.R.string.cancel),
(DialogInterface.OnClickListener)null);
//Fill the dialog
- fillData(contentView);
+ fillData(this.mContentView);
}
/**
* Method that shows the dialog.
*/
public void show() {
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this.mContext, this.mDialog);
}
/**
@@ -252,6 +258,9 @@ public class FilesystemInfoDialog implements OnClickListener {
this.mContext, R.style.secondary_text_appearance);
this.mInfoView.setVisibility(View.VISIBLE);
this.mDiskUsageView.setVisibility(View.GONE);
+
+ // Apply theme
+ applyTabTheme();
}
this.mInfoMsgView.setVisibility(
this.mIsMountAllowed || !this.mIsAdvancedMode ? View.GONE : View.VISIBLE);
@@ -267,6 +276,9 @@ public class FilesystemInfoDialog implements OnClickListener {
this.mContext, R.style.primary_text_appearance);
this.mInfoView.setVisibility(View.GONE);
this.mDiskUsageView.setVisibility(View.VISIBLE);
+
+ // Apply theme
+ applyTabTheme();
}
this.mDiskUsageGraph.post(new Runnable() {
@Override
@@ -337,4 +349,73 @@ public class FilesystemInfoDialog implements OnClickListener {
}
}
+ /**
+ * Method that applies the current theme to the activity
+ */
+ private void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
+ theme.setBackgroundDrawable(
+ this.mContext, this.mContentView, "background_drawable"); //$NON-NLS-1$
+ applyTabTheme();
+ View v = this.mContentView.findViewById(R.id.filesystem_info_dialog_tab_divider1);
+ theme.setBackgroundColor(this.mContext, v, "horizontal_divider_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_dialog_tab_divider2);
+ theme.setBackgroundColor(this.mContext, v, "vertical_divider_color"); //$NON-NLS-1$
+
+ v = this.mContentView.findViewById(R.id.filesystem_info_status_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_status);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_mount_point_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_mount_point);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_device_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_device);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_type_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_type);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_options_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_options);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_dump_pass_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_dump_pass);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_msg);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ ((TextView)v).setCompoundDrawablesWithIntrinsicBounds(
+ theme.getDrawable(this.mContext, "filesystem_warning_drawable"), //$NON-NLS-1$
+ null, null, null);
+
+ v = this.mContentView.findViewById(R.id.filesystem_info_total_disk_usage_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_total_disk_usage);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_used_disk_usage_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_used_disk_usage);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_free_disk_usage_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_free_disk_usage);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ }
+
+ /**
+ * Method that applies the current theme to the tab host
+ */
+ private void applyTabTheme() {
+ // Apply the theme
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
+ View v = this.mContentView.findViewById(R.id.filesystem_info_dialog_tab_info);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_dialog_tab_disk_usage);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ }
+
}
diff --git a/src/com/cyanogenmod/filemanager/ui/dialogs/FsoPropertiesDialog.java b/src/com/cyanogenmod/filemanager/ui/dialogs/FsoPropertiesDialog.java
index b3f10bb5..44c98005 100644
--- a/src/com/cyanogenmod/filemanager/ui/dialogs/FsoPropertiesDialog.java
+++ b/src/com/cyanogenmod/filemanager/ui/dialogs/FsoPropertiesDialog.java
@@ -55,6 +55,8 @@ import com.cyanogenmod.filemanager.model.UserPermission;
import com.cyanogenmod.filemanager.preferences.AccessMode;
import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.Preferences;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.AIDHelper;
import com.cyanogenmod.filemanager.util.CommandHelper;
import com.cyanogenmod.filemanager.util.DialogHelper;
@@ -161,6 +163,9 @@ public class FsoPropertiesDialog
(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
this.mContentView = li.inflate(R.layout.fso_properties_dialog, null);
+ // Apply current theme
+ applyTheme();
+
//Create the dialog
this.mDialog = DialogHelper.createDialog(
context,
@@ -199,7 +204,7 @@ public class FsoPropertiesDialog
* Method that shows the dialog.
*/
public void show() {
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this.mContext, this.mDialog);
}
/**
@@ -452,6 +457,9 @@ public class FsoPropertiesDialog
this.mContext, R.style.secondary_text_appearance);
this.mInfoView.setVisibility(View.VISIBLE);
this.mPermissionsView.setVisibility(View.GONE);
+
+ // Apply the them
+ applyTabTheme();
}
break;
@@ -466,6 +474,9 @@ public class FsoPropertiesDialog
this.mInfoView.setVisibility(View.GONE);
this.mPermissionsView.setVisibility(View.VISIBLE);
+ // Apply the them
+ applyTabTheme();
+
// Adjust the size of the spinners
adjustSpinnerSize(this.mSpnOwner);
adjustSpinnerSize(this.mSpnGroup);
@@ -599,6 +610,11 @@ public class FsoPropertiesDialog
String msg = null;
try {
+ // Apply theme
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
+ theme.setTextColor(
+ this.mContext, ((TextView) parent.getChildAt(0)), "text_color"); //$NON-NLS-1$
+
String row = parent.getItemAtPosition(position).toString();
int uid = Integer.parseInt(row.substring(0, row.indexOf(AID_SEPARATOR)));
String name = row.substring(row.indexOf(AID_SEPARATOR) + 3);
@@ -1086,4 +1102,89 @@ public class FsoPropertiesDialog
});
}
+ /**
+ * Method that applies the current theme to the activity
+ */
+ private void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
+ theme.setBackgroundDrawable(
+ this.mContext, this.mContentView, "background_drawable"); //$NON-NLS-1$
+ applyTabTheme();
+ View v = this.mContentView.findViewById(R.id.fso_properties_dialog_tab_divider1);
+ theme.setBackgroundColor(this.mContext, v, "horizontal_divider_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_dialog_tab_divider2);
+ theme.setBackgroundColor(this.mContext, v, "vertical_divider_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_dialog_tab_divider3);
+ theme.setBackgroundColor(this.mContext, v, "vertical_divider_color"); //$NON-NLS-1$
+
+ v = this.mContentView.findViewById(R.id.fso_properties_name_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_name);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_parent_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_parent);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_type_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_type);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_category_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_category);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_link_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_link);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_size_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_size);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_contains_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_contains);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_date_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_date);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+
+ v = this.mContentView.findViewById(R.id.fso_properties_owner_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_group_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_permissions_special_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_permissions_read_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_permissions_write_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_permissions_execute_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_permissions_owner_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_permissions_group_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_permissions_others_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_info_msg);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ ((TextView)v).setCompoundDrawablesWithIntrinsicBounds(
+ theme.getDrawable(this.mContext, "filesystem_warning_drawable"), //$NON-NLS-1$
+ null, null, null);
+ }
+
+ /**
+ * Method that applies the current theme to the tab host
+ */
+ private void applyTabTheme() {
+ // Apply the theme
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
+ View v = this.mContentView.findViewById(R.id.fso_properties_dialog_tab_info);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_dialog_tab_permissions);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ }
+
}
diff --git a/src/com/cyanogenmod/filemanager/ui/dialogs/InitialDirectoryDialog.java b/src/com/cyanogenmod/filemanager/ui/dialogs/InitialDirectoryDialog.java
index 2761531a..83a8578c 100644
--- a/src/com/cyanogenmod/filemanager/ui/dialogs/InitialDirectoryDialog.java
+++ b/src/com/cyanogenmod/filemanager/ui/dialogs/InitialDirectoryDialog.java
@@ -23,11 +23,14 @@ import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
+import android.widget.TextView;
import android.widget.Toast;
import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.Preferences;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.widgets.DirectoryInlineAutocompleteTextView;
import com.cyanogenmod.filemanager.util.DialogHelper;
@@ -82,6 +85,7 @@ public class InitialDirectoryDialog implements DialogInterface.OnClickListener {
(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout layout = (LinearLayout)li.inflate(R.layout.initial_directory, null);
final View msgView = layout.findViewById(R.id.initial_directory_info_msg);
+ final TextView labelView = (TextView)layout.findViewById(R.id.initial_directory_label);
this.mAutocomplete =
(DirectoryInlineAutocompleteTextView)layout.findViewById(
R.id.initial_directory_edittext);
@@ -117,6 +121,16 @@ public class InitialDirectoryDialog implements DialogInterface.OnClickListener {
});
this.mAutocomplete.setText(value);
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setBackgroundDrawable(context, layout, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(context, labelView, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(context, (TextView)msgView, "text_color"); //$NON-NLS-1$
+ ((TextView)msgView).setCompoundDrawablesWithIntrinsicBounds(
+ theme.getDrawable(this.mContext, "filesystem_warning_drawable"), //$NON-NLS-1$
+ null, null, null);
+ this.mAutocomplete.applyTheme();
+
//Create the dialog
this.mDialog = DialogHelper.createDialog(
context,
@@ -142,7 +156,7 @@ public class InitialDirectoryDialog implements DialogInterface.OnClickListener {
* Method that shows the dialog.
*/
public void show() {
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this.mContext, this.mDialog);
}
/**
diff --git a/src/com/cyanogenmod/filemanager/ui/dialogs/InputNameDialog.java b/src/com/cyanogenmod/filemanager/ui/dialogs/InputNameDialog.java
index 30cdc278..a0aaa0a6 100644
--- a/src/com/cyanogenmod/filemanager/ui/dialogs/InputNameDialog.java
+++ b/src/com/cyanogenmod/filemanager/ui/dialogs/InputNameDialog.java
@@ -29,6 +29,8 @@ import android.widget.TextView;
import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.model.FileSystemObject;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.DialogHelper;
import com.cyanogenmod.filemanager.util.FileHelper;
@@ -119,6 +121,15 @@ public class InputNameDialog
this.mEditText.addTextChangedListener(this);
this.mMsg = (TextView)v.findViewById(R.id.input_name_dialog_message);
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setBackgroundDrawable(context, v, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(context, title, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(context, this.mMsg, "text_color"); //$NON-NLS-1$
+ this.mMsg.setCompoundDrawablesWithIntrinsicBounds(
+ theme.getDrawable(this.mContext, "filesystem_warning_drawable"), //$NON-NLS-1$
+ null, null, null);
+
//Create the dialog
this.mDialog = DialogHelper.createDialog(
context,
@@ -194,7 +205,7 @@ public class InputNameDialog
* Method that shows the dialog.
*/
public void show() {
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this.mContext, this.mDialog);
}
/**
diff --git a/src/com/cyanogenmod/filemanager/ui/dialogs/MessageProgressDialog.java b/src/com/cyanogenmod/filemanager/ui/dialogs/MessageProgressDialog.java
index dde157a0..3b64a897 100644
--- a/src/com/cyanogenmod/filemanager/ui/dialogs/MessageProgressDialog.java
+++ b/src/com/cyanogenmod/filemanager/ui/dialogs/MessageProgressDialog.java
@@ -26,6 +26,8 @@ import android.widget.TextView;
import android.widget.Toast;
import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.DialogHelper;
/**
@@ -103,6 +105,12 @@ public class MessageProgressDialog implements DialogInterface.OnClickListener {
labelView.setText(labelMsg);
this.mProgress = (TextView)layout.findViewById(R.id.message_progress_dialog_progress);
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setBackgroundDrawable(context, layout, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(context, labelView, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(context, this.mProgress, "text_color"); //$NON-NLS-1$
+
//Create the dialog
this.mDialog = DialogHelper.createDialog(
context,
@@ -168,7 +176,7 @@ public class MessageProgressDialog implements DialogInterface.OnClickListener {
* Method that shows the dialog.
*/
public void show() {
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this.mContext, this.mDialog);
}
/**
diff --git a/src/com/cyanogenmod/filemanager/ui/policy/CompressActionPolicy.java b/src/com/cyanogenmod/filemanager/ui/policy/CompressActionPolicy.java
index 48f6a8a9..6c98f02d 100644
--- a/src/com/cyanogenmod/filemanager/ui/policy/CompressActionPolicy.java
+++ b/src/com/cyanogenmod/filemanager/ui/policy/CompressActionPolicy.java
@@ -128,7 +128,7 @@ public final class CompressActionPolicy extends ActionsPolicy {
@Override
public void onNoSelectChoice() {/**NON BLOCK**/}
});
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
}
}
@@ -170,7 +170,7 @@ public final class CompressActionPolicy extends ActionsPolicy {
@Override
public void onNoSelectChoice() {/**NON BLOCK**/}
});
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
}
@@ -472,7 +472,7 @@ public final class CompressActionPolicy extends ActionsPolicy {
}
}
});
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
} else {
// Execute background task
task.execute(task);
@@ -721,7 +721,7 @@ public final class CompressActionPolicy extends ActionsPolicy {
}
}
});
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
} else {
// Execute background task
task.execute(task);
diff --git a/src/com/cyanogenmod/filemanager/ui/policy/CopyMoveActionPolicy.java b/src/com/cyanogenmod/filemanager/ui/policy/CopyMoveActionPolicy.java
index 253d4250..75531480 100644
--- a/src/com/cyanogenmod/filemanager/ui/policy/CopyMoveActionPolicy.java
+++ b/src/com/cyanogenmod/filemanager/ui/policy/CopyMoveActionPolicy.java
@@ -220,7 +220,7 @@ public final class CopyMoveActionPolicy extends ActionsPolicy {
DialogHelper.createErrorDialog(ctx,
R.string.error_title,
R.string.msgs_illegal_argument);
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
return;
}
// 2.- All the destination files must have the same parent and it must be currentDirectory,
@@ -234,7 +234,7 @@ public final class CopyMoveActionPolicy extends ActionsPolicy {
DialogHelper.createErrorDialog(ctx,
R.string.error_title,
R.string.msgs_illegal_argument);
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
return;
}
if (linkedRes.mDst.getParent() == null ||
@@ -243,7 +243,7 @@ public final class CopyMoveActionPolicy extends ActionsPolicy {
DialogHelper.createErrorDialog(ctx,
R.string.error_title,
R.string.msgs_illegal_argument);
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
return;
}
}
@@ -444,7 +444,7 @@ public final class CopyMoveActionPolicy extends ActionsPolicy {
}
}
});
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
return;
}
}
@@ -515,7 +515,7 @@ public final class CopyMoveActionPolicy extends ActionsPolicy {
ctx,
R.string.error_title,
R.string.msgs_unresolved_inconsistencies);
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
return false;
}
@@ -527,7 +527,7 @@ public final class CopyMoveActionPolicy extends ActionsPolicy {
ctx,
R.string.error_title,
R.string.msgs_operation_not_allowed_in_current_directory);
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
return false;
}
}
diff --git a/src/com/cyanogenmod/filemanager/ui/policy/DeleteActionPolicy.java b/src/com/cyanogenmod/filemanager/ui/policy/DeleteActionPolicy.java
index 4364ce28..87c59afe 100644
--- a/src/com/cyanogenmod/filemanager/ui/policy/DeleteActionPolicy.java
+++ b/src/com/cyanogenmod/filemanager/ui/policy/DeleteActionPolicy.java
@@ -109,7 +109,7 @@ public final class DeleteActionPolicy extends ActionsPolicy {
}
}
});
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
}
/**
@@ -359,7 +359,7 @@ public final class DeleteActionPolicy extends ActionsPolicy {
ctx,
R.string.warning_title,
R.string.msgs_unresolved_inconsistencies);
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
return false;
}
}
diff --git a/src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java b/src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java
index 270f2e2c..be0533b7 100644
--- a/src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java
+++ b/src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java
@@ -37,6 +37,7 @@ import com.cyanogenmod.filemanager.util.ExceptionUtil;
import com.cyanogenmod.filemanager.util.FileHelper;
import com.cyanogenmod.filemanager.util.MimeTypeHelper;
import com.cyanogenmod.filemanager.util.MimeTypeHelper.MimeTypeCategory;
+import com.cyanogenmod.filemanager.util.ResourcesHelper;
import java.io.File;
import java.util.ArrayList;
@@ -260,13 +261,18 @@ public final class IntentsActionPolicy extends ActionsPolicy {
}
shortcutIntent.putExtra(ShortcutActivity.EXTRA_FSO, fso.getFullPath());
+ // Obtain the icon drawable (don't use here the themeable drawable)
+ String resid = MimeTypeHelper.getIcon(ctx, fso);
+ int dwid =
+ ResourcesHelper.getIdentifier(
+ ctx.getResources(), "string", resid); //$NON-NLS-1$
+
// The intent to send to broadcast for register the shortcut intent
Intent intent = new Intent();
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, fso.getName());
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
- Intent.ShortcutIconResource.fromContext(
- ctx, MimeTypeHelper.getIcon(ctx, fso)));
+ Intent.ShortcutIconResource.fromContext(ctx, dwid));
intent.setAction("com.android.launcher.action.INSTALL_SHORTCUT"); //$NON-NLS-1$
ctx.sendBroadcast(intent);
diff --git a/src/com/cyanogenmod/filemanager/ui/preferences/ThemeRoulette.java b/src/com/cyanogenmod/filemanager/ui/preferences/ThemeRoulette.java
new file mode 100644
index 00000000..3f401d48
--- /dev/null
+++ b/src/com/cyanogenmod/filemanager/ui/preferences/ThemeRoulette.java
@@ -0,0 +1,364 @@
+/*
+ * Copyright (C) 2012 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.cyanogenmod.filemanager.ui.preferences;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.Paint;
+import android.graphics.Point;
+import android.graphics.drawable.Drawable;
+import android.util.AttributeSet;
+import android.view.Display;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.HorizontalScrollView;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
+
+import java.util.List;
+
+/**
+ * A view that allow view all installed themes by scrolling horizontally.
+ */
+public class ThemeRoulette extends HorizontalScrollView {
+
+ /**
+ * An interface for raise theme selection events
+ */
+ public interface OnThemeScrollSelectionListener {
+ /**
+ * Method invoked when the scroll selection of a theme start
+ */
+ void onScrollSelectionStart();
+ /**
+ * Method invoked when a new scroll selection of a theme was made
+ *
+ * @param theme The new theme
+ */
+ void onScrollSelectionChanged(Theme theme);
+ }
+
+ /**
+ * @hide
+ */
+ ViewGroup mRouletteLayout;
+ private View mSpacer1;
+ private View mSpacer2;
+
+ /**
+ * @hide
+ */
+ int mSpacerWidth;
+ /**
+ * @hide
+ */
+ int mThemeWidth;
+
+ /**
+ * @hide
+ */
+ int mCurrentThemePosition;
+
+ /**
+ * @hide
+ */
+ OnThemeScrollSelectionListener mOnThemeScrollSelectionListener;
+
+ /**
+ * Constructor of <code>ThemeRoulette</code>.
+ *
+ * @param context The current context
+ */
+ public ThemeRoulette(Context context) {
+ super(context);
+ init();
+ }
+
+ /**
+ * Constructor of <code>ThemeRoulette</code>.
+ *
+ * @param context The current context
+ * @param attrs The attributes of the XML tag that is inflating the view.
+ */
+ public ThemeRoulette(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ init();
+ }
+
+ /**
+ * Constructor of <code>ThemeRoulette</code>.
+ *
+ * @param context The current context
+ * @param attrs The attributes of the XML tag that is inflating the view.
+ * @param defStyle The default style to apply to this view. If 0, no style
+ * will be applied (beyond what is included in the theme). This may
+ * either be an attribute resource, whose value will be retrieved
+ * from the current theme, or an explicit style resource.
+ */
+ public ThemeRoulette(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ init();
+ }
+
+ /**
+ * Method that initializes the view
+ */
+ private void init() {
+ this.mRouletteLayout = (ViewGroup)inflate(getContext(), R.layout.theme_roulette, null);
+ this.mRouletteLayout.setLayoutParams(
+ new LinearLayout.LayoutParams(
+ ViewGroup.LayoutParams.WRAP_CONTENT,
+ ViewGroup.LayoutParams.MATCH_PARENT));
+ this.mSpacer1 = this.mRouletteLayout.findViewById(R.id.spacer1);
+ this.mSpacer2 = this.mRouletteLayout.findViewById(R.id.spacer2);
+ addView(this.mRouletteLayout);
+
+ this.mCurrentThemePosition = -1;
+
+ setSmoothScrollingEnabled(false);
+ }
+
+ /**
+ * Method that sets the listener where return theme scroll selection changes
+ *
+ * @param onThemeScrollSelectionListener The listener
+ */
+ public void setOnThemeScrollSelectionListener(
+ OnThemeScrollSelectionListener onThemeScrollSelectionListener) {
+ this.mOnThemeScrollSelectionListener = onThemeScrollSelectionListener;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ int parentWidth = MeasureSpec.getSize(widthMeasureSpec);
+ int parentHeight = MeasureSpec.getSize(heightMeasureSpec);
+ this.setMeasuredDimension(parentWidth, parentHeight);
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+
+ int mw = (int)getResources().getDimension(R.dimen.theme_max_width);
+ int w = (int)(getWidth() / 1.5);
+ this.mSpacerWidth = (getWidth() - Math.min(w, mw)) / 2;
+ this.mSpacer1.getLayoutParams().width = this.mSpacerWidth;
+ this.mSpacer2.getLayoutParams().width = this.mSpacerWidth;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean onTouchEvent(MotionEvent ev) {
+
+ // Detect the motion
+ int action = ev.getAction();
+ switch (action & MotionEvent.ACTION_MASK) {
+ case MotionEvent.ACTION_DOWN:
+ break;
+
+ case MotionEvent.ACTION_MOVE:
+ if (this.mOnThemeScrollSelectionListener != null) {
+ this.mOnThemeScrollSelectionListener.onScrollSelectionStart();
+ }
+ break;
+
+ case MotionEvent.ACTION_CANCEL:
+ case MotionEvent.ACTION_UP:
+ post(new Runnable() {
+ @Override
+ public void run() {
+ int themeViewPosition = getVisibleThemeViewPosition();
+ if (themeViewPosition >= 1) {
+ ThemeRoulette.this.mCurrentThemePosition = themeViewPosition;
+ scrollToThemePosition(themeViewPosition, true);
+ }
+ }
+ });
+ break;
+ }
+ return super.onTouchEvent(ev);
+ }
+
+ /**
+ * Method that sets the themes of this roulette
+ *
+ * @param themes The themes of this roulette
+ * @param currentTheme The current theme
+ * @param scrollTo The theme to scroll to
+ */
+ public void setThemes(List<Theme> themes, Theme currentTheme, final int scrollTo) {
+ int cc = themes.size();
+ int pos = -1;
+ for (int i = 0; i < cc; i++) {
+ Theme theme = themes.get(i);
+ addTheme(this.mRouletteLayout, theme);
+ if (theme.compareTo(currentTheme) == 0) {
+ pos = i + 1;
+ }
+ }
+
+ // If the theme is found
+ if (pos != -1) {
+ final int childPos = pos;
+ post(new Runnable() {
+ @Override
+ public void run() {
+ ThemeRoulette.this.mCurrentThemePosition =
+ (scrollTo > 0) ? scrollTo : childPos;
+ scrollToThemePosition(ThemeRoulette.this.mCurrentThemePosition, false);
+ markThemeAsDefault(childPos);
+ }
+ });
+ }
+ }
+
+ /**
+ * Method that adds a theme to the roulette
+ *
+ * @param root The root view
+ * @param theme The theme to add
+ */
+ private void addTheme(ViewGroup root, Theme theme) {
+ // Create the layout and assign its theme
+ ThemeView v = (ThemeView)inflate(getContext(), R.layout.theme_view, null);
+ int mw = (int)getResources().getDimension(R.dimen.theme_max_width);
+ int w = (int)(getWidth() / 1.5);
+ this.mThemeWidth = Math.min(w, mw);
+ v.setLayoutParams(
+ new LinearLayout.LayoutParams(
+ this.mThemeWidth,
+ ViewGroup.LayoutParams.MATCH_PARENT));
+ v.setTag(theme);
+
+ // Set the view info
+ TextView name = (TextView)v.findViewById(R.id.theme_name);
+ name.setText(theme.getName());
+ TextView author = (TextView)v.findViewById(R.id.theme_author);
+ author.setText(theme.getAuthor());
+ TextView desc = (TextView)v.findViewById(R.id.theme_desc);
+ desc.setText(theme.getDescription());
+ ImageView preview = (ImageView)v.findViewById(R.id.theme_preview);
+ preview.setContentDescription(theme.getName());
+ Drawable dw = theme.getPreviewImage(getContext());
+ if (dw != null) {
+ preview.setImageDrawable(dw);
+ } else {
+ dw = theme.getNoPreviewImage(getContext());
+ preview.setImageDrawable(dw);
+ }
+
+ // Add to the end of the roulette
+ root.addView(v, root.getChildCount()-1);
+ }
+
+ /**
+ * Method that returns the visible theme view position, based on the position
+ * on the screen (the most centered is the current view)
+ *
+ * @return int The visible theme view position
+ * @hide
+ */
+ int getVisibleThemeViewPosition() {
+ Display display = ((Activity)getContext()).getWindowManager().getDefaultDisplay();
+ Point size = new Point();
+ display.getSize(size);
+
+ int x = size.x / 2;
+ int width = 0;
+
+ int[] location = new int[2];
+ int cc = this.mRouletteLayout.getChildCount()-1;
+ for (int i = 1; i < cc; i++) {
+ View v = this.mRouletteLayout.getChildAt(i);
+ if (v instanceof ThemeView) {
+ v.getLocationOnScreen(location);
+ width = v.getWidth();
+ if (location[0] <= x && x <= (location[0] + width)) {
+ return i;
+ }
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Method that scroll to the theme position
+ *
+ * @param position The position where to scroll
+ * @param smooth Use a smooth scroll to position
+ * @hide
+ */
+ void scrollToThemePosition(int position, boolean smooth) {
+ if (position <= 0) return;
+ int x = 0;
+ if (position > 1) {
+ x += ThemeRoulette.this.mThemeWidth * (position - 1);
+ }
+ if (smooth) {
+ smoothScrollTo(x, 0);
+ } else {
+ scrollTo(x, 0);
+ }
+
+ // Notify the change
+ if (ThemeRoulette.this.mOnThemeScrollSelectionListener != null) {
+ ThemeView v =
+ (ThemeView)ThemeRoulette.this.mRouletteLayout.
+ getChildAt(position);
+ ThemeRoulette.this.
+ mOnThemeScrollSelectionListener.
+ onScrollSelectionChanged((Theme)v.getTag());
+ }
+ }
+
+ /**
+ * Method that mark the current visible theme as the default
+ */
+ void markCurrentVisibleThemeAsDefault() {
+ int position = getVisibleThemeViewPosition();
+ if (position >= 1) {
+ markThemeAsDefault(position);
+ }
+ }
+
+ /**
+ * Method that mark the theme as the default
+ *
+ * @param position The position of the theme
+ */
+ void markThemeAsDefault(int position) {
+ int cc = this.mRouletteLayout.getChildCount()-1;
+ for (int i = 1; i < cc; i++) {
+ ThemeView v =
+ (ThemeView)ThemeRoulette.this.mRouletteLayout.
+ getChildAt(i);
+ if (i == position) {
+ v.getName().setPaintFlags(
+ v.getName().getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
+ } else {
+ v.getName().setPaintFlags(
+ v.getName().getPaintFlags() & ~Paint.UNDERLINE_TEXT_FLAG);
+ }
+ }
+ }
+}
diff --git a/src/com/cyanogenmod/filemanager/ui/preferences/ThemeSelectorPreference.java b/src/com/cyanogenmod/filemanager/ui/preferences/ThemeSelectorPreference.java
new file mode 100644
index 00000000..322bf8ce
--- /dev/null
+++ b/src/com/cyanogenmod/filemanager/ui/preferences/ThemeSelectorPreference.java
@@ -0,0 +1,317 @@
+/*
+ * Copyright (C) 2012 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.cyanogenmod.filemanager.ui.preferences;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Point;
+import android.os.AsyncTask;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.preference.Preference;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.Display;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.ProgressBar;
+import android.widget.Toast;
+
+import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
+import com.cyanogenmod.filemanager.ui.preferences.ThemeRoulette.OnThemeScrollSelectionListener;
+import com.cyanogenmod.filemanager.util.DialogHelper;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A preference implementation for the selection of a theme.
+ */
+public class ThemeSelectorPreference extends Preference implements OnClickListener {
+
+ private static final String TAG = "ThemeSelectorPreference"; //$NON-NLS-1$
+
+ /**
+ * @hide
+ */
+ final AsyncTask<Void, Integer, List<Theme>> mThemeTask =
+ new AsyncTask<Void, Integer, List<Theme>>() {
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected List<Theme> doInBackground(Void... params) {
+ List<Theme> themes = new ArrayList<Theme>();
+ themes.addAll(ThemeManager.getAvailableThemes(getContext()));
+ return themes;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onPostExecute(List<Theme> result) {
+ ThemeSelectorPreference.this.mRoulette.setThemes(
+ result,
+ ThemeManager.getCurrentTheme(getContext()),
+ ThemeSelectorPreference.this.mScrollTo);
+ ThemeSelectorPreference.this.mWaiting.setVisibility(View.GONE);
+ }
+ };
+
+
+ private View mRootView;
+ /**
+ * @hide
+ */
+ Button mButton;
+ /**
+ * @hide
+ */
+ ThemeRoulette mRoulette;
+ /**
+ * @hide
+ */
+ ProgressBar mWaiting;
+
+ // The visible theme, selected by scrolling. This may not be the current theme.
+ /**
+ * @hide
+ */
+ Theme mSelectedTheme;
+
+ /**
+ * @hide
+ */
+ int mScrollTo = -1;
+
+ /**
+ * Constructor of <code>ThemeSelectorPreference</code>.
+ *
+ * @param context The current context
+ */
+ public ThemeSelectorPreference(Context context) {
+ super(context);
+ init();
+ }
+
+ /**
+ * Constructor of <code>ThemeSelectorPreference</code>.
+ *
+ * @param context The current context
+ * @param attrs The attributes of the XML tag that is inflating the view.
+ */
+ public ThemeSelectorPreference(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ init();
+ }
+
+ /**
+ * Constructor of <code>ThemeSelectorPreference</code>.
+ *
+ * @param context The current context
+ * @param attrs The attributes of the XML tag that is inflating the view.
+ * @param defStyle The default style to apply to this view. If 0, no style
+ * will be applied (beyond what is included in the theme). This may
+ * either be an attribute resource, whose value will be retrieved
+ * from the current theme, or an explicit style resource.
+ */
+ public ThemeSelectorPreference(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ init();
+ }
+
+ /**
+ * Method that initializes the preference
+ */
+ private void init() {
+ setLayoutResource(R.layout.theme_selector_preference);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected View onCreateView(ViewGroup parent) {
+ this.mRootView = super.onCreateView(parent);
+ this.mButton = (Button)this.mRootView.findViewById(R.id.theme_button);
+ this.mButton.setOnClickListener(this);
+ this.mRoulette = (ThemeRoulette)this.mRootView.findViewById(R.id.theme_roulette);
+ this.mRoulette.setOnThemeScrollSelectionListener(new OnThemeScrollSelectionListener() {
+ @Override
+ public void onScrollSelectionStart() {
+ ThemeSelectorPreference.this.mButton.setEnabled(false);
+ }
+
+ @Override
+ public void onScrollSelectionChanged(Theme theme) {
+ boolean enabled = ThemeManager.getCurrentTheme(getContext()).compareTo(theme) != 0;
+ ThemeSelectorPreference.this.mButton.setEnabled(enabled);
+ if (enabled) {
+ ThemeSelectorPreference.this.mSelectedTheme = theme;
+ }
+ }
+ });
+ this.mWaiting = (ProgressBar)this.mRootView.findViewById(R.id.theme_waiting);
+ return this.mRootView;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onBindView(final View view) {
+ super.onBindView(view);
+ view.post(new Runnable() {
+ @Override
+ public void run() {
+ Resources res = getContext().getResources();
+ Display display = ((Activity)getContext()).getWindowManager().getDefaultDisplay();
+ Point size = new Point();
+ display.getSize(size);
+
+ // Set the preference height
+ int rowHeight = (int)res.getDimension(R.dimen.extra_margin);
+ int[] window = new int[2];
+ view.getLocationInWindow(window);
+ view.getLayoutParams().height = size.y - window[1] - rowHeight;
+
+ // The button width
+ int minWidth = (int)res.getDimension(R.dimen.themes_min_width_button);
+ int w = ThemeSelectorPreference.this.mButton.getWidth();
+ ThemeSelectorPreference.this.mButton.setWidth(Math.max(minWidth, w));
+
+ // Now display the progress and load the themes in background
+ ThemeSelectorPreference.this.mWaiting.setVisibility(View.VISIBLE);
+ ThemeSelectorPreference.this.mThemeTask.execute();
+ }
+ });
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void onClick(View v) {
+ String newValue = this.mSelectedTheme.getComposedId();
+ if (ThemeManager.setCurrentTheme(getContext(), newValue)) {
+ if (!persistString(newValue)) {
+ Log.w(TAG, "can't save theme preference"); //$NON-NLS-1$
+ }
+ this.mRoulette.markCurrentVisibleThemeAsDefault();
+ callChangeListener(newValue);
+
+ // Now we are in the current theme
+ ThemeSelectorPreference.this.mSelectedTheme =
+ ThemeManager.getCurrentTheme(getContext());
+ ThemeSelectorPreference.this.mButton.setEnabled(false);
+
+ // Display a confirmation
+ DialogHelper.showToast(
+ getContext(), R.string.pref_themes_confirmation, Toast.LENGTH_SHORT);
+ } else {
+ // The theme was not found
+ DialogHelper.showToast(
+ getContext(), R.string.pref_themes_not_found, Toast.LENGTH_SHORT);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Parcelable onSaveInstanceState() {
+ final Parcelable superState = super.onSaveInstanceState();
+ final SavedState myState = new SavedState(superState);
+ myState.mPosition = this.mRoulette.mCurrentThemePosition;
+ return myState;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onRestoreInstanceState(Parcelable state) {
+ if (state == null || !state.getClass().equals(SavedState.class)) {
+ // Didn't save state for us in onSaveInstanceState
+ super.onRestoreInstanceState(state);
+ return;
+ }
+
+ SavedState myState = (SavedState) state;
+ super.onRestoreInstanceState(myState.getSuperState());
+ this.mScrollTo = myState.mPosition;
+ }
+
+ /**
+ * A saved state persistence class
+ */
+ static class SavedState extends BaseSavedState {
+ int mPosition;
+
+ /**
+ * Constructor of <code>SavedState</code>
+ *
+ * @param source The original parcel
+ */
+ public SavedState(Parcel source) {
+ super(source);
+ this.mPosition = source.readInt();
+ }
+
+ /**
+ * Constructor of <code>SavedState</code>
+ *
+ * @param superState The super state
+ */
+ public SavedState(Parcelable superState) {
+ super(superState);
+ this.mPosition = -1;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ super.writeToParcel(dest, flags);
+ dest.writeInt(this.mPosition);
+ }
+
+ /**
+ * A class for create the saved state
+ */
+ @SuppressWarnings("hiding")
+ public static final Parcelable.Creator<SavedState> CREATOR =
+ new Parcelable.Creator<SavedState>() {
+ @Override
+ public SavedState createFromParcel(Parcel in) {
+ return new SavedState(in);
+ }
+
+ @Override
+ public SavedState[] newArray(int size) {
+ return new SavedState[size];
+ }
+ };
+ }
+}
diff --git a/src/com/cyanogenmod/filemanager/ui/preferences/ThemeView.java b/src/com/cyanogenmod/filemanager/ui/preferences/ThemeView.java
new file mode 100644
index 00000000..872aab48
--- /dev/null
+++ b/src/com/cyanogenmod/filemanager/ui/preferences/ThemeView.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2012 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.cyanogenmod.filemanager.ui.preferences;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
+
+/**
+ * A view that display information about a {@link Theme}
+ */
+public class ThemeView extends RelativeLayout {
+
+ private TextView mName;
+ private TextView mAuthor;
+ private TextView mDescription;
+ private ImageView mPreview;
+
+ /**
+ * Constructor of <code>ThemeView</code>.
+ *
+ * @param context The current context
+ */
+ public ThemeView(Context context) {
+ super(context);
+ }
+
+ /**
+ * Constructor of <code>ThemeView</code>.
+ *
+ * @param context The current context
+ * @param attrs The attributes of the XML tag that is inflating the view.
+ */
+ public ThemeView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ /**
+ * Constructor of <code>ThemeView</code>.
+ *
+ * @param context The current context
+ * @param attrs The attributes of the XML tag that is inflating the view.
+ * @param defStyle The default style to apply to this view. If 0, no style
+ * will be applied (beyond what is included in the theme). This may
+ * either be an attribute resource, whose value will be retrieved
+ * from the current theme, or an explicit style resource.
+ */
+ public ThemeView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onLayout(boolean changed, int l, int t, int r, int b) {
+ super.onLayout(changed, l, t, r, b);
+ this.mName = (TextView)findViewById(R.id.theme_name);
+ this.mAuthor = (TextView)findViewById(R.id.theme_author);
+ this.mDescription = (TextView)findViewById(R.id.theme_desc);
+ this.mPreview = (ImageView)findViewById(R.id.theme_preview);
+
+ // Apply current theme
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setTextColor(getContext(), this.mName, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(getContext(), this.mAuthor, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(getContext(), this.mDescription, "text_color"); //$NON-NLS-1$
+ }
+
+ /**
+ * Method that return the view for the name of the theme
+ *
+ * @return TextView The view that holds the name of the theme
+ */
+ public TextView getName() {
+ return this.mName;
+ }
+
+ /**
+ * Method that return the view for the author of the theme
+ *
+ * @return TextView The view that holds the author of the theme
+ */
+ public TextView getAuthor() {
+ return this.mAuthor;
+ }
+
+ /**
+ * Method that return the view for the description of the theme
+ *
+ * @return TextView The view that holds the description of the theme
+ */
+ public TextView getDescription() {
+ return this.mDescription;
+ }
+
+ /**
+ * Method that return the view for the preview image of the theme
+ *
+ * @return TextView The view that holds the preview image of the theme
+ */
+ public ImageView getPreview() {
+ return this.mPreview;
+ }
+
+}
diff --git a/src/com/cyanogenmod/filemanager/ui/widgets/Breadcrumb.java b/src/com/cyanogenmod/filemanager/ui/widgets/Breadcrumb.java
index 697c1e07..61ca1d9c 100644
--- a/src/com/cyanogenmod/filemanager/ui/widgets/Breadcrumb.java
+++ b/src/com/cyanogenmod/filemanager/ui/widgets/Breadcrumb.java
@@ -83,4 +83,8 @@ public interface Breadcrumb {
*/
DiskUsage getDiskUsageInfo();
+ /**
+ * Method that applies the current theme to the breadcrumb
+ */
+ void applyTheme();
}
diff --git a/src/com/cyanogenmod/filemanager/ui/widgets/BreadcrumbView.java b/src/com/cyanogenmod/filemanager/ui/widgets/BreadcrumbView.java
index a660b72e..41071056 100644
--- a/src/com/cyanogenmod/filemanager/ui/widgets/BreadcrumbView.java
+++ b/src/com/cyanogenmod/filemanager/ui/widgets/BreadcrumbView.java
@@ -17,6 +17,7 @@
package com.cyanogenmod.filemanager.ui.widgets;
import android.content.Context;
+import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
@@ -31,6 +32,8 @@ import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.model.DiskUsage;
import com.cyanogenmod.filemanager.model.MountPoint;
import com.cyanogenmod.filemanager.tasks.FilesystemAsyncTask;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.FileHelper;
import com.cyanogenmod.filemanager.util.StorageHelper;
@@ -123,6 +126,12 @@ public class BreadcrumbView extends RelativeLayout implements Breadcrumb, OnClic
this.mFilesystemInfo = (ImageView)findViewById(R.id.ab_filesystem_info);
this.mDiskUsageInfo = (ProgressBar)findViewById(R.id.breadcrumb_diskusage);
this.mLoading = findViewById(R.id.breadcrumb_loading);
+
+ // Change the image of filesystem (this is not called after a changeBreadcrumbPath call,
+ // so if need to be theme previously to protect from errors)
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setImageDrawable(
+ getContext(), this.mFilesystemInfo, "filesystem_warning_drawable"); //$NON-NLS-1$
}
/**
@@ -222,6 +231,9 @@ public class BreadcrumbView extends RelativeLayout implements Breadcrumb, OnClic
}
}
+ // Now apply the theme to the breadcrumb
+ applyTheme();
+
//Set scrollbar at the end
this.mScrollView.post(new Runnable() {
@Override
@@ -329,4 +341,34 @@ public class BreadcrumbView extends RelativeLayout implements Breadcrumb, OnClic
return null;
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+
+ //- Breadcrumb
+ if (this.mBreadcrumbBar != null) {
+ int cc = this.mBreadcrumbBar.getChildCount();
+ for (int i = 0; i < cc; i++) {
+ // There are 2 types: Breadcrumb items and separators
+ View v = this.mBreadcrumbBar.getChildAt(i);
+ if (v instanceof BreadcrumbItem) {
+ // Breadcrumb item
+ theme.setTextColor(
+ getContext(), (BreadcrumbItem)v, "text_color"); //$NON-NLS-1$
+ } else if (v instanceof ImageView) {
+ // Divider drawable
+ theme.setImageDrawable(
+ getContext(),
+ (ImageView)v, "breadcrumb_divider_drawable"); //$NON-NLS-1$
+ }
+ }
+ }
+ if (this.mDiskUsageInfo != null) {
+ Drawable dw = theme.getDrawable(getContext(), "horizontal_progress_bar"); //$NON-NLS-1$
+ this.mDiskUsageInfo.setProgressDrawable(dw);
+ }
+ }
}
diff --git a/src/com/cyanogenmod/filemanager/ui/widgets/DiskUsageGraph.java b/src/com/cyanogenmod/filemanager/ui/widgets/DiskUsageGraph.java
index 6fdd73f4..0787e64d 100644
--- a/src/com/cyanogenmod/filemanager/ui/widgets/DiskUsageGraph.java
+++ b/src/com/cyanogenmod/filemanager/ui/widgets/DiskUsageGraph.java
@@ -17,7 +17,6 @@
package com.cyanogenmod.filemanager.ui.widgets;
import android.content.Context;
-import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
@@ -25,8 +24,9 @@ import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;
-import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.model.DiskUsage;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import java.util.ArrayList;
import java.util.Collections;
@@ -37,9 +37,6 @@ import java.util.List;
*/
public class DiskUsageGraph extends View {
- private static int sColorFilterNormal;
- private static int sColorFilterWarning;
-
/**
* @hide
*/
@@ -59,7 +56,6 @@ public class DiskUsageGraph extends View {
*/
public DiskUsageGraph(Context context) {
super(context);
- init();
}
/**
@@ -70,7 +66,6 @@ public class DiskUsageGraph extends View {
*/
public DiskUsageGraph(Context context, AttributeSet attrs) {
super(context, attrs);
- init();
}
/**
@@ -85,18 +80,6 @@ public class DiskUsageGraph extends View {
*/
public DiskUsageGraph(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
- init();
- }
-
- /**
- * Method that initializes the widget
- */
- private void init() {
- if (sColorFilterNormal == 0 || sColorFilterWarning == 0) {
- Resources res = getContext().getResources();
- sColorFilterNormal = res.getColor(R.color.disk_usage_color_filter_normal);
- sColorFilterWarning = res.getColor(R.color.disk_usage_color_filter_warning);
- }
}
/**
@@ -216,20 +199,25 @@ public class DiskUsageGraph extends View {
if (this.mIndex == 0 && dwo == null) {
//Initialize the total arc circle
DiskUsageGraph.this.mDrawingObjects.add(
- createDrawingObject(rect, R.color.disk_usage_total, stroke));
+ createDrawingObject(
+ rect, "disk_usage_total_color", stroke)); //$NON-NLS-1$
continue;
}
if (this.mIndex == 1 && dwo == null) {
//Initialize the used arc circle
DiskUsageGraph.this.mDrawingObjects.add(
- createDrawingObject(rect, R.color.disk_usage_used, stroke));
+ createDrawingObject(
+ rect, "disk_usage_used_color", stroke)); //$NON-NLS-1$
continue;
}
if (this.mIndex == 1 && !disk_warning &&
dwo.mSweepAngle >= DiskUsageGraph.this.mDiskWarningAngle) {
- dwo.mPaint.setColor(getContext().
- getResources().getColor(R.color.disk_usage_used_warning));
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ dwo.mPaint.setColor(
+ theme.getColor(
+ getContext(),
+ "disk_usage_used_warning_color")); //$NON-NLS-1$
disk_warning = true;
}
@@ -293,14 +281,16 @@ public class DiskUsageGraph extends View {
* Method that creates the drawing object.
*
* @param rect The area of drawing
- * @param colorResourceId The resource identifier of the color
+ * @param colorResourceThemeId The theme resource identifier of the color
* @param stroke The stroke width
* @return DrawingObject The drawing object
*/
- private DrawingObject createDrawingObject(Rect rect, int colorResourceId, int stroke) {
+ private DrawingObject createDrawingObject(
+ Rect rect, String colorResourceThemeId, int stroke) {
DrawingObject out = new DrawingObject();
out.mSweepAngle = 0;
- out.mPaint.setColor(getContext().getResources().getColor(colorResourceId));
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ out.mPaint.setColor(theme.getColor(getContext(), colorResourceThemeId));
out.mPaint.setStrokeWidth(stroke);
out.mPaint.setAntiAlias(true);
out.mPaint.setStrokeCap(Paint.Cap.BUTT);
diff --git a/src/com/cyanogenmod/filemanager/ui/widgets/FlingerListView.java b/src/com/cyanogenmod/filemanager/ui/widgets/FlingerListView.java
index a4730e5f..8079127e 100644
--- a/src/com/cyanogenmod/filemanager/ui/widgets/FlingerListView.java
+++ b/src/com/cyanogenmod/filemanager/ui/widgets/FlingerListView.java
@@ -236,6 +236,9 @@ public class FlingerListView extends ListView {
this.mOnItemFlingerListener = mOnItemFlingerListener;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
public boolean onTouchEvent(MotionEvent ev) {
// If no flinger support is request, don't change the default behaviour
diff --git a/src/com/cyanogenmod/filemanager/ui/widgets/InlineAutocompleteTextView.java b/src/com/cyanogenmod/filemanager/ui/widgets/InlineAutocompleteTextView.java
index b4094afd..308be39f 100644
--- a/src/com/cyanogenmod/filemanager/ui/widgets/InlineAutocompleteTextView.java
+++ b/src/com/cyanogenmod/filemanager/ui/widgets/InlineAutocompleteTextView.java
@@ -28,11 +28,14 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
+import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.DialogHelper;
import java.util.ArrayList;
@@ -140,6 +143,9 @@ public class InlineAutocompleteTextView extends RelativeLayout
button.setOnClickListener(this);
button.setOnLongClickListener(this);
+ // Apply the theme
+ applyTheme();
+
//Initialize text views
setText(""); //$NON-NLS-1$
}
@@ -509,4 +515,18 @@ public class InlineAutocompleteTextView extends RelativeLayout
}
}
+ /**
+ * Method that applies the current theme to the widget components
+ */
+ public void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ View v = findViewById(R.id.inline_autocomplete_bg_text);
+ theme.setTextColor(getContext(), (TextView)v, "text_color"); //$NON-NLS-1$
+ v = findViewById(R.id.inline_autocomplete_fg_text);
+ theme.setTextColor(getContext(), (TextView)v, "text_color"); //$NON-NLS-1$
+ v = findViewById(R.id.inline_autocomplete_button_tab);
+ theme.setImageDrawable(
+ getContext(), (ImageView)v, "ab_tab_drawable"); //$NON-NLS-1$
+ }
+
}
diff --git a/src/com/cyanogenmod/filemanager/ui/widgets/NavigationView.java b/src/com/cyanogenmod/filemanager/ui/widgets/NavigationView.java
index 160a35e5..24b1af59 100644
--- a/src/com/cyanogenmod/filemanager/ui/widgets/NavigationView.java
+++ b/src/com/cyanogenmod/filemanager/ui/widgets/NavigationView.java
@@ -27,6 +27,7 @@ import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListAdapter;
+import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.Toast;
@@ -49,6 +50,8 @@ import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.NavigationLayoutMode;
import com.cyanogenmod.filemanager.preferences.ObjectIdentifier;
import com.cyanogenmod.filemanager.preferences.Preferences;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.policy.DeleteActionPolicy;
import com.cyanogenmod.filemanager.ui.policy.IntentsActionPolicy;
import com.cyanogenmod.filemanager.ui.widgets.FlingerListView.OnItemFlingerListener;
@@ -512,14 +515,25 @@ public class NavigationView extends RelativeLayout implements
* Method that refresh the view data.
*/
public void refresh() {
+ refresh(false);
+ }
+
+ /**
+ * Method that refresh the view data.
+ *
+ * @param restore Restore previous position
+ */
+ public void refresh(boolean restore) {
FileSystemObject fso = null;
// Try to restore the previous scroll position
- try {
- if (this.mAdapterView != null && this.mAdapter != null) {
- int position = this.mAdapterView.getFirstVisiblePosition();
- fso = this.mAdapter.getItem(position);
- }
- } catch (Throwable _throw) {/**NON BLOCK**/}
+ if (restore) {
+ try {
+ if (this.mAdapterView != null && this.mAdapter != null) {
+ int position = this.mAdapterView.getFirstVisiblePosition();
+ fso = this.mAdapter.getItem(position);
+ }
+ } catch (Throwable _throw) {/**NON BLOCK**/}
+ }
refresh(fso);
}
@@ -1206,4 +1220,26 @@ public class NavigationView extends RelativeLayout implements
return newDir;
}
+ /**
+ * Method that applies the current theme to the activity
+ */
+ public void applyTheme() {
+ //- Breadcrumb
+ if (getBreadcrumb() != null) {
+ getBreadcrumb().applyTheme();
+ }
+
+ //- Redraw the adapter view
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setBackgroundDrawable(getContext(), this, "background_drawable"); //$NON-NLS-1$
+ if (this.mAdapter != null) {
+ this.mAdapter.notifyThemeChanged();
+ }
+ if (this.mAdapterView instanceof ListView) {
+ ((ListView)this.mAdapterView).setDivider(
+ theme.getDrawable(getContext(), "horizontal_divider_drawable")); //$NON-NLS-1$
+ }
+ refresh();
+ }
+
}
diff --git a/src/com/cyanogenmod/filemanager/util/AndroidHelper.java b/src/com/cyanogenmod/filemanager/util/AndroidHelper.java
index 1692242d..57260ec1 100644
--- a/src/com/cyanogenmod/filemanager/util/AndroidHelper.java
+++ b/src/com/cyanogenmod/filemanager/util/AndroidHelper.java
@@ -17,11 +17,14 @@
package com.cyanogenmod.filemanager.util;
import android.content.Context;
+import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.util.DisplayMetrics;
import android.view.ViewConfiguration;
+import com.cyanogenmod.filemanager.R;
+
/**
* A helper class with useful methods for deal with android.
*/
@@ -57,7 +60,7 @@ public final class AndroidHelper {
* @param dp A value in dp (Device independent pixels) unit
* @return float A float value to represent Pixels equivalent to dp according to device
*/
- public static float convertDpToPixel(Context ctx, float dp){
+ public static float convertDpToPixel(Context ctx, float dp) {
Resources resources = ctx.getResources();
DisplayMetrics metrics = resources.getDisplayMetrics();
return dp * (metrics.densityDpi / 160f);
@@ -77,4 +80,25 @@ public final class AndroidHelper {
}
+ /**
+ * Method that check if the app is signed with the platform signature
+ *
+ * @param ctx The current context
+ * @return boolean If the app is signed with the platform signature
+ */
+ public static boolean isAppPlatformSignature(Context ctx) {
+ // TODO This need to be improved, checking if the app is really with the platform signature
+ try {
+ // For now only check that the app is installed in system directory
+ PackageManager pm = ctx.getPackageManager();
+ String appDir = pm.getApplicationInfo(ctx.getPackageName(), 0).sourceDir;
+ String systemDir = ctx.getString(R.string.system_dir);
+ return appDir.startsWith(systemDir);
+
+ } catch (Exception e) {
+ ExceptionUtil.translateException(ctx, e, true, false);
+ }
+ return false;
+ }
+
}
diff --git a/src/com/cyanogenmod/filemanager/util/BookmarksHelper.java b/src/com/cyanogenmod/filemanager/util/BookmarksHelper.java
index 309e01d1..0bc5dfee 100644
--- a/src/com/cyanogenmod/filemanager/util/BookmarksHelper.java
+++ b/src/com/cyanogenmod/filemanager/util/BookmarksHelper.java
@@ -16,7 +16,6 @@
package com.cyanogenmod.filemanager.util;
-import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.model.Bookmark;
/**
@@ -35,22 +34,22 @@ public final class BookmarksHelper {
* Method that returns the associated icon to the bookmark.
*
* @param bookmark The bookmark
- * @return The associated icon
+ * @return String The associated icon resource name
*/
- public static int getIcon(Bookmark bookmark) {
+ public static String getIcon(Bookmark bookmark) {
if (bookmark.mType.compareTo(Bookmark.BOOKMARK_TYPE.HOME) == 0) {
- return R.drawable.ic_holo_light_home;
+ return "ic_home_drawable"; //$NON-NLS-1$
}
if (bookmark.mType.compareTo(Bookmark.BOOKMARK_TYPE.FILESYSTEM) == 0) {
- return R.drawable.ic_holo_light_filesystem;
+ return "ic_filesystem_drawable"; //$NON-NLS-1$
}
if (bookmark.mType.compareTo(Bookmark.BOOKMARK_TYPE.SDCARD) == 0) {
- return R.drawable.ic_holo_light_sdcard;
+ return "ic_sdcard_drawable"; //$NON-NLS-1$
}
if (bookmark.mType.compareTo(Bookmark.BOOKMARK_TYPE.USB) == 0) {
- return R.drawable.ic_holo_light_usb;
+ return "ic_usb_drawable"; //$NON-NLS-1$
}
//Bookmark add by the user
- return R.drawable.ic_holo_light_user_defined_bookmark;
+ return "ic_user_defined_bookmark_drawable"; //$NON-NLS-1$
}
}
diff --git a/src/com/cyanogenmod/filemanager/util/DialogHelper.java b/src/com/cyanogenmod/filemanager/util/DialogHelper.java
index 1b69f0b5..4e9ca529 100644
--- a/src/com/cyanogenmod/filemanager/util/DialogHelper.java
+++ b/src/com/cyanogenmod/filemanager/util/DialogHelper.java
@@ -36,6 +36,8 @@ import android.widget.Toast;
import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.adapters.CheckableListAdapter;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import java.util.ArrayList;
import java.util.List;
@@ -209,6 +211,12 @@ public final class DialogHelper {
listView.setChoiceMode(AbsListView.CHOICE_MODE_SINGLE);
builder.setView(listView);
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setBackgroundDrawable(context, listView, "background_drawable"); //$NON-NLS-1$
+ listView.setDivider(
+ theme.getDrawable(context, "horizontal_divider_drawable")); //$NON-NLS-1$
+
builder.setNegativeButton(context.getString(R.string.cancel), new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
@@ -401,7 +409,7 @@ public final class DialogHelper {
*/
public static AlertDialog createDialog(Context context, int icon, String title, View content) {
//Create the alert dialog
- AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ final AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setCustomTitle(createTitle(context, icon, title, false));
builder.setView(content);
return builder.create();
@@ -432,6 +440,12 @@ public final class DialogHelper {
vText.setFilters(new InputFilter[]{new InputFilter.AllCaps()});
}
vText.setText(title);
+
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setBackgroundDrawable(context, lyTitle, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(context, vText, "dialog_text_color"); //$NON-NLS-1$
+
return lyTitle;
}
@@ -451,6 +465,12 @@ public final class DialogHelper {
null);
TextView vMsg = (TextView)lyMessage.findViewById(R.id.dialog_message);
vMsg.setText(message);
+
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setBackgroundDrawable(context, lyMessage, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(context, vMsg, "text_color"); //$NON-NLS-1$
+
return lyMessage;
}
@@ -473,6 +493,22 @@ public final class DialogHelper {
}
/**
+ * Method that delegates the display of a dialog. This method applies the style to the
+ * dialog, so all dialogs of the application MUST used this method to display the dialog.
+ *
+ * @param context The current context
+ * @param dialog The dialog to show
+ */
+ public static void delegateDialogShow(Context context, AlertDialog dialog) {
+ // Show the dialog
+ dialog.show();
+
+ // Apply theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setDialogStyle(context, dialog);
+ }
+
+ /**
* Method that creates and display a toast dialog.
*
* @param context The context to use.
diff --git a/src/com/cyanogenmod/filemanager/util/ExceptionUtil.java b/src/com/cyanogenmod/filemanager/util/ExceptionUtil.java
index 69e7f089..213f4dc7 100644
--- a/src/com/cyanogenmod/filemanager/util/ExceptionUtil.java
+++ b/src/com/cyanogenmod/filemanager/util/ExceptionUtil.java
@@ -219,8 +219,10 @@ public final class ExceptionUtil {
if (fToast) {
DialogHelper.showToast(context, fMsgResId, Toast.LENGTH_SHORT);
} else {
- DialogHelper.createErrorDialog(
- context, R.string.error_title, fMsgResId).show();
+ AlertDialog dialog =
+ DialogHelper.createErrorDialog(
+ context, R.string.error_title, fMsgResId);
+ DialogHelper.delegateDialogShow(context, dialog);
}
} catch (Exception e) {
Log.e(context.getClass().getSimpleName(),
@@ -322,7 +324,7 @@ public final class ExceptionUtil {
}
}
});
- alert.show();
+ DialogHelper.delegateDialogShow(context, alert);
}
/**
diff --git a/src/com/cyanogenmod/filemanager/util/MimeTypeHelper.java b/src/com/cyanogenmod/filemanager/util/MimeTypeHelper.java
index 05c638aa..3c7385dc 100644
--- a/src/com/cyanogenmod/filemanager/util/MimeTypeHelper.java
+++ b/src/com/cyanogenmod/filemanager/util/MimeTypeHelper.java
@@ -18,6 +18,7 @@ package com.cyanogenmod.filemanager.util;
import android.content.Context;
import android.content.res.Resources;
+import android.text.TextUtils;
import android.util.Log;
import com.cyanogenmod.filemanager.R;
@@ -181,7 +182,6 @@ public final class MimeTypeHelper {
*/
public static final String ALL_MIME_TYPES = "*/*"; //$NON-NLS-1$
- private static Map<String, Integer> sCachedIndentifiers;
private static Map<String, MimeTypeInfo> sMimeTypes;
/**
@@ -197,9 +197,9 @@ public final class MimeTypeHelper {
*
* @param context The current context
* @param fso The file system object
- * @return int The associated mime/type icon resource identifier
+ * @return String The associated mime/type icon resource identifier
*/
- public static final int getIcon(Context context, FileSystemObject fso) {
+ public static final String getIcon(Context context, FileSystemObject fso) {
//Ensure that mime types are loaded
if (sMimeTypes == null) {
loadMimeTypes(context);
@@ -207,7 +207,7 @@ public final class MimeTypeHelper {
//Check if the argument is a folder
if (fso instanceof Directory || FileHelper.isSymlinkRefDirectory(fso)) {
- return R.drawable.ic_fso_folder;
+ return "ic_fso_folder_drawable"; //$NON-NLS-1$
}
//Get the extension and delivery
@@ -215,21 +215,9 @@ public final class MimeTypeHelper {
if (ext != null) {
MimeTypeInfo mimeTypeInfo = sMimeTypes.get(ext);
if (mimeTypeInfo != null) {
- //Search the identifier in the cache
- int drawableId = 0;
- if (sCachedIndentifiers.containsKey(ext)) {
- // Try from cached resources
- drawableId = sCachedIndentifiers.get(ext).intValue();
- return drawableId;
- }
-
// Create a new drawable
- drawableId = ResourcesHelper.getIdentifier(
- context.getResources(), "drawable", //$NON-NLS-1$
- mimeTypeInfo.mDrawable);
- if (drawableId != 0) {
- sCachedIndentifiers.put(ext, Integer.valueOf(drawableId));
- return drawableId;
+ if (!TextUtils.isEmpty(mimeTypeInfo.mDrawable)) {
+ return mimeTypeInfo.mDrawable;
}
// Something was wrong here. The resource should exist, but it's not present.
@@ -239,24 +227,23 @@ public final class MimeTypeHelper {
"Something was wrong with the drawable of the fso:" + //$NON-NLS-1$
"%s, mime: %s", //$NON-NLS-1$
fso.toString(),
- mimeTypeInfo.toString()
- ));
+ mimeTypeInfo.toString()));
}
}
// Check system file
if (FileHelper.isSystemFile(fso)) {
- return R.drawable.fso_type_system;
+ return "fso_type_system_drawable"; //$NON-NLS-1$
}
// Check if the fso is executable (but not a symlink)
if (!(fso instanceof Symlink)) {
if (fso.getPermissions().getUser().isExecute() ||
fso.getPermissions().getGroup().isExecute() ||
fso.getPermissions().getOthers().isExecute()) {
- return R.drawable.fso_type_executable;
+ return "fso_type_executable_drawable"; //$NON-NLS-1$
}
}
- return R.drawable.ic_fso_default;
+ return "ic_fso_default_drawable"; //$NON-NLS-1$
}
/**
@@ -459,9 +446,7 @@ public final class MimeTypeHelper {
public static synchronized void loadMimeTypes(Context context) {
if (sMimeTypes == null) {
try {
- // Create a new icon holder
- sCachedIndentifiers = new HashMap<String, Integer>();
-
+ // Load the mime/type database
Properties mimeTypes = new Properties();
mimeTypes.load(context.getResources().openRawResource(R.raw.mime_types));
diff --git a/src/com/cyanogenmod/filemanager/util/SearchHelper.java b/src/com/cyanogenmod/filemanager/util/SearchHelper.java
index 7b45eac7..90fbb81f 100644
--- a/src/com/cyanogenmod/filemanager/util/SearchHelper.java
+++ b/src/com/cyanogenmod/filemanager/util/SearchHelper.java
@@ -16,7 +16,6 @@
package com.cyanogenmod.filemanager.util;
-import android.graphics.Color;
import android.graphics.Typeface;
import android.text.Spannable;
import android.text.SpannableString;
@@ -118,9 +117,11 @@ public final class SearchHelper {
*
* @param result The result to highlight
* @param queries The list of queries that parameterized the search
+ * @param highlightedColor The highlight color
* @return CharSequence The name string highlighted
*/
- public static CharSequence getHighlightedName(SearchResult result, List<String> queries) {
+ public static CharSequence getHighlightedName(
+ SearchResult result, List<String> queries, int highlightedColor) {
String name = result.getFso().getName();
int cc = queries.size();
for (int i = 0; i < cc; i++) {
@@ -135,7 +136,8 @@ public final class SearchHelper {
if (matcher.find()) {
//Highlight the match
span.setSpan(
- new BackgroundColorSpan(Color.YELLOW), matcher.start(), matcher.end(), 0);
+ new BackgroundColorSpan(highlightedColor),
+ matcher.start(), matcher.end(), 0);
span.setSpan(
new StyleSpan(Typeface.BOLD), matcher.start(), matcher.end(), 0);
return span;
diff --git a/themes/.gitignore b/themes/.gitignore
new file mode 100644
index 00000000..88efa7cc
--- /dev/null
+++ b/themes/.gitignore
@@ -0,0 +1,8 @@
+/.settings
+/bin
+/gen
+/.checkstyle
+/.classpath
+/.project
+/project.properties
+lint.xml \ No newline at end of file
diff --git a/themes/Android.mk b/themes/Android.mk
new file mode 100644
index 00000000..6d8bef90
--- /dev/null
+++ b/themes/Android.mk
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2012 The CyanogenMod Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_PACKAGE_NAME := CMFileManagerThemes
+LOCAL_PROGUARD_FLAG_FILES := proguard.flags
+LOCAL_AAPT_INCLUDE_ALL_RESOURCES := true
+
+include $(BUILD_PACKAGE)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/themes/AndroidManifest.xml b/themes/AndroidManifest.xml
new file mode 100644
index 00000000..33672ae3
--- /dev/null
+++ b/themes/AndroidManifest.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.cyanogenmod.filemanager.themes"
+ android:versionCode="100"
+ android:versionName="1.0.0">
+
+ <original-package android:name="com.cyanogenmod.filemanager.themes" />
+
+ <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16" />
+
+ <application
+ android:name=".ThemeActivity"
+ android:description="@string/app_description"
+ android:label="@string/app_name"
+ android:icon="@drawable/ic_launcher">
+
+ <activity
+ android:name="ThemeActivity"
+ android:label="@string/app_name"
+ android:permission="com.cyanogenmod.filemanager.permissions.READ_THEME"
+ android:exported="true">
+ <intent-filter>
+ <action android:name="com.cyanogenmod.filemanager.actions.MAIN_THEME" />
+ <category android:name="com.cyanogenmod.filemanager.categories.THEME" />
+ </intent-filter>
+ </activity>
+
+ </application>
+
+</manifest>
diff --git a/themes/CleanSpec.mk b/themes/CleanSpec.mk
new file mode 100644
index 00000000..c097f3f1
--- /dev/null
+++ b/themes/CleanSpec.mk
@@ -0,0 +1,50 @@
+# Copyright (C) 2007 The Android Open Source Project
+# Copyright (C) 2012 The CyanogenMod Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# If you don't need to do a full clean build but would like to touch
+# a file or delete some intermediate files, add a clean step to the end
+# of the list. These steps will only be run once, if they haven't been
+# run before.
+#
+# E.g.:
+# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
+# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
+#
+# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
+# files that are missing or have been moved.
+#
+# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
+# Use $(OUT_DIR) to refer to the "out" directory.
+#
+# If you need to re-do something that's already mentioned, just copy
+# the command and add it to the bottom of the list. E.g., if a change
+# that you made last week required touching a file and a change you
+# made today requires touching the same file, just copy the old
+# touch step and add it to the end of the list.
+#
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
+
+# For example:
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
+#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
+#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
+
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************ \ No newline at end of file
diff --git a/themes/README.md b/themes/README.md
new file mode 100644
index 00000000..6f87c2fe
--- /dev/null
+++ b/themes/README.md
@@ -0,0 +1,30 @@
+CyanogenMod File Manager Themes
+===============================
+
+An application that contains extra themes for the CMFileManager application.
+
+This packages brings with the next themes:
+
+ - Dark theme
+
+For build new themes, developers should:
+
+ - Create a new package that contains an activity with:
+ * Permission: com.cyanogenmod.filemanager.permissions.READ_THEME
+ * Action: com.cyanogenmod.filemanager.actions.MAIN_THEME
+ * Category: com.cyanogenmod.filemanager.categories.THEME
+ - Define the themes_ids, themes_names and themes_descriptions arrays-strings
+ definitions for the themes that the package support.
+ - Create a xxx_theme.xml for every theme that the package support, where the
+ xxx is the id of the theme. Put your resources in this file, prefixing the
+ resource with the id of the theme (xxx_). For a list of all supported
+ resources see theme.xml in res/values of CMFileManager project.
+
+
+This source was released under the terms of
+[Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) license.
+
+Visit [CyanogenMod Github](https://github.com/CyanogenMod) and [CyanogenMod
+Code Review](http://review.cyanogenmod.com/) to get the source and patches.
+
+Copyright © 2012 The CyanogenMod Project
diff --git a/themes/proguard.flags b/themes/proguard.flags
new file mode 100644
index 00000000..b0af53d3
--- /dev/null
+++ b/themes/proguard.flags
@@ -0,0 +1,28 @@
+#configuration
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+#keep common classes
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+
+#keep all classes that might be used in XML layouts
+-keep public class * extends android.view.View {
+ public <init>(android.content.Context);
+ public <init>(android.content.Context, android.util.AttributeSet);
+ public <init>(android.content.Context, android.util.AttributeSet, int);
+ public void set*(...);
+}
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet);
+}
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet, int);
+} \ No newline at end of file
diff --git a/themes/res/drawable-hdpi/btn_holo_dark_check_off_normal.png b/themes/res/drawable-hdpi/btn_holo_dark_check_off_normal.png
new file mode 100644
index 00000000..0ecc8e5a
--- /dev/null
+++ b/themes/res/drawable-hdpi/btn_holo_dark_check_off_normal.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/btn_holo_dark_check_on_normal.png b/themes/res/drawable-hdpi/btn_holo_dark_check_on_normal.png
new file mode 100644
index 00000000..21788fdc
--- /dev/null
+++ b/themes/res/drawable-hdpi/btn_holo_dark_check_on_normal.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/btn_holo_dark_check_on_normal_inverted.png b/themes/res/drawable-hdpi/btn_holo_dark_check_on_normal_inverted.png
new file mode 100644
index 00000000..97f723d0
--- /dev/null
+++ b/themes/res/drawable-hdpi/btn_holo_dark_check_on_normal_inverted.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/divider_horizontal_dark_opaque.9.png b/themes/res/drawable-hdpi/divider_horizontal_dark_opaque.9.png
new file mode 100644
index 00000000..60e2cb2d
--- /dev/null
+++ b/themes/res/drawable-hdpi/divider_horizontal_dark_opaque.9.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/divider_vertical_dark_opaque.9.png b/themes/res/drawable-hdpi/divider_vertical_dark_opaque.9.png
new file mode 100644
index 00000000..60e2cb2d
--- /dev/null
+++ b/themes/res/drawable-hdpi/divider_vertical_dark_opaque.9.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_accept.png b/themes/res/drawable-hdpi/ic_holo_dark_accept.png
new file mode 100644
index 00000000..ede11962
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_accept.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_bookmarks.png b/themes/res/drawable-hdpi/ic_holo_dark_bookmarks.png
new file mode 100644
index 00000000..8c964e10
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_bookmarks.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_close.png b/themes/res/drawable-hdpi/ic_holo_dark_close.png
new file mode 100644
index 00000000..87962ecf
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_close.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_config.png b/themes/res/drawable-hdpi/ic_holo_dark_config.png
new file mode 100644
index 00000000..1f6325e0
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_config.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_contextual_action.png b/themes/res/drawable-hdpi/ic_holo_dark_contextual_action.png
new file mode 100644
index 00000000..9e7b254c
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_contextual_action.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_expander_close.png b/themes/res/drawable-hdpi/ic_holo_dark_expander_close.png
new file mode 100644
index 00000000..94c6ec0b
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_expander_close.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_expander_open.png b/themes/res/drawable-hdpi/ic_holo_dark_expander_open.png
new file mode 100644
index 00000000..a81fecc8
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_expander_open.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_filesystem.png b/themes/res/drawable-hdpi/ic_holo_dark_filesystem.png
new file mode 100644
index 00000000..4c4ec36a
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_filesystem.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_fs_locked.png b/themes/res/drawable-hdpi/ic_holo_dark_fs_locked.png
new file mode 100644
index 00000000..e3aac478
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_fs_locked.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_fs_unlocked.png b/themes/res/drawable-hdpi/ic_holo_dark_fs_unlocked.png
new file mode 100644
index 00000000..24db9daf
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_fs_unlocked.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_fs_warning.png b/themes/res/drawable-hdpi/ic_holo_dark_fs_warning.png
new file mode 100644
index 00000000..26eab48e
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_fs_warning.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_history.png b/themes/res/drawable-hdpi/ic_holo_dark_history.png
new file mode 100644
index 00000000..d7f0881b
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_history.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_home.png b/themes/res/drawable-hdpi/ic_holo_dark_home.png
new file mode 100644
index 00000000..b647a412
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_home.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_layout.png b/themes/res/drawable-hdpi/ic_holo_dark_layout.png
new file mode 100644
index 00000000..33a1d8cb
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_layout.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_overflow.png b/themes/res/drawable-hdpi/ic_holo_dark_overflow.png
new file mode 100644
index 00000000..5f050269
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_overflow.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_save.png b/themes/res/drawable-hdpi/ic_holo_dark_save.png
new file mode 100644
index 00000000..d18cc5e8
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_save.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_sdcard.png b/themes/res/drawable-hdpi/ic_holo_dark_sdcard.png
new file mode 100644
index 00000000..9545efd7
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_sdcard.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_search.png b/themes/res/drawable-hdpi/ic_holo_dark_search.png
new file mode 100644
index 00000000..b8c2ba5d
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_search.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_sort_alphabetically.png b/themes/res/drawable-hdpi/ic_holo_dark_sort_alphabetically.png
new file mode 100644
index 00000000..a80e676d
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_sort_alphabetically.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_tab.png b/themes/res/drawable-hdpi/ic_holo_dark_tab.png
new file mode 100644
index 00000000..dde95461
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_tab.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_usb.png b/themes/res/drawable-hdpi/ic_holo_dark_usb.png
new file mode 100644
index 00000000..0c448eac
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_usb.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_user_defined_bookmark.png b/themes/res/drawable-hdpi/ic_holo_dark_user_defined_bookmark.png
new file mode 100644
index 00000000..c1814312
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_user_defined_bookmark.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_holo_dark_view.png b/themes/res/drawable-hdpi/ic_holo_dark_view.png
new file mode 100644
index 00000000..fd91f2c5
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_holo_dark_view.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/ic_launcher.png b/themes/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 00000000..f9f60cb7
--- /dev/null
+++ b/themes/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/progress_bg_holo_dark.9.png b/themes/res/drawable-hdpi/progress_bg_holo_dark.9.png
new file mode 100644
index 00000000..a4c5b8bc
--- /dev/null
+++ b/themes/res/drawable-hdpi/progress_bg_holo_dark.9.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/progress_primary_holo_dark.9.png b/themes/res/drawable-hdpi/progress_primary_holo_dark.9.png
new file mode 100644
index 00000000..b73abba7
--- /dev/null
+++ b/themes/res/drawable-hdpi/progress_primary_holo_dark.9.png
Binary files differ
diff --git a/themes/res/drawable-hdpi/progress_secondary_holo_dark.9.png b/themes/res/drawable-hdpi/progress_secondary_holo_dark.9.png
new file mode 100644
index 00000000..a75d0dd5
--- /dev/null
+++ b/themes/res/drawable-hdpi/progress_secondary_holo_dark.9.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/btn_holo_dark_check_off_normal.png b/themes/res/drawable-mdpi/btn_holo_dark_check_off_normal.png
new file mode 100644
index 00000000..d0bfa412
--- /dev/null
+++ b/themes/res/drawable-mdpi/btn_holo_dark_check_off_normal.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/btn_holo_dark_check_on_normal.png b/themes/res/drawable-mdpi/btn_holo_dark_check_on_normal.png
new file mode 100644
index 00000000..c9818699
--- /dev/null
+++ b/themes/res/drawable-mdpi/btn_holo_dark_check_on_normal.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/btn_holo_dark_check_on_normal_inverted.png b/themes/res/drawable-mdpi/btn_holo_dark_check_on_normal_inverted.png
new file mode 100644
index 00000000..8254d00f
--- /dev/null
+++ b/themes/res/drawable-mdpi/btn_holo_dark_check_on_normal_inverted.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/divider_horizontal_dark_opaque.9.png b/themes/res/drawable-mdpi/divider_horizontal_dark_opaque.9.png
new file mode 100644
index 00000000..60e2cb2d
--- /dev/null
+++ b/themes/res/drawable-mdpi/divider_horizontal_dark_opaque.9.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/divider_vertical_dark_opaque.9.png b/themes/res/drawable-mdpi/divider_vertical_dark_opaque.9.png
new file mode 100644
index 00000000..60e2cb2d
--- /dev/null
+++ b/themes/res/drawable-mdpi/divider_vertical_dark_opaque.9.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_accept.png b/themes/res/drawable-mdpi/ic_holo_dark_accept.png
new file mode 100644
index 00000000..24d5caa6
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_accept.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_bookmarks.png b/themes/res/drawable-mdpi/ic_holo_dark_bookmarks.png
new file mode 100644
index 00000000..8044b492
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_bookmarks.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_close.png b/themes/res/drawable-mdpi/ic_holo_dark_close.png
new file mode 100644
index 00000000..9241487c
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_close.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_config.png b/themes/res/drawable-mdpi/ic_holo_dark_config.png
new file mode 100644
index 00000000..79bc9fd6
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_config.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_contextual_action.png b/themes/res/drawable-mdpi/ic_holo_dark_contextual_action.png
new file mode 100644
index 00000000..129b763c
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_contextual_action.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_expander_close.png b/themes/res/drawable-mdpi/ic_holo_dark_expander_close.png
new file mode 100644
index 00000000..609f10ea
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_expander_close.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_expander_open.png b/themes/res/drawable-mdpi/ic_holo_dark_expander_open.png
new file mode 100644
index 00000000..aa55c8a8
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_expander_open.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_filesystem.png b/themes/res/drawable-mdpi/ic_holo_dark_filesystem.png
new file mode 100644
index 00000000..763f575f
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_filesystem.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_fs_locked.png b/themes/res/drawable-mdpi/ic_holo_dark_fs_locked.png
new file mode 100644
index 00000000..9ee963b8
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_fs_locked.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_fs_unlocked.png b/themes/res/drawable-mdpi/ic_holo_dark_fs_unlocked.png
new file mode 100644
index 00000000..134f8d77
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_fs_unlocked.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_fs_warning.png b/themes/res/drawable-mdpi/ic_holo_dark_fs_warning.png
new file mode 100644
index 00000000..3d8bffd4
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_fs_warning.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_history.png b/themes/res/drawable-mdpi/ic_holo_dark_history.png
new file mode 100644
index 00000000..e452d52a
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_history.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_home.png b/themes/res/drawable-mdpi/ic_holo_dark_home.png
new file mode 100644
index 00000000..ada79e05
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_home.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_layout.png b/themes/res/drawable-mdpi/ic_holo_dark_layout.png
new file mode 100644
index 00000000..2a45d7b7
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_layout.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_overflow.png b/themes/res/drawable-mdpi/ic_holo_dark_overflow.png
new file mode 100644
index 00000000..fff5d893
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_overflow.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_save.png b/themes/res/drawable-mdpi/ic_holo_dark_save.png
new file mode 100644
index 00000000..f38e301a
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_save.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_sdcard.png b/themes/res/drawable-mdpi/ic_holo_dark_sdcard.png
new file mode 100644
index 00000000..90b1de9b
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_sdcard.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_search.png b/themes/res/drawable-mdpi/ic_holo_dark_search.png
new file mode 100644
index 00000000..ffe30fc8
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_search.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_sort_alphabetically.png b/themes/res/drawable-mdpi/ic_holo_dark_sort_alphabetically.png
new file mode 100644
index 00000000..b2bc7e63
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_sort_alphabetically.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_tab.png b/themes/res/drawable-mdpi/ic_holo_dark_tab.png
new file mode 100644
index 00000000..19b26dbf
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_tab.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_usb.png b/themes/res/drawable-mdpi/ic_holo_dark_usb.png
new file mode 100644
index 00000000..69c7789a
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_usb.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_user_defined_bookmark.png b/themes/res/drawable-mdpi/ic_holo_dark_user_defined_bookmark.png
new file mode 100644
index 00000000..ad1d4156
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_user_defined_bookmark.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_holo_dark_view.png b/themes/res/drawable-mdpi/ic_holo_dark_view.png
new file mode 100644
index 00000000..64db9c2d
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_holo_dark_view.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/ic_launcher.png b/themes/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 00000000..d5cfd44b
--- /dev/null
+++ b/themes/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/progress_bg_holo_dark.9.png b/themes/res/drawable-mdpi/progress_bg_holo_dark.9.png
new file mode 100644
index 00000000..b1f5cf33
--- /dev/null
+++ b/themes/res/drawable-mdpi/progress_bg_holo_dark.9.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/progress_primary_holo_dark.9.png b/themes/res/drawable-mdpi/progress_primary_holo_dark.9.png
new file mode 100644
index 00000000..b86f4b51
--- /dev/null
+++ b/themes/res/drawable-mdpi/progress_primary_holo_dark.9.png
Binary files differ
diff --git a/themes/res/drawable-mdpi/progress_secondary_holo_dark.9.png b/themes/res/drawable-mdpi/progress_secondary_holo_dark.9.png
new file mode 100644
index 00000000..5651a7a1
--- /dev/null
+++ b/themes/res/drawable-mdpi/progress_secondary_holo_dark.9.png
Binary files differ
diff --git a/themes/res/drawable-nodpi/dark_background.9.png b/themes/res/drawable-nodpi/dark_background.9.png
new file mode 100644
index 00000000..f7e5e226
--- /dev/null
+++ b/themes/res/drawable-nodpi/dark_background.9.png
Binary files differ
diff --git a/themes/res/drawable-nodpi/dark_popup_background.9.png b/themes/res/drawable-nodpi/dark_popup_background.9.png
new file mode 100644
index 00000000..d68ffb7e
--- /dev/null
+++ b/themes/res/drawable-nodpi/dark_popup_background.9.png
Binary files differ
diff --git a/themes/res/drawable-nodpi/dark_selectionbar.9.png b/themes/res/drawable-nodpi/dark_selectionbar.9.png
new file mode 100644
index 00000000..3653f8b5
--- /dev/null
+++ b/themes/res/drawable-nodpi/dark_selectionbar.9.png
Binary files differ
diff --git a/themes/res/drawable-nodpi/dark_statusbar.9.png b/themes/res/drawable-nodpi/dark_statusbar.9.png
new file mode 100644
index 00000000..373e4d27
--- /dev/null
+++ b/themes/res/drawable-nodpi/dark_statusbar.9.png
Binary files differ
diff --git a/themes/res/drawable-nodpi/dark_theme_no_preview.png b/themes/res/drawable-nodpi/dark_theme_no_preview.png
new file mode 100644
index 00000000..2be38963
--- /dev/null
+++ b/themes/res/drawable-nodpi/dark_theme_no_preview.png
Binary files differ
diff --git a/themes/res/drawable-nodpi/dark_theme_preview.png b/themes/res/drawable-nodpi/dark_theme_preview.png
new file mode 100644
index 00000000..c18581f9
--- /dev/null
+++ b/themes/res/drawable-nodpi/dark_theme_preview.png
Binary files differ
diff --git a/themes/res/drawable-nodpi/dark_titlebar.9.png b/themes/res/drawable-nodpi/dark_titlebar.9.png
new file mode 100644
index 00000000..0dfb6f3f
--- /dev/null
+++ b/themes/res/drawable-nodpi/dark_titlebar.9.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/btn_holo_dark_check_off_normal.png b/themes/res/drawable-xhdpi/btn_holo_dark_check_off_normal.png
new file mode 100644
index 00000000..a69d5a6c
--- /dev/null
+++ b/themes/res/drawable-xhdpi/btn_holo_dark_check_off_normal.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/btn_holo_dark_check_on_normal.png b/themes/res/drawable-xhdpi/btn_holo_dark_check_on_normal.png
new file mode 100644
index 00000000..406fff5b
--- /dev/null
+++ b/themes/res/drawable-xhdpi/btn_holo_dark_check_on_normal.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/btn_holo_dark_check_on_normal_inverted.png b/themes/res/drawable-xhdpi/btn_holo_dark_check_on_normal_inverted.png
new file mode 100644
index 00000000..c74c2aaa
--- /dev/null
+++ b/themes/res/drawable-xhdpi/btn_holo_dark_check_on_normal_inverted.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/divider_horizontal_dark_opaque.9.png b/themes/res/drawable-xhdpi/divider_horizontal_dark_opaque.9.png
new file mode 100644
index 00000000..60e2cb2d
--- /dev/null
+++ b/themes/res/drawable-xhdpi/divider_horizontal_dark_opaque.9.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/divider_vertical_dark_opaque.9.png b/themes/res/drawable-xhdpi/divider_vertical_dark_opaque.9.png
new file mode 100644
index 00000000..60e2cb2d
--- /dev/null
+++ b/themes/res/drawable-xhdpi/divider_vertical_dark_opaque.9.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_accept.png b/themes/res/drawable-xhdpi/ic_holo_dark_accept.png
new file mode 100644
index 00000000..03ce9ccc
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_accept.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_bookmarks.png b/themes/res/drawable-xhdpi/ic_holo_dark_bookmarks.png
new file mode 100644
index 00000000..97f67666
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_bookmarks.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_close.png b/themes/res/drawable-xhdpi/ic_holo_dark_close.png
new file mode 100644
index 00000000..e8b36fce
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_close.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_config.png b/themes/res/drawable-xhdpi/ic_holo_dark_config.png
new file mode 100644
index 00000000..f0b7417c
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_config.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_contextual_action.png b/themes/res/drawable-xhdpi/ic_holo_dark_contextual_action.png
new file mode 100644
index 00000000..0fd69b7f
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_contextual_action.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_expander_close.png b/themes/res/drawable-xhdpi/ic_holo_dark_expander_close.png
new file mode 100644
index 00000000..5df85c03
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_expander_close.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_expander_open.png b/themes/res/drawable-xhdpi/ic_holo_dark_expander_open.png
new file mode 100644
index 00000000..48f5c7ac
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_expander_open.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_filesystem.png b/themes/res/drawable-xhdpi/ic_holo_dark_filesystem.png
new file mode 100644
index 00000000..7fda34e5
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_filesystem.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_fs_locked.png b/themes/res/drawable-xhdpi/ic_holo_dark_fs_locked.png
new file mode 100644
index 00000000..429d5fef
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_fs_locked.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_fs_unlocked.png b/themes/res/drawable-xhdpi/ic_holo_dark_fs_unlocked.png
new file mode 100644
index 00000000..bc794414
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_fs_unlocked.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_fs_warning.png b/themes/res/drawable-xhdpi/ic_holo_dark_fs_warning.png
new file mode 100644
index 00000000..a7d5cf9e
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_fs_warning.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_history.png b/themes/res/drawable-xhdpi/ic_holo_dark_history.png
new file mode 100644
index 00000000..1e7c5d01
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_history.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_home.png b/themes/res/drawable-xhdpi/ic_holo_dark_home.png
new file mode 100644
index 00000000..abead990
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_home.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_layout.png b/themes/res/drawable-xhdpi/ic_holo_dark_layout.png
new file mode 100644
index 00000000..9f6b30b4
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_layout.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_overflow.png b/themes/res/drawable-xhdpi/ic_holo_dark_overflow.png
new file mode 100644
index 00000000..7fe589e2
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_overflow.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_save.png b/themes/res/drawable-xhdpi/ic_holo_dark_save.png
new file mode 100644
index 00000000..ecd1f8d5
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_save.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_sdcard.png b/themes/res/drawable-xhdpi/ic_holo_dark_sdcard.png
new file mode 100644
index 00000000..25cadc5a
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_sdcard.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_search.png b/themes/res/drawable-xhdpi/ic_holo_dark_search.png
new file mode 100644
index 00000000..97774e46
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_search.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_sort_alphabetically.png b/themes/res/drawable-xhdpi/ic_holo_dark_sort_alphabetically.png
new file mode 100644
index 00000000..9d68ecf4
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_sort_alphabetically.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_tab.png b/themes/res/drawable-xhdpi/ic_holo_dark_tab.png
new file mode 100644
index 00000000..a129608f
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_tab.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_usb.png b/themes/res/drawable-xhdpi/ic_holo_dark_usb.png
new file mode 100644
index 00000000..687509ab
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_usb.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_user_defined_bookmark.png b/themes/res/drawable-xhdpi/ic_holo_dark_user_defined_bookmark.png
new file mode 100644
index 00000000..a6c5747a
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_user_defined_bookmark.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_holo_dark_view.png b/themes/res/drawable-xhdpi/ic_holo_dark_view.png
new file mode 100644
index 00000000..33296a58
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_holo_dark_view.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/ic_launcher.png b/themes/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 00000000..e49ebf60
--- /dev/null
+++ b/themes/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/progress_bg_holo_dark.9.png b/themes/res/drawable-xhdpi/progress_bg_holo_dark.9.png
new file mode 100644
index 00000000..34995280
--- /dev/null
+++ b/themes/res/drawable-xhdpi/progress_bg_holo_dark.9.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/progress_primary_holo_dark.9.png b/themes/res/drawable-xhdpi/progress_primary_holo_dark.9.png
new file mode 100644
index 00000000..f1069fd9
--- /dev/null
+++ b/themes/res/drawable-xhdpi/progress_primary_holo_dark.9.png
Binary files differ
diff --git a/themes/res/drawable-xhdpi/progress_secondary_holo_dark.9.png b/themes/res/drawable-xhdpi/progress_secondary_holo_dark.9.png
new file mode 100644
index 00000000..06ae19c0
--- /dev/null
+++ b/themes/res/drawable-xhdpi/progress_secondary_holo_dark.9.png
Binary files differ
diff --git a/themes/res/drawable/dark_checkable_selector.xml b/themes/res/drawable/dark_checkable_selector.xml
new file mode 100644
index 00000000..738bcb32
--- /dev/null
+++ b/themes/res/drawable/dark_checkable_selector.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item
+ android:drawable="@drawable/btn_holo_dark_check_on_normal_inverted"
+ android:state_selected="true"/>
+ <item
+ android:drawable="@drawable/btn_holo_dark_check_off_normal"/>
+
+</selector>
diff --git a/themes/res/drawable/dark_holo_button_selector.xml b/themes/res/drawable/dark_holo_button_selector.xml
new file mode 100644
index 00000000..76d512d1
--- /dev/null
+++ b/themes/res/drawable/dark_holo_button_selector.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@android:color/holo_blue_light"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_light"
+ android:state_enabled="true"
+ android:state_focused="true"/>
+ <item
+ android:drawable="@drawable/dark_background"/>
+
+</selector>
diff --git a/themes/res/drawable/dark_holo_list_selector_deselected.xml b/themes/res/drawable/dark_holo_list_selector_deselected.xml
new file mode 100644
index 00000000..c02103f6
--- /dev/null
+++ b/themes/res/drawable/dark_holo_list_selector_deselected.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_selected="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_light"
+ android:state_enabled="true"
+ android:state_focused="true"/>
+ <item
+ android:drawable="@android:color/transparent"/>
+
+</selector>
diff --git a/themes/res/drawable/dark_holo_list_selector_selected.xml b/themes/res/drawable/dark_holo_list_selector_selected.xml
new file mode 100644
index 00000000..119be360
--- /dev/null
+++ b/themes/res/drawable/dark_holo_list_selector_selected.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_selected="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_light"
+ android:state_enabled="true"
+ android:state_focused="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"/>
+
+</selector>
diff --git a/themes/res/drawable/dark_holo_popup_selector.xml b/themes/res/drawable/dark_holo_popup_selector.xml
new file mode 100644
index 00000000..326f9544
--- /dev/null
+++ b/themes/res/drawable/dark_holo_popup_selector.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_selected="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_light"
+ android:state_enabled="true"
+ android:state_focused="true"/>
+ <item
+ android:drawable="@drawable/dark_popup_background"/>
+
+</selector>
diff --git a/themes/res/drawable/dark_holo_selection.xml b/themes/res/drawable/dark_holo_selection.xml
new file mode 100644
index 00000000..1a15c570
--- /dev/null
+++ b/themes/res/drawable/dark_holo_selection.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@android:color/holo_blue_light"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_enabled="true"
+ android:state_focused="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_enabled="true"
+ android:state_checked="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_enabled="true"
+ android:state_selected="true"/>
+ <item
+ android:drawable="@android:color/transparent"/>
+
+</selector>
diff --git a/themes/res/drawable/dark_progress_horizontal_holo.xml b/themes/res/drawable/dark_progress_horizontal_holo.xml
new file mode 100644
index 00000000..328c7224
--- /dev/null
+++ b/themes/res/drawable/dark_progress_horizontal_holo.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:id="@android:id/background"
+ android:drawable="@drawable/progress_bg_holo_dark" />
+
+ <item android:id="@android:id/secondaryProgress">
+ <scale android:scaleWidth="100%"
+ android:drawable="@drawable/progress_secondary_holo_dark" />
+ </item>
+
+ <item android:id="@android:id/progress">
+ <scale android:scaleWidth="100%"
+ android:drawable="@drawable/progress_primary_holo_dark" />
+ </item>
+
+</layer-list>
diff --git a/themes/res/values/arrays.xml b/themes/res/values/arrays.xml
new file mode 100644
index 00000000..dc6d8fee
--- /dev/null
+++ b/themes/res/values/arrays.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- The identifiers of the themes that this app contains. All the resources
+ of every theme MUST be qualified with the identifier of the theme -->
+ <string-array name="themes_ids" translatable="false">
+ <item>dark</item>
+ </string-array>
+ <string-array name="themes_names" translatable="false">
+ <item>@string/dark_theme_name</item>
+ </string-array>
+ <string-array name="themes_descriptions" translatable="false">
+ <item>@string/dark_theme_desc</item>
+ </string-array>
+
+</resources>
diff --git a/themes/res/values/dark_theme.xml b/themes/res/values/dark_theme.xml
new file mode 100644
index 00000000..46e68160
--- /dev/null
+++ b/themes/res/values/dark_theme.xml
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<!--
+ A dark theme for CMFileManager.
+ -->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- The base theme used to customize some (non-themeables) widgets like dialogs
+ 2 possibles values:
+ * holo: @android:style/Theme.Holo
+ * holo_light: @android:style/Theme.Holo.Light
+ -->
+ <string name="dark_base_theme">holo</string>
+
+ <!-- The image preview -->
+ <drawable name="dark_theme_preview_drawable">@drawable/dark_theme_preview</drawable>
+
+ <!-- The drawable for the title bar -->
+ <drawable name="dark_titlebar_drawable">@drawable/dark_titlebar</drawable>
+
+ <!-- The background drawable -->
+ <drawable name="dark_background_drawable">@drawable/dark_background</drawable>
+
+ <!-- The drawable for the status bar -->
+ <drawable name="dark_statusbar_drawable">@drawable/dark_statusbar</drawable>
+
+ <!-- The drawable for the selection bar -->
+ <drawable name="dark_selectionbar_drawable">@drawable/dark_selectionbar</drawable>
+
+ <!-- The drawable for the overflow action bar button -->
+ <drawable name="dark_ab_overflow_drawable">@drawable/ic_holo_dark_overflow</drawable>
+ <!-- The drawable for the actions action bar button -->
+ <drawable name="dark_ab_actions_drawable">@drawable/ic_holo_dark_contextual_action</drawable>
+ <!-- The drawable for the search action bar button -->
+ <drawable name="dark_ab_search_drawable">@drawable/ic_holo_dark_search</drawable>
+ <!-- The drawable for the bookmarks action bar button -->
+ <drawable name="dark_ab_bookmarks_drawable">@drawable/ic_holo_dark_bookmarks</drawable>
+ <!-- The drawable for the history action bar button -->
+ <drawable name="dark_ab_history_drawable">@drawable/ic_holo_dark_history</drawable>
+ <!-- The drawable for the sort mode of expander bar -->
+ <drawable name="dark_ab_sort_mode_drawable">@drawable/ic_holo_dark_sort_alphabetically</drawable>
+ <!-- The drawable for the layout mode of expander bar -->
+ <drawable name="dark_ab_layout_mode_drawable">@drawable/ic_holo_dark_layout</drawable>
+ <!-- The drawable for the view options of expander bar -->
+ <drawable name="dark_ab_view_options_drawable">@drawable/ic_holo_dark_view</drawable>
+ <!-- The drawable for the selection done button -->
+ <drawable name="dark_ab_selection_done_drawable">@drawable/ic_holo_dark_accept</drawable>
+ <!-- The drawable for the save action bar button -->
+ <drawable name="dark_ab_save_drawable">@drawable/ic_holo_dark_save</drawable>
+ <!-- The drawable for the tab action bar button -->
+ <drawable name="dark_ab_tab_drawable">@drawable/ic_holo_dark_tab</drawable>
+
+ <!-- The close action drawable from the expander bar -->
+ <drawable name="dark_expander_close_drawable">@drawable/ic_holo_dark_expander_close</drawable>
+ <!-- The open action drawable from the expander bar -->
+ <drawable name="dark_expander_open_drawable">@drawable/ic_holo_dark_expander_open</drawable>
+
+ <!-- The text color of TextView controls -->
+ <color name="dark_text_color">#99ffffff</color>
+ <!-- The text color of Dialog
+ <color name="dialog_text_color">@null</color> -->
+
+ <!-- The highlight color for terms found in the search result -->
+ <color name="dark_search_highlight_color">#9933b5e5</color>
+
+ <!-- Breadcrumb divider drawable
+ <drawable name="dark_breadcrumb_divider_drawable">@null</drawable> -->
+
+ <!-- FileSystem locked drawable -->
+ <drawable name="dark_filesystem_locked_drawable">@drawable/ic_holo_dark_fs_locked</drawable>
+ <!-- FileSystem unlocked drawable -->
+ <drawable name="dark_filesystem_unlocked_drawable">@drawable/ic_holo_dark_fs_unlocked</drawable>
+ <!-- FileSystem warning drawable -->
+ <drawable name="dark_filesystem_warning_drawable">@drawable/ic_holo_dark_fs_warning</drawable>
+
+ <!-- The popup menu checkable selector drawable -->
+ <drawable name="dark_popup_checkable_selector_drawable">@drawable/dark_checkable_selector</drawable>
+ <!-- The menu checkable selector drawable -->
+ <drawable name="dark_menu_checkable_selector_drawable">@drawable/dark_holo_popup_selector</drawable>
+ <!-- The checkable item selector drawable -->
+ <drawable name="dark_selection_drawable">@drawable/dark_holo_selection</drawable>
+
+ <!-- Selectors -->
+ <drawable name="dark_selectors_deselected_drawable">@drawable/dark_holo_list_selector_deselected</drawable>
+ <drawable name="dark_selectors_selected_drawable">@drawable/dark_holo_list_selector_selected</drawable>
+ <drawable name="dark_selectors_button_drawable">@drawable/dark_holo_button_selector</drawable>
+
+ <!-- Checkboxes -->
+ <drawable name="dark_checkbox_deselected_drawable">@drawable/btn_holo_dark_check_off_normal</drawable>
+ <drawable name="dark_checkbox_selected_drawable">@drawable/btn_holo_dark_check_on_normal</drawable>
+
+ <!-- Dividers -->
+ <drawable name="dark_horizontal_divider_drawable">@drawable/divider_horizontal_dark_opaque</drawable>
+ <drawable name="dark_vertical_divider_drawable">@drawable/divider_vertical_dark_opaque</drawable>
+ <color name="dark_horizontal_divider_color">#99505050</color>
+ <color name="dark_vertical_divider_color">#99505050</color>
+
+ <!-- Icons -->
+ <drawable name="dark_ic_close_drawable">@drawable/ic_holo_dark_close</drawable>
+ <drawable name="dark_ic_config_drawable">@drawable/ic_holo_dark_config</drawable>
+ <drawable name="dark_ic_home_drawable">@drawable/ic_holo_dark_home</drawable>
+ <drawable name="dark_ic_filesystem_drawable">@drawable/ic_holo_dark_filesystem</drawable>
+ <drawable name="dark_ic_sdcard_drawable">@drawable/ic_holo_dark_sdcard</drawable>
+ <drawable name="dark_ic_usb_drawable">@drawable/ic_holo_dark_usb</drawable>
+ <drawable name="dark_ic_user_defined_bookmark_drawable">@drawable/ic_holo_dark_user_defined_bookmark</drawable>
+ <!--<drawable name="dark_ic_history_search_drawable">@null</drawable> -->
+
+ <!-- Disk usage graph -->
+ <color name="dark_disk_usage_total_color">#7ecccccc</color>
+ <color name="dark_disk_usage_used_color">#cc0099cc</color>
+ <color name="dark_disk_usage_used_warning_color">#99ff4444</color>
+
+ <!-- Disk usage filters
+ <color name="dark_disk_usage_filter_normal_color">@null</color>
+ <color name="dark_disk_usage_filter_warning_color">@null</color> -->
+
+ <!-- ProgressBar -->
+ <drawable name="dark_horizontal_progress_bar">@drawable/dark_progress_horizontal_holo</drawable>
+
+ <!-- Autocomplete -->
+ <color name="dark_autocomplete_fg_color">#99ffffff</color>
+ <color name="dark_autocomplete_bg_color">#aaa</color>
+
+ <!-- Console
+ <color name="dark_console_bg_color">@null</color>
+ <color name="dark_console_fg_color">@null</color> -->
+
+ <!-- Fso Icons
+ <drawable name="dark_ic_fso_folder_drawable">@null</drawable>
+ <drawable name="dark_ic_fso_default_drawable">@null</drawable>
+ <drawable name="dark_fso_type_app_drawable">@null</drawable>
+ <drawable name="dark_fso_type_audio_drawable">@null</drawable>
+ <drawable name="dark_fso_type_binary_drawable">@null</drawable>
+ <drawable name="dark_fso_type_calendar_drawable">@null</drawable>
+ <drawable name="dark_fso_type_cdimage_drawable">@null</drawable>
+ <drawable name="dark_fso_type_compress_drawable">@null</drawable>
+ <drawable name="dark_fso_type_contact_drawable">@null</drawable>
+ <drawable name="dark_fso_type_database_drawable">@null</drawable>
+ <drawable name="dark_fso_type_document_drawable">@null</drawable>
+ <drawable name="dark_fso_type_ebook_drawable">@null</drawable>
+ <drawable name="dark_fso_type_email_drawable">@null</drawable>
+ <drawable name="dark_fso_type_executable_drawable">@null</drawable>
+ <drawable name="dark_fso_type_feed_drawable">@null</drawable>
+ <drawable name="dark_fso_type_font_drawable">@null</drawable>
+ <drawable name="dark_fso_type_image_drawable">@null</drawable>
+ <drawable name="dark_fso_type_markup_document_drawable">@null</drawable>
+ <drawable name="dark_fso_type_pdf_drawable">@null</drawable>
+ <drawable name="dark_fso_type_presentation_drawable">@null</drawable>
+ <drawable name="dark_fso_type_security_drawable">@null</drawable>
+ <drawable name="dark_fso_type_shell_drawable">@null</drawable>
+ <drawable name="dark_fso_type_source_drawable">@null</drawable>
+ <drawable name="dark_fso_type_spreadsheet_drawable">@null</drawable>
+ <drawable name="dark_fso_type_system_drawable">@null</drawable>
+ <drawable name="dark_fso_type_text_drawable">@null</drawable>
+ <drawable name="dark_fso_type_video_drawable">@null</drawable> -->
+
+</resources>
diff --git a/themes/res/values/strings.xml b/themes/res/values/strings.xml
new file mode 100644
index 00000000..2e6bc51f
--- /dev/null
+++ b/themes/res/values/strings.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- The name of the application -->
+ <string name="app_name">File Manager Themes</string>
+ <!-- The description of the application -->
+ <string name="app_description">Themes for CyanogenMod File Manager.</string>
+
+ <!-- The author of the themes -->
+ <string name="themes_author" translatable="false">CyanogenMod</string>
+
+ <!-- The dark theme name -->
+ <string name="dark_theme_name">Dark Theme</string>
+ <!-- The dark theme description -->
+ <string name="dark_theme_desc">A dark theme for CyanogenMod File Manager.</string>
+
+</resources>
diff --git a/themes/src/com/cyanogenmod/filemanager/themes/ThemeActivity.java b/themes/src/com/cyanogenmod/filemanager/themes/ThemeActivity.java
new file mode 100644
index 00000000..cf0554ab
--- /dev/null
+++ b/themes/src/com/cyanogenmod/filemanager/themes/ThemeActivity.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2012 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.cyanogenmod.filemanager.themes;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+/**
+ * A mock activity for allow to <code>File Manager</code> to find this themes.<br/>
+ * <br/>
+ * NOTE: This activity must define the next filters:<br/>
+ * <ul>
+ * <li>Permission: <b>com.cyanogenmod.filemanager.permissions.READ_THEME</b></li>
+ * <li>Action: <b>com.cyanogenmod.filemanager.actions.MAIN_THEME</b></li>
+ * <li>Category: <b>com.cyanogenmod.filemanager.categories.THEME</b></li>
+ * </ul>
+ */
+public class ThemeActivity extends Activity {
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onCreate(Bundle state) {
+ //Save state
+ super.onCreate(state);
+ }
+}