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
@PreviewLightDark | |
@Composable | |
fun ButtonPreview() { | |
ComposeColorsTheme { | |
Surface { | |
Row { | |
Button( | |
onClick = {}, | |
enabled = true | |
) { |
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
@PreviewLightDark | |
@Composable | |
fun TimePickerPreview() { | |
AppTheme { | |
Surface { | |
TimePicker( | |
state = rememberTimePickerState( | |
initialHour = 11, | |
initialMinute = 11, | |
is24Hour = true, |
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
@PreviewLightDark | |
@Composable | |
fun ButtonPreview() { | |
AppTheme { | |
Button(onClick = {}) { | |
Text("This is onPrimary") | |
} | |
} | |
} |
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 AppTheme( | |
darkTheme: Boolean = isSystemInDarkTheme(), | |
content: @Composable() () -> Unit | |
) { | |
val colorScheme = when { | |
darkTheme -> darkScheme | |
else -> lightScheme | |
} |
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
import com.dropbox.android.external.store4.Fetcher | |
import com.dropbox.android.external.store4.Store | |
import com.dropbox.android.external.store4.StoreBuilder | |
import com.dropbox.android.external.store4.fresh | |
import com.dropbox.android.sample.Graph | |
import com.dropbox.android.sample.data.model.Post | |
import com.nhaarman.mockitokotlin2.any | |
import com.nhaarman.mockitokotlin2.mock | |
import com.nhaarman.mockitokotlin2.whenever | |
import kotlinx.coroutines.ExperimentalCoroutinesApi |
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
import com.dropbox.android.external.store4.Fetcher | |
import com.dropbox.android.external.store4.Store | |
import com.dropbox.android.external.store4.StoreBuilder | |
import com.dropbox.android.external.store4.fresh | |
import com.dropbox.android.sample.Graph | |
import com.dropbox.android.sample.data.model.Post | |
import io.mockk.coEvery | |
import io.mockk.every | |
import io.mockk.mockk | |
import kotlinx.coroutines.ExperimentalCoroutinesApi |
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
@RunWith(ParameterizedRobolectricTestRunner::class) | |
@Config(sdk = [27]) | |
// parameters declared in the params() are injected through the constructor to the test class | |
class ExampleUnitTest(private val param: Int) { | |
@Test | |
fun addition_isCorrect() { | |
// parameter use in a test | |
assertEquals(param * 2, param + param) | |
} |
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
import android.annotation.SuppressLint | |
import android.os.Bundle | |
import android.util.Log | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import androidx.databinding.DataBindingUtil | |
import androidx.fragment.app.Fragment | |
import androidx.lifecycle.Observer | |
import com.github.harmittaa.koinexample.R |
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
import androidx.lifecycle.LiveData | |
import androidx.lifecycle.ViewModel | |
import androidx.lifecycle.liveData | |
import com.github.harmittaa.koinexample.model.Weather | |
import com.github.harmittaa.koinexample.model.WeatherRepository | |
import org.koin.dsl.module | |
val viewModelModule = module { | |
factory { ExampleViewModel(get()) } | |
} |
NewerOlder