Instead of the verbose setOnClickListener
:
RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));
Observable
.just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
{"ads":"false","update":[{"version":"2.8.2000","title":"This app is now Open Source","description":"The App is available at github.com/gayankuruppu/android-vpn-client-ics-openvpn","size":"https://git.io/JeY69"}],"blocked":[{"id":0,"app":"com.android.game"},{"id":1,"app":"com.utorrent.client"},{"id":2,"app":"com.torrent.client"},{"id":3,"app":"com.tor.client"},{"id":4,"app":"com.insta.client"},{"id":5,"app":"com.facebook.client"},{"id":6,"app":"com.get.client"}],"free":[{"id":0,"file":0,"city":"73.239.44.11","country":"United States","image":"unitedstates","ip":"73.239.44.11","active":"true","signal":"a"},{"id":1,"file":1,"city":"172.119.125.80","country":"United States","image":"unitedstates","ip":"172.119.125.80","active":"true","signal":"a"},{"id":2,"file":2,"city":"198.27.183.33","country":"United States","image":"unitedstates","ip":"198.27.183.33","active":"true","signal":"a"},{"id":3,"file":3,"city":"80.246.28.38","country":"United States","image":"unitedstates","ip":"80.246.28.38","active":"true","signa |
{"ovpn_file":[{"id":0,"file":"dev tun proto udp remote 73.239.44.11 1442 cipher AES-128-CBC auth SHA1 resolv-retry infinite nobind persist-key persist-tun client verb 3 \u003cca\u003e -----BEGIN CERTIFICATE----- MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCB hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMTE5 MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgT EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR 6FSS0gpWsawNJN3Fz0RndJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8X pz3jsARh7v8Rl8f0hj4K+j5c+ZPmNHrZFGvnnLOFoIJ6dq9xkNfs/Q36nGz637CC 9BR++b7Epi9Pf5l/tfxnQ3K9DADWietrLNPtj5gcFKt+5eNu/Nio5JIk2kNrYrhV /erBvGy2i/MOjZrkm2xpmfh4SDBF1a3hDTxFYPwyllEnvGfDyi62a+pGx8cgoLEf Zd5ICLqkTqnyg0Y3hOvozIFIQ2dOciqb |
suspend fun downloadFile(url: String, | |
downloadFile: File, | |
downloadProgressFun: (bytesRead: Long, contentLength: Long, isDone: Boolean) -> Unit) { | |
async(CommonPool) { | |
val request = with(Request.Builder()) { | |
url(url) | |
}.build() | |
val client = with(OkHttpClient.Builder()) { | |
addNetworkInterceptor { chain -> |
/* | |
* Copyright (C) 2017 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 |
OkHttpClient.Builder okHttpClientBuilder = new OkHttpClient.Builder() | |
.cache(cache) | |
.addInterceptor(new RewriteRequestInterceptor()) | |
.addNetworkInterceptor(new RewriteResponseCacheControlInterceptor()) |
public class InstaModel { | |
public static final String CLIENT_ID = "31f1cc932c264e5da2711ad437753c78"; | |
public static final String CLIENT_SECRET = "3db8f5ff74474cadba35a6a2bf518b5d"; | |
public static final String CALLBACK_URL = "https://medium.com/@vutiendunguit"; | |
public static final String GRANT_TYPE = "authorization_code"; | |
public static final String AUTH_URL = "https://api.instagram.com/oauth/authorize/"; | |
public static final String TOKEN_URL = "https://api.instagram.com/oauth/access_token"; | |
public static final String API_URL = "https://api.instagram.com/v1"; |
import android.view.View | |
class TabControler : View.OnClickListener { | |
private var listener: OnCheckedChangeListener? = null | |
private val tabs = mutableListOf<View>() | |
private var lastSelected: Int = 0 | |
fun setTabs(firstSelected: Int, vararg views: View) { | |
tabs.clear() | |
for (i in views.indices) { |
100% — FF | |
99% — FC | |
98% — FA | |
97% — F7 | |
96% — F5 | |
95% — F2 | |
94% — F0 | |
93% — ED | |
92% — EB | |
91% — E8 |
import android.app.Activity; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.location.Location; | |
import android.os.Build; | |
import android.os.Bundle; | |
import android.provider.Settings; | |
import android.text.TextUtils; | |
import android.util.Log; |