Coder Social home page Coder Social logo

curacfr's Introduction

介绍

1.接手新项目时由于对项目代码不熟悉,找相应的界面会耗费大量时间,于是开发了这个库。

2.侵入性低,无需在每个页面或者基类调用设置代码。

3.java/kotlin通用。

注意

由于使用了FragmentLifecycleCallbacks来监听Fragment生命周期,所以要求v4包版本在25.1.0以上

展示

截图

使用

引用

dependencies {
	...
    debugImplementation 'com.vicedev:curacfr:1.0.0'
    releaseImplementation 'com.vicedev:curacfr-no-op:1.0.0'
}
初始化:
class App : Application() {
    override fun onCreate() {
        super.onCreate()
        CurAcFr.init(this)
    }
}
打开悬浮窗
//方式一:使用默认的悬浮窗界面
CurAcFr.show()
//方式二:参数1:当前页面的返回监听,参数2:是否使用默认的悬浮窗
CurAcFr.show(object : CurAcFr.OnChangeListener {
    override fun onCurrentActivityChange(currentActivityName: String?) {  
     }
    override fun onCurrentFragmentChange(currentFragmentName: String?) {
     }
}, false)    
关闭悬浮窗
CurAcFr.hide()

感谢

悬浮窗基于FloatWindow-master修改

1.修改滑动显示,使其不能滑动超出屏幕

2.去除了权限相关代码,由于权限适配bug较多且是自己用的工具,直接提示去设置打开就好了

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.