Search in sources :

Example 1 with LayoutInitCallback

use of com.risenb.expand.floatwindow.interfaces.LayoutInitCallback in project AndroidFrame by tongxiaoyun.

the class MyApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    m.getInstance().setFloatView(LayoutInflater.from(this).inflate(R.layout.float_window, null));
    m.getInstance().setCallback(new LayoutInitCallback() {

        @Override
        public void initView(View v, String path) {
            VideoView vv = (VideoView) v.findViewById(R.id.vv);
            vv.setVideoURI(Uri.parse(path));
            vv.start();
        }

        @Override
        public void reStart(View v, String path) {
            VideoView vv = (VideoView) v.findViewById(R.id.vv);
            vv.setVideoURI(Uri.parse(path));
            vv.start();
        }

        @Override
        public void stop(View v) {
            VideoView vv = (VideoView) v.findViewById(R.id.vv);
            vv.pause();
        }

        @Override
        public void destory(View v) {
        }
    });
}
Also used : VideoView(android.widget.VideoView) LayoutInitCallback(com.risenb.expand.floatwindow.interfaces.LayoutInitCallback) View(android.view.View) VideoView(android.widget.VideoView)

Aggregations

View (android.view.View)1 VideoView (android.widget.VideoView)1 LayoutInitCallback (com.risenb.expand.floatwindow.interfaces.LayoutInitCallback)1