blob: 2311d1e9a56cd020539da403079194e5b20126be [file] [log] [blame]
The Android Open Source Project31dd5032009-03-03 19:32:27 -08001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Joe Onoratoa5902522009-07-30 13:37:37 -070017package com.android.launcher2;
The Android Open Source Project31dd5032009-03-03 19:32:27 -080018
Romain Guyedcce092010-03-04 13:03:17 -080019import com.android.launcher.R;
20
Adam Lesinski2a898a02010-12-09 21:04:15 -080021import android.app.Activity;
22import android.app.DialogFragment;
23import android.app.Fragment;
24import android.os.Bundle;
25
Adam Lesinskicd5d8072010-11-19 15:06:46 -080026public class WallpaperChooser extends Activity {
Joe Onoratoa30ce8e2009-11-11 08:16:49 -080027 private static final String TAG = "Launcher.WallpaperChooser";
The Android Open Source Project31dd5032009-03-03 19:32:27 -080028
The Android Open Source Project31dd5032009-03-03 19:32:27 -080029 @Override
30 public void onCreate(Bundle icicle) {
31 super.onCreate(icicle);
Adam Lesinskicd5d8072010-11-19 15:06:46 -080032 setContentView(R.layout.wallpaper_chooser_base);
The Android Open Source Project31dd5032009-03-03 19:32:27 -080033
Adam Lesinski2a898a02010-12-09 21:04:15 -080034 Fragment fragmentView =
35 getFragmentManager().findFragmentById(R.id.wallpaper_chooser_fragment);
36 if (fragmentView == null) {
37 /* When the screen is XLarge, the fragment is not included in the layout, so show it
38 * as a dialog
Adam Lesinskicd5d8072010-11-19 15:06:46 -080039 */
Adam Lesinski2a898a02010-12-09 21:04:15 -080040 DialogFragment fragment = WallpaperChooserDialogFragment.newInstance();
41 fragment.show(getFragmentManager(), "dialog");
Romain Guye82140f2009-09-16 16:54:21 -070042 }
Romain Guy8c724f52009-09-14 15:18:12 -070043 }
The Android Open Source Project31dd5032009-03-03 19:32:27 -080044}