120f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren/* 220f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren * Copyright (C) 2015 The Android Open Source Project 320f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren * 420f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren * Licensed under the Apache License, Version 2.0 (the "License"); 520f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren * you may not use this file except in compliance with the License. 620f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren * You may obtain a copy of the License at 720f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren * 820f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren * http://www.apache.org/licenses/LICENSE-2.0 920f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren * 1020f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren * Unless required by applicable law or agreed to in writing, software 1120f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren * distributed under the License is distributed on an "AS IS" BASIS, 1220f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1320f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren * See the License for the specific language governing permissions and 1420f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren * limitations under the License. 1520f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren */ 1620f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren 1720f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wrenpackage com.android.example.notificationshowcase; 1820f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren 1920f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wrenimport android.app.Activity; 2020f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wrenimport android.os.Bundle; 2120f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wrenimport android.preference.PreferenceFragment; 2220f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren 2320f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wrenpublic class SettingsActivity extends Activity { 2420f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public static final String KEY_GLOBAL_FADE = "pref_key_global_fade"; 2520f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public static final String KEY_SMS_ENABLE = "pref_key_sms_enable"; 2620f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public static final String KEY_SMS_NOISY = "pref_key_sms_noisy"; 277257342de1639de10f8d3ea0a92b223daf18f1daChris Wren public static final String KEY_SMS_SOUND = "pref_key_sms_sound"; 2820f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public static final String KEY_SMS_BUZZY = "pref_key_sms_buzzy"; 290e6177c78af2de6d71279725753d5db92511f397Chris Wren public static final String KEY_SMS_ONCE = "pref_key_sms_once"; 3020f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public static final String KEY_SMS_PRIORITY = "pref_key_sms_priority"; 3120f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public static final String KEY_SMS_PERSON = "pref_key_sms_person"; 3220f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public static final String KEY_PHONE_ENABLE = "pref_key_phone_enable"; 3320f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public static final String KEY_PHONE_NOISY = "pref_key_phone_noisy"; 3420f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public static final String KEY_PHONE_FULLSCREEN = "pref_key_phone_fullscreen"; 3520f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public static final String KEY_PHONE_PERSON = "pref_key_phone_person"; 3620f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public static final String KEY_UPLOAD_ENABLE = "pref_key_upload_enable"; 3720f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public static final String KEY_TIMER_ENABLE = "pref_key_timer_enable"; 3820f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public static final String KEY_CALENDAR_ENABLE = "pref_key_calendar_enable"; 3920f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public static final String KEY_SOCIAL_ENABLE = "pref_key_social_enable"; 4020f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public static final String KEY_INBOX_ENABLE = "pref_key_inbox_enable"; 4120f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public static final String KEY_PICTURE_ENABLE = "pref_key_picture_enable"; 4220f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren 4320f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public class SettingsFragment extends PreferenceFragment { 4420f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren @Override 4520f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren public void onCreate(Bundle savedInstanceState) { 4620f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren super.onCreate(savedInstanceState); 4720f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren addPreferencesFromResource(R.xml.preferences); 4820f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren } 497257342de1639de10f8d3ea0a92b223daf18f1daChris Wren 507257342de1639de10f8d3ea0a92b223daf18f1daChris Wren public SettingsFragment() {} 5120f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren } 5220f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren 5320f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren @Override 5420f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren protected void onCreate(Bundle savedInstanceState) { 5520f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren super.onCreate(savedInstanceState); 5620f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren getFragmentManager().beginTransaction() 5720f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren .replace(android.R.id.content, new SettingsFragment()) 5820f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren .commit(); 5920f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren } 6020f6c51ab018c45347bc99ccccb17f45cbfb9fc0Chris Wren} 61