19767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn/*
29767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn * Copyright (C) 2009 Google Inc.
39767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn *
49767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn * Licensed under the Apache License, Version 2.0 (the "License"); you may not
59767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn * use this file except in compliance with the License. You may obtain a copy of
69767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn * the License at
79767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn *
89767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn * http://www.apache.org/licenses/LICENSE-2.0
99767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn *
109767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn * Unless required by applicable law or agreed to in writing, software
119767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
129767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
139767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn * License for the specific language governing permissions and limitations under
149767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn * the License.
159767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn */
169767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn
179767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackbornpackage android.service.wallpaper;
189767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn
199767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackbornimport android.content.res.Resources;
209767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackbornimport android.os.Bundle;
219767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackbornimport android.preference.PreferenceActivity;
229767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn
239767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn/**
249767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn * Base class for activities that will be used to configure the settings of
259767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn * a wallpaper.  You should derive from this class to allow it to select the
269767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn * proper theme of the activity depending on how it is being used.
2723ef7b4836d66d31430fedee2aac36275bb30d4bDianne Hackborn * @hide
289767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn */
299767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackbornpublic class WallpaperSettingsActivity extends PreferenceActivity {
309767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn    /**
319767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn     * This boolean extra in the launch intent indicates that the settings
329767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn     * are being used while the wallpaper is in preview mode.
339767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn     */
349767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn    final public static String EXTRA_PREVIEW_MODE
359767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn            = "android.service.wallpaper.PREVIEW_MODE";
369767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn
379767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn    @Override
389767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn    protected void onCreate(Bundle icicle) {
399767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn        if (false) {
409767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn            Resources.Theme theme = getTheme();
419767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn            if (getIntent().getBooleanExtra(EXTRA_PREVIEW_MODE, false)) {
429767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn                theme.applyStyle(com.android.internal.R.style.PreviewWallpaperSettings, true);
439767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn            } else {
449767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn                theme.applyStyle(com.android.internal.R.style.ActiveWallpaperSettings, true);
459767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn            }
469767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn        }
479767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn        super.onCreate(icicle);
489767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn    }
499767e41d92bd6f4cf16111b3f911cef78c8b01ebDianne Hackborn}
50