This file contains 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
const FeatureLayer = ({ id, circular }: { id: string; circular: boolean }) => { | |
if (circular) { | |
return ( | |
<MapboxGL.CircleLayer | |
id={`${id}-circle`} | |
style={{ circleRadius: 500, circleColor: "black" }} | |
/> | |
) | |
} else { | |
return ( |
This file contains 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 UsernameSearchViewModel( | |
api: CostarApi, | |
schedulersContainer: SchedulersContainer, | |
analytics: Analytics | |
) : ViewModel() { | |
enum class VisibleSearchComponent { Loading, List, EmptyMessage } | |
private val minCharacterCount = 3 | |
private val disposables = CompositeDisposable() |
This file contains 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
@Test | |
fun `An invalid message is sent if a user inputs an invalid password`() { | |
val api = mockk<CostarApi>() | |
val remoteConfig = mockk<RemoteConfig>() | |
every { api.validatePassword(any()) } returns Single.just(Invalid(listOf(PasswordLengthShouldGT6))) | |
every { remoteConfig.getString(validation_password_too_short) } returns "Too short" | |
val viewModel = buildViewModel(api, remoteConfig = remoteConfig) | |
viewModel.newPasswordInput("test") |
This file contains 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 AddNoteActivity : BaseActivity<AddNoteViewModel>() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_add_note) | |
add_note_button.setOnClickListener { viewModel.addNoteClicked(note_text.text.toString()) } | |
observeTrigger(viewModel.setResultAndFinishStream, this::setResultAndFinish) | |
observeTrigger(viewModel.showAddNoteFailedErrorStream, this::showErrorMessage) | |
observe(viewModel.shouldEnableAddNoteButtonStream, add_note_button::setEnabled) |
This file contains 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 GameStateMachine( | |
events: Flowable<Event>, | |
gameStateManager: GameStateManager, | |
playHarvester: PlayHarvesterImpl | |
) { | |
private var state: GameStateMachineState = | |
BatterUpState(GameCoordinator(gameStateManager, playHarvester)) | |
val viewStates: Flowable<ViewState> = Flowable.just(state.viewState).concatWith(events |
This file contains 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
export default class ContactsDisplay extends Component { | |
render() { | |
return ( | |
<View> | |
<Button title="Press me for contacts!" onPress={this.getContacts} /> | |
</View> | |
) | |
} | |
async requestContactsPermission() { |