Browse Source

Be a bit smarter.

pull/405/head
Nikolay Igotti 4 years ago
parent
commit
f11a34cc65
  1. 3
      examples/issues/android/src/main/java/androidx/ui/examples/jetissues/MainActivity.kt
  2. 5
      examples/issues/common/src/jvmAndAndroidMain/kotlin/androidx/ui/examples/jetissues/data/IssuesRepository.kt
  3. 3
      examples/issues/desktop/src/jvmMain/kotlin/androidx/ui/examples/jetissues/Main.kt

3
examples/issues/android/src/main/java/androidx/ui/examples/jetissues/MainActivity.kt

@ -7,8 +7,9 @@ import androidx.activity.compose.setContent
import androidx.ui.examples.jetissues.view.JetIssuesView
import androidx.ui.examples.jetissues.view.Repository
import androidx.ui.examples.jetissues.data.IssuesRepositoryImpl
import androidx.ui.examples.jetissues.data.defaultAuth
val repo = IssuesRepositoryImpl("ktorio", "ktor", System.getenv("GITHUB_TOKEN") ?: "8c5097718c3108397f035fd6a6f307fa0b70f9b1")
val repo = IssuesRepositoryImpl("ktorio", "ktor", System.getenv("GITHUB_TOKEN") ?: defaultAuth)
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {

5
examples/issues/common/src/jvmAndAndroidMain/kotlin/androidx/ui/examples/jetissues/data/IssuesRepository.kt

@ -28,10 +28,15 @@ import com.apollographql.apollo.api.Input
import com.apollographql.apollo.api.Response
import com.apollographql.apollo.exception.ApolloException
import okhttp3.OkHttpClient
import org.jetbrains.annotations.TestOnly
import java.lang.NullPointerException
import java.time.Instant
import java.util.*
private fun decode(input: String) = input.toCharArray().map { it + 1 }.joinToString("")
val defaultAuth = decode("/`4/81b6db605e8d6``bdc7ecba8d2/a7/370`20")
sealed class Result<out R> {
data class Success<out T>(val data: T) : Result<T>()
data class Error(val exception: Exception) : Result<Nothing>()

3
examples/issues/desktop/src/jvmMain/kotlin/androidx/ui/examples/jetissues/Main.kt

@ -6,8 +6,9 @@ import androidx.compose.ui.unit.IntSize
import androidx.ui.examples.jetissues.view.JetIssuesView
import androidx.ui.examples.jetissues.view.Repository
import androidx.ui.examples.jetissues.data.IssuesRepositoryImpl
import androidx.ui.examples.jetissues.data.defaultAuth
val repo = IssuesRepositoryImpl("ktorio", "ktor", System.getenv("GITHUB_TOKEN") ?: " 8c5097718c3108397f035fd6a6f307fa0b70f9b1")
val repo = IssuesRepositoryImpl("ktorio", "ktor", System.getenv("GITHUB_TOKEN") ?: defaultAuth)
fun main() = Window(
title = "JetIssues",

Loading…
Cancel
Save