Android view elements appear black (only on OnePlus 6 with Android Pie) - android

I'm working on an MVVM Android application. When I run the app on an OnePlus 6 with Android Pie all views appear in a sort of "dark theme". All the CardViews, Spinners and Dialogs through the app have a black background out of nowhere.
I made a new app with a CardView and let it run on the OnePlus6. That app was normal with a white CardView background.
I also tried to build the app on lots of different phones but only on the OnePlus 6 this sudden "dark theme" appears.
The OnePlus 6 uses the light theme, so that can not be the problem.
Does anyone know where this comes from? What code can I upload to make things extra clear?

one plus 6 has his own theme engine so you have first to installs themes to the mobile using for example : "substratum" then it will be better.

The problem is with the develop options on the phone. I tried to turn that off and on and for a while it worked in the normal way.
I don't know why it turns to black but it has to do with the Developer Options.

Related

Why my app crash on some devices and change layout while in other devices even with diffrent sizes it work perfectly

Hi im new to android dev i started from 1 months ago
Well i created simple calculating application
I configured layout so it looks stable and in preview in some screen sizes it was as i expected
When i run the app it workks perfectly ln some devices i tried android 11 5 and 7
But in some other devices android 10,9,8,5 some buttons get bigger... and when i click a button to show an alerte dialog it crasheess
Well in other devices the alerte dialog show and the app works perfectly without any problem please help
well the problem is that you wrote your program for android 11 and that is why it is shown and performs differently in older versions of android if you wish to make it work the same on all devices then you should choose an older SDK version preferably one that is compatible with version 5; But if you do so you might not be able to use some of the new libraries or packages that you used for android 11.
Make sure the version you are applying on other devices is supported. If you are still experiencing crashing, please share the error code with us.

Theme or coloring issue in android

I'm stuck in a unknown issue of coloring. I develop an food delivery application. I set the design of application, for example i take Food Menu screen. Actual output of screen :
I run the app on almost 6 mobiles include samsung, q-mobile, huawei. It works perfect.
But when i run the app on another random samsung mobile it show me the layout like this:
I don't know why this dark gray appear in boxes bakcground. This is happening in only one mobile of samsung. I'm confused because i also check on samsung on other mobile with same android version and it works fine.
The same thing was happening to me on my OnePlus phone. The solution I use was that I added background color for all component that was not using correct color on my OP phone. So in the case of CardView's that you have below, I added app:cardBackgroundColor property to CardView XML component view and it started to show just fine. I didn't investigate any further to know what was the reason behind this, but as you said, it almost certainly got to do something with a different Theme on that Samsung.

How to solve massive rendering problems in Android development

I'm currently working with Xamarin for developing an android app. The structure of the app is really simple yet but a big problem appeared concerning the rendering of my main page. First, it's important to know that I'm supposed to develop for target API 23 so Android 6.0.
And every time I test my application on my Android 6.0 device via USB-debugging the design is totally messed up with my only (!) button duplicated many times and the textViews mixed up over the screen (As shown in the picture link below).
Even though I am new to Xamarin and Android (and C#) I have my settings (as I think) in perfect order. The minimum API level is 21, the target SDK version 23 (Android 6.0), my device runs version 6.0.1, the target compiling framework in properties is set to 6.0, the manifest is set up as I mentioned before and even my "Designer" window with the layouts .axml is set to v23.
I really don't know what to try next, because I want to start coding further. Would be nice if sb could help me out with that.
I have already tested the code of the app on a different API level (26 I think) and it worked perfectly fine with my Galaxy S9 in Debugger mode. Everything looked like it was designed in first place.
I also tried different AppThemes in Visual Studio but not one of the 7-8 I tried worked in any way different except for the colors.
The android app does only switch when clicking the button, texthttps://imgur.com/i0xChVniew 2 into the current date and time. I'm really sure, that my code is not the problem.
Picture: How it should look (In Xamarin)
Picture: How it looks on the phone

Why `onComputeColors` is being ignored on Android P beta (DP2)?

Background
I have a live wallpaper that uses the relatively new API (from Android 8.1 - API 26) to request the OS to use customized colors:
https://developer.android.com/reference/android/service/wallpaper/WallpaperService.Engine.html#notifyColorsChanged()
https://developer.android.com/reference/android/service/wallpaper/WallpaperService.Engine#onComputeColors()
The problem
On Android 8.1 and even on Android P DP1, all worked fine with these functions, as they did what normal wallpaper do with the colors, affecting the notification drawer if the color that was chosen is dark enough. Here's a comparison between choosing a non-dark color and choosing a dark color background:
Thing is, on Android P beta (DP2), even though this function get called, it doesn't do anything, ever.
To test it on your own, you can try the full project I've published here.
What I've found
I thought that maybe the API has changed, so I've tried to find which functions are available, but I couldn't see anything that's new.
I've tried to use various ways to return the customized colors:
a. WallpaperColors(Color.valueOf(0xff000000.toInt()), Color.valueOf(0xff000000.toInt()), Color.valueOf(0xff000000.toInt()))
b. WallpaperColors.fromDrawable(ColorDrawable(0xff000000.toInt()))
c. WallpaperColors.fromDrawable(BitmapDrawable(completelyBlackBitmap))
d. WallpaperColors.fromBitmap(completelyBlackBitmap)
Sadly none worked (fromBitmap is the one that works well on Android 8.1).
Seeing this, I've re-checked that my code is ok, and noticed that the built in live wallpaper works fine, and that selecting a solid black wallpaper (instead of live wallpaper) also affected the UI of the OS.
Seeing that it works with built in apps, I've reported to Google about this issue, only to find out that they don't understand what I'm talking about, and each time I've tried to tell them they've misunderstood it differently:
https://issuetracker.google.com/issues/79404938
https://issuetracker.google.com/issues/79665215
https://issuetracker.google.com/issues/80029770
I wanted to make sure it's not an issue with just my app, but with others too, so I've tested Muzei live wallpaper app, which is actually made by one of Google's own developers. The issue indeed occurs there too, while working fine on Android 8.1.
I was just curious, and wanted to check if the issue could occur if I've moved Muzei to be a system app, but after doing so, I've seen the issue still exists.
The questions
How come it doesn't work anymore?
Is there a workaround/fix for this?
Why does it work fine for built in apps and for normal wallpapers, but not for third party apps? I don't think their code is any difference.
OK, Google confirmed it's a bug, which will be fixed on later version:
The development team has fixed the issue that you have reported and it
will be available in a future build.
And, it works fine now on DP4 (beta 3) of Android P.

Drop-down list in hybrid app has black text on grey backround on certain android devices

We have a hybrid app built with phonegap and jquery mobile.
In one screen we have standard HTML5 select (drop-down list)
On one android device, Samsung S6 Galaxy with Android System WebView M42, the drop-down is shown with black text on grey background. See screenshot.
On all other Android devices it is shown with white text on grey background.
Are there any way of fixing this from the hybrid app?
This is not ideal fix, but i fixed it by switching to older android theme. In your manifest file
android:theme="#style/android:Theme.Holo.Light"
Have you reduced this to the simplest of examples? Just use the default app template, add in jquery mobile and create a list and show it to make sure it really is a problem specific to that device / environment.
The reason I ask is that I ran into similar issues until I ran my app's html and css through the WC3 validators. Turns out there were a couple misplaced tags here and there that caused issues only in some environments.

Categories

Resources