package io.stanwood.bitrise
import android.annotation.SuppressLint
import android.content.pm.PackageManager
import android.support.v4.app.ActivityCompat
import android.support.v4.content.ContextCompat
import android.support.v7.app.AppCompatActivity
import kotlinx.coroutines.experimental.CancellableContinuation
import kotlinx.coroutines.experimental.suspendCancellableCoroutine
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
<uses-permission | |
android:name="android.permission.BLUETOOTH" | |
android:maxSdkVersion="30" /> | |
<uses-permission | |
android:name="android.permission.BLUETOOTH_ADMIN" | |
android:maxSdkVersion="30" /> | |
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" /> | |
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> | |
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> |
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
object ConfigGson { | |
fun getGson() = GsonBuilder().apply { | |
registerTypeAdapter(Launchable::class.java, InterfaceAdapter<Launchable>()) | |
registerTypeAdapter(Trigger::class.java, InterfaceAdapter<Trigger>()) | |
}.create() | |
} |
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 help // List all comands | |
== Adb Server | |
adb kill-server | |
adb start-server | |
== Adb Reboot | |
adb reboot | |
adb reboot recovery | |
adb reboot-bootloader |
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 hasInternetConnection(): Boolean { | |
val connectivityManager = getApplication<NewsApplication>().getSystemService( | |
Context.CONNECTIVITY_SERVICE | |
) as ConnectivityManager | |
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | |
val activeNetwork = connectivityManager.activeNetwork ?: return false | |
val capabilities = connectivityManager.getNetworkCapabilities(activeNetwork) ?: return false | |
return when { | |
capabilities.hasTransport(TRANSPORT_WIFI) -> true | |
capabilities.hasTransport(TRANSPORT_CELLULAR) -> 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
class NestedConverter { | |
companion object { | |
@TypeConverter | |
@JvmStatic //needed | |
fun stringToList(data: String?): List<NestedRepo> { | |
if (data == null) { | |
return emptyList() | |
} | |
val type = object : TypeToken<List<NestedRepo>>() {}.type |
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 com.github.shchurov.gitterclient.unit_tests.tests.* | |
import org.junit.runner.RunWith | |
import org.junit.runners.Suite | |
@RunWith(Suite::class) | |
@Suite.SuiteClasses( | |
GetRoomMessagesInteractorTest::class, | |
GetRoomsInteractorTest::class | |
class UnitTestsSuite |
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
<service | |
android:name="com.example.AuthenticatorService" | |
android:enabled="true" | |
android:exported="true"> | |
<intent-filter> | |
<action android:name="android.accounts.AccountAuthenticator" /> | |
</intent-filter> | |
<meta-data | |
android:name="android.accounts.AccountAuthenticator" |
NewerOlder