Skip to content

Instantly share code, notes, and snippets.

View rakshitsoni02's full-sized avatar
🌏
making a dent on the universe

Rax rakshitsoni02

🌏
making a dent on the universe
View GitHub Profile
public class SMSCode {
public static SMSInfo findSMSCode(String content) {
if (content.length() == 0)
return null;
// 去掉 URL
String pattern = "[a-zA-z]+://[^\\s]*";
content = content.replaceAll(pattern, "");
@rakshitsoni02
rakshitsoni02 / App level Gradle
Last active December 10, 2019 13:32
JetPack Compose SetUp
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
@rakshitsoni02
rakshitsoni02 / MenuItemSearchBehavior.kt
Last active October 18, 2023 11:33
Dagger Assisted Injection example Android
class MenuItemSearchBehavior
@AssistedInject internal constructor(
@Assisted private val hint: String,
@Assisted private val activityProvider: () -> Activity,
@Assisted onMenuCreated: ((menu: Menu) -> Unit)?,
analytics: IMenuAnalytics
) : MenuBehavior(
menuRes = R.menu.menu_search,
R.id.action_search to { item -> analytics.trackMenuItemClicked(item) },
onMenuCreated = onMenuCreated
@rakshitsoni02
rakshitsoni02 / AndroidApplicationConventionPlugin.kt
Last active June 12, 2024 13:21
Groovy to kotlin migration build logic, sample for conventional plugins
import com.android.build.api.dsl.ApplicationExtension
import com.orgname.samples.plugins.APP_TARGET_SDK_VERSION
import com.orgname.samples.plugins.configureKotlinAndroid
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
class AndroidApplicationConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
@rakshitsoni02
rakshitsoni02 / AndroidCompose.kt
Last active June 13, 2024 09:25
Groovy to kotlin migration build logic, sample of common extensions and base config for reuse
@file:Suppress("UnstableApiUsage")
package com.orgname.samples.plugins
import com.android.build.api.dsl.CommonExtension
import org.gradle.api.Project
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile