-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bitrise Buildbot
committed
Sep 20, 2024
1 parent
7e39ca2
commit 9d2b636
Showing
10 changed files
with
179 additions
and
2 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
docs/output/com.geotab.mobile.sdk.publicInterfaces/-drive-sdk/get-min-availability-html.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> | ||
<title>getMinAvailabilityHtml</title> | ||
<link href="../../../images/logo-icon.svg" rel="icon" type="image/svg"> | ||
<script>var pathToRoot = "../../../";</script> | ||
<script>const storage = localStorage.getItem("dokka-dark-mode") | ||
if (storage == null) { | ||
const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches | ||
if (osDarkSchemePreferred === true) { | ||
document.getElementsByTagName("html")[0].classList.add("theme-dark") | ||
} | ||
} else { | ||
const savedDarkMode = JSON.parse(storage) | ||
if(savedDarkMode === true) { | ||
document.getElementsByTagName("html")[0].classList.add("theme-dark") | ||
} | ||
} | ||
</script> | ||
<script type="text/javascript" src="../../../scripts/sourceset_dependencies.js" async="async"></script> | ||
<link href="../../../styles/style.css" rel="Stylesheet"> | ||
<link href="../../../styles/jetbrains-mono.css" rel="Stylesheet"> | ||
<link href="../../../styles/main.css" rel="Stylesheet"> | ||
<link href="../../../styles/prism.css" rel="Stylesheet"> | ||
<link href="../../../styles/logo-styles.css" rel="Stylesheet"> | ||
<script type="text/javascript" src="../../../scripts/clipboard.js" async="async"></script> | ||
<script type="text/javascript" src="../../../scripts/navigation-loader.js" async="async"></script> | ||
<script type="text/javascript" src="../../../scripts/platform-content-handler.js" async="async"></script> | ||
<script type="text/javascript" src="../../../scripts/main.js" defer="defer"></script> | ||
<script type="text/javascript" src="../../../scripts/prism.js" async="async"></script> | ||
<script type="text/javascript" src="../../../scripts/symbol-parameters-wrapper_deferred.js" defer="defer"></script> | ||
</head> | ||
<body> | ||
<div class="navigation-wrapper" id="navigation-wrapper"> | ||
<div id="leftToggler"><span class="icon-toggler"></span></div> | ||
<div class="library-name"> | ||
<a href="../../../index.html"> | ||
<span>output</span> | ||
</a> | ||
</div> | ||
<div> | ||
</div> | ||
<div class="pull-right d-flex"> | ||
<div class="filter-section" id="filter-section"> | ||
<button class="platform-tag platform-selector jvm-like" data-active="" data-filter=":geotabdrivesdk:dokkaHtml/release">androidJvm</button> | ||
</div> | ||
<button id="theme-toggle-button"><span id="theme-toggle"></span></button> | ||
<div id="searchBar"></div> | ||
</div> | ||
</div> | ||
<div id="container"> | ||
<div id="leftColumn"> | ||
<div id="sideMenu"></div> | ||
</div> | ||
<div id="main"> | ||
<div class="main-content" data-page-type="member" id="content" pageIds="output::com.geotab.mobile.sdk.publicInterfaces/DriveSdk/getMinAvailabilityHtml/#kotlin.String#kotlin.Function1[com.geotab.mobile.sdk.module.Result[com.geotab.mobile.sdk.module.Success[kotlin.String],com.geotab.mobile.sdk.module.Failure],kotlin.Unit]/PointingToDeclaration//-1010896762"> | ||
<div class="breadcrumbs"><a href="../../../index.html">output</a><span class="delimiter">/</span><a href="../index.html">com.geotab.mobile.sdk.publicInterfaces</a><span class="delimiter">/</span><a href="index.html">DriveSdk</a><span class="delimiter">/</span><span class="current">getMinAvailabilityHtml</span></div> | ||
<div class="cover "> | ||
<h1 class="cover"><span>get</span><wbr></wbr><span>Min</span><wbr></wbr><span>Availability</span><wbr></wbr><span><span>Html</span></span></h1> | ||
</div> | ||
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":geotabdrivesdk:dokkaHtml/release"><div class="symbol monospace"><span class="token keyword">abstract </span><span class="token keyword"></span><span class="token keyword">fun </span><a href="get-min-availability-html.html"><span class="token function">getMinAvailabilityHtml</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">userName<span class="token operator">: </span><span data-unresolved-link="kotlin/String///PointingToDeclaration/">String</span><span class="token punctuation">, </span></span><span class="parameter ">callback<span class="token operator">: </span><span class="token punctuation">(</span><span class="token keyword"></span><span data-unresolved-link="com.geotab.mobile.sdk.module/Result///PointingToDeclaration/">Result</span><span class="token operator"><</span><span class="token keyword"></span><span data-unresolved-link="com.geotab.mobile.sdk.module/Success///PointingToDeclaration/">Success</span><span class="token operator"><</span><span class="token keyword"></span><span data-unresolved-link="kotlin/String///PointingToDeclaration/">String</span><span class="token operator">></span><span class="token punctuation">, </span><span class="token keyword"></span><span data-unresolved-link="com.geotab.mobile.sdk.module/Failure///PointingToDeclaration/">Failure</span><span class="token operator">></span><span class="token punctuation">)</span><span class="token operator"> -> </span><span class="token keyword"></span><span data-unresolved-link="kotlin/Unit///PointingToDeclaration/">Unit</span></span></span><span class="token punctuation">)</span></div><p class="paragraph">Returns the active driver's Minimum availability as html</p><span class="kdoc-tag"><h4 class="">Return</h4><p class="paragraph">Html string with the minimum availability</p></span></div></div> | ||
</div> | ||
<div class="footer"> | ||
<span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>© 2024 Copyright</span><span | ||
class="pull-right"><span>Generated by </span><a | ||
href="https://github.com/Kotlin/dokka"><span>dokka</span><span class="padded-icon"></span></a></span> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
geotabdrivesdk/src/main/assets/ModuleFunction.GetMinAvailabilityHtmlFunction.Api.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(async (callerId) => { | ||
try { | ||
const userName = '{{userName}}'; | ||
|
||
if (userName == null || userName === '') { | ||
throw new Error('No users'); | ||
} | ||
|
||
const api = window.webViewLayer.getApi(userName); | ||
const availabilityHtml = await api.mobile.user.getMinAvailabilityHtml(); | ||
|
||
window.geotabModules.{{moduleName}}.{{functionName}}( | ||
{ callerId, result: availabilityHtml }, | ||
() => {} | ||
); | ||
} catch (err) { | ||
window.geotabModules.{{moduleName}}.{{functionName}}( | ||
{ callerId, error: err.message }, | ||
() => {} | ||
); | ||
throw err; | ||
} | ||
})('{{callerId}}'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...rivesdk/src/main/java/com/geotab/mobile/sdk/module/user/GetMinAvailabilityHtmlFunction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.geotab.mobile.sdk.module.user | ||
|
||
import android.content.Context | ||
import com.geotab.mobile.sdk.Error | ||
import com.geotab.mobile.sdk.models.enums.GeotabDriveError | ||
import com.geotab.mobile.sdk.module.BaseCallbackFunction | ||
import com.geotab.mobile.sdk.module.Failure | ||
import com.geotab.mobile.sdk.module.ModuleFunction | ||
import com.geotab.mobile.sdk.module.Result | ||
import com.geotab.mobile.sdk.module.Success | ||
|
||
class GetMinAvailabilityHtmlFunction( | ||
override val name: String = "getMinAvailabilityHtml", | ||
override val module: UserModule | ||
) : ModuleFunction, | ||
BaseCallbackFunction(name) { | ||
|
||
var userName = "" | ||
|
||
companion object { | ||
const val TEMPLATE_FILE_NAME = "ModuleFunction.GetMinAvailabilityHtmlFunction.Api.js" | ||
} | ||
|
||
override fun handleJavascriptCall( | ||
jsonString: String?, | ||
jsCallback: (Result<Success<String>, Failure>) -> Unit | ||
) { | ||
val response = this.transformOrInvalidate(jsonString, jsCallback) ?: return | ||
val sdkCallback = this.getSdkCallbackOrInvalidate(response, jsCallback) ?: return | ||
if (!response.result.isNullOrEmpty()) { | ||
sdkCallback(Success(response.result)) | ||
} else { | ||
jsCallback(Failure(Error(GeotabDriveError.JS_ISSUED_ERROR))) | ||
callbacks.remove(response.callerId) | ||
return | ||
} | ||
|
||
callbacks.remove(response.callerId) | ||
jsCallback(Success("undefined")) | ||
} | ||
|
||
override fun getJavascript(context: Context, callerId: String): String { | ||
val scriptParameter: HashMap<String, Any> = | ||
hashMapOf("moduleName" to module.name, "functionName" to name, "userName" to userName) | ||
scriptParameter.putAll(hashMapOf("callerId" to callerId)) | ||
return module.getScriptFromTemplate(context, TEMPLATE_FILE_NAME, scriptParameter) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters