(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /* | |
| * Copyright 2014 Chris Banes | |
| * | |
| * 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 |
| import java.io.IOException; | |
| import okhttp3.HttpUrl; | |
| import okhttp3.Interceptor; | |
| import okhttp3.OkHttpClient; | |
| import okhttp3.Request; | |
| /** An interceptor that allows runtime changes to the URL hostname. */ | |
| public final class HostSelectionInterceptor implements Interceptor { | |
| private volatile String host; |
| /* | |
| * 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 |
| /** | |
| _____ _____ _ | |
| | __ \ / ____| | | | |
| | | | | ___| | _ __ _ _ _ __ | |_ ___ _ __ | |
| | | | |/ _ \ | | '__| | | | '_ \| __/ _ \| '__| | |
| | |__| | __/ |____| | | |_| | |_) | || (_) | | | |
| |_____/ \___|\_____|_| \__, | .__/ \__\___/|_| | |
| __/ | | | |
| |___/|_| | |
| */ |
| package br.com.nglauber.jetpackcomposeplayground.screens | |
| import androidx.compose.foundation.background | |
| import androidx.compose.foundation.layout.* | |
| import androidx.compose.foundation.lazy.LazyColumn | |
| import androidx.compose.foundation.lazy.LazyRow | |
| import androidx.compose.foundation.lazy.items | |
| import androidx.compose.foundation.shape.RoundedCornerShape | |
| import androidx.compose.material.MaterialTheme | |
| import androidx.compose.material.Text |
| extension Date { | |
| static func ISOStringFromDate(date: Date) -> String { | |
| let dateFormatter = DateFormatter() | |
| dateFormatter.locale = Locale(identifier: "en_US_POSIX") | |
| dateFormatter.timeZone = TimeZone(abbreviation: "GMT") | |
| dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS" | |
| return dateFormatter.string(from: date).appending("Z") | |
| } | |
| /* | |
| * Copyright (C) 2012 Sebastian Kaspari | |
| * | |
| * 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 |
| <?xml version="1.0" encoding="utf-8"?> | |
| <android.support.v7.widget.SwitchCompat xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:id="@android:id/checkbox" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:background="@null" | |
| android:clickable="false" | |
| android:focusable="false" /> |