[FIX] developer/mobile: use spaces and not tabs for indentation
closes odoo/documentation#2984 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
parent
197dbea3d2
commit
17fa2e0333
@ -68,7 +68,7 @@ Show Toast in device
|
|||||||
|
|
||||||
.. js:function:: showToast
|
.. js:function:: showToast
|
||||||
|
|
||||||
:param object args: **message** text to display
|
:param object args: **message** text to display
|
||||||
|
|
||||||
A toast provides simple feedback about an operation in a small popup. It only
|
A toast provides simple feedback about an operation in a small popup. It only
|
||||||
fills the amount of space required for the message and the current activity
|
fills the amount of space required for the message and the current activity
|
||||||
@ -76,7 +76,7 @@ remains visible and interactive.
|
|||||||
|
|
||||||
.. code-block:: javascript
|
.. code-block:: javascript
|
||||||
|
|
||||||
mobile.methods.showToast({'message': 'Message sent'});
|
mobile.methods.showToast({'message': 'Message sent'});
|
||||||
|
|
||||||
.. image:: mobile/toast.png
|
.. image:: mobile/toast.png
|
||||||
|
|
||||||
@ -87,22 +87,22 @@ Vibrating device
|
|||||||
|
|
||||||
.. js:function:: vibrate
|
.. js:function:: vibrate
|
||||||
|
|
||||||
:param object args: Vibrates constantly for the specified period of time
|
:param object args: Vibrates constantly for the specified period of time
|
||||||
(in milliseconds).
|
(in milliseconds).
|
||||||
|
|
||||||
Vibrate mobile device with given duration.
|
Vibrate mobile device with given duration.
|
||||||
|
|
||||||
.. code-block:: javascript
|
.. code-block:: javascript
|
||||||
|
|
||||||
mobile.methods.vibrate({'duration': 100});
|
mobile.methods.vibrate({'duration': 100});
|
||||||
|
|
||||||
Show snackbar with action
|
Show snackbar with action
|
||||||
.........................
|
.........................
|
||||||
|
|
||||||
.. js:function:: showSnackBar
|
.. js:function:: showSnackBar
|
||||||
|
|
||||||
:param object args: (*required*) **Message** to show in snackbar and action **button label** in Snackbar (optional)
|
:param object args: (*required*) **Message** to show in snackbar and action **button label** in Snackbar (optional)
|
||||||
:returns: ``True`` if the user clicks on the Action button, ``False`` if SnackBar auto dismissed after some time.
|
:returns: ``True`` if the user clicks on the Action button, ``False`` if SnackBar auto dismissed after some time.
|
||||||
|
|
||||||
Snackbars provide lightweight feedback about an operation. They show a brief
|
Snackbars provide lightweight feedback about an operation. They show a brief
|
||||||
message at the bottom of the screen on mobile or in the lower left corner on larger devices.
|
message at the bottom of the screen on mobile or in the lower left corner on larger devices.
|
||||||
@ -111,13 +111,13 @@ displayed at a time.
|
|||||||
|
|
||||||
.. code-block:: javascript
|
.. code-block:: javascript
|
||||||
|
|
||||||
mobile.methods.showSnackBar({'message': 'Message is deleted', 'btn_text': 'Undo'}).then(function(result){
|
mobile.methods.showSnackBar({'message': 'Message is deleted', 'btn_text': 'Undo'}).then(function(result){
|
||||||
if(result){
|
if(result){
|
||||||
// Do undo operation
|
// Do undo operation
|
||||||
}else{
|
}else{
|
||||||
// Snack Bar dismissed
|
// Snack Bar dismissed
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
.. image:: mobile/snackbar.png
|
.. image:: mobile/snackbar.png
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ Showing notification
|
|||||||
|
|
||||||
.. js:function:: showNotification
|
.. js:function:: showNotification
|
||||||
|
|
||||||
:param object args: **title** (first row) of the notification, **message** (second row) of the notification, in a standard notification.
|
:param object args: **title** (first row) of the notification, **message** (second row) of the notification, in a standard notification.
|
||||||
|
|
||||||
A notification is a message you can display to the user outside of your
|
A notification is a message you can display to the user outside of your
|
||||||
application's normal UI. When you tell the system to issue a notification, it
|
application's normal UI. When you tell the system to issue a notification, it
|
||||||
@ -137,7 +137,7 @@ view at any time.
|
|||||||
|
|
||||||
.. code-block:: javascript
|
.. code-block:: javascript
|
||||||
|
|
||||||
mobile.showNotification({'title': 'Simple Notification', 'message': 'This is a test for a simple notification'})
|
mobile.showNotification({'title': 'Simple Notification', 'message': 'This is a test for a simple notification'})
|
||||||
|
|
||||||
.. image:: mobile/mobile_notification.png
|
.. image:: mobile/mobile_notification.png
|
||||||
|
|
||||||
@ -147,31 +147,31 @@ Create contact in device
|
|||||||
|
|
||||||
.. js:function:: addContact
|
.. js:function:: addContact
|
||||||
|
|
||||||
:param object args: Dictionary with contact details. Possible keys (name, mobile, phone, fax, email, website, street, street2, country_id, state_id, city, zip, parent_id, function and image)
|
:param object args: Dictionary with contact details. Possible keys (name, mobile, phone, fax, email, website, street, street2, country_id, state_id, city, zip, parent_id, function and image)
|
||||||
|
|
||||||
Create a new device contact with the given contact details.
|
Create a new device contact with the given contact details.
|
||||||
|
|
||||||
.. code-block:: javascript
|
.. code-block:: javascript
|
||||||
|
|
||||||
var contact = {
|
var contact = {
|
||||||
'name': 'Michel Fletcher',
|
'name': 'Michel Fletcher',
|
||||||
'mobile': '9999999999',
|
'mobile': '9999999999',
|
||||||
'phone': '7954856587',
|
'phone': '7954856587',
|
||||||
'fax': '765898745',
|
'fax': '765898745',
|
||||||
'email': 'michel.fletcher@agrolait.example.com',
|
'email': 'michel.fletcher@agrolait.example.com',
|
||||||
'website': 'http://www.agrolait.com',
|
'website': 'http://www.agrolait.com',
|
||||||
'street': '69 rue de Namur',
|
'street': '69 rue de Namur',
|
||||||
'street2': false,
|
'street2': false,
|
||||||
'country_id': [21, 'Belgium'],
|
'country_id': [21, 'Belgium'],
|
||||||
'state_id': false,
|
'state_id': false,
|
||||||
'city': 'Wavre',
|
'city': 'Wavre',
|
||||||
'zip': '1300',
|
'zip': '1300',
|
||||||
'parent_id': [8, 'Agrolait'],
|
'parent_id': [8, 'Agrolait'],
|
||||||
'function': 'Analyst',
|
'function': 'Analyst',
|
||||||
'image': '<<BASE 64 Image Data>>'
|
'image': '<<BASE 64 Image Data>>'
|
||||||
}
|
}
|
||||||
|
|
||||||
mobile.methods.addContact(contact);
|
mobile.methods.addContact(contact);
|
||||||
|
|
||||||
.. image:: mobile/mobile_contact_create.png
|
.. image:: mobile/mobile_contact_create.png
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ Scanning barcodes
|
|||||||
|
|
||||||
.. js:function:: scanBarcode
|
.. js:function:: scanBarcode
|
||||||
|
|
||||||
:returns: Scanned ``code`` from any barcode
|
:returns: Scanned ``code`` from any barcode
|
||||||
|
|
||||||
The barcode API detects barcodes in real-time, on the device, in any orientation.
|
The barcode API detects barcodes in real-time, on the device, in any orientation.
|
||||||
|
|
||||||
@ -191,11 +191,11 @@ The barcode API can read the following barcode formats:
|
|||||||
|
|
||||||
.. code-block:: javascript
|
.. code-block:: javascript
|
||||||
|
|
||||||
mobile.methods.scanBarcode().then(function(code){
|
mobile.methods.scanBarcode().then(function(code){
|
||||||
if(code){
|
if(code){
|
||||||
// Perform operation with the scanned code
|
// Perform operation with the scanned code
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Switching account in device
|
Switching account in device
|
||||||
...........................
|
...........................
|
||||||
@ -206,6 +206,6 @@ Use switchAccount to switch from one account to another on the device.
|
|||||||
|
|
||||||
.. code-block:: javascript
|
.. code-block:: javascript
|
||||||
|
|
||||||
mobile.methods.switchAccount();
|
mobile.methods.switchAccount();
|
||||||
|
|
||||||
.. image:: mobile/mobile_switch_account.png
|
.. image:: mobile/mobile_switch_account.png
|
||||||
|
Loading…
Reference in New Issue
Block a user