Import design from Sketch and Figma

Having an excellent UX is critical in today's applications. So, WorkWithPlus provides a wide set of default design systems that can be used to generate applications with amazing UX. These designs can be selected and customized from our Design System Wizard

However, sometimes you need to create your own design system according to your business requirements. WorkWithPlus has 100% flexibility, so you will be able to create the exact design that you need, or you can import a design created with a designer tool (e.g. Sketch design toolkit or Figma design toolkit).

WorkWithPlus for Native Mobile 15 provides the possibility of integrating with a GeneXus's powerful feature: the Import Design option. In this way, you will be able to use GeneXus feature to import your designs from Sketch or Figma and create the layouts, and WorkWithPlus will automatically generate the WorkWithPlus instance for those layouts.

This new functionality enables the WorkWithPlus community to use the Import Design option from GeneXus, and also take advantage of using WorkWithPlus hierarchical declaration and real-time preview to customize and maintain your layouts. Learn more about WorkWithPlus for Native Mobile IDE here.

Let's explain this feature by following a step-by-step example.

Step 1 - Import your design

Firstly, we need to import your Sketch or Figma design. So, from the GeneXus toolbar, go to: Tools > Application Integration > Design Import and follow the steps explained here. For this example, we'll use a sample design system that is published by GeneXus here.

Once the importing process is finished, in your KB you will have all the panels and resources automatically created by GeneXus:

The GeneXus KB Explorer tree for the TestDSOConvert knowledge base is expanded under Root Module, showing Stencils folder with Bars, CartLine, FeaturedFoodtrucks, FoodtruckItem, PillSmall, ProductItem, PromoCard, and PromoCard2, plus Foodtrucks, FoodtrucksMenu, View01Home through View05Order objects, Files, Images, References, Customization, and Documentation nodes.

If you open one of the generated panels, you'll see that GeneXus has generated the layout based on the imported design. This is a huge advantage as you now have your screens ready to run, but you'll have to use the GeneXus´s abstract layout if you want to customize it. In this layout, it's difficult to imagine how the design will look like at runtime:

The GeneXus Layout editor for panel View04Product shows a WorkWithPlus grid-based product detail layout: image cells at top, then rows for &Product_Title, &PillSmall_Label, &Product_Description, a quantity stepper with &Product_Quantity, a price cell with &Product_Price, and an 'Add to cart' button at the bottom.

In the following steps, we'll use WorkWithPlus feature to automatically create the WorkWithPlus instances, so we can use WorkWithPlus IDE.

Step 2 - Initialize WorkWithPlus for Native Mobile

To use WorkWithPlus for Native Mobile we must initialize it first. So, from the WorkWithPlus menu, go to WorkWithPlus> for Native Mobile > Design System Wizard. As we want to use our current design (not one of the defaults design systems provided by WorkWithPlus), we'll select the "Skip Design" option. 

The 'Create a New Application' wizard shows a template gallery with options including E-Commerce, Simple E-Commerce, Business, Clean Dark, Banking, and Fitness. The 'Simple E-Commerce' template is selected, with Application title 'TestDSOConvert', Connectivity set to Online, Security set to None, and a live mobile preview of a 'Cala Tote' product screen. A red arrow points to the 'Skip Design' button at the bottom.

By selecting this option, WorkWithPlus for Native Mobile will be initialized, but no design system nor template will be imported.

Step 3 - Create your WorkWithPlus instances

Once WorkWithPlus is initialized, we're ready to create the instances from our current panels. So, for each panel, you should open it, go to the Pattern tab, and you will see the "Create from the current Panel layout" option:

The GeneXus object editor for panel View04Product shows the Patterns tab, with a red arrow pointing to the 'Patterns' menu item and another pointing to the 'Create from the current Panel layout...' link under the WorkWithPlus pattern section, next to a 'Select template...' link and an empty preview pane set to Android Tablet 7 inch.

By selecting this option, WorkWithPlus will automatically create the WorkWithPlus instance as follows:

The GeneXus Patterns tab for panel View04Product shows the WorkWithPlus pattern before it has been applied: only 'Create from the current Panel layout...' and 'Select template...' links are available, and the iPhone 5.5 inch preview pane on the right is empty.

As you can visualize, the WorkWithPlus instance was created, and now you can work with this panel by using the hierarchical declaration and real-time preview.

Step 4 - Customize your instance

If you need to modify your instance, you can easily do it from the hierarchical declaration and preview, and taking advantage of the wide set of ready-to-use features that WorkWithPlus provides. Let's see two examples:

Example 1 - Add a confirmation message

We can easily add a confirmation message to the "Add to cart" action just by using the "Confirm" property as follows:

The GeneXus Patterns editor tree for View04Product highlights the 'User Action (Button_Add2)' node under Wrap_Button_Add, with a red arrow pointing across to its Properties panel showing Button Class 'Button_Add_Margin_T0_L19...', Caption 'Add to cart', and Confirmation properties Confirm=True and Message='Are you sure?'. The mobile preview shows the product detail screen with an 'Add to cart' button.

At runtime, the following confirmation message will be triggered:

A mobile app preview of a 'Cherry cream with berries' product detail screen shows an 'Are you sure?' confirmation dialog with CANCEL and OK buttons, triggered by tapping the 'Add to cart' button, illustrating the Confirm=True behavior configured on the Add to cart action.

In this example, we added extra behaviour to our layout just by turning on a WorkWithPlus property.

Example 2 - Modify your layout

You can easily modify your layout from the hierarchical declaration and see the results automatically in the real-time preview. 

For example, we can add another button next to the "Add to cart" action, as follows:

The GeneXus IDE Patterns tab shows the panel tree for View04Product with the 'User Action (Button_Add2)' node selected under Wrap_Button_Add, and the Properties pane on the right listing Button, Confirmation, and Location in father container settings, matching the Add to cart action's confirm dialog.

Final comments:

As you learned though this article, WorkWithPlus for Native Mobile 15 includes a powerful way to integrate with a design system created in Sketch or Figma.

This new functionality can also be applied to convert any panel to WorkWithPlus (even if that panel was not created by using the Import Design option). In this way, you can easily adopt WorkWithPlus in existing KBs where your panels already exists.