This file contains hidden or 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
class MainViewModelTest { | |
@get:Rule | |
val mainCoroutineRule = MainCoroutineRule() | |
private val userServices = mock<UserServices>() | |
private lateinit var viewModel: MainViewModel | |
private val testDispatcher = AppDispatchers( |
This file contains hidden or 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
class MainViewModelTest { | |
@get:Rule | |
val mainCoroutineRule = MainCoroutineRule() | |
private val userServices = mock<UserServices>() | |
private lateinit var viewModel: MainViewModel | |
private val testDispatcher = AppDispatchers( |
This file contains hidden or 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
testImplementation 'junit:junit:4.13.2' | |
testImplementation 'org.mockito.kotlin:mockito-kotlin:4.0.0' | |
//For runBlockingTest, CoroutineDispatcher etc. | |
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.2' |
This file contains hidden or 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
@Composable | |
fun ShowcaseSample() { | |
val targets = remember { | |
mutableStateMapOf<String, ShowcaseProperty>() | |
} | |
Box { | |
Scaffold( | |
modifier = Modifier.fillMaxSize(), | |
topBar = { | |
TopAppBar( |
This file contains hidden or 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
@Composable | |
fun IntroShowCase( | |
targets: SnapshotStateMap<String, ShowcaseProperty>, | |
backgroundColor: Color = Color.Black, | |
onShowcaseCompleted: () -> Unit | |
) { | |
val uniqueTargets = targets.values.sortedBy { it.index } | |
var currentTargetIndex by remember { mutableStateOf(0) } | |
val currentTarget = |
This file contains hidden or 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
<uses-permission android:name="android.permission.RECORD_AUDIO" /> | |
<uses-permission android:name="android.permission.INTERNET" /> |
This file contains hidden or 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
//okhttp | |
implementation("com.squareup.okhttp3:okhttp:4.9.3") | |
//coroutine | |
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9") |
This file contains hidden or 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
private const val RECORDER_SAMPLERATE = 44100 | |
private val RECORDER_CHANNELS: Int = AudioFormat.CHANNEL_IN_STEREO | |
private val RECORDER_AUDIO_ENCODING: Int = AudioFormat.ENCODING_PCM_16BIT | |
class AudioStreamManager { | |
private var audioRecord: AudioRecord? = null | |
val BUFFER_SIZE_RECORDING = AudioRecord.getMinBufferSize( | |
RECORDER_SAMPLERATE, |
This file contains hidden or 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
val okHttpClient = OkHttpClient.Builder() | |
.connectTimeout(30, TimeUnit.SECONDS) | |
.readTimeout(30, TimeUnit.SECONDS) | |
.build() |
This file contains hidden or 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
val request = Request.Builder().url("our ws:// url").build() |