LayoutSheet (Update)

Description

LayoutSheet allows you to generate a modal window or dialog, practically with any component (Layout, Textbox, Image, Label).

For more customisation and control use Layout!

Update v4

  • I rewrote the code based on the first version.
  • Fixed the cancel problem
  • Removed unused blocks, left some properties from old version
  • Fixed radius mismatching problem
  • Updated gravity data
  • Updated deprecated java syntaxes

Blocks

Instructions
RegisterBlock

Component Component For more customisation use layout
Height (Percent) Number Height in percentage based on the screen size
Width Number -1 or -2 (Full Width or Auto)
DimAmount float Background attenuation (Recommended 0.5/0.8/1)
Gravity Number Defines the position of the dialogue on the screen there are defined blocks (Top, Middle, Bottom)
RadiusTopLeft Number
RadiusTopRight Number
RadiusBottomLeft Number
RadiusTopRight Number

GravityBlocks

DialogBottom Number Lower screen position its numerical value is 80
DialogMiddle Number Centre screen position its value in number is 16
DialogTop Number Up screen position its value in number is 35

ActionBlocks

Show Display dialogue
Dismiss To hide the dialogue or disable
UnRegister Unregister the component as a dialog

returnBlocks

IsShowing Return true or false if dialogue is currently showing
IsCancelable Returns true or false if the dialogue is allowed to be cancelled

block2

Dismissed Fired when dialog dismissed
Shown Fired when dialog is shown

Visual Interface
VisualProperties

BackgroundColor Color Allows to assign colour to dialog
Cancelable Boolean Activate if you want the dialog to be cancelable by clicking outside the dialog.

Usage Example Block

ExampleBlock1


Usage Example


DialogTop and DimAmount with value 0.8


DialogMiddle and DimAmount with value 0.8


DialogBottom and DimAmount with value 0.5


DialogBottom and DimAmount with value 1

Download

AIA: app_Test.aia (65.4 KB)
AIX: LayoutSheet v4.aix (12.3 KB)
Link: LayoutSheet v4

***Extension compiled in Niotron IDE

I made some fixes and small modifications to an old Claws extension and code, this is a continuation of v2 of VSATISH13, just recovering some properties of the first version.

1 Like
  1. What the difference with the original one?
  2. better to use a new package name.

What this for? gravity? and what is each number means?
ans what is dimAmount?

1- Not a lot, fix some conflict, modify some properties, remove some unnecessary code, ease of use for the user. (I think I detailed it in the description)

2- Mmm I did not use it thinking that those who still use it will not be affected, but if you think it is necessary I will gladly make the modification.

3- Amm what gravity is the position of the dialog above, in the middle, below based on this of android
https://developer.android.com/reference/android/view/Gravity

4- And the DisAmount is like the opacity of the background how dark or how light you want it to be when the dialog comes out, if you allow the background content to be seen or you darken it completely focusing only the dialog.

Please edit your first post and add all information there
Later before listing the thread, we will remove all the discussion

Taifun

Check it out!

some small issues:

  1. if the modal dialog is showing and refresh the companion screen, the dialog will not disappear.
  2. the radius is not same unit with the AI2, that means users need to multiply the screen density.
  3. If we set a big radius, the effect like this:
    image
  4. the gravity, you can try change to use dropdown helper blocks.

1- Amm first of all I don't understand your point because even the AI2 notifier has that problem, but it is cancelable even if you overwrite it several times or after refreshing (which the extension I made also does, check and see).
2- I didn't understand, but I will search the internet to understand better and make a change if necessary.
3- I noticed that, I thought the user could solve it and there was no need to make a margin or padding to the content, but I'll see what I can do to make it a better visual experience.
4-I will see what I can do

for 1 and 3, not big issue, I just mention it to see if you can modify it.
for 2, you just need to
radius * form.deviceDensity()

Yeah, okay, as I wrote I'll see what I can do to fix those mini bugs. :v:
Oh :thinking: :thinking:, once I'm in office I'll try radius!

LayoutSheet v4.aix (12.3 KB)
Check if the radius is OK.