Recent

Author Topic: Android design  (Read 10775 times)

huberte

  • Jr. Member
  • **
  • Posts: 78
Android design
« on: April 28, 2012, 10:07:45 pm »
started a new thread....

To look like ICS button : http://developer.android.com/design/downloads/index.html I did try with image, but it's not so good

The best would be to create a new drawer for Android 4, my drawer is based in Android 2. Look at the file lazarus/lcl/customdrawn_android.pas and you need to write a similar file which implements Android 4 style instead of the current Android 2.

I will look at this complex file when I got time, seems complicated, no ?
Thing is, I end with a non android 2 design (gray button, grey bckground color, green button when pushed though) when I launch LCL Test on my android. How do we get this design running ?

Thks

EDIT :

Here you can see (despite the new customdrawnproc.pas and latest svn lazarus), that the background color (set to black) is not being shown. Moreover, it seems that the new LCL buil in Lazarus has some pb whith the screen. When you rotate your phone,  buttons are visible though

http://tof.canardpc.com/view/ac1bfff2-0d01-40e3-91ec-3b0913ee4107.jpg
« Last Edit: April 29, 2012, 10:54:06 pm by huberte »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Andoid design
« Reply #1 on: April 29, 2012, 11:28:09 am »
Thing is, I end with a non android 2 design (gray button, grey bckground color, green button when pushed though) when I launch LCL Test on my android. How do we get this design running ?

Android has many multiple looks, it changes not only with the Android version but also some manufacturers change the look =/

Having said that my current Android look does immitate well the Android look for many components.

Yes, you are right about the background, it should probably be changed to black, but I haven't done so yet because then it causes problems with the text drawing, because black text does not show in a black background and also small errors which we have in the font rendering become much more apparent.

But the native standard (non-manufacturer modified) Android 2 button is grey when up and green when pushed down, please see: http://www.androidpeople.com/wp-content/uploads/2010/01/buttondrawable.png See also HTC Wildfire for an example.

Quote
Here you can see (despite the new customdrawnproc.pas and latest svn lazarus), that the background color (set to black) is not being shown. Moreover, it seems that the new LCL buil in Lazarus has some pb whith the screen. When you rotate your phone,  buttons are visible though

http://tof.canardpc.com/view/ac1bfff2-0d01-40e3-91ec-3b0913ee4107.jpg

Are you 100% sure that you are using Lazarus SVN? If you open in Lazarus the menu Tools->Options what is your Lazarus directory? Is it the Lazarus SVN directory?

Also does it work for you in the desktop? You can use the lazarus/examples/androidtest/nonandroidtest.lpi to check how it works with LCL-CustomDrawn in the Desktop.

About the layout, it seams wrong, kind of like if the measurement of the screensize is wrong.

Which device are you using?

huberte

  • Jr. Member
  • **
  • Posts: 78
Re: Andoid design
« Reply #2 on: April 29, 2012, 04:38:41 pm »
Quote
Yes, you are right about the background, it should probably be changed to black,

You wrote :

I did set a color for a form (black) but it's still gray in android.

I fixed it in this commit: http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&root=lazarus&revision=37010

that's why I tried :) Bbut ok, no pb I'll wait....

Quote
Are you 100% sure that you are using Lazarus SVN? If you open in Lazarus the menu Tools->Options what is your Lazarus directory? Is it the Lazarus SVN directory?

Yep, c:\Lazarus, which is the folder I'm using with tortoise. Moreover, it worked two days ago before I get an update from svn.

Quote
Also does it work for you in the desktop? You can use the lazarus/examples/androidtest/nonandroidtest.lpi to check how it works with LCL-CustomDrawn in the Desktop.

Not anymore, could you give it a try, it worked 2 days ago. Compiling is fine, with running I end with :

http://tof.canardpc.com/view/d3e40602-032c-4ee6-9de8-27c6d4813791.jpg

and

http://tof.canardpc.com/view/7cd5665c-95f9-4a77-8dfd-e4ad12560019.jpg

About the layout, I think it's because of the previous error, it was fine 2 days ago.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Andoid design
« Reply #3 on: April 29, 2012, 04:56:49 pm »
Could you find the revision that broke it? In TortoiseSVN there is "update to revision" and there you can put a revision number which you can see here:

http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&root=lazarus&revision=37083

You can successively try revision. For example try 36000 and 37000. If it works in 37000 but not in 36000 then the error is somewhere in between .... so try 36500, and so on. You can find the error after some tries.

huberte

  • Jr. Member
  • **
  • Posts: 78
Re: Andoid design
« Reply #4 on: April 29, 2012, 08:55:39 pm »
This error is not android related, but windows related (strangely, only with the example androidlcl, whi i did not modify)

the screen is now fine when rolling back lazarus to a prior version (the LCLxxxx seems to be a pb)

So you can confirm, it's not possible to have a bckground color, button color or font color ?

thks
« Last Edit: April 29, 2012, 09:05:35 pm by huberte »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Andoid design
« Reply #5 on: April 30, 2012, 10:47:01 am »
I just checked here in my Android and the background color works fine.

Then I tested in Windows in both LCL-CustomDrawn-Windows and LCL-Win32 and both worked fine. Could you post a screenshot of your problem? Which interface are you using?

huberte

  • Jr. Member
  • **
  • Posts: 78
Re: Android design
« Reply #6 on: April 30, 2012, 05:17:29 pm »
I set up for form1 : clBLack then ClBackground

works fine under windows, still gray under android with LCL-CustomDrawn :

http://tof.canardpc.com/view/83aedd47-bb4a-48f5-ada3-57fcd2f9bdcb.jpg

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Android design
« Reply #7 on: April 30, 2012, 05:46:42 pm »
I just tested here and for me it works fine. clBlack is black clBackground is blue.

Use the latest SVN Lazarus.

huberte

  • Jr. Member
  • **
  • Posts: 78
Re: Android design
« Reply #8 on: May 01, 2012, 06:20:21 am »
So I did after 10 hours on irc (thks to Laksen by the way), to build the fpc and lazarus from source (not had the force to build the crosscompiler from the source).

I do have the latest lazarus from svn and the bckground is black !

SO now I can ask two more questions :)

In lazarus the path should go to the ndk, wiki said v 8, but what the difference with v14 ?

How difficult could it be to build an app with an ICS look ? Is there a way to build customdrawn_android.pas easy ?

thks again
« Last Edit: May 04, 2012, 12:38:04 pm by huberte »

 

TinyPortal © 2005-2018