This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.text.InputFilter | |
import android.text.Spanned | |
class NewlineLimitingInputFilter(val maxLines: Int) : InputFilter { | |
var monitor: LimitMonitor? = null | |
var numNewlines = 0 | |
override fun filter(source: CharSequence, start: Int, end: Int, dest: Spanned, dstart: Int, dend: Int): CharSequence? { | |
// subtract all newlines in dest range | |
for (char in dest.subSequence(dstart, dend)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import android.support.annotation.IntegerRes | |
import android.util.Log | |
import android.view.* | |
import android.widget.BaseAdapter | |
import android.widget.TextView | |
class IntRangeAdapter(val context: Context, | |
@IntegerRes var resource: Int, |