diff --git a/community/maps-navigate.lua b/community/maps-navigate.lua new file mode 100644 index 0000000..09673a8 --- /dev/null +++ b/community/maps-navigate.lua @@ -0,0 +1,31 @@ +-- name = "Navigate" +-- description = "Navigate to address" +-- data_source = "internal" +-- type = "search" +-- author = "Sriram SV" +-- version = "1.0" + +text_from = "" +text_to = "" +maps_intent_action = "android.intent.action.VIEW" +maps_intent_category = "android.intent.category.DEFAULT" +maps_package_name = "com.google.android.apps.maps" + +local md_color = require "md_colors" +local blue = md_colors.light_blue_800 + +function on_search(input) + text_from = input + text_to = "" + search:show({..input},{blue}) +end + +function on_click(idx) + intent:start_activity{ + action = maps_intent_action, + category = maps_intent_category, + package = maps_package_name, + data = "google.navigation:q="..text_from + } +end +