

Stewag
Members-
Content Count
18 -
Joined
-
Last visited
Community Reputation
2 NeutralTechnical Information
-
Delphi-Version
Delphi 12 Athens
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Android 15 and edge-to-edge enforcement
Stewag replied to alejandro.sawers's topic in Cross-platform
...okay, so no solution to the edge-to-edge problem, same as: <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item> was for Android 15. I'd like to reduce display size only if the smartphone is an edge-to-edge and not depending of its Android version in general. We will probably need to wait for D13 and hope that it brings a fix. -
Android 15 and edge-to-edge enforcement
Stewag replied to alejandro.sawers's topic in Cross-platform
Sorry David, I was a little quick with stating that it works. Compile runs smoothly, but now I get extra space also on my Android 15, which has no edge-to-edge display, wasting space. It seems as if CheckBuildAndTarget(35) simply checks the Android version and not if display and Navigationbar collide? -
Android 15 and edge-to-edge enforcement
Stewag replied to alejandro.sawers's topic in Cross-platform
Stupid me! I copied the OnResize Code from your initial post in 2024! Now it works. Brilliant as always - thank you David!!! Best regards Steffen -
Android 15 and edge-to-edge enforcement
Stewag replied to alejandro.sawers's topic in Cross-platform
Thanks a lot David, unfortunately it doesn't work for me yet. I get an "TAndroidHelpersEx undeclared" error. When I than add DW.Android.Helpers to uses, the circle starts again, asking for DW.Androidapi.JNI.App.pas, then 'DW.GlobalDefines.inc' and so on. I probably need to install Kastri? But If I do, will there be much more code added to my project then the few lines in your post? -
Android 15 and edge-to-edge enforcement
Stewag replied to alejandro.sawers's topic in Cross-platform
Hi Alejandro, thanks but I have no idea what you mean. I haven't installed Kastri, I just copied DW.UIHelper and DW.Android.Helpers.pas to uses and to my library directory. Due to internal dependencies, I had to copy also DW.UIHelper.Android and DW.Androidapi.JNI.DWUtility and more. I decided this is getting too big, so I stopped. Burning it down to 30 lines would be nice... -
Android 15 and edge-to-edge enforcement
Stewag replied to alejandro.sawers's topic in Cross-platform
Has anybody burned down the required Kastri files to the absolute minimum? I don't want to bloat my code just because of a few lines of it. -
Android 15 and edge-to-edge enforcement
Stewag replied to alejandro.sawers's topic in Cross-platform
Has anybody already installed Android SDK 36 and run into the same topic again? I did when a user with a Galaxy S25 Ultra reported cut off title and base in a beta. Is there a new fix in the meantime? Steffen -
Set font size automatically depending on display size
Stewag replied to stewag64's topic in Cross-platform
replace Screen.Height with Form.Height -
Set font size automatically depending on display size
Stewag replied to stewag64's topic in Cross-platform
4.5 and 5.9" -
Set font size automatically depending on display size
Stewag replied to stewag64's topic in Cross-platform
I use the function only for the longest strings and then choose the same fontsize for other components. For some I apply font.size +n or -n. -
Set font size automatically depending on display size
Stewag replied to stewag64's topic in Cross-platform
"Maxwidth" will take of course a variable, such as button1.width, not a number. -
Thank you Wak, but this is somewhat complicated and still not as effective as the procedure, that Patrick suggested. I implemented it now as follows: - remove stylebooks from all forms - add new Datamodules, one for each OS (DatamoduleAndroid, DatamoduleiOS, DatamoduleWindows) - put a stylebook with an OS-specific style on each of the datamodules - set UseStyleManager property on all stylebooks to true, to ensure that the style is valid for all forms - add this code to .FormCreate of each form: {$IFDEF MSWINDOWS} if not assigned(DataModuleWindows) then DataModuleWindows := TDataModuleWindows.Create(self); Stylebook := DataModuleWindows.StyleBook1 {$ENDIF} {$IFDEF ANDROID} if not assigned(DataModuleAndroid) then DataModuleAndroid := TDataModuleAndroid.Create(self); Stylebook := DataModuleAndroid.StyleBook1 {$ENDIF} {$IFDEF IOS} if not assigned(DataModuleiOS) then DataModuleiOS := TDataModuleIOS.Create(self); Stylebook := DataModuleiOS.StyleBook1 {$ENDIF} - and this to uses: {$IFDEF IOS} DMIOS, {$ENDIF} {$IFDEF ANDROID} DMAndroid, {$ENDIF} {$IFDEF MSWINDOWS} DMWINDOWS, {$ENDIF} This totally prevents bloating of packages with foreign styles and reduced my package size more than 15% 🙂
-
Hi Patrick, this sounds workable, I will try it. Thank you! Still I am puzzled as I don't think that many programmers are aware of this "style-addup". At least I never read about it. Even in Emba's "screens" code samples in GetIt, various styles are just added to the main form (screenshot). This seems to be a poorly documented topic?
-
I develop a smartphone app for Android and iOS. In that, I use a stylebook and added Android, iOS and Windows styles to the master form (Windows only for development). Recently I found out, that the styles for other OS are also included in Android .apk and .aab packages! Here are the sizes of my Android packages. I deleted one style after the other, and the package got considerably smaller each time : .apk (Android development): Android, iOS and Windows styles: 15.2 MB Android and OS styles: 14.2 MB only Android style: 13.2 MB .aab (Android store): Android, iOS and Windows styles: 25.0 MB Android and OS styles: 14.2 MB: 23.1 MB only Android style: 21.3 MB I haven't tested yet if iOS .ipa is handled the same way. I would have expected, that styles of other OS would simply be ignored. Now I learned, that I can reduce the size of the store package by 15% simply by deleting other styles prior to compilation😯 This seems to be a major bug, isn't it?
-
Oh, I was not aware, that it is yours I am even more thankful then! Have you tested the behaviour with a mobile app for general usage?