Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f07439fb authored by John Spurlock's avatar John Spurlock
Browse files

Beans in space.

Quick example dream reusing the JB bean bag view.

Change-Id: Iad3ecedc9ba2c258bd33fcfbba2e3fc48382bdc8
parent 080ca09c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -179,5 +179,17 @@
<!--            <category android:name="android.intent.category.LAUNCHER" />-->
            </intent-filter>
        </activity>

        <!-- Beans in space -->
        <service
            android:name=".BeanBagDream"
            android:exported="true"
            android:label="Beans in space">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.DREAM" />
            </intent-filter>
        </service>
    </application>
</manifest>
+31 −0
Original line number Diff line number Diff line
package com.android.systemui;

import android.service.dreams.Dream;

import com.android.systemui.BeanBag.Board;

public class BeanBagDream extends Dream {

    private Board mBoard;

    @Override
    public void onStart() {
        super.onStart();
        setInteractive(true);
        mBoard = new Board(this, null);
    }

    @Override
    public void onAttachedToWindow() {
        super.onAttachedToWindow();
        setContentView(mBoard);
        lightsOut();
        mBoard.startAnimation();
    }

    @Override
    public void finish() {
        mBoard.stopAnimation();
        super.finish();
    }
}