This commit is contained in:
machiav3lli
2021-10-24 17:02:29 +02:00
parent 132ae9b77d
commit 2dc3d8fae4
4 changed files with 2 additions and 62 deletions

View File

@@ -1,26 +0,0 @@
package com.looker.droidify.widget
import android.content.Context
import android.util.AttributeSet
import android.widget.LinearLayout
class FragmentLinearLayout : LinearLayout {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
init {
fitsSystemWindows = true
}
@Suppress("unused")
var percentTranslationY: Float
get() = height.let { if (it > 0) translationY / it else 0f }
set(value) {
translationY = value * height
}
}

View File

@@ -1,33 +0,0 @@
package com.looker.droidify.widget
import android.content.Context
import android.util.AttributeSet
import androidx.appcompat.widget.Toolbar
class Toolbar : Toolbar {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
private var initalized = false
private var layoutDirectionChanged: Int? = null
init {
initalized = true
val layoutDirection = layoutDirectionChanged
layoutDirectionChanged = null
if (layoutDirection != null) onRtlPropertiesChanged(layoutDirection)
}
override fun onRtlPropertiesChanged(layoutDirection: Int) {
if (initalized) {
super.onRtlPropertiesChanged(layoutDirection)
} else {
layoutDirectionChanged = layoutDirection
}
}
}