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
getTranslateXY(obj) { | |
const transArr = []; | |
if (window.getComputedStyle) { | |
const style = getComputedStyle(obj); | |
const transform = style.transform || style.webkitTransform || style.mozTransform; | |
let mat = transform.match(/^matrix3d\((.+)\)$/); | |
if (mat) return parseFloat(mat[1].split(', ')[13]); | |
mat = transform.match(/^matrix\((.+)\)$/); | |
if (mat) { |
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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="com.example.diegosantos.constraintlayoutexample.MainActivity"> | |
<View | |
android:id="@+id/leftLine" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:gravity="center" | |
android:orientation="vertical"> | |
<LinearLayout | |
android:layout_width="wrap_content" |
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 Activity { | |
val permissionManager: PermissionManager | |
fun selectImage() { | |
if (permissionManager.isStoragePermissionGranted(this)) { | |
getImage() | |
} else { | |
askPermission() | |
} | |
} |
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
@Before | |
fun setUpTest() { | |
loadKoinModules(listOf(module { | |
single { mockRepository } | |
})) | |
} |
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
@Mock | |
lateinit var mockRepository: Repository |
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
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.10.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
testCompile group: 'org.mockito', name: 'mockito-inline', version: '2.23.3' |
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
@Before | |
fun setUpTest() { | |
MockitoAnnotations.initMocks(this) | |
} | |
@Test | |
fun test() { | |
Mockito.`when`(mockRepository.getList(anyInt(),anyString())).thenReturn(expectedValue) | |
presenter.loadList() | |
verify(mockView, times(1)).showLoading() |
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
testImplementation 'com.squareup.okhttp3:mockwebserver:(insert latest version)' |
OlderNewer