Skip to content

Commit

Permalink
Added ActionButton
Browse files Browse the repository at this point in the history
  • Loading branch information
rafael-figueiredo-alves committed Nov 9, 2024
1 parent 5e6d9a4 commit a36a77c
Show file tree
Hide file tree
Showing 24 changed files with 206 additions and 11 deletions.
Binary file added assets/UI/common/Add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/UI/toolbar/dark/Accept.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/UI/toolbar/dark/BackBtn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/UI/toolbar/dark/Clear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/UI/toolbar/dark/Delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/UI/toolbar/dark/Help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/UI/toolbar/dark/Update.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/UI/toolbar/light/Accept.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/UI/toolbar/light/BackBtn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/UI/toolbar/light/Clear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/UI/toolbar/light/Delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/UI/toolbar/light/Help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/UI/toolbar/light/Update.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 19 additions & 1 deletion eTasks.deployproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<PropertyGroup>
<DeviceId Condition="'$(Platform)'=='Android'"/>
<DeviceId Condition="'$(Platform)'=='Android'">42003880e44364f9</DeviceId>
<DeviceId Condition="'$(Platform)'=='Android64'"/>
</PropertyGroup>
<ItemGroup Condition="'$(Platform)'=='Win32'">
Expand Down Expand Up @@ -306,6 +306,24 @@
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="Win32\Debug\translate.json" Condition="'$(Config)'=='Debug'">
<RemoteDir>eTasks\assets\internal\</RemoteDir>
<RemoteName>translate.json</RemoteName>
<DeployClass>File</DeployClass>
<Operation>0</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="Win32\Debug\translate.json" Condition="'$(Config)'=='Release'">
<RemoteDir>eTasks\</RemoteDir>
<RemoteName>translate.json</RemoteName>
<DeployClass>File</DeployClass>
<Operation>0</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<DeployFile Include="$(ProjectName).Artwork\Android\FM_VectorizedSplashV31.xml" Condition="'$(Config)'=='Debug'">
<RemoteDir>eTasks\res\drawable-anydpi-v31\</RemoteDir>
<RemoteName>splash_vector.xml</RemoteName>
Expand Down
13 changes: 11 additions & 2 deletions eTasks.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ uses
FMX.Skia,
eTranslate4Pascal,
System.SysUtils,
System.IOUtils,
eTasks.View.Main in 'src\View\eTasks.View.Main.pas' {fMain},
eTasks.Components.AppBar in 'src\Components\Bars\eTasks.Components.AppBar.pas' {AppBar},
eTasks.Components.TitleBar in 'src\Components\Bars\eTasks.Components.TitleBar.pas' {TitleBar},
Expand All @@ -40,16 +41,24 @@ uses
eTasks.Components.Offcanvas in 'src\Components\Offcanvas\eTasks.Components.Offcanvas.pas' {Offcanvas},
eTasks.Shared.Consts in 'src\Shared\eTasks.Shared.Consts.pas' {$R *.res},
eTasks.Components.AvatarMenu in 'src\Components\Offcanvas\eTasks.Components.AvatarMenu.pas' {AvatarMenu},
eTasks.Components.Menu in 'src\Components\Offcanvas\eTasks.Components.Menu.pas' {OffcanvasMenu};
eTasks.Components.Menu in 'src\Components\Offcanvas\eTasks.Components.Menu.pas' {OffcanvasMenu},
eTasks.Components.ActionButton in 'src\Components\Buttons\eTasks.Components.ActionButton.pas' {ActionButton};

{$R *.res}

begin
ReportMemoryLeaksOnShutdown := True;
GlobalUseSkia := True;
Application.Initialize;
{$IFDEF ANDROID}
eTranslate(TPath.Combine(TPath.GetDocumentsPath, 'translate.json'), 'pt-BR');
{$ENDIF}

{$IFDEF MSWINDOWS}
eTranslate(ExtractFilePath(ParamStr(0)) + 'translate.json', 'pt-BR');
{$ENDIF}

Application.CreateForm(TfMain, fMain);
Application.CreateForm(TOffcanvasMenu, OffcanvasMenu);
Application.CreateForm(TActionButton, ActionButton);
Application.Run;
end.
22 changes: 21 additions & 1 deletion eTasks.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@
<PropertyGroup Condition="'$(Cfg_1_Android)'!=''">
<VerInfo_Build>1</VerInfo_Build>
<IncludeAndroid_NotificationAccentColor>false</IncludeAndroid_NotificationAccentColor>
<IncludeAndroid_AdaptiveIcon>true</IncludeAndroid_AdaptiveIcon>
<IncludeAndroid_VectorizedSplash>true</IncludeAndroid_VectorizedSplash>
<Android_BackgroundColor>#FFFFFF</Android_BackgroundColor>
<Android_DarkBackgroundColor>#FFFFFF</Android_DarkBackgroundColor>
<IncludeAndroid_VectorizedNotificationIcon>true</IncludeAndroid_VectorizedNotificationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<DCC_RemoteDebug>false</DCC_RemoteDebug>
Expand Down Expand Up @@ -265,10 +270,12 @@
</DCCReference>
<DCCReference Include="src\Components\Offcanvas\eTasks.Components.AvatarMenu.pas">
<Form>AvatarMenu</Form>
<FormType>fmx</FormType>
</DCCReference>
<DCCReference Include="src\Components\Offcanvas\eTasks.Components.Menu.pas">
<Form>OffcanvasMenu</Form>
</DCCReference>
<DCCReference Include="src\Components\Buttons\eTasks.Components.ActionButton.pas">
<Form>ActionButton</Form>
<FormType>fmx</FormType>
</DCCReference>
<BuildConfiguration Include="Base">
Expand Down Expand Up @@ -922,6 +929,19 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Win32\Debug\translate.json" Configuration="Debug" Class="File">
<Platform Name="Android">
<RemoteDir>assets\internal\</RemoteDir>
<RemoteName>translate.json</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Win32\Debug\translate.json" Configuration="Release" Class="File">
<Platform Name="Android">
<RemoteName>translate.json</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="assets\Icones\Logo_Windows_UWP_150.png" Configuration="Debug" Class="UWP_DelphiLogo150">
<Platform Name="Win32">
<RemoteDir>Assets\</RemoteDir>
Expand Down
Binary file modified prototype/eTasks_v2_Final.sketch
Binary file not shown.
58 changes: 58 additions & 0 deletions src/Components/Buttons/eTasks.Components.ActionButton.fmx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
object ActionButton: TActionButton
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 104
ClientWidth = 152
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [Desktop]
DesignerMasterStyle = 0
object LayoutActionButton: TLayout
Anchors = [akRight, akBottom]
Position.X = 81.000000000000000000
Position.Y = 28.000000000000000000
Size.Width = 60.000000000000000000
Size.Height = 60.000000000000000000
Size.PlatformDefault = False
TabOrder = 0
object Button: TCircle
Align = Client
Fill.Color = xFF66BB6A
Size.Width = 60.000000000000000000
Size.Height = 60.000000000000000000
Size.PlatformDefault = False
Stroke.Kind = None
object ImgAdd: TImage
MultiResBitmap.Height = 39
MultiResBitmap.Width = 39
MultiResBitmap = <
item
Width = 39
Height = 39
PNG = {
89504E470D0A1A0A0000000D49484452000000270000002708060000008CA351
350000000473424954080808087C08648800000092494441545885EDD6C10983
401484E179C1BBA5241D182BB425D3414A89158C97204B0828C30B79C87C3759
197ED8CB027642913142F20660DA4623C68CDD1424EF6C64ED5EB2867EC1712A
C7A91CA7729CCA71AAD2715DFBF17E5DF4C2CEF56367107B9688787E3D2139F3
BFE6B6A7F4B5968E4B413F368B719CCA712AC7A91CA7729CAA745CB7FFCB212F
008FA42D3BB7151E67AFBC746D2C0E0000000049454E44AE426082}
FileName = 'C:\MeusProjetos\eTasks\assets\UI\common\Add.png'
end>
Align = Center
HitTest = False
Size.Width = 30.000000000000000000
Size.Height = 30.000000000000000000
Size.PlatformDefault = False
end
object Sombra: TShadowEffect
Distance = 4.000000000000000000
Direction = 90.000000000000000000
Softness = 0.300000011920929000
Opacity = 0.600000023841857900
ShadowColor = claBlack
end
end
end
end
69 changes: 69 additions & 0 deletions src/Components/Buttons/eTasks.Components.ActionButton.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
unit eTasks.Components.ActionButton;

interface

uses
System.SysUtils,
System.Types,
System.UITypes,
System.Classes,
System.Variants,
FMX.Types,
FMX.Controls,
FMX.Forms,
FMX.Graphics,
FMX.Dialogs,
FMX.Objects,
FMX.Layouts,
FMX.Effects,
eTasks.Components.Interfaces;

type
TActionButton = class(TForm, iActionButton)
LayoutActionButton: TLayout;
Button: TCircle;
ImgAdd: TImage;
Sombra: TShadowEffect;
private
{ Private declarations }
fOnClickClick : TEventoClick;
public
{ Public declarations }
function isDarkMode(const value: boolean): iActionButton;
function SetHint(const value: string): iActionButton;
function OnClick(const Event: TEventoClick): iActionButton;

class function New(const Form: TForm): iActionButton;
end;

var
ActionButton: TActionButton;

implementation

{$R *.fmx}

{ TActionButton }

function TActionButton.isDarkMode(const value: boolean): iActionButton;
begin

end;

class function TActionButton.New(const Form: TForm): iActionButton;
begin
Result := Self.Create(Form);
Form.AddObject(TActionButton(Result).LayoutActionButton);
end;

function TActionButton.OnClick(const Event: TEventoClick): iActionButton;
begin

end;

function TActionButton.SetHint(const value: string): iActionButton;
begin

end;

end.
2 changes: 1 addition & 1 deletion src/Components/Offcanvas/eTasks.Components.AvatarMenu.fmx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ object AvatarMenu: TAvatarMenu
Top = 0
Caption = 'Form1'
ClientHeight = 480
ClientWidth = 640
ClientWidth = 680
StyleBook = Styles
FormFactor.Width = 320
FormFactor.Height = 480
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Offcanvas/eTasks.Components.Menu.fmx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ object OffcanvasMenu: TOffcanvasMenu
Top = 0
Caption = 'Form1'
ClientHeight = 480
ClientWidth = 284
ClientWidth = 256
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [Desktop]
Expand Down
14 changes: 13 additions & 1 deletion src/Components/eTasks.Components.Builder.pas
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@ TComponentOffcanvas = class
class function AvatarMenu(const Form: TForm; isDarkMode: Boolean = false; Direction: TOffcanvasDirection = ocdRight) : iAvatarMenu;
end;

TComponentButtons = class
class function ActionButton(const Form: TForm) : iActionButton;
end;

implementation

uses
eTasks.Components.AppBar, eTasks.Components.TitleBar,
eTasks.Components.Offcanvas, eTasks.Components.AvatarMenu;
eTasks.Components.Offcanvas, eTasks.Components.AvatarMenu,
eTasks.Components.ActionButton;

{ TComponentBars }

Expand Down Expand Up @@ -60,4 +65,11 @@ class function TComponentOffcanvas.MainMenu(const Form: TForm; isDarkMode: Boole
Result := TOffcanvas.New(Form, ockMenu, Direction, isDarkMode);
end;

{ TComponentButtons }

class function TComponentButtons.ActionButton(const Form: TForm): iActionButton;
begin
Result := TActionButton.New(Form);
end;

end.
7 changes: 7 additions & 0 deletions src/Components/eTasks.Components.Interfaces.pas
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ interface
['{CD663DA8-C7F0-43E9-9382-3D1926C10042}']
end;

iActionButton = interface
['{58E61ADA-76CE-4E16-9356-9C8EF7E367B1}']
function isDarkMode(const value: boolean): iActionButton;
function SetHint(const value: string): iActionButton;
function OnClick(const Event: TEventoClick): iActionButton;
end;

implementation


Expand Down
10 changes: 6 additions & 4 deletions src/View/eTasks.View.Main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ TfMain = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
AppBar : iAppBar;
TitleBar : iTitleBar;
MainMenu : iOffcanvas;
AvatarMenu : iAvatarMenu;
AppBar : iAppBar;
TitleBar : iTitleBar;
MainMenu : iOffcanvas;
AvatarMenu : iAvatarMenu;
ActionButton : iActionButton;
fDarkMode : Boolean;
procedure SetTheme(sender : TObject);
procedure SetLanguage(sender : TObject);
Expand Down Expand Up @@ -54,6 +55,7 @@ procedure TfMain.FormCreate(Sender: TObject);
AppBar.SetButtonAppBarAction(ThemeBtn, SetTheme);
AppBar.SetButtonAppBarAction(MenuBtn, OpenMenu);
AppBar.SetButtonAppBarAction(AvatarBtn, OpenAvatarMenu);
ActionButton := TComponentButtons.ActionButton(fMain);
TranslateUI;
end;

Expand Down

0 comments on commit a36a77c

Please sign in to comment.