/FloatingOverlay

ViewOverlay with touch events support.

Primary LanguageJavaMIT LicenseMIT

FloatingOverlay

山寨版 ViewOverlay :bowtie: 支持浮层滑动/点击 (Android 4.0 及以上).

用途

替换 WebView 视频播放器, 并实现小窗播放 (仿腾讯新闻). 下载示例

用法

复制 FloatingOverlay.java

final FloatingOverlay.LayoutParams layoutParams = new FloatingOverlay.LayoutParams();
layoutParams.x = 100;
layoutParams.y = 100;
layoutParams.width = 100;
layoutParams.height = 100;

final VideoView videoView = new VideoView(this);
videoView.setLayoutParams(layoutParams);

final FloatingOverlay floatingOverlay = FloatingOverlay.create(webView);
floatingOverlay.add(videoView);
floatingOverlay.show();