Fix many compilation warnings

This commit is contained in:
inorichi
2017-10-28 19:12:17 +02:00
parent 827792c4f0
commit 4ae00c80ca
21 changed files with 43 additions and 41 deletions

View File

@@ -10,15 +10,16 @@ abstract class FABAnimationBase : FloatingActionButton.Behavior() {
var isAnimatingOut = false
override fun onStartNestedScroll(coordinatorLayout: CoordinatorLayout, child: FloatingActionButton,
directTargetChild: View, target: View, nestedScrollAxes: Int): Boolean {
directTargetChild: View, target: View, axes: Int, type: Int): Boolean {
// Ensure we react to vertical scrolling
return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL ||
super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, nestedScrollAxes)
return axes == ViewCompat.SCROLL_AXIS_VERTICAL ||
super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, axes, type)
}
override fun onNestedScroll(coordinatorLayout: CoordinatorLayout, child: FloatingActionButton, target: View,
dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int) {
super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed)
override fun onNestedScroll(coordinatorLayout: CoordinatorLayout, child: FloatingActionButton,
target: View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int,
dyUnconsumed: Int, type: Int) {
super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, type)
if (dyConsumed > 0 && !isAnimatingOut && child.visibility == View.VISIBLE) {
// User scrolled down and the FAB is currently visible -> hide the FAB
animateOut(child)

View File

@@ -9,6 +9,7 @@ import android.view.animation.Animation
import android.view.animation.AnimationUtils
import eu.kanade.tachiyomi.R
@Suppress("unused", "UNUSED_PARAMETER")
class FABAnimationUpDown @JvmOverloads constructor(ctx: Context, attrs: AttributeSet? = null) : FABAnimationBase() {
private val INTERPOLATOR = FastOutSlowInInterpolator()

View File

@@ -48,6 +48,7 @@ open class SimpleNavigationView @JvmOverloads constructor(
R.styleable.NavigationView_elevation, 0).toFloat())
}
@Suppress("DEPRECATION")
ViewCompat.setFitsSystemWindows(this,
a.getBoolean(R.styleable.NavigationView_android_fitsSystemWindows, false))
@@ -61,6 +62,7 @@ open class SimpleNavigationView @JvmOverloads constructor(
/**
* Overriden to measure the width of the navigation view.
*/
@SuppressLint("SwitchIntDef")
override fun onMeasure(widthSpec: Int, heightSpec: Int) {
val width = when (MeasureSpec.getMode(widthSpec)) {
MeasureSpec.AT_MOST -> MeasureSpec.makeMeasureSpec(

View File

@@ -31,14 +31,14 @@ abstract class LoginDialogPreference(bundle: Bundle? = null) : DialogController(
.negativeText(android.R.string.cancel)
.build()
onViewCreated(dialog.view, savedState)
onViewCreated(dialog.view)
return dialog
}
fun onViewCreated(view: View, savedState: Bundle?) {
fun onViewCreated(view: View) {
v = view.apply {
show_password.setOnCheckedChangeListener { v, isChecked ->
show_password.setOnCheckedChangeListener { _, isChecked ->
if (isChecked)
password.transformationMethod = null
else