I am trying to achieve a floating draggable view that will be displayed across all the activities of a single app.
Meaning there will be a view of 30% height and 50% width of the screen that the user will be able to drag on the screen and it will be drawn above any activity in the app. When the user will switch to another activity within the same app the floating view should remain in the same place.
I know it is possible using SYSTEM_ALERT_WINDOW
permission, which I want to avoid because this view is only required to be displayed within the app and I don't want the users to be asked to approve such permission.
Another important point:
This view is going to be part of an SDK.
Meaning that I am not responsible for the activities/fragments/layouts of the app.
I can have/assume:
- Base Application that the hosting app will subclass
- All the root layouts have some identifier and are of some specific type (e.g. all the root layouts are
RelativeLayout
and have an idroot_layout
)
Similar questions that was asked 4-6 years ago with 0 satisfying answers: