Skip to content

Commit f07439f

Browse files
author
John Spurlock
committed
Beans in space.
Quick example dream reusing the JB bean bag view. Change-Id: Iad3ecedc9ba2c258bd33fcfbba2e3fc48382bdc8
1 parent 080ca09 commit f07439f

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

packages/SystemUI/AndroidManifest.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,5 +179,17 @@
179179
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
180180
</intent-filter>
181181
</activity>
182+
183+
<!-- Beans in space -->
184+
<service
185+
android:name=".BeanBagDream"
186+
android:exported="true"
187+
android:label="Beans in space">
188+
<intent-filter>
189+
<action android:name="android.intent.action.MAIN" />
190+
<category android:name="android.intent.category.DEFAULT" />
191+
<category android:name="android.intent.category.DREAM" />
192+
</intent-filter>
193+
</service>
182194
</application>
183195
</manifest>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.android.systemui;
2+
3+
import android.service.dreams.Dream;
4+
5+
import com.android.systemui.BeanBag.Board;
6+
7+
public class BeanBagDream extends Dream {
8+
9+
private Board mBoard;
10+
11+
@Override
12+
public void onStart() {
13+
super.onStart();
14+
setInteractive(true);
15+
mBoard = new Board(this, null);
16+
}
17+
18+
@Override
19+
public void onAttachedToWindow() {
20+
super.onAttachedToWindow();
21+
setContentView(mBoard);
22+
lightsOut();
23+
mBoard.startAnimation();
24+
}
25+
26+
@Override
27+
public void finish() {
28+
mBoard.stopAnimation();
29+
super.finish();
30+
}
31+
}

0 commit comments

Comments
 (0)