blob: 39e472711cd8d60e7a64cfaef9a352bf9ec7ec2e [file] [log] [blame]
Daniel Sandler50a53132012-10-24 15:02:27 -04001/*
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 Spurlockf07439fb2012-08-25 13:17:22 -040017package com.android.systemui;
18
Dianne Hackbornbe87e2f2012-09-28 16:31:34 -070019import android.service.dreams.DreamService;
John Spurlockf07439fb2012-08-25 13:17:22 -040020
21import com.android.systemui.BeanBag.Board;
22
Dianne Hackbornbe87e2f2012-09-28 16:31:34 -070023public class BeanBagDream extends DreamService {
John Spurlockf07439fb2012-08-25 13:17:22 -040024
25 private Board mBoard;
26
27 @Override
Daniel Sandler2d784902012-10-03 23:04:50 -040028 public void onAttachedToWindow() {
29 super.onAttachedToWindow();
John Spurlockf07439fb2012-08-25 13:17:22 -040030 setInteractive(true);
Daniel Sandler2d784902012-10-03 23:04:50 -040031 setFullscreen(true);
John Spurlockf07439fb2012-08-25 13:17:22 -040032 mBoard = new Board(this, null);
Daniel Sandler2d784902012-10-03 23:04:50 -040033 setContentView(mBoard);
John Spurlockf07439fb2012-08-25 13:17:22 -040034 }
35
36 @Override
Daniel Sandler2d784902012-10-03 23:04:50 -040037 public void onDreamingStarted() {
38 super.onDreamingStarted();
John Spurlockf07439fb2012-08-25 13:17:22 -040039 mBoard.startAnimation();
40 }
41
42 @Override
Daniel Sandler2d784902012-10-03 23:04:50 -040043 public void onDreamingStopped() {
John Spurlockf07439fb2012-08-25 13:17:22 -040044 mBoard.stopAnimation();
Daniel Sandler2d784902012-10-03 23:04:50 -040045 super.onDreamingStopped();
John Spurlockf07439fb2012-08-25 13:17:22 -040046 }
47}