Giter Site home page Giter Site logo

Comments (7)

princekin-f avatar princekin-f commented on July 21, 2024

你好,如果只需要点击时滑上去,相对简单些:设置一下退出动画(默认有),点击时关闭浮窗即可。

如果触摸时控制上滑,则需要重写touch事件,具体又可分为两种实现方式:

  • 第一种,重写浮窗内部拖拽逻辑,对竖直方向的拖拽做出反应,实现上下拖动效果,并且保证向下的最大坐标不超过原始y轴坐标;
  • 另一种处理方式,只使用浮窗的窗口显示功能,拖拽窗口内部的子View,对子View做拖拽处理,这样对浮窗没有侵入性,不影响浮窗原有的逻辑。

Ps:子View的拖拽需要屏蔽掉浮窗的事件拦截requestDisallowInterceptTouchEvent(true)

from easyfloat.

malonecoder avatar malonecoder commented on July 21, 2024

感谢大佬才看到~ 给产品看说申请权限太重了 让做成页面级别的 切换页面的时候可以让浮窗消失 ,但是在任何一个界面来了推送消息都要显示,这个怎么做合理呢

from easyfloat.

princekin-f avatar princekin-f commented on July 21, 2024

可以通过ActivityLifecycleCallbacks获取当前Activity的实例,在BaseActivity写具体的方法,传入具体的实例即可。

from easyfloat.

malonecoder avatar malonecoder commented on July 21, 2024

谢谢大佬

from easyfloat.

malonecoder avatar malonecoder commented on July 21, 2024

在dismiss悬浮窗的时候提示parentView没有初始化 AbstractDragFloatingView - 367行 lazyinit property parentView has not been initialized

from easyfloat.

princekin-f avatar princekin-f commented on July 21, 2024

parentView就是activity的根布局,为什么该值会为空不是很明白,但为了代码的健壮做了额外的判断v 1.2.2

from easyfloat.

malonecoder avatar malonecoder commented on July 21, 2024

谢谢~~

from easyfloat.

Related Issues (20)

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.