-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathuMain.pas
94 lines (74 loc) · 2.29 KB
/
uMain.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
unit uMain;
{
author: ZuBy
https://github.com/rzaripov1990
...
Âêëþ÷èòü ôàéë (FMX.Helpers.Android) â ïðîåêò è èñïîëüçóéòå òåìó òåêóùåé âåðñèè android
...
Include the file (FMX.Helpers.Android) in the project and use the theme of the current version of android
...
2017
}
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Controls.Presentation,
FMX.StdCtrls, FMX.ListBox, FMX.DateTimeCtrls;
type
TFormMain = class(TForm)
Button1: TButton;
ComboBox1: TComboBox;
TimeEdit1: TTimeEdit;
DateEdit1: TDateEdit;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormMain: TFormMain;
implementation
{$R *.fmx}
uses
Androidapi.JNI.App,
FMX.Helpers.Android;
procedure TFormMain.Button1Click(Sender: TObject);
begin
ShowMessage('Test Message');
end;
procedure TFormMain.ComboBox1Change(Sender: TObject);
begin
// óñòàíàâëèâàåì âûáðàííóþ òåìó
// åñëè íå óêàçûâàòü áóäåò èñïîëüçîâàòüñÿ ñòàíäàðòíàÿ òåìà äëÿ òåêóùåé âåðñèè àíäðîèäà
TJAndroidThemeHelper.ThemeID := ComboBox1.ListItems[ComboBox1.ItemIndex].Tag;
end;
procedure TFormMain.FormCreate(Sender: TObject);
var
aItem: TListBoxItem;
begin
aItem := TListBoxItem.Create(ComboBox1);
aItem.Tag := TJAlertDialog.JavaClass.THEME_TRADITIONAL;
aItem.Text := 'THEME_TRADITIONAL';
ComboBox1.AddObject(aItem);
aItem := TListBoxItem.Create(ComboBox1);
aItem.Tag := TJAlertDialog.JavaClass.THEME_DEVICE_DEFAULT_DARK;
aItem.Text := 'THEME_DEVICE_DEFAULT_DARK';
ComboBox1.AddObject(aItem);
aItem := TListBoxItem.Create(ComboBox1);
aItem.Tag := TJAlertDialog.JavaClass.THEME_DEVICE_DEFAULT_LIGHT;
aItem.Text := 'THEME_DEVICE_DEFAULT_LIGHT';
ComboBox1.AddObject(aItem);
aItem := TListBoxItem.Create(ComboBox1);
aItem.Tag := TJAlertDialog.JavaClass.THEME_HOLO_DARK;
aItem.Text := 'THEME_HOLO_DARK';
ComboBox1.AddObject(aItem);
aItem := TListBoxItem.Create(ComboBox1);
aItem.Tag := TJAlertDialog.JavaClass.THEME_HOLO_LIGHT;
aItem.Text := 'THEME_HOLO_LIGHT';
ComboBox1.AddObject(aItem);
// ComboBox1.ItemIndex := 0;
end;
end.