-
Notifications
You must be signed in to change notification settings - Fork 10
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
Showing
9 changed files
with
140 additions
and
11 deletions.
There are no files selected for viewing
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
20 changes: 18 additions & 2 deletions
20
documentation/mvflow/net.pedroloureiro.mvflow/-m-v-flow.html
Large diffs are not rendered by default.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
documentation/mvflow/net.pedroloureiro.mvflow/-m-v-flow/-view2/actions.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,29 @@ | ||
<HTML> | ||
<HEAD> | ||
<meta charset="UTF-8"> | ||
<title>MVFlow.View2.actions - mvflow</title> | ||
<link rel="stylesheet" href="../../../../style.css"> | ||
</HEAD> | ||
<BODY> | ||
<a href="../../../index.html">mvflow</a> / <a href="../../index.html">net.pedroloureiro.mvflow</a> / <a href="../index.html">MVFlow</a> / <a href="index.html">View2</a> / <a href="./actions.html">actions</a><br/> | ||
<br/> | ||
<h1>actions</h1> | ||
<a name="net.pedroloureiro.mvflow.MVFlow.View2$actions()"></a> | ||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">actions</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><a href="https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html"><span class="identifier">Flow</span></a><span class="symbol"><</span><span class="identifier">Action</span><span class="symbol">></span></code> <a href="https://github.com/pedroql/mvflow/blob/master/mvflow-core/src/main/kotlin/net/pedroloureiro/mvflow/MVFlow.kt#L164">(source)</a> | ||
<p>Function to return a <a href="https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html">kotlinx.coroutines.flow.Flow</a> of the actions that the user makes inside this view.</p> | ||
<p>You can create this in many ways, one suggestion is using | ||
<a href="https://github.com/ReactiveCircus/FlowBinding">FlowBinding</a> or doing it yourself like in this sample:</p> | ||
<pre><code class="lang-kotlin">class MyActivity : AppCompatActivity(), MVFlow.View<State> { | ||
// could also be a Fragment, or a plain class you created. | ||
private val actionChannel = Channel<Action>() | ||
|
||
fun setupUi() { | ||
swipeRefreshLayout.setOnRefreshListener { | ||
actionChannel.offer(Action.Load) | ||
} | ||
} | ||
|
||
override fun actions() = actionChannel.consumeAsFlow() | ||
}</code></pre> | ||
</BODY> | ||
</HTML> |
41 changes: 41 additions & 0 deletions
41
documentation/mvflow/net.pedroloureiro.mvflow/-m-v-flow/-view2/index.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,41 @@ | ||
<HTML> | ||
<HEAD> | ||
<meta charset="UTF-8"> | ||
<title>MVFlow.View2 - mvflow</title> | ||
<link rel="stylesheet" href="../../../../style.css"> | ||
</HEAD> | ||
<BODY> | ||
<a href="../../../index.html">mvflow</a> / <a href="../../index.html">net.pedroloureiro.mvflow</a> / <a href="../index.html">MVFlow</a> / <a href="./index.html">View2</a><br/> | ||
<br/> | ||
<h1>View2</h1> | ||
<code><span class="keyword">interface </span><span class="identifier">View2</span><span class="symbol"><</span><span class="identifier">State</span><span class="symbol">, </span><span class="identifier">Action</span><span class="symbol">></span></code> <a href="https://github.com/pedroql/mvflow/blob/master/mvflow-core/src/main/kotlin/net/pedroloureiro/mvflow/MVFlow.kt#L150">(source)</a> | ||
<p>An interface for a View used in MVFlow.</p> | ||
<h3>Parameters</h3> | ||
<p><a name="State"></a> | ||
<code>State</code> - a class that defines what this class shows.</p> | ||
<p><a name="Action"></a> | ||
<code>Action</code> - a class, usually a sealed class, that contains the information about all the interactions that can | ||
happen inside this view.</p> | ||
<h3>Functions</h3> | ||
<table> | ||
<tbody> | ||
<tr> | ||
<td> | ||
<h4><a href="actions.html">actions</a></h4> | ||
</td> | ||
<td> | ||
<p>Function to return a <a href="https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html">kotlinx.coroutines.flow.Flow</a> of the actions that the user makes inside this view.</p> | ||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">actions</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><a href="https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html"><span class="identifier">Flow</span></a><span class="symbol"><</span><span class="identifier">Action</span><span class="symbol">></span></code></td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<h4><a href="render.html">render</a></h4> | ||
</td> | ||
<td> | ||
<p>Function that renders the UI based on <a href="render.html#net.pedroloureiro.mvflow.MVFlow.View2$render(net.pedroloureiro.mvflow.MVFlow.View2.State)/state">state</a>.</p> | ||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">render</span><span class="symbol">(</span><span class="identifier" id="net.pedroloureiro.mvflow.MVFlow.View2$render(net.pedroloureiro.mvflow.MVFlow.View2.State)/state">state</span><span class="symbol">:</span> <span class="identifier">State</span><span class="symbol">)</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html"><span class="identifier">Unit</span></a></code></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</BODY> | ||
</HTML> |
15 changes: 15 additions & 0 deletions
15
documentation/mvflow/net.pedroloureiro.mvflow/-m-v-flow/-view2/render.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,15 @@ | ||
<HTML> | ||
<HEAD> | ||
<meta charset="UTF-8"> | ||
<title>MVFlow.View2.render - mvflow</title> | ||
<link rel="stylesheet" href="../../../../style.css"> | ||
</HEAD> | ||
<BODY> | ||
<a href="../../../index.html">mvflow</a> / <a href="../../index.html">net.pedroloureiro.mvflow</a> / <a href="../index.html">MVFlow</a> / <a href="index.html">View2</a> / <a href="./render.html">render</a><br/> | ||
<br/> | ||
<h1>render</h1> | ||
<a name="net.pedroloureiro.mvflow.MVFlow.View2$render(net.pedroloureiro.mvflow.MVFlow.View2.State)"></a> | ||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">render</span><span class="symbol">(</span><span class="identifier" id="net.pedroloureiro.mvflow.MVFlow.View2$render(net.pedroloureiro.mvflow.MVFlow.View2.State)/state">state</span><span class="symbol">:</span> <span class="identifier">State</span><span class="symbol">)</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html"><span class="identifier">Unit</span></a></code> <a href="https://github.com/pedroql/mvflow/blob/master/mvflow-core/src/main/kotlin/net/pedroloureiro/mvflow/MVFlow.kt#L154">(source)</a> | ||
<p>Function that renders the UI based on <a href="render.html#net.pedroloureiro.mvflow.MVFlow.View2$render(net.pedroloureiro.mvflow.MVFlow.View2.State)/state">state</a>.</p> | ||
</BODY> | ||
</HTML> |
Oops, something went wrong.