Skip to content

Instantly share code, notes, and snippets.

View anangkur's full-sized avatar
🏠
Working from home

Anang Kurniawan anangkur

🏠
Working from home
View GitHub Profile
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="your-deeplink-scheme" android:host="your-deeplink-host" />
class ButtonActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Scaffold {
Column(modifier = Modifier.padding(10.dp)) {
Button(
content = { Text("Button") },
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Scaffold(
content = {
Column(
modifier = Modifier.fillMaxSize(),
class MainActivity : AppCompatActivity() {
...
private fun sendMessage(message: String) {
webSocketService.sendMessage(message)
adapter.addItem(Message(message = message, isFromSender = true))
}
@SuppressLint("CheckResult")
private fun observeConnection() {
class MainActivity : AppCompatActivity() {
...
private fun setupWebSocketService() {
webSocketService = provideWebSocketService(
scarlet = provideScarlet(
client = provideOkhttp(),
lifecycle = provideLifeCycle(),
streamAdapterFactory = provideStreamAdapterFactory(),
)
)
sonarqube {
properties {
property("sonar.host.url", "")
property("sonar.login", "")
property("sonar.projectKey", "")
property("sonar.projectName", "")
property("sonar.sourceEncoding", "")
property("sonar.language", "")
property("sonar.sources", "")
property("sonar.tests", "")
interface EchoService {
@Receive
fun observeConnection(): Flowable<WebSocket.Event>
@Send
fun sendMessage(param: String)
}
dependencies {
...
// rx
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'io.reactivex.rxjava2:rxkotlin:2.4.0'
}
dependencies {
...
// scarlet
implementation 'com.tinder.scarlet:scarlet:0.1.12'
}
fun blur(
viewToBlur: ViewGroup = this,
radius: Float = 16f,
isAutoUpdate: Boolean = true,
hasFixedTransformationMatrix: Boolean = true,
) {
binding.blurView.setupWith(viewToBlur)
.setBlurAlgorithm(RenderScriptBlur(this.context))
.setBlurRadius(radius)
.setBlurAutoUpdate(isAutoUpdate)