summaryrefslogtreecommitdiffstats
path: root/core/java/android/service
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-09-15 18:45:34 -0700
committerDianne Hackborn <hackbod@google.com>2009-09-15 18:59:31 -0700
commit9767e41d92bd6f4cf16111b3f911cef78c8b01eb (patch)
tree115b324793c1bcc89164ee249711fe9a2475eb9b /core/java/android/service
parent5862b673d412e596f3fa419c00bd0ba16bf6c094 (diff)
downloadframeworks_base-9767e41d92bd6f4cf16111b3f911cef78c8b01eb.zip
frameworks_base-9767e41d92bd6f4cf16111b3f911cef78c8b01eb.tar.gz
frameworks_base-9767e41d92bd6f4cf16111b3f911cef78c8b01eb.tar.bz2
Some improvements for wallpaper configuration.
This introduces a new activity that you can derive from to implement a wall paper configuration activity. This is supposed to select a theme based on whether it is being run to configure a real wallpaper or a preview, but this is going to be more difficult to do than I thought. :( Also fix a problem in the white theme where the list view's background was being set to white, so it wouldn't work on a transparent bg. Change-Id: I26d5a8695a3c878a1664eb09900eded57eaff990
Diffstat (limited to 'core/java/android/service')
-rw-r--r--core/java/android/service/wallpaper/WallpaperSettingsActivity.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/core/java/android/service/wallpaper/WallpaperSettingsActivity.java b/core/java/android/service/wallpaper/WallpaperSettingsActivity.java
new file mode 100644
index 0000000..501947d
--- /dev/null
+++ b/core/java/android/service/wallpaper/WallpaperSettingsActivity.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package android.service.wallpaper;
+
+import android.content.res.Resources;
+import android.os.Bundle;
+import android.preference.PreferenceActivity;
+
+/**
+ * Base class for activities that will be used to configure the settings of
+ * a wallpaper. You should derive from this class to allow it to select the
+ * proper theme of the activity depending on how it is being used.
+ */
+public class WallpaperSettingsActivity extends PreferenceActivity {
+ /**
+ * This boolean extra in the launch intent indicates that the settings
+ * are being used while the wallpaper is in preview mode.
+ */
+ final public static String EXTRA_PREVIEW_MODE
+ = "android.service.wallpaper.PREVIEW_MODE";
+
+ @Override
+ protected void onCreate(Bundle icicle) {
+ if (false) {
+ Resources.Theme theme = getTheme();
+ if (getIntent().getBooleanExtra(EXTRA_PREVIEW_MODE, false)) {
+ theme.applyStyle(com.android.internal.R.style.PreviewWallpaperSettings, true);
+ } else {
+ theme.applyStyle(com.android.internal.R.style.ActiveWallpaperSettings, true);
+ }
+ }
+ super.onCreate(icicle);
+ }
+}