Recent

Author Topic: [solved]Icon, splashscreen, left button  (Read 5619 times)

huberte

  • Jr. Member
  • **
  • Posts: 78
[solved]Icon, splashscreen, left button
« on: May 02, 2012, 01:31:25 am »
Hi,

Here the thing I did not see in the wiki

Where should I put the android Icon ? Which format ?

How can I add a splaschscreen ? Like a normal SPlaschscreen in common program ?

Which control is controling the left button on android phone (often the about button) ?

thks
« Last Edit: May 04, 2012, 05:14:44 am by huberte »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Icon, splashscreen, left button
« Reply #1 on: May 02, 2012, 07:53:55 am »
Where should I put the android Icon ? Which format ?

In android/res/drawable-* there are 3 folders there, for 3 icon sizes: ldpi, mdpi and hdpi
The format is PNG

Quote
How can I add a splaschscreen ? Like a normal SPlaschscreen in common program ?

Just make your main form (the first from the auto-creation list) a splash form. There put a image+text or something like that and a timer with 5 interval for example. In the timer OnTimer event execute whatever long code you want and in the end load the next form and disable the timer.

Quote
Which control is controling the left button on android phone (often the about button) ?

Button presses are sent to the events OnKeyDown, OnKeyUp and OnKeyPress.

About the about button I am not sure if it is already in the list of supported items, you can just press it and see if anything shows in the logcat. Also could you take a photo of a device and circle it in read and post the image here? For I don't remember any "about" button in the devices I know. The buttons I remember are:
*Menu button
*Search button
*Home button
*Back button
*Camera button
*Volume
*Trackball click

huberte

  • Jr. Member
  • **
  • Posts: 78
Re: Icon, splashscreen, left button
« Reply #2 on: May 03, 2012, 04:15:47 am »
thks

Sorry it was the Menu button, thaht I can add an About icon in there (is it possible ?)

Quote
I/lclapp  (30262): onPrepareOptionsMenu
I/lclapp  (30262): LCLOnMenuAction called kind=0 itemIndex=0
D/InputReader( 5106): Input event: value=1
I/InputDispatcher( 5106): Delivering key to current input target: action: 0, channel '40c97fc0 com.pascal.lclbtn/com.pascal.lclbtn.LCLActivity (server)'
D/InputReader( 5106): Input event: value=0
I/InputDispatcher( 5106): Delivering key to current input target: action: 1, channel '40c97fc0 com.pascal.lclbtn/com.pascal.lclbtn.LCLActivity (server)'
I/lclapp  (30262): onPrepareOptionsMenu

How do I add this function and how do I add a button there ?

Many thks

EDIt :moreover, I think the form stretch itself to the screen of the user ? Am I right ? Just sometimes is the font not so readable.... It seems that the font is proportionnal to the button. Could you explain how the font work in a button ? thks.

PS : I need to add the lazarus icon, text about lazarus and credit for people who help me in this.
« Last Edit: May 03, 2012, 06:03:19 am by huberte »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Icon, splashscreen, left button
« Reply #3 on: May 03, 2012, 07:52:42 am »
Sorry it was the Menu button, thaht I can add an About icon in there (is it possible ?)

The menu button will show the TMainMenu object attached to the current form.

Images in menus are not currently supported, but I'll add it to my ToDo.

Quote
How do I add this function and how do I add a button there ?

Put a TMainMenu in your form.

Quote
EDIt :moreover, I think the form stretch itself to the screen of the user ? Am I right ? Just sometimes is the font not so readable.... It seems that the font is proportionnal to the button. Could you explain how the font work in a button ? thks.

Yes, the form and everything else is adjusted to fit the screen, but it is not a stretch. All elements are redrawn. However I do have seen sometimes some elements which were not updated, I need to check again if everything is being invalidated in a form rotation as it should, but I think that I already fixed this problem. Could you show a series of screenshots showing the problem?

Quote
PS : I need to add the lazarus icon, text about lazarus and credit for people who help me in this.

Make an about form and use TImage and TLabel

huberte

  • Jr. Member
  • **
  • Posts: 78
Re: Icon, splashscreen, left button
« Reply #4 on: May 04, 2012, 05:14:30 am »
Quote
The menu button will show the TMainMenu object attached to the current form.
Images in menus are not currently supported, but I'll add it to my ToDo.

Works ! No image needed after all...

I used

Quote
LCLIntf.MessageBox(0, 'Text', 'Caption', 10000)

(thanks to Paul) To have a TextBox without button

Quote
Could you show a series of screenshots showing the problem?
I though I could modify the button or the font directly in IDE (I know you told me to modify customdrawn_android.pas). So the result in ANdroid was awful. I revert all button to default and everything is fine now.

thks !
« Last Edit: May 04, 2012, 05:18:02 am by huberte »

 

TinyPortal © 2005-2018