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
This commit is contained in:
Dianne Hackborn
2009-09-15 18:45:34 -07:00
parent 5862b673d4
commit 9767e41d92
8 changed files with 149 additions and 8 deletions

View File

@@ -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);
}
}

View File

@@ -249,7 +249,7 @@ public class ZoomButtonsController implements View.OnTouchListener {
lp.height = LayoutParams.WRAP_CONTENT;
lp.width = LayoutParams.FILL_PARENT;
lp.type = LayoutParams.TYPE_APPLICATION_PANEL;
lp.format = PixelFormat.TRANSPARENT;
lp.format = PixelFormat.TRANSLUCENT;
lp.windowAnimations = com.android.internal.R.style.Animation_ZoomButtons;
mContainerLayoutParams = lp;