mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-09-22 03:35:06 -04:00
docs: publish channels: main api
This commit is contained in:
1 parent
2d9f471838
commit
86014cd4f3
9 files changed
+9
-9
No files matched your search
@@ -95,7 +95,7 @@
|
||||
<h1 class="cover"><span>Robolectric</span><wbr><span>Ble</span><wbr><span><span>Bonding</span></span></h1>
|
||||
<div class="platform-hinted with-platform-tabs" data-platform-hinted="data-platform-hinted">
|
||||
<div class="platform-bookmarks-row" data-toggle-list="data-toggle-list"><button class="platform-bookmark" data-filterable-current=":core:testing/androidMain" data-filterable-set=":core:testing/androidMain" data-active="" data-toggle=":core:testing/androidMain">android</button></div>
|
||||
<div class="content sourceset-dependent-content" data-active="" data-togglable=":core:testing/androidMain"><div class="symbol monospace"><span class="token keyword">object </span><a href="index.html">RobolectricBleBonding</a><span class="source-link-wrapper"><span class="source-link" data-element-type="source-link">(<a href="https://github.com/meshtastic/Meshtastic-Android/blob/main/core/testing/src/androidMain/kotlin/org/meshtastic/core/testing/RobolectricBleBonding.kt#L44">source</a>)</span></span></div><p class="paragraph">Reusable Robolectric helpers for driving Android Bluetooth bonding logic in <code class="lang-kotlin">androidHostTest</code> source sets.</p><p class="paragraph">These let a unit test exercise the real <code class="lang-kotlin">AndroidBluetoothRepository.bond()</code> (and any future BLE bonding code) without an emulator and without a production seam. They rely on two Robolectric behaviors (verified against Robolectric 4.16.x):</p><ul><li><p class="paragraph"><a href="https://developer.android.com/reference/kotlin/android/bluetooth/BluetoothAdapter.html#getremotedevice">android.bluetooth.BluetoothAdapter.getRemoteDevice</a> caches the returned <a href="https://developer.android.com/reference/kotlin/android/bluetooth/BluetoothDevice.html">BluetoothDevice</a> by address in a static map, so the shadow configured here is the <i>same</i> instance production code reads when it calls <code class="lang-kotlin">getRemoteDevice(mac)</code> internally.</p></li><li><p class="paragraph"><span data-unresolved-link="org.robolectric.shadows/ShadowBluetoothDevice/createBond/#/PointingToDeclaration/">ShadowBluetoothDevice.createBond</span> calls <code class="lang-kotlin">checkForBluetoothConnectPermission()</code> first, so tests must call <a href="grant-bluetooth-connect-permission.html">grantBluetoothConnectPermission</a> or <code class="lang-kotlin">createBond()</code> throws <a href="https://developer.android.com/reference/kotlin/java/lang/SecurityException.html">SecurityException</a> instead of returning a value.</p></li></ul><p class="paragraph">Isolation note: because the device cache is static and survives across tests in the same JVM, give each test a distinct MAC so bond-state cannot bleed between tests.</p></div> </div>
|
||||
<div class="content sourceset-dependent-content" data-active="" data-togglable=":core:testing/androidMain"><div class="symbol monospace"><span class="token keyword">object </span><a href="index.html">RobolectricBleBonding</a><span class="source-link-wrapper"><span class="source-link" data-element-type="source-link">(<a href="https://github.com/meshtastic/Meshtastic-Android/blob/main/core/testing/src/androidMain/kotlin/org/meshtastic/core/testing/RobolectricBleBonding.kt#L44">source</a>)</span></span></div><p class="paragraph">Reusable Robolectric helpers for driving Android Bluetooth bonding logic in <code class="lang-kotlin">androidHostTest</code> source sets.</p><p class="paragraph">These let a unit test exercise the real <code class="lang-kotlin">AndroidBluetoothRepository.bond()</code> (and any future BLE bonding code) without an emulator and without a production seam. They rely on two Robolectric behaviors (verified against Robolectric 4.16.x):</p><ul><li><p class="paragraph"><a href="https://developer.android.com/reference/kotlin/android/bluetooth/BluetoothAdapter.html#getRemoteDevice(kotlin.ByteArray)">android.bluetooth.BluetoothAdapter.getRemoteDevice</a> caches the returned <a href="https://developer.android.com/reference/kotlin/android/bluetooth/BluetoothDevice.html">BluetoothDevice</a> by address in a static map, so the shadow configured here is the <i>same</i> instance production code reads when it calls <code class="lang-kotlin">getRemoteDevice(mac)</code> internally.</p></li><li><p class="paragraph"><span data-unresolved-link="org.robolectric.shadows/ShadowBluetoothDevice/createBond/#/PointingToDeclaration/">ShadowBluetoothDevice.createBond</span> calls <code class="lang-kotlin">checkForBluetoothConnectPermission()</code> first, so tests must call <a href="grant-bluetooth-connect-permission.html">grantBluetoothConnectPermission</a> or <code class="lang-kotlin">createBond()</code> throws <a href="https://developer.android.com/reference/kotlin/java/lang/SecurityException.html">SecurityException</a> instead of returning a value.</p></li></ul><p class="paragraph">Isolation note: because the device cache is static and survives across tests in the same JVM, give each test a distinct MAC so bond-state cannot bleed between tests.</p></div> </div>
|
||||
</div>
|
||||
<div class="tabbedcontent">
|
||||
<div class="tabs-section" tabs-section="tabs-section"><button class="section-tab" data-active="" data-togglable="CONSTRUCTOR,TYPE,PROPERTY,FUNCTION">Members</button></div>
|
||||
|
||||
File diff suppressed because one or more lines are too long.
+1
-1
@@ -94,7 +94,7 @@
|
||||
<div class="cover ">
|
||||
<h1 class="cover"><span>Connection</span><wbr><span>Action</span><wbr><span><span>Button</span></span></h1>
|
||||
</div>
|
||||
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":feature:connections/commonMain"><div class="symbol monospace"><div class="block"><div class="block"><span class="token annotation builtin">@</span><a href="https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable.html"><span class="token annotation builtin">Composable</span></a></div></div><span class="token keyword">fun </span><a href="-connection-action-button.html"><span class="token function">ConnectionActionButton</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">onClick<span class="token operator">: </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -> </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html">Unit</a><span class="token punctuation">, </span></span><span class="parameter ">icon<span class="token operator">: </span><a href="https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/vector/ImageVector.html">ImageVector</a><span class="token punctuation">, </span></span><span class="parameter ">text<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span></span><span class="parameter ">modifier<span class="token operator">: </span><a href="https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.html">Modifier</a><span class="token operator"> = </span>Modifier<span class="token punctuation">, </span></span><span class="parameter ">style<span class="token operator">: </span><a href="-connection-action-button-style/index.html">ConnectionActionButtonStyle</a><span class="token operator"> = </span>ConnectionActionButtonStyle.Filled<span class="token punctuation">, </span></span><span class="parameter ">enabled<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html">Boolean</a><span class="token operator"> = </span><span class="token boolean">true</span><span class="token punctuation">, </span></span><span class="parameter ">iconContentDescription<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html">String</a><span class="token operator">?</span><span class="token operator"> = </span>null</span></span><span class="token punctuation">)</span><span class="source-link-wrapper"><span class="source-link" data-element-type="source-link">(<a href="https://github.com/meshtastic/Meshtastic-Android/blob/main/feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/ui/components/ConnectionActionButton.kt#L44">source</a>)</span></span></div><p class="paragraph">Shared "icon + label" button used throughout the Connections screen. Centralises M3 sizing conventions (<a href="https://developer.android.com/reference/kotlin/androidx/compose/material3/ButtonDefaults.html#IconSize">ButtonDefaults.IconSize</a>, <a href="https://developer.android.com/reference/kotlin/androidx/compose/material3/ButtonDefaults.html#IconSpacing">ButtonDefaults.IconSpacing</a>, and the variant-appropriate <code class="lang-kotlin">*WithIconContentPadding</code>) so every scan / add / empty-state affordance renders identically.</p><h4 class="tableheader">Parameters</h4><div class="table"><div class="table-row table-row_content" data-filterable-current=":feature:connections/commonMain" data-filterable-set=":feature:connections/commonMain"><div class="main-subrow keyValue "><div class=""><span class="inline-flex"><div><u><span>icon</span><wbr><span>Content</span><wbr><span><span>Description</span></span></u></div></span></div><div><div class="title"><p class="paragraph">accessibility label for the leading icon. Defaults to <code class="lang-kotlin">null</code> because the visible <a href="-connection-action-button.html">text</a> usually describes the action; override when the icon carries information the text does not.</p></div></div></div></div></div></div></div>
|
||||
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":feature:connections/commonMain"><div class="symbol monospace"><div class="block"><div class="block"><span class="token annotation builtin">@</span><a href="https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable.html"><span class="token annotation builtin">Composable</span></a></div></div><span class="token keyword">fun </span><a href="-connection-action-button.html"><span class="token function">ConnectionActionButton</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">onClick<span class="token operator">: </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -> </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html">Unit</a><span class="token punctuation">, </span></span><span class="parameter ">icon<span class="token operator">: </span><a href="https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/vector/ImageVector.html">ImageVector</a><span class="token punctuation">, </span></span><span class="parameter ">text<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span></span><span class="parameter ">modifier<span class="token operator">: </span><a href="https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.html">Modifier</a><span class="token operator"> = </span>Modifier<span class="token punctuation">, </span></span><span class="parameter ">style<span class="token operator">: </span><a href="-connection-action-button-style/index.html">ConnectionActionButtonStyle</a><span class="token operator"> = </span>ConnectionActionButtonStyle.Filled<span class="token punctuation">, </span></span><span class="parameter ">enabled<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html">Boolean</a><span class="token operator"> = </span><span class="token boolean">true</span><span class="token punctuation">, </span></span><span class="parameter ">iconContentDescription<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html">String</a><span class="token operator">?</span><span class="token operator"> = </span>null</span></span><span class="token punctuation">)</span><span class="source-link-wrapper"><span class="source-link" data-element-type="source-link">(<a href="https://github.com/meshtastic/Meshtastic-Android/blob/main/feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/ui/components/ConnectionActionButton.kt#L44">source</a>)</span></span></div><p class="paragraph">Shared "icon + label" button used throughout the Connections screen. Centralises M3 sizing conventions (<a href="https://developer.android.com/reference/kotlin/androidx/compose/material3/ButtonDefaults.html#iconsize">ButtonDefaults.IconSize</a>, <a href="https://developer.android.com/reference/kotlin/androidx/compose/material3/ButtonDefaults.html#iconspacing">ButtonDefaults.IconSpacing</a>, and the variant-appropriate <code class="lang-kotlin">*WithIconContentPadding</code>) so every scan / add / empty-state affordance renders identically.</p><h4 class="tableheader">Parameters</h4><div class="table"><div class="table-row table-row_content" data-filterable-current=":feature:connections/commonMain" data-filterable-set=":feature:connections/commonMain"><div class="main-subrow keyValue "><div class=""><span class="inline-flex"><div><u><span>icon</span><wbr><span>Content</span><wbr><span><span>Description</span></span></u></div></span></div><div><div class="title"><p class="paragraph">accessibility label for the leading icon. Defaults to <code class="lang-kotlin">null</code> because the visible <a href="-connection-action-button.html">text</a> usually describes the action; override when the icon carries information the text does not.</p></div></div></div></div></div></div></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="footer--container">
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
</span></span></div>
|
||||
<div>
|
||||
<div class="title">
|
||||
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":feature:connections/commonMain"><div class="symbol monospace"><div class="block"><div class="block"><span class="token annotation builtin">@</span><a href="https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable.html"><span class="token annotation builtin">Composable</span></a></div></div><span class="token keyword">fun </span><a href="-connection-action-button.html"><span class="token function">ConnectionActionButton</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">onClick<span class="token operator">: </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -> </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html">Unit</a><span class="token punctuation">, </span></span><span class="parameter ">icon<span class="token operator">: </span><a href="https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/vector/ImageVector.html">ImageVector</a><span class="token punctuation">, </span></span><span class="parameter ">text<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span></span><span class="parameter ">modifier<span class="token operator">: </span><a href="https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.html">Modifier</a><span class="token operator"> = </span>Modifier<span class="token punctuation">, </span></span><span class="parameter ">style<span class="token operator">: </span><a href="-connection-action-button-style/index.html">ConnectionActionButtonStyle</a><span class="token operator"> = </span>ConnectionActionButtonStyle.Filled<span class="token punctuation">, </span></span><span class="parameter ">enabled<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html">Boolean</a><span class="token operator"> = </span><span class="token boolean">true</span><span class="token punctuation">, </span></span><span class="parameter ">iconContentDescription<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html">String</a><span class="token operator">?</span><span class="token operator"> = </span>null</span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Shared "icon + label" button used throughout the Connections screen. Centralises M3 sizing conventions (<a href="https://developer.android.com/reference/kotlin/androidx/compose/material3/ButtonDefaults.html#IconSize">ButtonDefaults.IconSize</a>, <a href="https://developer.android.com/reference/kotlin/androidx/compose/material3/ButtonDefaults.html#IconSpacing">ButtonDefaults.IconSpacing</a>, and the variant-appropriate <code class="lang-kotlin">*WithIconContentPadding</code>) so every scan / add / empty-state affordance renders identically.</p></div></div></div>
|
||||
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":feature:connections/commonMain"><div class="symbol monospace"><div class="block"><div class="block"><span class="token annotation builtin">@</span><a href="https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable.html"><span class="token annotation builtin">Composable</span></a></div></div><span class="token keyword">fun </span><a href="-connection-action-button.html"><span class="token function">ConnectionActionButton</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">onClick<span class="token operator">: </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -> </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html">Unit</a><span class="token punctuation">, </span></span><span class="parameter ">icon<span class="token operator">: </span><a href="https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/vector/ImageVector.html">ImageVector</a><span class="token punctuation">, </span></span><span class="parameter ">text<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span></span><span class="parameter ">modifier<span class="token operator">: </span><a href="https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.html">Modifier</a><span class="token operator"> = </span>Modifier<span class="token punctuation">, </span></span><span class="parameter ">style<span class="token operator">: </span><a href="-connection-action-button-style/index.html">ConnectionActionButtonStyle</a><span class="token operator"> = </span>ConnectionActionButtonStyle.Filled<span class="token punctuation">, </span></span><span class="parameter ">enabled<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html">Boolean</a><span class="token operator"> = </span><span class="token boolean">true</span><span class="token punctuation">, </span></span><span class="parameter ">iconContentDescription<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html">String</a><span class="token operator">?</span><span class="token operator"> = </span>null</span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Shared "icon + label" button used throughout the Connections screen. Centralises M3 sizing conventions (<a href="https://developer.android.com/reference/kotlin/androidx/compose/material3/ButtonDefaults.html#iconsize">ButtonDefaults.IconSize</a>, <a href="https://developer.android.com/reference/kotlin/androidx/compose/material3/ButtonDefaults.html#iconspacing">ButtonDefaults.IconSpacing</a>, and the variant-appropriate <code class="lang-kotlin">*WithIconContentPadding</code>) so every scan / add / empty-state affordance renders identically.</p></div></div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user