Daniel Sandler | 50a5313 | 2012-10-24 15:02:27 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 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 | |
John Spurlock | f07439fb | 2012-08-25 13:17:22 -0400 | [diff] [blame] | 17 | package com.android.systemui; |
| 18 | |
Dianne Hackborn | be87e2f | 2012-09-28 16:31:34 -0700 | [diff] [blame] | 19 | import android.service.dreams.DreamService; |
John Spurlock | f07439fb | 2012-08-25 13:17:22 -0400 | [diff] [blame] | 20 | |
| 21 | import com.android.systemui.BeanBag.Board; |
| 22 | |
Dianne Hackborn | be87e2f | 2012-09-28 16:31:34 -0700 | [diff] [blame] | 23 | public class BeanBagDream extends DreamService { |
John Spurlock | f07439fb | 2012-08-25 13:17:22 -0400 | [diff] [blame] | 24 | |
| 25 | private Board mBoard; |
| 26 | |
| 27 | @Override |
Daniel Sandler | 2d78490 | 2012-10-03 23:04:50 -0400 | [diff] [blame] | 28 | public void onAttachedToWindow() { |
| 29 | super.onAttachedToWindow(); |
John Spurlock | f07439fb | 2012-08-25 13:17:22 -0400 | [diff] [blame] | 30 | setInteractive(true); |
Daniel Sandler | 2d78490 | 2012-10-03 23:04:50 -0400 | [diff] [blame] | 31 | setFullscreen(true); |
John Spurlock | f07439fb | 2012-08-25 13:17:22 -0400 | [diff] [blame] | 32 | mBoard = new Board(this, null); |
Daniel Sandler | 2d78490 | 2012-10-03 23:04:50 -0400 | [diff] [blame] | 33 | setContentView(mBoard); |
John Spurlock | f07439fb | 2012-08-25 13:17:22 -0400 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | @Override |
Daniel Sandler | 2d78490 | 2012-10-03 23:04:50 -0400 | [diff] [blame] | 37 | public void onDreamingStarted() { |
| 38 | super.onDreamingStarted(); |
John Spurlock | f07439fb | 2012-08-25 13:17:22 -0400 | [diff] [blame] | 39 | mBoard.startAnimation(); |
| 40 | } |
| 41 | |
| 42 | @Override |
Daniel Sandler | 2d78490 | 2012-10-03 23:04:50 -0400 | [diff] [blame] | 43 | public void onDreamingStopped() { |
John Spurlock | f07439fb | 2012-08-25 13:17:22 -0400 | [diff] [blame] | 44 | mBoard.stopAnimation(); |
Daniel Sandler | 2d78490 | 2012-10-03 23:04:50 -0400 | [diff] [blame] | 45 | super.onDreamingStopped(); |
John Spurlock | f07439fb | 2012-08-25 13:17:22 -0400 | [diff] [blame] | 46 | } |
| 47 | } |