Skip to content

Commit

Permalink
Set Android MinSdkVersion to 19, Using Name and StoragePath to save l…
Browse files Browse the repository at this point in the history
…ast state in non-transient way (and with .readcom file extension)
  • Loading branch information
birbilis@zoomicon.com authored and birbilis@zoomicon.com committed Jun 5, 2022
1 parent fbbfe92 commit 9b6a330
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 26 deletions.
2 changes: 1 addition & 1 deletion App/AndroidManifest.template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:versionCode="%versionCode%"
android:versionName="%versionName%"
android:installLocation="%installLocation%">
<uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="%targetSdkVersion%" />
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="%targetSdkVersion%" />
<%uses-permission%>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<queries>
Expand Down
11 changes: 1 addition & 10 deletions App/READCOM_App.deployproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</ProjectExtensions>
<PropertyGroup>
<DeviceId Condition="'$(Platform)'=='Android'"/>
<DeviceId Condition="'$(Platform)'=='Android64'"/>
<DeviceId Condition="'$(Platform)'=='Android64'">HGAJGEJN</DeviceId>
<DeviceId Condition="'$(Platform)'=='iOSDevice64'"/>
</PropertyGroup>
<ItemGroup Condition="'$(Platform)'=='OSX64'">
Expand Down Expand Up @@ -661,15 +661,6 @@
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="Android\Release\libREADCOM_App.so" Condition="'$(Config)'=='Release'">
<RemoteDir>READCOM_App\library\lib\armeabi-v7a\</RemoteDir>
<RemoteName>libREADCOM_App.so</RemoteName>
<DeployClass>ProjectOutput_Android32</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="Android64\Debug\strings.xml" Condition="'$(Config)'=='Debug'">
<RemoteDir>READCOM_App\res\values\</RemoteDir>
<RemoteName>strings.xml</RemoteName>
Expand Down
6 changes: 0 additions & 6 deletions App/READCOM_App.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -859,12 +859,6 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Android\Release\libREADCOM_App.so" Configuration="Release" Class="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteName>libREADCOM_App.so</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Android\Release\READCOM_App.classes" Configuration="Release" Class="AndroidClasses">
<Platform Name="Android">
<Operation>64</Operation>
Expand Down
25 changes: 17 additions & 8 deletions App/Views/READCOM.Views.Main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ TMainForm = class(TForm, IStory)
implementation
uses
System.Contnrs, //for TClassList
System.IOUtils, //for TPath
System.Math, //for Max
System.Net.URLClient, //for TURLStream (Delphi 11.1+)
Zoomicon.Helpers.RTL.ClassListHelpers, //for TClassList.Create(TClassArray)
Expand Down Expand Up @@ -1121,9 +1122,12 @@ function TMainForm.LoadCommandLineParameter: Boolean;

function TMainForm.LoadSavedState: Boolean;
begin
Log('LoadSavedState');

With SaveState do
begin
//StoragePath := ... //TODO: default is transient, change to make permanent
Name := 'SavedState.readcom';
StoragePath := TPath.GetHomePath;
result := LoadFromStream(Stream, false); //don't ActivateHome, keep last Active one (needed in case the OS brought down the app and need to continue from where we were from saved state)
end;
end;
Expand Down Expand Up @@ -1157,13 +1161,17 @@ function TMainForm.LoadDefaultDocument: Boolean;

procedure TMainForm.SaveCurrentState;
begin
Log('SaveState');
//StoragePath := ... //TODO: default is transient, change to make permanent
SaveState.Stream.Clear;
Log('SaveCurrentState');

var TheRootStoryItemView := RootStoryItemView;
if Assigned(TheRootStoryItemView) then
with SaveState do
with SaveState do
begin
Name := 'SavedState.readcom';
StoragePath := TPath.GetHomePath;

Stream.Clear;

var TheRootStoryItemView := RootStoryItemView;
if Assigned(TheRootStoryItemView) then
try
TheRootStoryItemView.Save(Stream); //default file format is EXT_READCOM
except
Expand All @@ -1173,7 +1181,8 @@ procedure TMainForm.SaveCurrentState;
Log(E);
ShowException(E, @TMainForm.SaveCurrentState);
end;
end;
end;
end;
end;

procedure TMainForm.FormSaveState(Sender: TObject);
Expand Down
2 changes: 1 addition & 1 deletion Zoomicon.Media/Zoomicon.Media.FMX.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<FrameworkType>None</FrameworkType>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<Platform Condition="'$(Platform)'==''">OSX64</Platform>
<TargetedPlatforms>168979</TargetedPlatforms>
<AppType>Package</AppType>
<Platform>OSX64</Platform>
Expand Down

0 comments on commit 9b6a330

Please sign in to comment.