The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 1 | /* |
| 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 Onorato | a590252 | 2009-07-30 13:37:37 -0700 | [diff] [blame] | 17 | package com.android.launcher2; |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 18 | |
Romain Guy | edcce09 | 2010-03-04 13:03:17 -0800 | [diff] [blame] | 19 | import com.android.launcher.R; |
| 20 | |
Adam Lesinski | 2a898a0 | 2010-12-09 21:04:15 -0800 | [diff] [blame] | 21 | import android.app.Activity; |
| 22 | import android.app.DialogFragment; |
| 23 | import android.app.Fragment; |
| 24 | import android.os.Bundle; |
| 25 | |
Adam Lesinski | cd5d807 | 2010-11-19 15:06:46 -0800 | [diff] [blame] | 26 | public class WallpaperChooser extends Activity { |
Joe Onorato | a30ce8e | 2009-11-11 08:16:49 -0800 | [diff] [blame] | 27 | private static final String TAG = "Launcher.WallpaperChooser"; |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 28 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 29 | @Override |
| 30 | public void onCreate(Bundle icicle) { |
| 31 | super.onCreate(icicle); |
Adam Lesinski | cd5d807 | 2010-11-19 15:06:46 -0800 | [diff] [blame] | 32 | setContentView(R.layout.wallpaper_chooser_base); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 33 | |
Adam Lesinski | 2a898a0 | 2010-12-09 21:04:15 -0800 | [diff] [blame] | 34 | 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 Lesinski | cd5d807 | 2010-11-19 15:06:46 -0800 | [diff] [blame] | 39 | */ |
Adam Lesinski | 2a898a0 | 2010-12-09 21:04:15 -0800 | [diff] [blame] | 40 | DialogFragment fragment = WallpaperChooserDialogFragment.newInstance(); |
| 41 | fragment.show(getFragmentManager(), "dialog"); |
Romain Guy | e82140f | 2009-09-16 16:54:21 -0700 | [diff] [blame] | 42 | } |
Romain Guy | 8c724f5 | 2009-09-14 15:18:12 -0700 | [diff] [blame] | 43 | } |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 44 | } |