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
import PropTypes from 'prop-types'; | |
import React, { useCallback, useState } from 'react'; | |
import { TextInput } from 'react-native'; | |
/* | |
Combined 2 solutions to achieve purpose of scrolling with custom font on Android and long text not render on iOS: | |
- https://github.com/facebook/react-native/issues/18132#issuecomment-499267942 | |
- https://github.com/facebook/react-native/issues/19453#issuecomment-481071561 | |
*/ | |
const ScrollWithCustomFontFixedTextInput = props => { |
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
Show hidden characters
{ | |
"env": { | |
"browser": true, | |
"es6": true, | |
"react-native/react-native": true // In order to whitelist all browser-like globals | |
}, | |
"extends": [ | |
"eslint:recommended", | |
"plugin:@typescript-eslint/eslint-recommended", | |
"plugin:@typescript-eslint/recommended", |
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
import * as React from 'react'; | |
import { PropsWithChildren } from 'react'; | |
import { Platform, StyleSheet, View } from 'react-native'; | |
const CARD_RADIUS = 16; | |
const SHADOW = '#0000004D'; | |
export interface FixAndroidBehaviourProp { | |
// disable it if have issues with rendering without it and already have correct background color under your component | |
// (fixes this https://github.com/facebook/react-native/issues/15826) |
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
//... imports | |
class AddEditCardPresenterTest { | |
private lateinit var presenter: AddEditCardPresenter | |
private val view = mock<AddEditCardContract.View>() | |
private val repository = mock<VoyaRepository>() | |
private val scheduleProvider = ImmediateSchedulerProvider() | |
private val creditCardNumbers = mapOf( | |
CreditCardEnum.AMERICAN_EXPRESS to listOf("371449635398431", |
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
public class MyApplication extends Application { | |
private static final String TAG = "MyApplication"; | |
@Override | |
public void onCreate() { | |
if (BuildConfig.DEBUG) { | |
Log.w(TAG, "======================================================"); | |
Log.w(TAG, "======= APPLICATION IN STRICT MODE - DEBUGGING ======="); | |
Log.w(TAG, "======================================================"); |
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
subprojects { | |
project.configurations.all { | |
resolutionStrategy.eachDependency { details -> | |
if (details.requested.group == 'com.android.support' | |
&& !details.requested.name.contains('multidex') ) { | |
details.useVersion "26.1.0" | |
} | |
} | |
} | |
} |
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
interface RetrofitService { | |
companion object { | |
fun create(): DevGetVoilaService { | |
val clientBuilder = OkHttpClient.Builder().apply { | |
val loggingInterceptor = HttpLoggingInterceptor() | |
loggingInterceptor.level = HttpLoggingInterceptor.Level.BODY | |
addInterceptor(loggingInterceptor) | |
addInterceptor(AuthenticationInterceptor()) | |
addInterceptor(AuditInterceptor()) | |
} |
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
open class Repository private constructor( | |
remoteDataSource: DataSource, | |
localDataSource: DataSource) | |
: DataSource { | |
private val mRemoteDataSource = remoteDataSource | |
private val mLocalDataSource = localDataSource | |
companion object { | |
private var INSTANCE: Repository? = null |
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
open class RemoteDataSource private constructor() : DataSource { | |
private val service by lazy { | |
RetrofitService.create() | |
} | |
companion object { | |
private var INSTANCE: RemoteDataSource? = null |
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
open class LocalDataSource private constructor() : DataSource, AnkoLogger { | |
private val authorizeTokenAlias = "authorizeTokenAlias" | |
private val conversationIdAlias = "conversationIdAlias" | |
companion object { | |
private var INSTANCE: LocalDataSource? = null | |
fun getInstance(): LocalDataSource { | |
if (INSTANCE == null) { |
NewerOlder