├── sample ├── .gitignore ├── res │ ├── drawable │ │ ├── icon.png │ │ ├── abc_ic_star_black_16dp.png │ │ ├── abc_ic_star_black_36dp.png │ │ ├── abc_ic_star_black_48dp.png │ │ ├── abc_btn_check_to_on_mtrl_000.png │ │ ├── abc_btn_check_to_on_mtrl_015.png │ │ ├── abc_btn_radio_to_on_mtrl_000.png │ │ ├── abc_btn_radio_to_on_mtrl_015.png │ │ ├── abc_ic_star_half_black_16dp.png │ │ ├── abc_ic_star_half_black_36dp.png │ │ ├── abc_ic_star_half_black_48dp.png │ │ ├── c_outline_close_black_48dp.png │ │ ├── abc_list_divider_mtrl_alpha.9.png │ │ ├── c_outline_settings_black_48dp.png │ │ ├── c_outline_drag_handle_black_48dp.png │ │ ├── c_outline_visibility_black_48dp.png │ │ ├── c_outline_visibility_off_black_48dp.png │ │ ├── c_outline_add_circle_outline_black_48dp.png │ │ ├── c_outline_pause_circle_outline_black_48dp.png │ │ └── c_outline_remove_circle_outline_black_48dp.png │ ├── drawable-hdpi │ │ └── ic_launcher.png │ ├── drawable-mdpi │ │ └── ic_launcher.png │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ ├── drawable-xxhdpi │ │ └── ic_launcher.png │ ├── layout │ │ ├── activity_d.xml │ │ ├── activity_c.xml │ │ ├── activity_b.xml │ │ └── activity_main.xml │ └── values │ │ └── strings.xml ├── lint.xml ├── src │ └── com │ │ └── example │ │ └── fixedfloatwindow │ │ ├── BaseActivity.java │ │ ├── BaseApplication.java │ │ ├── ActivityC.java │ │ ├── ActivityB.java │ │ └── MainActivity.java ├── .classpath ├── project.properties ├── proguard-rules.pro ├── .project ├── AndroidManifest.xml └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── floatwindow ├── src │ └── com │ │ └── yhao │ │ └── floatwindow │ │ ├── interfaces │ │ ├── ISensorRotateChanged.java │ │ ├── ResumedListener.java │ │ ├── LifecycleListener.java │ │ ├── IConfigChanged.java │ │ ├── ViewStateListener.java │ │ ├── ViewStateListenerAdapter.java │ │ ├── BaseFloatView.java │ │ └── BaseFloatWindow.java │ │ ├── enums │ │ ├── EScreen.java │ │ ├── ETypeRotateChange.java │ │ └── EMoveType.java │ │ ├── permission │ │ ├── PermissionListener.java │ │ └── PermissionUtil.java │ │ ├── utils │ │ ├── FwContent.java │ │ ├── Rom.java │ │ ├── ViewUtils.java │ │ ├── Miui.java │ │ ├── RotateUtil.java │ │ ├── RefInvoke.java │ │ └── L.java │ │ ├── FloatActivity.java │ │ ├── impl │ │ ├── FloatToast.java │ │ ├── FloatPhone.java │ │ ├── FloatLifecycleReceiver.java │ │ └── IFloatWindowImpl.java │ │ └── FloatWindow.java ├── lint.xml ├── .classpath ├── project.properties ├── proguard-rules.pro ├── .project ├── AndroidManifest.xml ├── maven.gradle └── build.gradle ├── gradle.properties ├── version.md ├── clean.sh ├── .gitignore ├── cleanCache.sh ├── gradlew.bat ├── README.md ├── gradlew └── LICENSE.txt /sample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':sample', ':floatwindow' 2 | -------------------------------------------------------------------------------- /sample/res/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/icon.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/res/drawable/abc_ic_star_black_16dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/abc_ic_star_black_16dp.png -------------------------------------------------------------------------------- /sample/res/drawable/abc_ic_star_black_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/abc_ic_star_black_36dp.png -------------------------------------------------------------------------------- /sample/res/drawable/abc_ic_star_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/abc_ic_star_black_48dp.png -------------------------------------------------------------------------------- /sample/res/drawable/abc_btn_check_to_on_mtrl_000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/abc_btn_check_to_on_mtrl_000.png -------------------------------------------------------------------------------- /sample/res/drawable/abc_btn_check_to_on_mtrl_015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/abc_btn_check_to_on_mtrl_015.png -------------------------------------------------------------------------------- /sample/res/drawable/abc_btn_radio_to_on_mtrl_000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/abc_btn_radio_to_on_mtrl_000.png -------------------------------------------------------------------------------- /sample/res/drawable/abc_btn_radio_to_on_mtrl_015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/abc_btn_radio_to_on_mtrl_015.png -------------------------------------------------------------------------------- /sample/res/drawable/abc_ic_star_half_black_16dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/abc_ic_star_half_black_16dp.png -------------------------------------------------------------------------------- /sample/res/drawable/abc_ic_star_half_black_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/abc_ic_star_half_black_36dp.png -------------------------------------------------------------------------------- /sample/res/drawable/abc_ic_star_half_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/abc_ic_star_half_black_48dp.png -------------------------------------------------------------------------------- /sample/res/drawable/c_outline_close_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/c_outline_close_black_48dp.png -------------------------------------------------------------------------------- /sample/res/drawable/abc_list_divider_mtrl_alpha.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/abc_list_divider_mtrl_alpha.9.png -------------------------------------------------------------------------------- /sample/res/drawable/c_outline_settings_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/c_outline_settings_black_48dp.png -------------------------------------------------------------------------------- /sample/res/drawable/c_outline_drag_handle_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/c_outline_drag_handle_black_48dp.png -------------------------------------------------------------------------------- /sample/res/drawable/c_outline_visibility_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/c_outline_visibility_black_48dp.png -------------------------------------------------------------------------------- /sample/res/drawable/c_outline_visibility_off_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/c_outline_visibility_off_black_48dp.png -------------------------------------------------------------------------------- /sample/res/drawable/c_outline_add_circle_outline_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/c_outline_add_circle_outline_black_48dp.png -------------------------------------------------------------------------------- /sample/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample/res/drawable/c_outline_pause_circle_outline_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/c_outline_pause_circle_outline_black_48dp.png -------------------------------------------------------------------------------- /sample/res/drawable/c_outline_remove_circle_outline_black_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDKers/FloatWindow/HEAD/sample/res/drawable/c_outline_remove_circle_outline_black_48dp.png -------------------------------------------------------------------------------- /floatwindow/src/com/yhao/floatwindow/interfaces/ISensorRotateChanged.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.interfaces; 2 | 3 | public interface ISensorRotateChanged { 4 | public abstract void onRotateChanged(); 5 | } 6 | -------------------------------------------------------------------------------- /floatwindow/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | android.injected.testOnly=false 2 | org.gradle.daemon=true 3 | org.gradle.parallel=true 4 | org.gradle.jvmargs=-Xmx2048m -XX\:MaxPermSize\=512m -XX\:+HeapDumpOnOutOfMemoryError -Dfile.encoding\=UTF-8 5 | org.gradle.configureondemand=true 6 | -------------------------------------------------------------------------------- /sample/res/layout/activity_d.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Jul 22 21:37:38 CST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip -------------------------------------------------------------------------------- /sample/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | FloadWindow 4 | Hello world! 5 | Settings 6 | 7 | -------------------------------------------------------------------------------- /version.md: -------------------------------------------------------------------------------- 1 | # 版本变更 2 | 3 | >记录版本变更 4 | 5 | ## 详情 6 | ====== 7 | 8 | ### v1.0.9.1 9 | 10 | * 日期: 2019.02.19 11 | * 变更内容: 12 | 1. 增加操作脚本(编译、清除等) 13 | 2. 支持android studio/eclipse工具开发.(不得不吐槽下,as内存占用太猛了,8Gmac开不了几个工程) 14 | 3. 去除V4依赖 15 | 4. 初步合并之前几个合并.(销毁和反注册方法/滑动超出范围的处理) 16 | 5. 调整目录结构 17 | 18 | 19 | -------------------------------------------------------------------------------- /floatwindow/src/com/yhao/floatwindow/enums/EScreen.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.enums; 2 | 3 | /** 4 | * @Copyright © 2019 Analysys Inc. All rights reserved. 5 | * @Description: 屏幕宽高。去除V4依赖 6 | * @Version: 1.0 7 | * @Create: Feb 19, 2019 11:25:37 AM 8 | * @Author: sanbo 9 | */ 10 | public enum EScreen { 11 | WIDTH, 12 | HEIGHT 13 | } -------------------------------------------------------------------------------- /floatwindow/src/com/yhao/floatwindow/interfaces/ResumedListener.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.interfaces; 2 | 3 | /** 4 | * @Copyright © 2017 Analysys Inc. All rights reserved. 5 | * @Description: 6 | * @Version: 1.0.9 7 | * @Create: 2017-11-14 17:15:35 8 | * @Author: yhao 9 | */ 10 | public interface ResumedListener { 11 | public void onResumed(); 12 | } 13 | -------------------------------------------------------------------------------- /floatwindow/src/com/yhao/floatwindow/permission/PermissionListener.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.permission; 2 | 3 | /** 4 | * @Copyright © 2017 Analysys Inc. All rights reserved. 5 | * @Description: 6 | * @Version: 1.0.9 7 | * @Create: 2017/11/14 17:15:35 8 | * @Author: yhao 9 | */ 10 | public interface PermissionListener { 11 | void onSuccess(); 12 | 13 | void onFail(); 14 | } 15 | -------------------------------------------------------------------------------- /floatwindow/src/com/yhao/floatwindow/enums/ETypeRotateChange.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.enums; 2 | 3 | /** 4 | * 手机旋转类型. 5 | *

6 | * T_ACTIVITY_ROTATE: activity lifecycle 监听的页面屏幕旋转 7 | * T_SENSOR_ROTATE: 传感器监听的手机旋转 8 | */ 9 | public enum ETypeRotateChange { 10 | // 页面回调,监听的页面旋转(此时手机旋转无效) 11 | T_ACTIVITY_ROTATE, 12 | // 跳出app后,监听的手机旋转(页面旋转失效) 13 | T_SENSOR_ROTATE 14 | } 15 | -------------------------------------------------------------------------------- /sample/src/com/example/fixedfloatwindow/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.fixedfloatwindow; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | 6 | public class BaseActivity extends Activity { 7 | 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | setContentView(R.layout.activity_d); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /floatwindow/src/com/yhao/floatwindow/interfaces/LifecycleListener.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.interfaces; 2 | 3 | /** 4 | * @Copyright © 2017 Analysys Inc. All rights reserved. 5 | * @Description: 6 | * @Version: 1.0.9 7 | * @Create: 2017-11-14 17:15:35 8 | * @Author: yhao 9 | */ 10 | public interface LifecycleListener { 11 | 12 | public void onShow(); 13 | 14 | public void onHide(); 15 | 16 | public void onBackToDesktop(); 17 | } 18 | -------------------------------------------------------------------------------- /clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | : ' 4 | 清除程序入口 5 | ' 6 | echo ">>>>clean project<<<<" 7 | dir=("floatwindow" "sample" ) 8 | for element in ${dir[@]} 9 | do 10 | #clean task 11 | rm -rf $element/build/ 12 | rm -rf $element/bin/ 13 | rm -rf $element/gen/ 14 | rm -rf $element/.externalNativeBuild 15 | done 16 | 17 | rm -rf build/ 18 | rm -rf release/ 19 | 20 | 21 | if [ $# == 0 ]; then 22 | echo " clean project success. " 23 | else 24 | echo ">>clean project Failed!<<" 25 | fi 26 | -------------------------------------------------------------------------------- /floatwindow/src/com/yhao/floatwindow/utils/FwContent.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.utils; 2 | 3 | /** 4 | * @Copyright © 2019 sanbo Inc. All rights reserved. 5 | * @Description: 常量 6 | * @Version: 1.0 7 | * @Create: 2019-10-17 15:19:24 8 | * @author: sanbo 9 | */ 10 | public class FwContent { 11 | 12 | public static final String VERSION = "v1.10.0"; 13 | public static final String DEFAULT_TAG = "default_float_window_tag"; 14 | public static final boolean isDebug = false; 15 | } 16 | -------------------------------------------------------------------------------- /sample/src/com/example/fixedfloatwindow/BaseApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.fixedfloatwindow; 2 | 3 | import android.app.Application; 4 | 5 | /** 6 | * @Copyright © 2017 Analysys Inc. All rights reserved. 7 | * @Description: https://github.com/yhaolpz 8 | * @Version: 1.0 9 | * @Create: 2017/12/18 16:57:40 10 | * @Author: yhao 11 | */ 12 | public class BaseApplication extends Application { 13 | 14 | @Override 15 | public void onCreate() { 16 | super.onCreate(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /floatwindow/src/com/yhao/floatwindow/interfaces/IConfigChanged.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.interfaces; 2 | 3 | /** 4 | * @Copyright © 2019 sanbo Inc. All rights reserved. 5 | * @Description: 页面旋转回调 6 | * @Version: 1.0 7 | * @Create: 2019-10-15 14:47:56 8 | * @author: sanbo 9 | */ 10 | public interface IConfigChanged { 11 | //页面旋转时回调 12 | public abstract void onActivityConfigChanged(); 13 | 14 | // 跳出应用、打开应用回调,用于旋转优先级选择。 15 | public abstract void onBackToDesktop(boolean isBack); 16 | } 17 | -------------------------------------------------------------------------------- /floatwindow/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /sample/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /sample/src/com/example/fixedfloatwindow/ActivityC.java: -------------------------------------------------------------------------------- 1 | package com.example.fixedfloatwindow; 2 | 3 | import android.os.Bundle; 4 | import android.view.View; 5 | 6 | public class ActivityC extends BaseActivity { 7 | 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | setContentView(R.layout.activity_c); 12 | setTitle("C"); 13 | 14 | } 15 | 16 | public void back(View view) { 17 | finish(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | captures 2 | .externalNativeBuild 3 | import-summary.txt 4 | 5 | #java files 6 | *.class 7 | *.dex 8 | 9 | #for idea temp file 10 | *.iws 11 | *.ipr 12 | *.iml 13 | 14 | #mac temp file 15 | *.idea/ 16 | __MACOSX 17 | *.DS_Store 18 | 19 | #test android studio module 20 | *androidTest/ 21 | */out/ 22 | *.gradle/ 23 | */release/ 24 | */build/ 25 | build/ 26 | release/ 27 | */bin/ 28 | */gen/ 29 | 30 | #for eclipse 31 | .settings/ 32 | local.properties 33 | 34 | #temp file 35 | *.bak 36 | 37 | *.pmd 38 | *.wiki/ 39 | -------------------------------------------------------------------------------- /floatwindow/src/com/yhao/floatwindow/enums/EMoveType.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.enums; 2 | 3 | /** 4 | * @Copyright © 2019 Analysys Inc. All rights reserved. 5 | * @Description: 移动类型, 去除V4依赖 6 | *

7 | * SLIDE : 可拖动,释放后自动贴边 (默认) 8 | *

9 | * BACK : 可拖动,释放后自动回到原位置 10 | *

11 | * ACTIVE : 可拖动 12 | *

13 | * INACTIVE : 不可拖动 14 | * @Version: 1.0 15 | * @Create: Feb 19, 2019 11:32:21 AM 16 | * @Author: sanbo 17 | */ 18 | public enum EMoveType { 19 | FIXED, 20 | INACTIVE, 21 | ACTIVE, 22 | SLIDE, 23 | BACK 24 | } -------------------------------------------------------------------------------- /sample/res/layout/activity_c.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 |