2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

Fixes #3527 - Set Collection name max length (#3531)

This commit is contained in:
vmbaicu 2019-06-24 23:58:04 +03:00 committed by Colin Lee
parent cfefc5632b
commit 021900e7ad

View File

@ -5,6 +5,7 @@ package org.mozilla.fenix.collections
file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import android.os.Handler
import android.text.InputFilter
import android.view.KeyEvent
import android.view.LayoutInflater
import android.view.View
@ -81,6 +82,7 @@ class CollectionCreationUIView(
increaseTapArea(increaseButtonByDps)
}
view.name_collection_edittext.filters += InputFilter.LengthFilter(COLLECTION_NAME_MAX_LENGTH)
view.name_collection_edittext.setOnEditorActionListener { v, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_DONE && v.text.toString().isNotBlank()) {
when (step) {
@ -349,5 +351,6 @@ class CollectionCreationUIView(
companion object {
private const val TRANSITION_DURATION = 200L
private const val increaseButtonByDps = 16
private const val COLLECTION_NAME_MAX_LENGTH = 128
}
}