Refine
This commit is contained in:
@@ -3,13 +3,13 @@ package be.mygod.vpnhotspot.widget
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.core.view.isGone
|
||||
|
||||
class AutoCollapseTextView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = android.R.attr.textViewStyle) :
|
||||
AppCompatTextView(context, attrs, defStyleAttr) {
|
||||
override fun onTextChanged(text: CharSequence?, start: Int, lengthBefore: Int, lengthAfter: Int) {
|
||||
super.onTextChanged(text, start, lengthBefore, lengthAfter)
|
||||
isVisible = !text.isNullOrEmpty()
|
||||
isGone = text.isNullOrEmpty()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user