How to design this UI?

Inman

Well-Known Member
Licensed User
Longtime User
Of late many apps are starting to use the UI of the official Google Plus app. Here is a screenshot.

http://i.imgur.com/U4iSyRO.png

This UI can be attained using Panels and ScrollView. But what I am trying to understand is how Google provides a slight 3D embossed look for each Google Plus post in the UI. It looks like some sort of shadow around the edges of each item and it looks great.

Any idea how this is done?

krwkZxx.png
 

Inman

Well-Known Member
Licensed User
Longtime User
I checked your sample app for Expandable Panels class but it has a plain background and not the shadow effect. But your BackupSMS.apk file has exactly the UI I am looking for.

Could you please explain how you did it? I couldn't find search_background or card_background files in your res sub folders.

EDIT:

I read the rest of your thread and found search_bg_shadow.9.png. Fortunately a Google search also provided card_background.9.png. Let me see if I can put together the UI.
 
Last edited:
Upvote 0

Informatix

Expert
Licensed User
Longtime User
Of late many apps are starting to use the UI of the official Google Plus app. Here is a screenshot.

http://i.imgur.com/U4iSyRO.png

This UI can be attained using Panels and ScrollView. But what I am trying to understand is how Google provides a slight 3D embossed look for each Google Plus post in the UI. It looks like some sort of shadow around the edges of each item and it looks great.

Any idea how this is done?

krwkZxx.png

Basically, you have two techniques:
- using a 9-patch drawable with the shadow already drawn (that's what the Google devs use most of the time);
- drawing a shadow (a blurry rectangle with a transparency gradient) behind your main panel.
 
Upvote 0

Inman

Well-Known Member
Licensed User
Longtime User
Thanks guys. I made it with technique 1 - using their own 9 patch drawable.

Another question. Is the gray color border around the panel that displays the number of user comments (which is 100 in the above screenshot) achieved using a 9 patch as well? I couldn't find any direct options to add a border. There is a function posted in the forums that adds a border by drawing a rectangle around the view using canvas but it won't work for rounded rectangles.
 
Upvote 0

Inman

Well-Known Member
Licensed User
Longtime User
I think I found the relevant PNG file from Google Plus apk.

http://i.imgur.com/B1KG7RJ.png

The filename is btn_white.9.png, so I assumed it is a 9 patch PNG file. But when I tried it with the SetNinePatchView function, I get the following error during compilation.

B4X:
ERROR: 9-patch image res\drawable\btn_white.9.png malformed.
       Frame pixels must be either solid or transparent (not intermediate alphas).
       Found at pixel #4 along top edge.
ERROR: Failure processing PNG image res\drawable\btn_white.9.png

If it is not a valid 9 patch file, I wonder how Google is using it.
 
Upvote 0

Inman

Well-Known Member
Licensed User
Longtime User
HYI0MVk.png


Looks like Google has made some slight changes to their Card UI. The above screenshot is from the latest version of the YouTube app. The shadow at the bottom is not as thick as it used to be and the cards now have some sort of a border around.

Previously it was done using a 9-patch image for the background, but I am not sure if that is the case now. I decompiled the YouTube apk file and checked its resource folder. There are many 9-patch files but I couldn't find the right one. The drawables folder also contains some XML files, which might be how Google draws it.

I have uploaded the contents of the res folder of YouTube apk. Could you please take a look and see if you can find out how Google does this UI?

https://mega.co.nz/#!DhBDUKCI!zKvKJzSNPOrykiypHGvOGwE56-IrsaMLHnvZ_vJFY1w
 
Upvote 0
Top