Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Fixes #3527 - Set Collection name max length (#3531)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmbaicu authored and colintheshots committed Jun 24, 2019
1 parent cfefc56 commit 021900e
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
}
}

0 comments on commit 021900e

Please sign in to comment.