Application level floating views with navigation in Android - android

I have to show a floating button that will be added in WindowManager so it remain on the top of all Activities. (I have done this part using https://github.com/marshallino16/FloatingView)
When that button is tapped I have to open screen and show detail view and navigate between other views. To achieve this thing I can do following things either adding
1 - PopUpWindow
2 - Dialog
But I cannot provide navigation using either of them. So my questions is.
What is the best way to add multiple views and providing navigation between them while keeping everything above the application that is running it.
How can we add Activity so that it won't pause user application?

You should open Activity and implement all navigation inside it.
Android may pause activities behind, so make your Activity only for part of the screen.
Inside Activity hide floating button and show it again on exit.

Related

Android, Cicerone. Is it possible to implement cicerone with bottom navigation and Single Activity approach?

I'm using cicerone and single activity approach. When the application starts, the first three seconds I'm showing splash fragment inside my activity and so redirect to home fragment. Now I need to add to my application bottom navigation. Is it possible to add bottom navigation using single activity approach and cicerone. Or will I have to add another activity for the holding bottom navigation ?
Unfortunately, I could not find examples of projects with cicerone, single activity and bottom navigation.
My main goal is to save single activity, please tell me if it is possible to achieve this ?

How to keep Bottom Navigation View after opening an Activity from Fragment?

I'm a beguinner with Android programming, and in my app I have a Bottom Navigation View with 3 fragments.
One of those fragments has a button that allows the user to open another Activity to listen to music. But whenever the Activity is opened using Intents, the Bottom Navigation View from the previous screens disappears.
Can I open an Activity from a Fragment, but still have the Bottom Navigation View active?
Below is attached a link with an image of the mock-up I've made, hope it helps to clarify the question:
Thank you in advance for trying to help me out!
Reason
Well I guess (because I have no clue about your code base) the bottom navigation bar is a part of the main activity in which the fragments are being contained. When you are starting a new activity, the main activity with the bottom navigation goes as the music player layout loads.
Recommended Solution
Instead of keeping the music player as an activity make it a fragment and load in the view you are using as the fragment container in the main activity.
Another Way round (Not recommended)
Make another view of the bottom navigation bar in the music player activity and map the actions of the button click to load the main activity.
It might be a bit time taking and buggy initially but with debugging and testing, you can make it work.
But again its not a good option.

How do i make my Floating Action Button(FAB) to visible in all the screen of app not just the page viewer

I want to make my FAB to be visible throughout the app.
I have pageviewr and im able to display FAB in all pageViewer.
- FAB works same in all the screen so.
Even i have different activity too, i want to display in those activity too.
can any let me how do i do that.
Or do i need to add the FAB button in different activity ?
Every activity in Android has its own content View, so you need to add FAB to each one.
But if you want to reduce duplications, you can make fab_layout.xml with <include> tag and use it for every layout every Activity.
Also you can implement Base activity, with providing base functionality to FAB. Or instead of parent Base activity you can implement FabHandler class and use it in each activity.

How do I implement a slide-out drawer on the Android's call screen?

The Android app Thrutu puts a drawer on top of the in call screen which has several functions and only takes up a fraction of the screen. The call control buttons below still are fully functional. Even a transparent activity would not allow this behaviour. Any idea on how to implement this?
The trick to making the underlying buttons work is to implement the UI using a Service rather than an Activity, make the Window you add (using WindowManager.addView) one of the higher-priority types (e.g. TYPE_PHONE), then use FLAG_NOT_TOUCH_MODAL.
I think you need android.permission.SYSTEM_ALERT_WINDOW.
Take a look at How to display a fullscreen TYPE_SYSTEM_ALERT window? and in particular Creating a system overlay where the home buttons still work?

Layout issue - how to start an activity without moving certain UI elements?

I'm trying to implement tab buttons bar and a navigation bar in my android application. The problem is, that I would like the navigation elements to persist. When starting a child activity, the nav bar moves.
How can I make these two elements "non-movable"?
Add button bar and navigation bar to all your activities and share it's state via static fields. Remember to initialize bars when child activity starts and update parent's bars when child activity finishes (either via onResume or as a result of startActivityForResult).
It is not possible to share instances of UI elements between activities, as Activities are (by design) independent of each other.
Application cannot control how new activity is introduced - it can slide, zoom in or just show up if user disable animation in device preferences, UPDATE: it looks like since API Level 5 there are ways to override this, please refer to Activity transition in Android . But if you really need to keep bars in place, use single Activity and replace main view content with animation you like.

Categories

Resources