Android app doesn't show colors properly? - android

I tried some Material Design stuff based on the Google's design principles and I wanted to add some "Material colors". I chose the colors from Google's material color palette but my device showed the colors MUCH brighter than on the site. After that I picked up some colors from materialpalette.com but I had the same problem. I tested this with an Android 4.2 device.

Different colors rendering is due to phone hardware. Deal with it.

Related

How to achieve Google's Android 12 app widgets backgrounds?

Android 12 came with the new app widget feature "device theming" using the system's default theme #android:style/Theme.DeviceDefault.DayNight.
Seeing a screenshot like the one below in the documentation I was expecting to see more of the theme colours to be picked up in my own widget:
Compared to both the screenshot above and Google's app widgets like the ones for the weather and Gmail I can hardly measure any colours being picked up.
I also tried out Material Design 3's way of doing it via Theme.Material3.DynamicColors.DayNight with the same result. The screenshot below shows the Material design example app widget vs Google's weather widget - running on an Android 12 Pixel 5 device.
What is that Google's app widgets do differently to pick up so much more colour from the device theme?
I got word about the system_accent1_* colours and the blog post https://medium.com/#xch3dx/using-material-you-in-your-app-15ec982eecb4 .
Using <item name="android:backgroundTint">#android:color/system_accent1_50</item> I finally got the same background colour as Google has for their widgets.

Force Android App to have Jellybean Theme?

I am making an Android app and was messing around with styles. Instead of using the Material Light/Dark or other themes that I could find, is it possible to render the phone in Jellybean? I would like the look and feel of Jellybean while keeping the functionality of Lollipop. Does anyone know how to do this?
-- Ben

Android notifications: have colors in small icon

Since Lollipop, notification small icons are "masks" (only the alpha channel is used).
I can verify this in the project I am working on: previously we had a colorful small icon, and it worked well on 4.4- devices but appeared as a white square on 5.0+ devices. (We updated the icon to fix this).
But now I see apps that manage to have colorful icons on 5.0+ devices!
How do they do it?
I realize I shouldn't even try to do that since the guidelines say the icon should be a white shape, but I am curious and would like to know how it is done.
I suspect this is related to the targetSdk, but didn't find any resources about it.

How to create consistent Material Design UIs if elevation attribute is not available on pre lollipop devices

Many of the Material Design UIs if not all are dependent on drop shadows. But sadly the elevation attribute is only present on Lollipop devices. So how to create a single consistent UI for your application if something as simple as drop shadows is not available on pre lollipop build versions?
There are of course some workarounds such as creating two versions of each layout, using nine patch drawables, using CardView, etc. But they all have certain problems:
They require creating two versions of every layout, if you wan't to use the lollipop APIs as well for supported devices.
Hard to implement for custom views with different shapes.
Require separate drawables for every view, cluttering up the drawables folder.
The shadows are considered a part of the view itself, so side by side placed views with the same elevation require use of negative margins.
So what is the solution to creating Material Design UIs that work on both Lollipop as well as pre Lollipop devices?
It might not be the ideal solution, but for me using compatibility libraries for all Android versions works pretty well. I own a Galaxy S with Android Gingerbread, so it's really old and certainly doesn't support shadows and ripples. So I wrote a library backporting all things I needed. Rendering realtime shadows for arbitrary shapes is possible since Cupcake (or Froyo - I'm not sure). Ripples are very easy to implement. So it's like this:
One version of each layout
Supports any shape
No additional drawables
Shadows are drawn by layouts, not by shadow casters.
One of the problems is that there's no that new rendering thread, so for example the ripple animation lags when an Activity changes.
If you'd like to know more about my approach, check out my blog and github.
https://androidreclib.wordpress.com/ https://github.com/ZieIony/Carbon
Make use of android support libraries
http://developer.android.com/tools/support-library/features.html#v4-appcompat

Android Panel Style (Card UI) in Jelly Bean are they usable?

aI have been looking at the stock apps on my Google nexus running Jelly Bean, and there are some nice panel styles I would like to use in my own App I was wondering if they are part of the stock UI elements that are available to use?
Here's a screenshot of the panel I'd like to use:
This screenshot is taken from the Google Maps apps but can be seen in other applications, it has a thin grey border and the bottom border is slightly thicker. Some panels have rounded corners, some I've seen have square corners.
No, this is not a standard widget.
You can however choose a library which provides these (or equivalent) widgets:
Cardslib
Cards-UI
Also, you could try to see if some of the 9 patches (*.9.png) which are in the folder (on Windows):
C:\Program Files\Eclipse\adt-bundle-windows-x64\sdk\platforms\android-16\data\res\drawable-mdpi
May help you in your design.
The part in bold is to be replaced by your installation path.
I indicated API level 16, but you can choose among all the ones you have installed
And, of course, you're not limited to look into the mdpi folder. That's just the DEFAULTone.
If anyone finds this question, right now you can use CardView to make cards like the ones shown in the picture.

Categories

Resources