Hide on screen buttons in android phonegap app - android

I've made an app for Android using phonegap and i wanted to make it really full screen and hide/remove the buttons at the bottom of the screen (The back button, the home button and the app switcher button) I know this is possible because the BBC iPlayer app does it when you're viewing a video, but i dont know if it's possible with phonegap, Does anyone know if it is, and if so, could you point me in the right direction

Not possible - I haven't used the BBC Sport app properly, but hazard a guess it uses the device's default player (which is an Android player) and thus this is the only desirable time you want full-screen mode.
Android relies on those buttons - otherwise, how can you exit the app? It's like the home button on iOS - you need it to operate the device.
There are event listeners you can use for the back button and menu button which you can override the default behaviour for:
document.addEventListener('backbutton', function () {
// do something when back is pressed
}, false);
document.addEventListener('menubutton', function () {
// do something when menu is pressed
}, false);
That's about it though. Think in terms of the Samsung Galaxy phones - these are hard buttons and so you can't 'hide' them like you can on stock Android.

Related

How to take user to select appWidget to pin into screen From my App

I have developed a Widget for my Android App, and It can be added in following ways.
User can long press in the Home launcher and select Widgets and then drag and drop to Home Launcher Screen, like this -
and then
From the App, in a button click, If
Build.VERSION_CODES.O && appWidgetManager.isRequestPinAppWidgetSupported is true
then we call
appWidgetManager.requestPinAppWidget
And It works, for some devices It doesn't work even if isRequestPinAppWidgetSupported was true.
I am looking for a way to navigate user to 1st way ( going to select widget screen) from my app, whenever isRequestPinAppWidgetSupported was false.
I've used:
addWidgetActivityLauncher.launch(Intent(AppWidgetManager.ACTION_APPWIDGET_PICK).apply { putExtra(EXTRA_APPWIDGET_ID,requireActivity().appW.allocateAppWidgetId()) })
But this opens up a screen like this
,
but clicking on my widget doesn't do anything. Just closes this dialog.
I want to automate the 1st way till the widget selection screen from my app.
PLease help me discover what I am missing.

Android 11, keyboard bottom area is not working after app launched via Custom launcher and then back from app Recent List

In Android-11, I enabled the Gesture navigation in the Android System Settings and launched a sample application(which contains only one editText on the Screen) using my custom App Launcher. you can see in the below screenshot,
Gesture Navigation means there is no 3-button navigation, similar behavior of iPhones behavior,
You can see in the above image at the keyboard bottom, that there is some additional space available, so in order to remove the space, I used the below code to hide that
WindowInsetsController wcon = getWindow().getInsetsController();
wcon.hide(WindowInsets.Type.navigationBars());
wcon.setSystemBarsBehavior(WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
So, after I used the code, I got the expected behavior as below, in this stage everything is working fine, (the additional area is hided)
But,
Once I moved this from recent apps like below and again moved back from the normal stage, the Bottom keyboard area touch is not working, I highlight using the Red Color,
This only happens, when I launched the app using Custom App
What went wrong with this behavior, Why is the bottom area not working?

How to prevent user from clicking Navigation buttons in Android

I have encountered a problem where user will exit my application accidentally. I know Android is preventing to block use of these buttons, because you should always be able to exit your app somehow but I am creating an app for blind and visually impaired people and I will implement a special exit the app so they won't close it when they will be using it.
Here are some things I gathered:
I can block the onBackPressed() function and prevent going back.
I can't use onKeyEvent() since it won't grab the home click
Good example is MX Player where you can "lock" your screen but it just draws over the whole screen, thus preventing user to click on anything.
Ok, so I would like to grab the same thing as MX Player, except, I would like for user, to still have interaction with the screen.
I tried using Immersive full screen that Google has introduced for full screen apps, but whenever user slides his finger on the screen, Navigation Menu popus up. Can I keep this hidden at all times? Also, can I prevent the slide from Status Bar to display the buttons? I would like to have full control of how the user is moving their finger over the screen.
So if I go back to the MX Player solution - drawing over the screen. Can I create like a Canvas that doesn't have focus and it's just there to prevent the clicks on the buttons?
Any help is very much appreciated. Thanks.

How to bypass the lockscreen in android.?

I'm working on a lockscreen widget(not trying to be specific here, but Nexus 7 ) . The widget has a button which would trigger an activity.When the user clicks the button, the unlock slide symbol get's highlighted hinting the user has to slide-unlock his screen before he wants to see the button's activity. Since now, the device is locked,is there a way to bypass this and just display the activity on top of the lock screen? (not in the case of pin/pattern obviously, but only just slide)
Was searching a lot for a way to do it. We need to use flags in while giving an intent to the widget button. More information here.
Android Lock Screen Widget

Android "Tooltip"

The current Android YouTube application provides helpful hints for navigating the user interface. For example: the first time the user switches between tabs while a video is playing, a small "tooltip" with an arrow pops up and says "You can also switch between tabs by swiping left and right." or something to that effect. Is there a way to mimic the look and functionality of this tooltip?
The best way I could think of doing that is having something in a preferences file and when the user triggers a certain event (pressing a tab in Youtube rather than swiping) it brings up a custom view or even a Toast message. Then, after the tooltip is triggered, set the specific tag in the preferences file as triggered.

Categories

Resources