Skip to content

Instantly share code, notes, and snippets.

private val sseClient = OkHttpClient.Builder()
.connectTimeout(6, TimeUnit.SECONDS)
.readTimeout(10, TimeUnit.MINUTES)
.writeTimeout(10, TimeUnit.MINUTES)
.build()
private val sseRequest = Request.Builder()
.url(EVENTSURL)
.header("Accept", "application/json")
.addHeader("Accept", "text/event-stream")
const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
const app = express();
app.use(cors());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
class EditTextWithError(
context: Context,
attributeSet: AttributeSet
):FrameLayout(context,attributeSet) {
private var errorText = ""
private var linearLayout:LinearLayout
private var editText:EditText
private var linearLayoutWidth = WRAP_CONTENT
private var linearLayoutHeight = WRAP_CONTENT
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="16dp" />
<stroke
android:color="@color/gray_light"
android:width="1dp"/>
binding.btnGoto.setOnClickListener {
// Navigate to feature_01
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("raystatic://multi.module.app/feat01"))
startActivity(intent)
// Navigate to feature_02
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("raystatic://multi.module.app/feat02"))
startActivity(intent)
}
/* Navigate to feature_01 */
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("raystatic://multi.module.app/feat01"))
startActivity(intent)
/* Navigate to feature_02 */
val intentFeat02 = Intent(Intent.ACTION_VIEW, Uri.parse("raystatic://multi.module.app/feat02"))
startActivity(intent)
<intent-filter
android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="raystatic"
android:host="multi.module.app"/>
class DefaultDeeplinkHandler constructor(
private val processors: Set<@JvmSuppressWildcards DeeplinkProcessor>
): DeeplinkHandler {
override fun process(deeplink: String): Boolean {
processors.forEach {
if (it.matches(deeplink)) {
it.execute(deeplink)
return true
}
}
private fun handleIntent(intent: Intent) {
intent.data?.toString()?.let {
deeplinkHandler.process(it)
finish()
}
}
@Module
@InstallIn(SingletonComponent::class)
interface DeepLinkProcessorModule {
@Binds
@IntoSet
fun bindFeat01Processors(
feature01DeeplinkProcessor: Feature01DeeplinkProcessor
): DeeplinkProcessor