Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 06/30/21 in all areas

  1. Alexander Sviridenkov

    Need suggestion on developing a custom component

    @wuwuxin Yes, code is quite simple in Delphi: uses htfontawesome, htdefscriptadapter. HTML: <style> body {background: white} table {background: #eeeeff; border-collapse: collapse} td {padding: 5px} .value {border: solid #ddd 1px; background: white; resize: horizontal} input {border: solid transparent 1px} .left {width: 10px; padding-top: 5px} .hidden {display: none} </style> <script type="passcript"> procedure Expand(Section); begin $('#'+Section).toggleClass('hidden'); this.toggleClass('fa-minus'); this.toggleClass('fa-plus'); end; </script> <table width="500"> <tr> <td class="left" ><i onclick="expand('1')" class="fas fa-minus"></i></td> <td class="title" colspan="2">ID Settings</td> </tr> <tr id="1"> <td class="left"></td> <td class="value" width="200">Name</td> <td class="value"><input type="text" value="Bill Smith"/></td> </tr> <tr id="1"> <td class="left"></td> <td class="value">Address</td> <td class="value"><input type="text" value=""/></td> </tr> <tr id="1"> <td class="left"></td> <td class="value">Birthday</td> <td class="value"><input type="date" value="01.01.1998"/></td> </tr> <tr> <td class="left" ><i onclick="expand('2')" class="fas fa-minus"></i></td> <td class="title" colspan="2">Marketing Settings</td> </tr> <tr id="2"> <td class="left"></td> <td class="value">Email</td> <td class="value"><input type="text" value="bill@gmail.com"/></td> </tr> <tr id="2"> <td class="left"></td> <td class="value">FrequentBuyer</td> <td class="value"><input type="checkbox"/></td> </tr> </table>
  2. Cristian Peța

    need code to receive low memory warning

    Set an event handler: if TPlatformServices.Current.SupportsPlatformService(IFMXApplicationEventService, IInterface(AppEventService)) then AppeventService.SetApplicationEventHandler(My_ApplicationEventHandler); And in that event you will receive the warning: function TFormMain.My_ApplicationEventHandler(AAppEvent: TApplicationEvent; AContext: TObject): Boolean; begin case AAppEvent of TApplicationEvent.LowMemory: ; end; end;
  3. There is no need to uncheck those. Actually, those are still needed for supporting older Androids (unless you set minimum API to 26) Procedure would be - fill all icons you can through Project > Options > Application > Icons, then only add additional icons that cannot be set through Delphi. There is open issue requesting support for adaptive icons https://quality.embarcadero.com/browse/RSP-21335 and I attached zip with default icons resources created by Android Studio new project template. This makes it easier to see which icons need to be added manually and how they should look like.
  4. Adaptive Icon First of all, don’t uncheck the icons in deployment and don’t change the manifest. 1) Add your icons in .png format in Project Options normally. This is necessary to keep the compatibility with android 7.1 and oldest. 2) You need to create 3 files "ic_launcher.xml", "ic_launcher_background.xml" and "ic_launcher_foreground.xml" 3) ic_launcher.xml example: <?xml version="1.0" encoding="utf-8"?> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <background android:drawable="@drawable/ic_launcher_background" /> <foreground android:drawable="@drawable/ic_launcher_foreground" /> </adaptive-icon> Add it in deployment with remote path "res\drawable-anydpi-v26" 4) ic_background.xml example: <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="108dp" android:height="108dp" android:viewportWidth="108.0" android:viewportHeight="108.0"> <path android:name="square" android:fillColor="#ff3657f4" android:pathData="M0,0 L108,0 L108,108 L0,108 z" /> </vector> Note that I fixed a solid color (#ff3657f4), but you can put gradients in this xml or an image in place the background (not recomended). Add it in deployment with remote path "res\drawable" 5) ic_foreground.xml example: <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="108dp" android:height="108dp" android:viewportWidth="108.0" android:viewportHeight="108.0"> <path android:name="square" android:fillColor="#ffffffff" android:pathData="M 53.91,32.73 C 54.35,32.75 54.49,33.06 54.75,33.39 54.75,33.39 56.18,35.17 56.18,35.17 56.18,35.17 62.30,42.80 62.30,42.80 62.30,42.80 65.32,46.57 65.32,46.57 67.71,49.56 69.15,51.35 69.99,55.19 70.19,56.06 70.35,56.97 70.35,57.86 70.35,60.63 70.34,61.92 69.39,64.60 67.61,69.60 63.19,73.48 58.06,74.76 56.05,75.26 54.85,75.23 52.81,75.20 51.89,75.19 50.64,74.92 49.74,74.70 44.14,73.29 39.76,68.84 38.20,63.31 37.95,62.41 37.66,60.97 37.65,60.04 37.62,57.15 37.69,55.37 38.79,52.61 39.86,49.91 41.15,48.49 42.92,46.27 42.92,46.27 48.17,39.73 48.17,39.73 48.17,39.73 51.98,34.98 51.98,34.98 52.41,34.44 53.40,33.04 53.91,32.73 Z M 46.57,58.86 C 46.57,58.86 43.70,58.86 43.70,58.86 43.70,58.86 43.70,59.45 43.70,59.45 43.70,63.37 46.54,66.93 50.04,68.42 50.88,68.79 51.80,69.02 52.71,69.13 53.27,69.20 53.36,69.10 54.00,69.26 54.00,69.26 54.00,66.29 54.00,66.29 52.87,66.29 51.97,66.13 50.93,65.66 48.53,64.57 46.57,61.94 46.57,59.25 46.57,59.25 46.57,58.86 46.57,58.86 Z" /> </vector> You can change the white color (#ffffffff) and the pathData. Note: this pathData is the same path data inside the .svg. If you have your icon in .svg, just open it in notepad and copy the "d" field inside the "path" to the pathData of xml (only if the svg has size 108x108). Add it in deployment with remote path "res\drawable" Result (the low quality is due to the gif format) Extra You can do the same with the splash screen (vector splash screen). The vector splash screen works in all android versions supported by Delphi.
  5. David Heffernan

    Physically reduce jpeg image size??

    Do you want to resize the image or increase the compression? And which framework, vcl or fmx? And if you want to resize, what resampling do you want to use?
  6. Lars Fosdal

    Delphi compatibility with Windows 11?

    FYI - Found out that Get-WmiObject doesn't work with PS 7.x. This works, but you need to run in an elevated pwsh instance. foreach($instance in Get-CIMInstance -Namespace Root\CIMV2\Security\MicrosoftTpm -Class Win32_Tpm) { $instance | Select-Object -Property * | Format-List } and for me it returns IsActivated_InitialValue : True IsEnabled_InitialValue : True IsOwned_InitialValue : True ManufacturerId : 1398033696 ManufacturerIdTxt : STM ManufacturerVersion : 73.4.17568.4452 ManufacturerVersionFull20 : 73.4.17568.4452 ManufacturerVersionInfo : PhysicalPresenceVersionInfo : 1.3 SpecVersion : 2.0, 0, 1.16 PSComputerName : CimClass : Root/CIMV2/Security/MicrosoftTpm:Win32_Tpm CimInstanceProperties : {IsActivated_InitialValue, IsEnabled_InitialValue, IsOwned_InitialValue, ManufacturerId…} CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties
  7. jeanmilost

    SVG Magic released

    Hi developers, Have you ever encountered problems because your interface changes with high DPI but your images remains on the same size? Have you ever wanted to add incredible animations to your interface, but have been frustrated by the limited possibilities of the proposed image formats? So there is a library for you. SVG Magic brings the support of the Scalable Vector Graphics (SVG) image format to the C++ and Delphi VCL. Please visit: https://svgmagic.io/
×