add phone functions

This commit is contained in:
Evgeny
2021-09-02 14:03:09 +03:00
parent 340e342f19
commit 9c6b2e3486
3 changed files with 35 additions and 0 deletions

View File

@@ -149,6 +149,18 @@ Calendar table format:
* `name` - name of the calendar; * `name` - name of the calendar;
* `color` - color of the calendar in the format #XXXXXXXX. * `color` - color of the calendar in the format #XXXXXXXX.
# Phone
* `phone:get_contacts()` - returns table of phone contacts;
* `phone:make_call(number)` - dial the number in the dialer;
* `phone:send_sms(number, [text])` - open SMS application and enter the number, optionally enter text;
Contacts table format:
* `lookupKey` - unique contact identifier;
* `name` - contact name;
* `number` - contact number.
# Settings # Settings
* `settings:get()` - returns the settings table in an array of words format; * `settings:get()` - returns the settings table in an array of words format;

View File

@@ -149,6 +149,18 @@ ui:show_context_menu({
* `name` - название календаря; * `name` - название календаря;
* `color` - цвет календаря в фолрмате #XXXXXX. * `color` - цвет календаря в фолрмате #XXXXXX.
# Телефон
* `phone:get_contacts()` - возвращает таблицу телефонных контактов;
* `phone:make_call(number)` - набрать номер в диалере;
* `phone:send_sms(number, [text])` - открыть приложение СМС и ввети номер, опционально ввести текст;
Формат таблицы контактов:
* `lookupKey` - уникальный идентификтор контакта;
* `name` - имя контакта;
* `number` - номер контакта.
# Настройки # Настройки
* `settings:get()` - возвращает таблицу настроек в формате массива слов; * `settings:get()` - возвращает таблицу настроек в формате массива слов;

11
samples/dialer-sample.lua Normal file
View File

@@ -0,0 +1,11 @@
function on_resume()
ui:show_lines({ "Make call 123", "Send SMS 123" })
end
function on_click(idx)
if idx == 1 then
phone:make_call("123")
else
phone:send_sms("123", "Test")
end
end