Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS:...

29
Yiwei Ma Gavin Rehkemper Web AppBuilder for ArcGIS: Developing for Mobile

Transcript of Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS:...

Page 1: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

Yiwei Ma

Gavin Rehkemper

Web AppBuilder for ArcGIS:

Developing for Mobile

Page 2: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.
Page 3: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

Basic Mobile Design

Principles

You can Implement in Your App

Page 4: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

Less is More

• Display only the essential content

• Remove any unnecessary UI elements if

possible

• Minimal UI design

Image credit: UXPERT LABS

Page 5: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

Finger-Friendly Target Sizes

• Make the targets big enough

- Greater than 40px (size of an adult’s index finger)

• Leave enough spacing between UI elements

Image credit: UX Planet

Page 6: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

Design Controls That Are Easy to Reach

• Position UI elements wisely based on their:

- Priorities

- Frequency of use

Image credit: UX Planet

Thumb comfort zones for one-handed use

Page 7: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

Utilize Gestures

• Include gestures for smoother interactions,

such as:

- Pinch, drag, swipe for map navigation (supported

by API)

- Swipe to navigate

Image credit: The Next Web

Page 8: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

How Web AppBuilder handles

Mobile

Page 9: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

Mobile Breakpoint

• The default breakpoint for mobile

is 600px (either in width or height)

• The number is stored in

window.jimuConfig.breakPoints

which can be reset heig

ht

width

< 600 pixels

desktop

mobile

Page 10: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

Mobile Specific Properties Provided by WAB

• A class name “jimu-ismobile” is add to the jimu-layout-

manager element in the dom tree

• A global property “appInfo.isRunInMobile” is turned to true

Page 11: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

Out-of-Box Solutions

• Each theme in WAB provides mobile optimizations in some

degree, such as:

- Displaying widgets at the bottom half of the screen

- The panel containing widgets can be maximized / minimized

- Re-positioned on-screen widgets for better finger reachability

- Mobile-first UI design (available in certain themes)

Mobile view of an app with LaunchPad

theme applied

Page 12: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

How to:

Create Mobile Layout

Page 13: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

“MobileLayout” Property in Layout Config File:

• Defines the app layout on a mobile device

• Works only for on-screen widgets and map

• Only includes the layout settings that are different from the

default (desktop) ones

- others will inherit the default settings

Page 14: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

What You Can Do and Cannot Do:

YES:

• Change size

• Change position

• Change the parent a widget’s position is

relative to (map or browser)

• Change stacking order (z index)

NO:

• Remove a widget

• Add a widget

• Hide a widget

Page 15: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

All on-screen widgets are absolute

positioned

Absolute position properties can be

defined in a layout config file

left

top

right

bottom

z-index

Page 16: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

“MobileLayout” in LaunchPad Theme:

Desktop Mobile

not available in mobile

Page 17: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

Create a new mobile layout for

Foldable theme

Mobile Layout

Demo

Page 18: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

How to:

Create Mobile Specific Styles

Page 19: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

“jimu-ismobile” Class

• “jimu-ismobile” is the extra class name added to

the root element of the app running in mobile

• Add it in front of the CSS rules to gain higher

specificity

• Recommendation: Use a CSS preprocessor

(SASS or LESS) to a better development

experience

.jimu-ismobile {

// your override styles

}

CSS preprocessor: wrap all CSS override

rules inside of “.jimu-ismobile”

Page 20: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

.jimu-ismobile .dijitSliderImageHandleH {width: 40px;height: 40px;background-image: none;background-color: #008dcc;border-radius: 50%;border: 4px solid #fff;top: -20px;box-shadow: 0 2px 9px rgba(0,0,0,0.5);

}

Desktop

Mobile

Page 21: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

Where to Put the CSS Override Styles?

1. common.css in the theme folder Effective to all styles in one theme

2. style.css in a style folder in a theme Effective to one style in one theme

3. style.css in a widget’s folder Effective only to that one widget regardless

which theme is selected

Page 22: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

Create custom CSS to restyle UI

elements

Mobile Specific

Styles

Page 23: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

Mobile Responsive Custom

Widgets

Page 24: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

Style and Markup

• (no) Tables

• Width attributes

• Image sizes

Page 25: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

Demo: Mobile Responsive

Layout in Custom Widgets

Page 26: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

Mobile handling in Web

Appbuilder Next Gen

A Sneak Peek

Page 27: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

A Major Change in Theme

• Theme ONLY refers to the styling part (CSS)

• Layout will be no longer part of a theme. It will follow a similar pattern but with more

capabilities, such as:

- Flexbox layout model

- Multiple pages support

- Does not have to be map-centric

- More configurable properties (background, border, shadow, margin, padding, etc.)

Page 28: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.

For Mobile

• Flexbox layout will offer a default responsive handling

• Still have breakpoints and their corresponding class names and properties

• Still have mobileLayout in layout configuration

Page 29: Web AppBuilder for ArcGIS: Developing for Mobile · 2019-04-15 · Web AppBuilder for ArcGIS: Developing for Mobile . Basic Mobile Design Principles You can Implement in Your App.