diff options
author | nebkat <nebkat@gmail.com> | 2011-11-27 21:34:20 +0000 |
---|---|---|
committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2012-08-06 17:21:58 +0100 |
commit | 12675a79c0dbc46a4b4edbe50b99c9b43c71d40b (patch) | |
tree | a0ffa581c3344a00952b62b1d9ef63bd1172ac81 /src | |
parent | 4ca067e55ce5c0e756bce8cb11496589b8ab3ea0 (diff) | |
download | android_packages_apps_Trebuchet-12675a79c0dbc46a4b4edbe50b99c9b43c71d40b.tar.gz android_packages_apps_Trebuchet-12675a79c0dbc46a4b4edbe50b99c9b43c71d40b.tar.bz2 android_packages_apps_Trebuchet-12675a79c0dbc46a4b4edbe50b99c9b43c71d40b.zip |
Preferences: initial Preferences Activity, Provider and XML
Change-Id: I27d44993c4e34e08cfafff6d7a418df7c4f06fd2
Diffstat (limited to 'src')
3 files changed, 72 insertions, 1 deletions
diff --git a/src/com/cyanogenmod/trebuchet/Launcher.java b/src/com/cyanogenmod/trebuchet/Launcher.java index 59f5f493d..b9de8fd6c 100644 --- a/src/com/cyanogenmod/trebuchet/Launcher.java +++ b/src/com/cyanogenmod/trebuchet/Launcher.java @@ -95,6 +95,7 @@ import android.widget.Toast; import com.android.common.Search; import com.cyanogenmod.trebuchet.R; import com.cyanogenmod.trebuchet.DropTarget.DragObject; +import com.cyanogenmod.trebuchet.preference.Preferences; import java.io.DataInputStream; import java.io.DataOutputStream; @@ -128,7 +129,8 @@ public final class Launcher extends Activity private static final int MENU_WALLPAPER_SETTINGS = Menu.FIRST + 1; private static final int MENU_MANAGE_APPS = MENU_WALLPAPER_SETTINGS + 1; private static final int MENU_SYSTEM_SETTINGS = MENU_MANAGE_APPS + 1; - private static final int MENU_HELP = MENU_SYSTEM_SETTINGS + 1; + private static final int MENU_PREFERENCES = MENU_SYSTEM_SETTINGS + 1; + private static final int MENU_HELP = MENU_PREFERENCES + 1; private static final int REQUEST_CREATE_SHORTCUT = 1; private static final int REQUEST_CREATE_APPWIDGET = 5; @@ -1504,6 +1506,9 @@ public final class Launcher extends Activity Intent settings = new Intent(android.provider.Settings.ACTION_SETTINGS); settings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); + Intent preferences = new Intent().setClass(this, Preferences.class); + preferences.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK + | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); String helpUrl = getString(R.string.help_url); Intent help = new Intent(Intent.ACTION_VIEW, Uri.parse(helpUrl)); help.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK @@ -1520,6 +1525,10 @@ public final class Launcher extends Activity .setIcon(android.R.drawable.ic_menu_preferences) .setIntent(settings) .setAlphabeticShortcut('P'); + menu.add(0, MENU_PREFERENCES, 0, R.string.menu_preferences) + .setIcon(android.R.drawable.ic_menu_preferences) + .setIntent(preferences) + .setAlphabeticShortcut('O'); if (!helpUrl.isEmpty()) { menu.add(0, MENU_HELP, 0, R.string.menu_help) .setIcon(android.R.drawable.ic_menu_help) diff --git a/src/com/cyanogenmod/trebuchet/preference/Preferences.java b/src/com/cyanogenmod/trebuchet/preference/Preferences.java new file mode 100644 index 000000000..c277bc397 --- /dev/null +++ b/src/com/cyanogenmod/trebuchet/preference/Preferences.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2008 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. + */ + +package com.cyanogenmod.trebuchet.preference; + +import android.os.Bundle; +import android.preference.Preference; +import android.preference.PreferenceActivity; +import com.cyanogenmod.trebuchet.R; + +public class Preferences extends PreferenceActivity { + + private static final String TAG = "Launcher.Preferences"; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.preferences); + } +} diff --git a/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java b/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java new file mode 100644 index 000000000..2a124021e --- /dev/null +++ b/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java @@ -0,0 +1,29 @@ +package com.cyanogenmod.trebuchet.preference; + +import android.content.Context; +import android.content.SharedPreferences; + +public final class PreferencesProvider { + private static final String PREFERENCES_FILE = "com.cyanogenmod.trebuchet_preferences"; + public static class Interface { + public static class Homescreen { + + } + + public static class Drawer { + + } + + public static class Dock { + + } + + public static class Icons { + + } + } + + public static class General { + + } +} |