Forum > Android
[solved]Icon, splashscreen, left button
(1/1)
huberte:
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
felipemdc:
--- Quote from: huberte on May 02, 2012, 01:31:25 am ---Where should I put the android Icon ? Which format ?
--- End quote ---
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 ?
--- End quote ---
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) ?
--- End quote ---
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:
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
--- End quote ---
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.
felipemdc:
--- Quote from: huberte on May 03, 2012, 04:15:47 am ---Sorry it was the Menu button, thaht I can add an About icon in there (is it possible ?)
--- End 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.
--- Quote ---How do I add this function and how do I add a button there ?
--- End quote ---
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.
--- End quote ---
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.
--- End quote ---
Make an about form and use TImage and TLabel
huberte:
--- 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.
--- End quote ---
Works ! No image needed after all...
I used
--- Quote ---LCLIntf.MessageBox(0, 'Text', 'Caption', 10000)
--- End quote ---
(thanks to Paul) To have a TextBox without button
--- Quote ---Could you show a series of screenshots showing the problem?
--- End quote ---
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 !
Navigation
[0] Message Index