Old / dark dialogs when using TStyleBook

This issue is strongly related to the following question: Why do all dialogs use the "old" Android 2.x Style?

I am using Delphi Berlin (10.1), where this problem has already been fixed:

enter image description here

But, as soon as the TStyleBook is dropped into the form and assigned to it (for example, by right-clicking on the component and then “edit your own style”), the dialog boxes (all of them) will again return to the dark style:

enter image description here

The automatically cropped style is still the "light" version ("AndroidL Light"). And yes, I checked this "GetNativeTheme ()" function in FMX.Helpers.Android.pas assigned Result, I even copied the file and added it to the project. Deleting a job from Form1.StyleBookdisplays dialogs with a native style again.

How can this be resolved while continuing to use TStyleBook?

+4
source share
1 answer

: GetNativeTheme() TStyleManager.FindStyleDescriptor() TStyleDescription, , "[LIGHTSTYLE]" "[DARKSTYLE]" . , IDE TStyleBook . IDE, TStyleDescription, / . , GetThemeFromDescriptor() 0, , -, / .

, TStyleBook, (*.style), TStyleDescription. IDE. .

,   ,

:

  object TStyleDescription
    StyleName = 'Description'
    Author = 'Embarcadero Technologies Inc.'
    AuthorURL = 'www.embarcadero.com'
    PlatformTarget = '[ANDROID][ANDROIDL][LIGHTSTYLE][DEFINEFONTSTYLES]'
    MobilePlatform = True
    Title = 'AndroidL Light'
    Version = '1.0'
  end
+4

Source: https://habr.com/ru/post/1690176/


All Articles