Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

textVisiblePassword inputType #69

Open
adelpuva opened this issue Nov 28, 2019 · 0 comments
Open

textVisiblePassword inputType #69

adelpuva opened this issue Nov 28, 2019 · 0 comments

Comments

@adelpuva
Copy link

android:inputType="textVisiblePassword"

doesn't work, the characters remain hidden.I need them for a keyboard with characters and numbers.

I fixed it this way:

package com.mypackage

import android.content.Context
import android.util.AttributeSet

class PinEntryEditText : com.alimuzaffar.lib.pin.PinEntryEditText {
    constructor(context: Context?) : super(context)
    constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
    constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    )

    override fun setInputType(type: Int) {
        super.setInputType(type)
        setMask(null)
    }

}
    <com.mypackage.PinEntryEditText
        android:id="@+id/code"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:cursorVisible="false"
        android:layoutDirection="ltr"
        android:maxLength="10"
        android:textIsSelectable="false"
        app:pinBackgroundDrawable="@drawable/pin_code"
        app:pinCharacterSpacing="4dp"/>
class MyFragment : Fragment() {
       override fun onActivityCreated(state: Bundle?) {
             super.onActivityCreated(savedInstanceState)
             code.inputType = InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
      }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant