Einzelnen Beitrag anzeigen

greenmile

Registriert seit: 17. Apr 2003
1.107 Beiträge
 
Delphi 10.3 Rio
 
#29

AW: Fragen zu FMX unter Android

  Alt 20. Aug 2014, 09:51
Frage selbst beantwortet, funktioniert in fast allen Fällen.

Code:

uses
  ...
  FMX.Platform.Android, Androidapi.JNI.GraphicsContentViewText, FMX.Helpers.Android,
  ...

function IsTabletNormal: Boolean; // z.B. Handy
begin
  Result := (MainActivity.getResources.getConfiguration.screenLayout and TJConfiguration.JavaClass.SCREENLAYOUT_SIZE_MASK)
    >= TJConfiguration.JavaClass.SCREENLAYOUT_SIZE_NORMAL;
end;

function IsTabletLarge: Boolean; // z.B. 7" Nexus
begin
  Result := (MainActivity.getResources.getConfiguration.screenLayout and TJConfiguration.JavaClass.SCREENLAYOUT_SIZE_MASK)
    >= TJConfiguration.JavaClass.SCREENLAYOUT_SIZE_LARGE;
end;

function IsTabletXLarge: Boolean; // z.B. 10" Nexus
begin
  Result := (MainActivity.getResources.getConfiguration.screenLayout and TJConfiguration.JavaClass.SCREENLAYOUT_SIZE_MASK)
    >= TJConfiguration.JavaClass.SCREENLAYOUT_SIZE_XLARGE;
end;

Geändert von greenmile (20. Aug 2014 um 09:53 Uhr)
  Mit Zitat antworten Zitat