Jerk in UI with notification bar - android

In my application I have two Activities A and B. In Activity A, i disable the notification bar in manifest but in Activity B notification bar is enabled. While navigating from Activity A to Activity B there is some jerk in User Interface. Can any body help me in this.

I think jerk is happening because the phone/tablet on which you are testing either:
has a weak GPU and thus cannot render the transition fluidly, or
the version of Android does not support it.
This is not a problem with your app. Ideally there should be a smooth slide-in, like on my Nexus 7.
A nice way to solve it is by either having the notification-bar on in both Activities or off in both. No jerk :)

Have you tried performance testing your app? Your UI could be causing the problem. Do you see the same Jerk if you temporarily disable the notification bar? Have you tried using the Hierarchy Viewer on Activity B?

Related

Immersive app with startActivityForResult

I have a fullscreen, immersive-sticky activity A, which works fine due to: https://developer.android.com/training/system-ui/immersive.html.
From there I want to take a picture using startActivityForResult() as in: https://developer.android.com/training/camera/photobasics.html
However, before leaving A into the system camera app, the system bar appears shortly in my app, which is considerably irritating. How can I prevent this?
Best would be to prevent the system bar in the camery app as well, but I think this is futile.

Window setFlags() behaviour differences between Android versions?

I have an Activity, which has a Fragment, inside of which is a ViewPager of images. In the ViewPager, there might be certain images which are sensitive, and the viewer should not be able to take a screenshot of (only) those. When such an item shows, I do:
fragment.getActivty().getWindow().addFlags(FLAG_SECURE).
And then in that fragment's onDestroy (or ViewPager's swipe), I clear that flag on the window.
This works perfectly on Android versions 6.0 and above: when that particular image is open, screenshots are blocked.
However, on Android 5.x and below, the flag update does not take place till there's a configuration change on the hosting Activity.
Does anyone know why this happens? And what's the best workaround?
I found some references here on StackOverflow, talking about the problem and a workaround, but (a) nothing explains why there's this discrepancy and (b) the workaround suggested is very, very high friction: it flashes the entire screen black.
References:
How to disable screen capture in Android fragment?

disable android systemui button and other components are not showing

I am trying different options to disable system bar permanently for my android app. Now, the most successfully solution is stop the android systemui service.
service call activity 42 s16 com.android.systemui
But, this cause serious issues in my app. I have 3 android UI components on screen, 2 webviews and one videoView. Upon disabling the UI service, my webviews will show on screen for a second and then turn completely black(maybe disappeared). Only videoview is playing. Because I am refreshing the webview every 10seconds, the webview will shown up another second upon each refresh and gone. In addition, all my buttons are gone as well. Any suggestions? Thanks
How could you consider to stop system services?
You shouldn't mess with your users' devices!
Why didn't you just try to hide the Status bar and/or the Navigation Bar
Edit:
Another solution is to implement the Kiosk mode as in this tutorial or Screen pinning if devices are running Lollipop

Disable Home Button or system bar on tablet

I'm working on an existing Android application for medical purposes.
The back button and home button should be disabled.
With the existing code, the back button is disabled.
For disabling the home button they used onAttachedWindow with LayoutParams TYPE KEYGUARD,
but this security hole is fixed since 4.0.
I tried a lot of similar questions, but none worked out for me.
What is the way to get this done these days?
Also, hiding the status bar on tablet (where the home & back button live) would do the trick,
so any suggestions there are equally helpful!
Update: also, free third party apps that do the hiding trick are okay!
This sounds like a kiosk or dedicated use kinda thing, yes? You want your app to "own" the tablet and prevent other usage? I did this for an app whose sole purpose was to act as a remote control for a custom device. Basically I created two apps, a "custom launcher" app and the app that did the remote control. It's probably possible to integrate the two, but I wanted to support both dedicated and non-dedicated use. Note that I gave the launcher app a password-protected way to access settings so that I could recover the tablet at any time.
You can find a number of tutorials that will guide you through creating a custom launcher, just strip out all the stuff that makes it a generic launcher and replace it with an image button or similar that launches the actual app, or replace the launcher activity with your main app activity. Warning: I never figured out how to remove the launcher except by going into the settings.
As for hiding the system bar (notifications and status icons at the top of the screen), you'll want to use a full-screen theme like #android:style/Theme.NoTitleBar.Fullscreen.
As for hiding the home button I took this approach:
View main_layout = this.findViewById(android.R.id.content).getRootView();
main_layout.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
Unfortunately the STATUS_BAR_HIDDEN flag is deprecated now, but I think some of the other options would have the same effect. Regardless, the best you can achieve within Android's intended use is to temporarily hide the navigation buttons (home and back). A tap on the screen will bring them back.

Switching activities on lockscreen shows lockscreen

So I'm making an app for my company, for a android tablet to be used like a "kiosk". Users should only be able to use this one app, and be able to do nothing else on the tablet.
I've found a solution by using WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED on the activities. However, when I switch to another activity in my app, the leaving activity fades out, shows the lock screen quickly and then the next activity appears.
I'm guessing that this is because the FLAG_SHOW_WHEN_LOCKED is in onCreate(), as opposed to earlier in the Activity creation process.
Is there anywhere else I can put this flag, or any other way to prevent the lockscreen to be shown between activities? It's not a huge issue, but it is a poor user experience.
It is a Samsung Galaxy Tab 10.1 Running ICS 4.0.3.
I was able to best fix this by using Fragments and using FragmentManager to swap out the fragments in the activity, so the lockscreen was never shown, since I never left the activity. The android developer guide has a good example for this.
http://developer.android.com/reference/android/app/Fragment.html

Categories

Resources