提交 b2423fcf 编写于 作者: 若苗瞬's avatar 若苗瞬 😶

rename main form, separate default path of windows and android. set proper style.

上级 bceda0a0
......@@ -3,7 +3,7 @@ program pro_Lottery;
uses
System.StartUpCopy,
FMX.Forms,
Unit1 in 'Unit1.pas' {Form5},
unMain in 'unMain.pas' {fmMain},
ufmSelect in 'ufmSelect.pas' {fmSelect};
{$R *.res}
......@@ -11,6 +11,6 @@ uses
begin
Application.Initialize;
Application.FormFactor.Orientations := [TFormOrientation.Landscape, TFormOrientation.InvertedLandscape];
Application.CreateForm(TForm5, Form5);
Application.CreateForm(TfmMain, fmMain);
Application.Run;
end.
......@@ -119,7 +119,7 @@
<Android_LauncherIcon192>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png</Android_LauncherIcon192>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Android64)'!=''">
<VerInfo_Keys>package=com.ac.$(MSBuildProjectName);label=奥诚新春大抽奖;versionCode=12;versionName=1.0.12;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=No TitleBar;hardwareAccelerated=true;apiKey=</VerInfo_Keys>
<VerInfo_Keys>package=com.ac.$(MSBuildProjectName);label=奥诚新春大抽奖;versionCode=13;versionName=1.0.2022;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=No TitleBar;hardwareAccelerated=true;apiKey=</VerInfo_Keys>
<BT_BuildType>Debug</BT_BuildType>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<Android_LauncherIcon36>res\ICON\cia_36.png</Android_LauncherIcon36>
......@@ -137,7 +137,7 @@
<Android_NotificationIcon72>res\ICON\cia_72.png</Android_NotificationIcon72>
<Android_NotificationIcon96>res\ICON\cia_96.png</Android_NotificationIcon96>
<EnabledSysJars>annotation-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.0.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.0.1.dex.jar;core-runtime-2.0.1.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.dex.jar;fmx.dex.jar;fragment-1.0.0.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.0.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.0.0.dex.jar;lifecycle-runtime-2.0.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.0.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.0.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.1.0.dex.jar</EnabledSysJars>
<VerInfo_Build>12</VerInfo_Build>
<VerInfo_Build>13</VerInfo_Build>
<Android_SplashTileMode>disabled</Android_SplashTileMode>
<Android_SplashGravity>center</Android_SplashGravity>
<Android_NotificationAccentColor>#000000</Android_NotificationAccentColor>
......@@ -185,7 +185,7 @@
<DCC_RemoteDebug>true</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Android64)'!=''">
<VerInfo_Build>12</VerInfo_Build>
<VerInfo_Build>13</VerInfo_Build>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<DCC_RemoteDebug>false</DCC_RemoteDebug>
......@@ -206,9 +206,9 @@
<DCC_DebugInformation>0</DCC_DebugInformation>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Android64)'!=''">
<VerInfo_Build>12</VerInfo_Build>
<VerInfo_Build>13</VerInfo_Build>
<EL_SecureFileSharing>true</EL_SecureFileSharing>
<VerInfo_Keys>package=com.ac.$(MSBuildProjectName);label=奥诚新春大抽奖;versionCode=12;versionName=1.0.12;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey=</VerInfo_Keys>
<VerInfo_Keys>package=com.ac.$(MSBuildProjectName);label=奥诚新春大抽奖;versionCode=13;versionName=1.0.2022;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=No TitleBar;hardwareAccelerated=true;apiKey=</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
......@@ -217,9 +217,9 @@
<VerInfo_Locale>1033</VerInfo_Locale>
<Icon_MainIcon>res\ICON\cia.ico</Icon_MainIcon>
<VerInfo_Release>8</VerInfo_Release>
<VerInfo_Build>40</VerInfo_Build>
<VerInfo_Build>46</VerInfo_Build>
<VerInfo_AutoIncVersion>true</VerInfo_AutoIncVersion>
<VerInfo_Keys>CompanyName=奥诚科技;FileDescription=奥诚科技新春年会大抽奖;FileVersion=1.0.8.40;InternalName=ac_lattery.exe;LegalCopyright=AC;LegalTrademarks=AC;OriginalFilename=pro_lattery.exe;ProgramID=com.ac.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0;Comments=</VerInfo_Keys>
<VerInfo_Keys>CompanyName=奥诚科技;FileDescription=奥诚科技新春年会大抽奖;FileVersion=1.0.8.46;InternalName=ac_lattery.exe;LegalCopyright=AC;LegalTrademarks=AC;OriginalFilename=pro_lattery.exe;ProgramID=com.ac.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0;Comments=</VerInfo_Keys>
<Icns_MainIcns>res\ICON\cia_48.icns</Icns_MainIcns>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
......@@ -230,8 +230,8 @@
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="Unit1.pas">
<Form>Form5</Form>
<DCCReference Include="unMain.pas">
<Form>fmMain</Form>
<FormType>fmx</FormType>
</DCCReference>
<DCCReference Include="ufmSelect.pas">
......@@ -471,6 +471,12 @@
</Platform>
</DeployFile>
<DeployFile LocalName="res\ICON\Logo_960.png" Configuration="Debug" Class="Android_SplashImage960"/>
<DeployFile LocalName="Android64\provider_paths.xml" Configuration="Release" Class="AndroidFileProvider">
<Platform Name="Android64">
<RemoteName>provider_paths.xml</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="$(BDS)\lib\android\debug\armeabi-v7a\libnative-activity.so" Configuration="Release" Class="AndroidLibnativeArmeabiv7aFile">
<Platform Name="Android64">
<RemoteName>libpro_Lottery.so</RemoteName>
......
......@@ -2,15 +2,17 @@
<BorlandProject>
<Transactions>
<Transaction>1899-12-30 00:00:00.000.274,=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.748,=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.964,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.pas=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.168,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.pas=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.173,=C:\Users\Shion\Documents\Embarcadero\Studio\Projects\Lottery\Unit1.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.060,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect.pas=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect_Sample.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.168,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.fmx=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect.fmx</Transaction>
<Transaction>1899-12-30 00:00:00.000.111,C:\Users\Shion\Documents\Embarcadero\Studio\Projects\Lottery\pro_Lottery.dproj=C:\Users\Shion\Documents\Embarcadero\Studio\Projects\Project1.dproj</Transaction>
<Transaction>1899-12-30 00:00:00.000.439,=C:\Users\Shion\Documents\Embarcadero\Studio\Projects\Unit1.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.060,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect_Sample.pas=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.900,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect_Sample.pas=</Transaction>
<Transaction>1899-12-30 00:00:00.000.111,C:\Users\Shion\Documents\Embarcadero\Studio\Projects\Project1.dproj=C:\Users\Shion\Documents\Embarcadero\Studio\Projects\Lottery\pro_Lottery.dproj</Transaction>
<Transaction>1899-12-30 00:00:00.000.173,=C:\Users\Shion\Documents\Embarcadero\Studio\Projects\Lottery\Unit1.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.748,=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.168,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect.fmx=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.fmx</Transaction>
<Transaction>1899-12-30 00:00:00.000.964,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect.pas=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.168,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect.pas=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.pas</Transaction>
<Transaction>2021-11-23 09:57:48.052,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\unMain.fmx=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit1.fmx</Transaction>
<Transaction>2021-11-23 09:57:48.052,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\unMain.pas=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit1.pas</Transaction>
</Transactions>
<ActiveMobileDevice>
<NoProfile Android64=""/>
......
无法预览此类型文件
......@@ -6,10 +6,10 @@ object fmSelect: TfmSelect
ClientHeight = 419
ClientWidth = 711
Position = MainFormCenter
StyleBook = fmMain.StyleBook1
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [Desktop]
FullScreen = True
OnCreate = FormCreate
DesignerMasterStyle = 0
object lstItems: TListBox
......
......@@ -35,7 +35,6 @@ type
var
fmSelect: TfmSelect;
fmSelect2: TfmSelect;
implementation
......@@ -43,7 +42,8 @@ implementation
uses
System.IOUtils,
StrUtils;
StrUtils,
unMain;
procedure TfmSelect.btnRefreshClick(Sender: TObject);
begin
......
此差异已折叠。
unit Unit1;
unit unMain;
interface
......@@ -15,7 +15,7 @@ uses
FMX.Filter.Effects, FMX.Filter;
type
TForm5 = class(TForm)
TfmMain = class(TForm)
StyleBook1: TStyleBook;
Panel1: TPanel;
opd_names: TOpenDialog;
......@@ -36,7 +36,6 @@ type
GlowEffect1: TGlowEffect;
FloatAnimation3: TFloatAnimation;
ShadowEffect1: TShadowEffect;
Edit1: TEdit;
spb_loadmusic: TSpeedButton;
MediaPlayer1: TMediaPlayer;
opd_music: TOpenDialog;
......@@ -62,7 +61,7 @@ type
end;
var
Form5: TForm5;
fmMain: TfmMain;
implementation
......@@ -77,7 +76,7 @@ uses
ufmSelect;
{$R *.fmx}
constructor TForm5.Create(AOwner: TComponent);
constructor TfmMain.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF ANDROID}
......@@ -86,13 +85,13 @@ begin
{$ENDIF}
end;
destructor TForm5.Destroy;
destructor TfmMain.Destroy;
begin
inherited Destroy;
end;
// Optional rationale display routine to display permission requirement rationale to the user
procedure TForm5.DisplayRationale(Sender: TObject; const APermissions: TClassicStringDynArray; const APostRationaleProc: TProc);
procedure TfmMain.DisplayRationale(Sender: TObject; const APermissions: TClassicStringDynArray; const APostRationaleProc: TProc);
var
I: Integer;
RationaleMsg: string;
......@@ -114,7 +113,7 @@ begin
end)
end;
procedure TForm5.LoadList(ASelectedItem: String);
procedure TfmMain.LoadList(ASelectedItem: String);
var
i:Integer;
aFStream:TFileStream;
......@@ -145,7 +144,7 @@ begin
end;
end;
procedure TForm5.FormCreate(Sender: TObject);
procedure TfmMain.FormCreate(Sender: TObject);
begin
mem_names.Lines.Clear;
......@@ -156,10 +155,9 @@ begin
ShadowEffect1.Enabled:=false;
FloatAnimation3.Enabled:=false;
musicName:='/storage/emulated/0/ACMusic.mp3';
Edit1.Text :='/storage/emulated/0/ACList.jpg';
end;
procedure TForm5.spb_goClick(Sender: TObject);
procedure TfmMain.spb_goClick(Sender: TObject);
begin
if spb_go.Text='开始摇奖' then
begin
......@@ -226,17 +224,17 @@ begin
end;
end;
procedure TForm5.spb_loadmusicClick(Sender: TObject);
procedure TfmMain.spb_loadmusicClick(Sender: TObject);
begin
PermissionsService.RequestPermissions([FPermissionReadExternalStorage, FPermissionWriteExternalStorage], LoadSongPermissionRequestResult, DisplayRationale);
end;
procedure TForm5.spb_loadnameClick(Sender: TObject);
procedure TfmMain.spb_loadnameClick(Sender: TObject);
begin
PermissionsService.RequestPermissions([FPermissionReadExternalStorage, FPermissionWriteExternalStorage], LoadListPermissionRequestResult, DisplayRationale);
end;
procedure TForm5.Timer1Timer(Sender: TObject);
procedure TfmMain.Timer1Timer(Sender: TObject);
begin
Randomize;
tmpi:=Random(lsb_names.Items.Count);
......@@ -245,7 +243,7 @@ begin
Application.ProcessMessages;
end;
procedure TForm5.LoadListPermissionRequestResult(Sender: TObject; const APermissions: TClassicStringDynArray; const AGrantResults: TClassicPermissionStatusDynArray);
procedure TfmMain.LoadListPermissionRequestResult(Sender: TObject; const APermissions: TClassicStringDynArray; const AGrantResults: TClassicPermissionStatusDynArray);
begin
// 2 permissions involved: READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE
if (Length(AGrantResults) = 2) and
......@@ -258,18 +256,22 @@ begin
// end;
// LoadList(Edit1.Text);
if fmSelect = nil then
begin
Application.CreateForm(TfmSelect, fmSelect);
fmSelect.Callback := MyListFile;
end;
begin
Application.CreateForm(TfmSelect, fmSelect);
end;
fmSelect.Callback := MyListFile;
fmSelect.Show;
fmSelect.CD(ExtractFilePath(Edit1.Text));
{$IFDEF ANDROID}
fmSelect.CD(ExtractFilePath(musicName));
{$ELSE}
fmSelect.CD('.\');
{$ENDIF}
end
else
TDialogService.ShowMessage('Cannot load list, the required permissions are not granted');
end;
procedure TForm5.LoadSongPermissionRequestResult(Sender: TObject; const APermissions: TClassicStringDynArray; const AGrantResults: TClassicPermissionStatusDynArray);
procedure TfmMain.LoadSongPermissionRequestResult(Sender: TObject; const APermissions: TClassicStringDynArray; const AGrantResults: TClassicPermissionStatusDynArray);
begin
// 2 permissions involved: READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE
if (Length(AGrantResults) = 2) and
......@@ -286,29 +288,33 @@ begin
// MediaPlayer1.FileName:=musicName;
// MediaPlayer1.Play;
// end;
if fmSelect2 = nil then
if fmSelect = nil then
begin
Application.CreateForm(TfmSelect, fmSelect2);
fmSelect2.Callback := MySongFile;
Application.CreateForm(TfmSelect, fmSelect);
end;
fmSelect2.Show;
fmSelect2.CD(ExtractFilePath(musicName));
fmSelect.Callback := MySongFile;
fmSelect.Show;
{$IFDEF ANDROID}
fmSelect.CD(ExtractFilePath(musicName));
{$ELSE}
fmSelect.CD('.\');
{$ENDIF}
end
else
TDialogService.ShowMessage('Cannot load song, the required permissions are not granted');
end;
procedure TForm5.MyListFile(ASelectedItem: String);
procedure TfmMain.MyListFile(ASelectedItem: String);
begin
LoadList(ASelectedItem);
//
end;
procedure TForm5.MySongFile(ASelectedItem: String);
procedure TfmMain.MySongFile(ASelectedItem: String);
begin
MediaPlayer1.Stop;
MediaPlayer1.FileName:=ASelectedItem;
MediaPlayer1.Play;
//MediaPlayer1.Play;
end;
end.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册