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 | |
Daniel Sandler | 325dc23 | 2013-06-05 22:57:57 -0400 | [diff] [blame] | 17 | package com.android.launcher3; |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 18 | |
Daniel Sandler | 325dc23 | 2013-06-05 22:57:57 -0400 | [diff] [blame] | 19 | import com.android.launcher3.R; |
Romain Guy | edcce09 | 2010-03-04 13:03:17 -0800 | [diff] [blame] | 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 { |
Michael Jurka | 3a9fced | 2012-04-13 14:44:29 -0700 | [diff] [blame] | 27 | @SuppressWarnings("unused") |
Joe Onorato | a30ce8e | 2009-11-11 08:16:49 -0800 | [diff] [blame] | 28 | private static final String TAG = "Launcher.WallpaperChooser"; |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 29 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 30 | @Override |
| 31 | public void onCreate(Bundle icicle) { |
| 32 | super.onCreate(icicle); |
Adam Lesinski | cd5d807 | 2010-11-19 15:06:46 -0800 | [diff] [blame] | 33 | setContentView(R.layout.wallpaper_chooser_base); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 34 | |
Adam Lesinski | 2a898a0 | 2010-12-09 21:04:15 -0800 | [diff] [blame] | 35 | Fragment fragmentView = |
| 36 | getFragmentManager().findFragmentById(R.id.wallpaper_chooser_fragment); |
Amith Yamasani | 6be5949 | 2011-06-21 13:03:34 -0700 | [diff] [blame] | 37 | // TODO: The following code is currently not exercised. Leaving it here in case it |
| 38 | // needs to be revived again. |
Adam Lesinski | 2a898a0 | 2010-12-09 21:04:15 -0800 | [diff] [blame] | 39 | if (fragmentView == null) { |
| 40 | /* When the screen is XLarge, the fragment is not included in the layout, so show it |
| 41 | * as a dialog |
Adam Lesinski | cd5d807 | 2010-11-19 15:06:46 -0800 | [diff] [blame] | 42 | */ |
Adam Lesinski | 2a898a0 | 2010-12-09 21:04:15 -0800 | [diff] [blame] | 43 | DialogFragment fragment = WallpaperChooserDialogFragment.newInstance(); |
| 44 | fragment.show(getFragmentManager(), "dialog"); |
Romain Guy | e82140f | 2009-09-16 16:54:21 -0700 | [diff] [blame] | 45 | } |
Romain Guy | 8c724f5 | 2009-09-14 15:18:12 -0700 | [diff] [blame] | 46 | } |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 47 | } |