165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane/* 265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * Copyright (C) 2014 The Android Open Source Project 365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * 465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * Licensed under the Apache License, Version 2.0 (the "License"); 565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * you may not use this file except in compliance with the License. 665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * You may obtain a copy of the License at 765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * 865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * http://www.apache.org/licenses/LICENSE-2.0 965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * 1065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * Unless required by applicable law or agreed to in writing, software 1165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * distributed under the License is distributed on an "AS IS" BASIS, 1265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * See the License for the specific language governing permissions and 1465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * limitations under the License. 1565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane */ 1665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 1765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lanepackage com.android.tv.settings.system; 1865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 1965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Laneimport com.android.tv.settings.ActionBehavior; 2065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Laneimport com.android.tv.settings.ActionKey; 2165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Laneimport com.android.tv.settings.R; 2265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Laneimport com.android.tv.settings.dialog.old.Action; 2365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 2465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Laneimport android.content.res.Resources; 2565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 2665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Laneenum ActionType { 2765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane /* 2865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * General 2965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane */ 3065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane AGREE(R.string.agree), 3165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DISAGREE(R.string.disagree), 3265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane EMAIL_ADDRESS(R.string.system_email_address), 3365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane OK(R.string.title_ok), 3465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CANCEL(R.string.title_cancel), 3565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane ON(R.string.on), 3665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane OFF(R.string.off), 3765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane /* 3865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * Date & Time 3965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane */ 4065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DATE_TIME_OVERVIEW(R.string.system_date_time), 4165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DATE(R.string.system_date), 4265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane TIME(R.string.system_time), 4365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DATE_SET_DATE(R.string.system_set_date), 4465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DATE_CHOOSE_FORMAT(R.string.system_choose_date_format), 4565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane TIME_SET_TIME(R.string.system_set_time), 4665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane TIME_SET_TIME_ZONE(R.string.system_set_time_zone), 4765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane TIME_CHOOSE_FORMAT(R.string.system_set_time_format), 4865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane AUTO_DATE_TIME(R.string.system_auto_date_time, R.string.desc_auto_date_time), 4965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane /* 5065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * Location 5165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane */ 5265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane LOCATION_OVERVIEW(R.string.system_location), 5365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane NETWORK_LOCATION_CONFIRM(R.string.system_network_location_confirm), 5465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane LOCATION_STATUS(R.string.location_status), 5565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane LOCATION_MODE(R.string.location_mode_title), 5665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane LOCATION_MODE_WIFI(R.string.location_mode_wifi_description), 5765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane LOCATION_RECENT_REQUESTS(R.string.location_category_recent_location_requests), 5865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane LOCATION_NO_RECENT_REQUESTS(R.string.location_no_recent_apps), 5965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane LOCATION_SERVICES(R.string.location_services), 6065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane LOCATION_SERVICES_GOOGLE(R.string.google_location_services_title), 6165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane LOCATION_SERVICES_GOOGLE_SETTINGS(R.string.google_location_services_title), 6265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane LOCATION_SERVICES_GOOGLE_REPORTING(R.string.location_reporting, 6365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.location_reporting_desc), 6465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane LOCATION_SERVICES_GOOGLE_HISTORY(R.string.location_history, R.string.location_history_desc), 6565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane LOCATION_SERVICES_THIRD_PARTY(R.string.third_party_location_services_title), 6665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane LOCATION_HISTORY_DELETE(R.string.delete_location_history_title, 6765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.delete_location_history_desc), 6865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane /* 6965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * Developer Options 7065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane */ 7165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_OVERVIEW(R.string.system_developer_options), 7265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_GENERAL(R.string.system_general), 7365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_DEBUGGING(R.string.system_debugging), 7465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_INPUT(R.string.system_input), 7565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_DRAWING(R.string.system_drawing), 7665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_MONITORING(R.string.system_monitoring), 7765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_APPS(R.string.system_apps), 7865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_GENERAL_STAY_AWAKE(R.string.system_stay_awake, 7965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_stay_awake), 8065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_GENERAL_HDCP_CHECKING(R.string.system_hdcp_checking, 8165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_hdcp_checking), 8265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_GENERAL_HDMI_OPTIMIZATION(R.string.system_hdmi_optimization, 8365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_hdmi_optimization), 8465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_GENERAL_BT_HCI_LOG(R.string.system_bt_hci_log, 8565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_bt_hci_log), 8665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_GENERAL_REBOOT(R.string.system_reboot_confirm, 8765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_reboot_confirm), 8865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_HDCP_NEVER_CHECK(R.string.system_never_check), 8965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_HDCP_CHECK_FOR_DRM_CONTENT_ONLY(R.string.system_check_for_drm_content_only), 9065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_HDCP_ALWAYS_CHECK(R.string.system_always_check), 9165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_DEBUGGING_USB_DEBUGGING(R.string.system_usb_debugging, 9265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_usb_debugging), 9365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_DEBUGGING_ALLOW_MOCK_LOCATIONS(R.string.system_allow_mock_locations), 9465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_DEBUGGING_SELECT_DEBUG_APP(R.string.system_select_debug_app), 9565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_DEBUGGING_WAIT_FOR_DEBUGGER(R.string.system_wait_for_debugger, 9665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_wait_for_debugger), 9765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_DEBUGGING_VERIFY_APPS_OVER_USB(R.string.system_verify_apps_over_usb, 9865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_verify_apps_over_usb), 9965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_DEBUGGING_WIFI_VERBOSE_LOGGING(R.string.system_wifi_verbose_logging, 10065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_wifi_verbose_logging), 10165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_INPUT_SHOW_TOUCHES(R.string.system_show_touches), 10265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_INPUT_POINTER_LOCATION(R.string.system_pointer_location), 10365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_DRAWING_SHOW_LAYOUT_BOUNDS(R.string.system_show_layout_bounds, 10465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_show_layout_bounds), 10565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_DRAWING_SHOW_GPU_VIEW_UPDATES(R.string.system_show_gpu_view_updates, 10665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_show_gpu_view_updates), 10765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_DRAWING_SHOW_GPU_OVERDRAW(R.string.system_show_gpu_overdraw, 10865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_show_gpu_overdraw), 10965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_DRAWING_SHOW_HARDWARE_LAYER(R.string.system_show_hardware_layer, 11065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_show_hardware_layer), 11165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_DRAWING_SHOW_SURFACE_UPDATES(R.string.system_show_surface_updates, 11265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_show_surface_updates), 11365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_DRAWING_WINDOW_ANIMATION_SCALE(R.string.system_window_animation_scale), 11465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_DRAWING_TRANSITION_ANIMATION_SCALE(R.string.system_transition_animation_scale), 11565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_DRAWING_ANIMATOR_DURATION_SCALE(R.string.system_animator_duration_scale), 11665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_MONITORING_STRICT_MODE_ENABLED(R.string.system_strict_mode_enabled, 11765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_strict_mode_enabled), 11865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_MONITORING_SHOW_CPU_USAGE(R.string.system_show_cpu_usage, 11965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_show_cpu_usage), 12065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_MONITORING_PROFILE_GPU_RENDERING(R.string.system_profile_gpu_rendering, 12165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.system_desc_profile_gpu_rendering), 12265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_MONITORING_ENABLE_TRACES(R.string.system_enable_traces), 12365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_APPS_DONT_KEEP_ACTIVITIES(R.string.system_dont_keep_activities), 12465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_APPS_BACKGROUND_PROCESS_LIMIT(R.string.system_background_process_limit), 12565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane DEVELOPER_APPS_SHOW_ALL_ANRS(R.string.system_show_all_anrs), 12665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane /* 12765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * Keyboard 12865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane */ 12965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane KEYBOARD_OVERVIEW(R.string.system_keyboard), 13065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane KEYBOARD_OVERVIEW_CURRENT_KEYBOARD(R.string.title_current_keyboard), 13165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane KEYBOARD_OVERVIEW_CONFIGURE(R.string.title_configure, R.string.desc_configure_keyboard), 13265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 13365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane /* 13465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * Security 13565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane */ 13665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane SECURITY_OVERVIEW(R.string.system_security), 13765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane SECURITY_UNKNOWN_SOURCES(R.string.security_unknown_sources_title, 13865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.security_unknown_sources_desc), 13965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane SECURITY_UNKNOWN_SOURCES_CONFIRM(R.string.security_unknown_sources_title, 14065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.security_unknown_sources_confirm_desc), 14165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane SECURITY_VERIFY_APPS(R.string.security_verify_apps_title, 14265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.security_verify_apps_desc), 14365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 14465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane /* 14565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * StorageReset 14665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane */ 14765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane STORAGERESET_OVERVIEW(R.string.device_storage_reset), 14865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane STORAGERESET_FACTORY_RESET(R.string.device_reset), 14965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane STORAGERESET_STORAGE(R.string.device_storage), 15065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 15165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane /* 15265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane * Accessibility 15365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane */ 15465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane ACCESSIBILITY_OVERVIEW(R.string.system_accessibility), 15565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane ACCESSIBILITY_SERVICES(R.string.system_services), 15665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane ACCESSIBILITY_SERVICES_SETTINGS(R.string.accessibility_service_settings), 15765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane ACCESSIBILITY_SERVICES_STATUS(R.string.system_accessibility_status), 15865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane ACCESSIBILITY_SERVICES_CONFIRM_ON(R.string.system_accessibility_status), 15965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane ACCESSIBILITY_SERVICES_CONFIRM_OFF(R.string.system_accessibility_status), 16065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane ACCESSIBILITY_SERVICE_CONFIG(R.string.system_accessibility_config), 16165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane ACCESSIBILITY_CAPTIONS(R.string.accessibility_captions), 16265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane ACCESSIBILITY_SPEAK_PASSWORDS(R.string.system_speak_passwords), 16365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane ACCESSIBILITY_TTS_OUTPUT(R.string.system_accessibility_tts_output), 16465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane ACCESSIBILITY_PREFERRED_ENGINE(R.string.system_preferred_engine), 16565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane ACCESSIBILITY_LANGUAGE(R.string.system_language), 16665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane ACCESSIBILITY_SPEECH_RATE(R.string.system_speech_rate), 16765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane ACCESSIBILITY_PLAY_SAMPLE(R.string.system_play_sample), 16865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane ACCESSIBILITY_INSTALL_VOICE_DATA(R.string.system_install_voice_data), 16965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 17065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CAPTIONS_OVERVIEW(R.string.accessibility_captions, 17165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane R.string.accessibility_captions_description), 17265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CAPTIONS_DISPLAY(R.string.captions_display), 17365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CAPTIONS_CONFIGURE(R.string.captions_configure), 17465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CAPTIONS_LANGUAGE(R.string.captions_lanaguage), 17565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CAPTIONS_TEXTSIZE(R.string.captions_textsize), 17665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CAPTIONS_CAPTIONSTYLE(R.string.captions_captionstyle), 17765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CAPTIONS_CUSTOMOPTIONS(R.string.captions_customoptions), 17865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CAPTIONS_FONTFAMILY(R.string.captions_fontfamily), 17965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CAPTIONS_TEXTCOLOR(R.string.captions_textcolor), 18065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CAPTIONS_TEXTOPACITY(R.string.captions_textopacity), 18165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CAPTIONS_EDGETYPE(R.string.captions_edgetype), 18265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CAPTIONS_EDGECOLOR(R.string.captions_edgecolor), 18365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CAPTIONS_BACKGROUNDCOLOR(R.string.captions_backgroundcolor), 18465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CAPTIONS_BACKGROUNDOPACITY(R.string.captions_backgroundopacity), 18565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CAPTIONS_WINDOWCOLOR(R.string.captions_windowcolor), 18665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane CAPTIONS_WINDOWOPACITY(R.string.captions_windowopacity); 18765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 18865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane private final int mTitleResource; 18965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane private final int mDescResource; 19065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 19165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane private ActionType(int titleResource) { 19265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane mTitleResource = titleResource; 19365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane mDescResource = 0; 19465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane } 19565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 19665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane private ActionType(int titleResource, int descResource) { 19765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane mTitleResource = titleResource; 19865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane mDescResource = descResource; 19965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane } 20065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane String getTitle(Resources resources) { 20165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane return resources.getString(mTitleResource); 20265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane } 20365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 20465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane String getDescription(Resources resources) { 20565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane if (mDescResource != 0) { 20665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane return resources.getString(mDescResource); 20765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane } 20865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane return null; 20965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane } 21065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 21165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane Action toAction(Resources resources) { 21265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane return toAction(resources, true/*enabled*/); 21365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane } 21465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 21565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane Action toAction(Resources resources, boolean enabled) { 21665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane return toAction(resources, getDescription(resources), enabled, false/* not checked */); 21765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane } 21865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 21965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane Action toAction(Resources resources, String description) { 22065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane return toAction(resources, description, true/*enabled*/, false /* not checked */); 22165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane } 22265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 22365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane Action toAction(Resources resources, String description, boolean enabled) { 22465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane return toAction(resources, description, enabled, false /* not checked */); 22565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane } 22665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 22765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane Action toAction(Resources resources, String description, boolean enabled, boolean checked) { 22865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane return new Action.Builder() 22965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane .key(getKey(this, ActionBehavior.INIT)) 23065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane .title(getTitle(resources)) 23165a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane .description(description) 23265a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane .enabled(enabled) 23365a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane .checked(checked) 23465a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane .build(); 23565a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane } 23665a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane 23765a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane private String getKey(ActionType t, ActionBehavior b) { 23865a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane return new ActionKey<ActionType, ActionBehavior>(t, b).getKey(); 23965a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane } 24065a5a7d84ad9b5324ae53eda526e39e513473af7Christopher Lane} 241