Added global preferences object

This commit is contained in:
tom5079
2020-08-30 19:52:51 +09:00
parent fdd9b02388
commit 7ca4418a50
23 changed files with 157 additions and 248 deletions

View File

@@ -19,6 +19,7 @@
package xyz.quaver.pupil.util
import android.annotation.SuppressLint
import okhttp3.OkHttpClient
import java.util.*
import kotlin.collections.ArrayList
@@ -59,4 +60,11 @@ fun byteToString(byte: Long, precision : Int = 1) : String {
*
* https://stackoverflow.com/questions/38072322/generate-16-bit-unique-ids-in-android-for-startactivityforresult
*/
fun Int.normalizeID() = this.and(0xFFFF)
fun Int.normalizeID() = this.and(0xFFFF)
fun OkHttpClient.Builder.proxyInfo(proxyInfo: ProxyInfo) = this.apply {
proxy(proxyInfo.proxy())
proxyInfo.authenticator()?.let {
proxyAuthenticator(it)
}
}