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
plugins { | |
id 'jacoco' | |
} | |
jacocoTestReport { | |
reports { | |
xml.enabled true | |
} | |
} |
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
== Adb Server | |
adb kill-server | |
adb start-server | |
== Adb Reboot | |
adb reboot | |
adb reboot recovery | |
adb reboot-bootloader | |
== Shell |
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
/* | |
* Copyright (C) 2014 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
// status bar height | |
int statusBarHeight = 0; | |
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); | |
if (resourceId > 0) { | |
statusBarHeight = getResources().getDimensionPixelSize(resourceId); | |
} | |
// action bar height | |
int actionBarHeight = 0; | |
final TypedArray styledAttributes = getActivity().getTheme().obtainStyledAttributes( |
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
package cc.cubone.turbo.core.app; | |
import android.os.Bundle; | |
import android.support.v4.app.Fragment; | |
import android.view.View; | |
/** | |
* Fragment for handling view after it has been created and visible to user for the first time. | |
* | |
* <p>Specially in {@link android.support.v4.view.ViewPager}, the page will be created beforehand |
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
private fun getLocation(lastLocation: Task<Location>) { | |
lastLocation.addOnCompleteListener { task -> | |
if (task.isSuccessful) { | |
val data = workDataOf( | |
"latitude" to location.latitude, | |
"longitude" to location.longitude | |
) | |
future.set(Payload(Result.SUCCESS, data)) | |
} else { | |
future.setException(task.exception) |
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 LocationWorker( | |
context: Context, | |
params: WorkerParameters | |
) : ListenableWorker(context, params) { | |
private val future: ResolvableFuture<Payload> = ResolvableFuture.create() | |
override fun startWork(): ListenableFuture<Payload> { | |
if (hasLocationPermission()) { | |
getLocation(getFusedLocationProviderClient().lastLocation) |
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 LocationWorker( | |
context: Context, | |
params: WorkerParameters | |
) : ListenableWorker(context, params) { | |
override fun startWork(): ListenableFuture<Payload> { | |
TODO("not implemented") | |
} | |
} |
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
"substring" should include("str") | |
user.email should beLowerCase() | |
a + b shouldBe result |
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
infix fun String.shouldBeSame(other: String) = this == other | |
// calling the function using the infix notation | |
"bello" shouldBeSame "bello" | |
// is the same as | |
"hello".shouldBeSame("hello") |
NewerOlder