Fix build

This commit is contained in:
Tlaster 2020-02-06 15:58:34 +08:00
parent 3412eb6635
commit 4b137a8e2c
10 changed files with 20 additions and 16 deletions

View File

@ -237,6 +237,7 @@ dependencies {
implementation "com.github.mariotaku.RestFu:okhttp3:${libVersions['RestFu']}"
implementation "com.github.mariotaku.RestFu:logansquare:${libVersions['RestFu']}"
implementation "com.squareup.okhttp3:okhttp:${libVersions['OkHttp']}"
implementation("com.squareup.okio:okio:2.4.3")
implementation 'com.lnikkila:extendedtouchview:0.1.1'
implementation "com.google.dagger:dagger:${libVersions['Dagger']}"
implementation 'org.attoparser:attoparser:2.0.4.RELEASE'

View File

@ -18,6 +18,7 @@
-dontobfuscate
-dontwarn org.codehaus.mojo.animal_sniffer.*
-dontwarn com.squareup.haha.**
-dontwarn com.makeramen.roundedimageview.**
-dontwarn jnamed**

View File

@ -19,8 +19,8 @@
package androidx.core.view
fun WindowInsetsCompat(obj: Any) = WindowInsetsCompat.wrap(obj)
fun createWindowInsetsCompat(obj: Any) = WindowInsetsCompat(obj)
val WindowInsetsCompat.unwrapped: Any?
@Suppress("RestrictedApi")
get() = WindowInsetsCompat.unwrap(this)
get() = this.toWindowInsets()

View File

@ -53,7 +53,6 @@ import org.mariotaku.kpreferences.KPreferences
import org.mariotaku.kpreferences.get
import org.mariotaku.ktextension.activityLabel
import org.mariotaku.ktextension.getSystemWindowInsets
import org.mariotaku.ktextension.systemWindowInsets
import org.mariotaku.ktextension.unregisterReceiverSafe
import org.mariotaku.restfu.http.RestHttpClient
import org.mariotaku.twidere.BuildConfig
@ -204,7 +203,10 @@ open class BaseActivity : ChameleonActivity(), IBaseActivity<BaseActivity>, IThe
override fun onApplyWindowInsets(v: View, insets: WindowInsetsCompat): WindowInsetsCompat {
if (systemWindowsInsets == null) {
systemWindowsInsets = insets.systemWindowInsets
systemWindowsInsets = Rect(insets.systemWindowInsets.left,
insets.systemWindowInsets.top,
insets.systemWindowInsets.right,
insets.systemWindowInsets.bottom)
} else {
insets.getSystemWindowInsets(systemWindowsInsets!!)
}

View File

@ -23,7 +23,7 @@ import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.content.Context
import android.os.Build
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.createWindowInsetsCompat
import android.util.AttributeSet
import android.view.MotionEvent
import android.view.WindowInsets
@ -55,7 +55,7 @@ open class ExtendedFrameLayout(context: Context, attrs: AttributeSet? = null) :
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
override fun onApplyWindowInsets(insets: WindowInsets): WindowInsets {
onApplyWindowInsetsCompatListener?.onApplyWindowInsets(WindowInsetsCompat(insets))
onApplyWindowInsetsCompatListener?.onApplyWindowInsets(createWindowInsetsCompat(insets))
return super.onApplyWindowInsets(insets)
}

View File

@ -23,7 +23,7 @@ import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.content.Context
import android.os.Build
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.createWindowInsetsCompat
import androidx.appcompat.widget.AppCompatImageView
import android.util.AttributeSet
import android.view.MotionEvent
@ -64,7 +64,7 @@ class ExtendedImageView(context: Context, attrs: AttributeSet? = null) :
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
override fun onApplyWindowInsets(insets: WindowInsets): WindowInsets {
onApplyWindowInsetsCompatListener?.onApplyWindowInsets(WindowInsetsCompat(insets))
onApplyWindowInsetsCompatListener?.onApplyWindowInsets(createWindowInsetsCompat(insets))
return super.onApplyWindowInsets(insets)
}

View File

@ -23,7 +23,7 @@ import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.content.Context
import android.os.Build
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.createWindowInsetsCompat
import android.util.AttributeSet
import android.view.MotionEvent
import android.view.WindowInsets
@ -54,7 +54,7 @@ class ExtendedLinearLayout(context: Context, attrs: AttributeSet? = null) : Line
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
override fun onApplyWindowInsets(insets: WindowInsets): WindowInsets {
onApplyWindowInsetsCompatListener?.onApplyWindowInsets(WindowInsetsCompat(insets))
onApplyWindowInsetsCompatListener?.onApplyWindowInsets(createWindowInsetsCompat(insets))
return super.onApplyWindowInsets(insets)
}

View File

@ -26,7 +26,7 @@ import android.graphics.Rect
import android.graphics.drawable.Drawable
import android.os.Build
import androidx.annotation.DrawableRes
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.createWindowInsetsCompat
import android.util.AttributeSet
import android.view.MotionEvent
import android.view.WindowInsets
@ -109,7 +109,7 @@ open class ExtendedRelativeLayout(context: Context, attrs: AttributeSet? = null)
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
override fun onApplyWindowInsets(insets: WindowInsets): WindowInsets {
onApplyWindowInsetsCompatListener?.onApplyWindowInsets(WindowInsetsCompat(insets))
onApplyWindowInsetsCompatListener?.onApplyWindowInsets(createWindowInsetsCompat(insets))
return super.onApplyWindowInsets(insets)
}

View File

@ -23,7 +23,7 @@ import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.content.Context
import android.os.Build
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.createWindowInsetsCompat
import android.util.AttributeSet
import android.view.MotionEvent
import android.view.WindowInsets
@ -74,7 +74,7 @@ class ExtendedSwipeRefreshLayout(context: Context, attrs: AttributeSet? = null)
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
override fun onApplyWindowInsets(insets: WindowInsets): WindowInsets {
onApplyWindowInsetsCompatListener?.onApplyWindowInsets(WindowInsetsCompat(insets))
onApplyWindowInsetsCompatListener?.onApplyWindowInsets(createWindowInsetsCompat(insets))
return super.onApplyWindowInsets(insets)
}
}

View File

@ -23,7 +23,7 @@ import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.content.Context
import android.os.Build
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.createWindowInsetsCompat
import android.util.AttributeSet
import android.view.MotionEvent
import android.view.View
@ -81,7 +81,7 @@ class ProfileBannerImageView(context: Context, attrs: AttributeSet) :
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
override fun onApplyWindowInsets(insets: WindowInsets): WindowInsets {
onApplyWindowInsetsCompatListener?.onApplyWindowInsets(WindowInsetsCompat(insets))
onApplyWindowInsetsCompatListener?.onApplyWindowInsets(createWindowInsetsCompat(insets))
return super.onApplyWindowInsets(insets)
}
}