Add tasks.org integration
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
package de.mm20.launcher2.search
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import androidx.core.net.toUri
|
||||
import de.mm20.launcher2.icons.ColorLayer
|
||||
import de.mm20.launcher2.icons.StaticLauncherIcon
|
||||
import de.mm20.launcher2.icons.TextLayer
|
||||
import de.mm20.launcher2.ktx.tryStartActivity
|
||||
import java.net.URLEncoder
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
interface CalendarEvent : SavableSearchable {
|
||||
@@ -34,5 +38,19 @@ interface CalendarEvent : SavableSearchable {
|
||||
)
|
||||
}
|
||||
|
||||
fun openLocation(context: Context) {}
|
||||
fun openLocation(context: Context) {
|
||||
if (location == null) return
|
||||
context.tryStartActivity(
|
||||
Intent(Intent.ACTION_VIEW)
|
||||
.setData(
|
||||
"geo:0,0?q=${
|
||||
URLEncoder.encode(
|
||||
location,
|
||||
"utf8"
|
||||
)
|
||||
}".toUri()
|
||||
)
|
||||
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -388,6 +388,7 @@
|
||||
<string name="missing_permission_call_contacts_settings">Call permission is required to start calls</string>
|
||||
<!-- Missing calendar permission in search settings screen -->
|
||||
<string name="missing_permission_calendar_search_settings">Calendar permission is required to search calendar</string>
|
||||
<string name="missing_permission_tasks_search_settings">Tasks permission is required to search tasks</string>
|
||||
<!-- Missing calendar permission in calendar widget settings screen -->
|
||||
<string name="missing_permission_calendar_widget_settings">This widget requires calendar permission</string>
|
||||
<string name="widget_config_calendar_missing_calendars_hint">Can\'t find your calendars?</string>
|
||||
@@ -608,6 +609,8 @@
|
||||
<string name="preference_search_calendar">Calendar</string>
|
||||
<string name="preference_search_calendar_summary">Search upcoming appointments and events</string>
|
||||
<string name="preference_search_local_calendar_summary">Search calendars on this device</string>
|
||||
<string name="preference_search_tasks">Tasks</string>
|
||||
<string name="preference_search_tasks_summary">Search tasks in the Tasks.org app</string>
|
||||
<string name="preference_search_appshortcuts">App shortcuts</string>
|
||||
<string name="preference_search_appshortcuts_summary">Search app shortcuts</string>
|
||||
<string name="preference_search_calculator">Calculator</string>
|
||||
@@ -630,6 +633,7 @@
|
||||
<string name="preference_search_cloud_summary">Search %1$s\'s files</string>
|
||||
<string name="preference_search_owncloud">Owncloud</string>
|
||||
<string name="preference_calendar_calendars">Calendars</string>
|
||||
<string name="preference_calendar_tasks">Tasks</string>
|
||||
<string name="preference_calendar_hide_completed">Hide completed tasks</string>
|
||||
<string name="preference_screen_buildinfo">Build information</string>
|
||||
<string name="preference_screen_buildinfo_summary">More information about this build of this app</string>
|
||||
|
||||
Reference in New Issue
Block a user