White screen and actionbar seen on app startup instead of black screen - android

As JadeMason said here https://android.stackexchange.com/a/1440/74487:
"Black is the default plot color for Android, so this is the placeholder until the app completes it's layout operation"
I noticed most other apps do show black screen while starting up until their layout is ready to show.
However, my app instead shows white screen with the actionbar visible (but the menu items in the action bar are not visible; it is just the black/darkgrey bar and the app icon on the left side of it that are visible).
The background color of the main activity of my app is black. And the radical color transition between the complete white and complete black is so ugly and fatigues my eyes.
I'd like to have the default black screen during my app startup. How to achieve this?
More information on my app:
My app has minSdkVersion 10 and targetSdkVersion 20.
My app theme is Theme.AppCompat.Light.DarkActionBar (is it the appcompat that is
causing this issue?)

Cyril Mottier has a really great blog post about this topic here.

Related

How do I change the colour of status bar icons when a fragment is opened?

I have created 2 fragments and made them overlap using bottom sheet. First one fragment opens, then the second framgment opens, but when the 2nd fragment is closed,the colour of the status bar icons change to white if the status bar background is white and same for dark.
How do I fix this? Or how do I change the colour of status bar icons?
I have read the docs and read about WindowInsetsController but this will do it for android R only. My issue persists for all versions.
Please help.
You can't change the icons with a specific color but with that in your styles.xml file you can make it light or dark. Keep in mind that it only works API 23 and above.
<item name="android:windowLightStatusBar">true</item>
More references or ways of individual solutions you can find at this post.

Black stripe over the navigation bar (AOSP)

I have a strange black bar (around 30 dp), which is over the navigation bar (see attached image).
It is preventing my app from fully wrapping it's view. Probably it is some system window border, which I can't yet find how to disable/resize.
It is observed in some apps, and in some it is not (which seems that applying some theme or window flag should remove it).
Here is what I've tried up to now:
Changed app theme to a different one (e.g. #android:style/Theme.DeviceDefault.Settings).
Applied this in oncreate:
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
Changed the nav bar size - it only gets smaller, but the black line stays in the same position
Using uiautomatorviewer doesn't seem to show the view (and id) of the navigation bar at all.
Any help for removing this line would be appreciated.
Hello again and thanks for the support.
Finally I've found the issue. It was due to the api which was used (android-23). After updating to android-29, the issue is resolved. Seems that somehow theming or windowing mechanism is affected by the old api (and the app does not cover the whole screen - the rest is covered by a black background).
PS: I needed to restart the phone in order this to be applied. Killing of the app after adb push didn't apply the setting.

How to set different icons for app and for its notifications?

I'm using a picture with black background and white sign as an icon for my app. The problem is when I'm getting a notification a icon at the top of the display is completely white (I don't know why to be honest, when screen is locked it looks as originally).
I want to solve this problem by setting different icon for notifications, I can use this site, when I'm using a text icon generated by this site it works just fine.
I'm wondering how to set different icons for my app and its notifications, I know it's possible, but I only have folders that are used for both app and notification icon (drawable-[hdpi/mdpi/xhdpi/xxhdpi/xxxhdpi]).
The problem is when I'm getting a notification a icon at the top of the display is completely white (I don't know why to be honest, when screen is locked it looks as originally).
You set the SetSmallIcon() in the Notification.Builder.
To understand the Android documentation which is as follows – “Update or remove assets that involve color. The system ignores all non-alpha channels in action icons and in the main notification icon. You should assume that these icons will be alpha-only. The system draws notification icons in white and action icons in dark gray.”
you can convert your notification icon to an Android friendly one with a few clicks.
In Notification icon generator, open up your icon file. Convert all parts of the image that you don’t want to show to transparent pixels. All colors and non transparent pixels are displayed in white.
Problem solved, I added below to AndroidManifest.xml (application section)
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="#drawable/new_notification_icon" />

Android: Replacing navigation bar icons with dots

I've seen a number of apps on Android that replace the navigation bar icons (the triangle, for back, circle, and square) with dots. The button is still there, just less intrusive. Good for games and video apps.
How is this done? I can't find an api for it other than immersive mode.
Try using View.setSystemUiVisibility(SYSTEM_UI_FLAG_LOW_PROFILE) on one of the Views in your Activity.
Or, if you want to set it on the window:
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
To hide completely:
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
Android View documentation
Relevant Question

how to gradually turn transparent action bar into solid color as user scrolls down

In recent android L apps ( lets say google i/o 2014 app) with material theme we have seen that if there is image view at top (followed by any kind of list), then to begin with the actionbar is transparent, then as the user scrolls down the actionbar gradually becomes solid color.
2 questions:
1. does this phenomenon have some name, if yes what is it?
2. how do i code to achieve this in an app for android L or is it default
take a look here : https://github.com/ManuelPeinado/FadingActionBar
second question : based on my researching until now, we have to implement it by code. it's called Fading action bar. You should install Libraries for developers (Android application) that have a lot of libraries demo.

Categories

Resources