Commit 044fb23d authored by Mygod's avatar Mygod

Update dependencies

parent e6b511f2
......@@ -56,7 +56,7 @@ dependencies {
api "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion"
api 'androidx.preference:preference:1.1.0-beta01'
api "androidx.room:room-runtime:$roomVersion"
api 'androidx.work:work-runtime-ktx:2.1.0-beta01'
api 'androidx.work:work-runtime-ktx:2.1.0-beta02'
api 'com.crashlytics.sdk.android:crashlytics:2.10.1'
api 'com.google.code.gson:gson:2.8.5'
api 'com.google.firebase:firebase-config:18.0.0'
......
......@@ -27,7 +27,7 @@ import java.util.*
class PluginConfiguration(val pluginsOptions: Map<String, PluginOptions>, val selected: String) {
private constructor(plugins: List<PluginOptions>) : this(
plugins.filter { it.id.isNotEmpty() }.associate { it.id to it },
plugins.filter { it.id.isNotEmpty() }.associateBy { it.id },
if (plugins.isEmpty()) "" else plugins[0].id)
constructor(plugin: String) : this(plugin.split('\n').map { line ->
if (line.startsWith("kcptun ")) {
......
......@@ -108,7 +108,7 @@ object PluginManager {
if (cachedPlugins == null) {
val pm = app.packageManager
cachedPlugins = (pm.queryIntentContentProviders(Intent(PluginContract.ACTION_NATIVE_PLUGIN),
PackageManager.GET_META_DATA).map { NativePlugin(it) } + NoPlugin).associate { it.id to it }
PackageManager.GET_META_DATA).map { NativePlugin(it) } + NoPlugin).associateBy { it.id }
}
cachedPlugins!!
}
......
......@@ -22,7 +22,6 @@ package com.github.shadowsocks.utils
import android.content.ClipData
import androidx.recyclerview.widget.SortedList
import org.json.JSONArray
private sealed class ArrayIterator<out T> : Iterator<T> {
abstract val size: Int
......@@ -38,12 +37,6 @@ private class ClipDataIterator(private val data: ClipData) : ArrayIterator<ClipD
}
fun ClipData.asIterable() = Iterable { ClipDataIterator(this) }
private class JSONArrayIterator(private val arr: JSONArray) : ArrayIterator<Any>() {
override val size get() = arr.length()
override fun get(index: Int) = arr.get(index)
}
fun JSONArray.asIterable() = Iterable { JSONArrayIterator(this) }
private class SortedListIterator<out T>(private val list: SortedList<T>) : ArrayIterator<T>() {
override val size get() = list.size()
override fun get(index: Int) = list[index]
......
......@@ -14,6 +14,14 @@
}
},
"oauth_client": [
{
"client_id": "261400168171-pcgrp7aprh210vvfc6vut3am2n3chopq.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.github.shadowsocks",
"certificate_hash": "7309a97ff2680788113c6d0ce53898b911885ff5"
}
},
{
"client_id": "261400168171-sfik8o3pj7e243583olorh7s5974vab1.apps.googleusercontent.com",
"client_type": 1,
......@@ -33,15 +41,43 @@
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
"other_platform_oauth_client": [
{
"client_id": "261400168171-g7aelv5bu012ojr7dod7lq09c9anjimh.apps.googleusercontent.com",
"client_type": 3
}
]
}
},
"admob_app_id": "ca-app-pub-9097031975646651~3330146721"
},
{
"client_info": {
"mobilesdk_app_id": "1:261400168171:android:0dbac07695d93817",
"android_client_info": {
"package_name": "com.github.shadowsocks.tv"
}
},
"ads_service": {
"status": 2
"oauth_client": [
{
"client_id": "261400168171-g7aelv5bu012ojr7dod7lq09c9anjimh.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCee3fAad7nb3YsxeUO9mqqHFfAvsSCbVs"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "261400168171-g7aelv5bu012ojr7dod7lq09c9anjimh.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
......
......@@ -35,6 +35,7 @@ import com.github.shadowsocks.R
import com.github.shadowsocks.bg.BaseService
import com.github.shadowsocks.net.HttpsTest
import com.google.android.material.bottomappbar.BottomAppBar
import kotlin.math.abs
class StatsBar @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null,
defStyleAttr: Int = R.attr.bottomAppBarStyle) :
......@@ -53,8 +54,8 @@ class StatsBar @JvmOverloads constructor(context: Context, attrs: AttributeSet?
dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int,
type: Int, consumed: IntArray) {
val dy = dyConsumed + dyUnconsumed
super.onNestedScroll(coordinatorLayout, child, target, dxConsumed,
if (Math.abs(dy) >= threshold) dy else 0, dxUnconsumed, 0, type, consumed)
super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, if (abs(dy) >= threshold) dy else 0,
dxUnconsumed, 0, type, consumed)
}
}
return behavior
......
<?xml version="1.0" encoding="utf-8"?>
<!--
Source: https://github.com/material-components/material-components-android/blob/79239aab18b85cc3a6a9de98d797b97a96d59bbc/lib/java/com/google/android/material/button/res/color/mtrl_text_btn_text_color_selector.xml
Source: https://github.com/material-components/material-components-android/blob/2de39fafe0285aab7e6e101549c4bc93f184a7e5/lib/java/com/google/android/material/button/res/color/mtrl_text_btn_text_color_selector.xml
Copyright 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.
......@@ -14,6 +14,8 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/color_primary_text" android:state_enabled="true"/>
<item android:alpha="1.00" android:color="@color/color_primary_text" android:state_checkable="true" android:state_checked="true" android:state_enabled="true"/>
<item android:alpha="0.60" android:color="?attr/colorOnSurface" android:state_checkable="true" android:state_checked="false" android:state_enabled="true"/>
<item android:alpha="1.00" android:color="@color/color_primary_text" android:state_enabled="true"/>
<item android:alpha="0.38" android:color="?attr/colorOnSurface"/>
</selector>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment