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

Add prefixEnabled property to allow the prefix to be disabled #415

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

scottyab
Copy link
Contributor

@scottyab scottyab commented Feb 23, 2021

I ran in a weird bug with TokenCompleteTextView.onRestoreInstanceState() and so ended up not wanting to use the restored objects in onRestoreInstanceState (we have the state in our viewmodel. However the even though I'm not using the prefix the setPrefix() in onRestoreInstanceState() the would clear the tokens I had already set in the TokenCompleteTextView in my activities onCreate(). Specifically when it called setText().

To resolve I've added the prefixEnabled property. This allows callers to disable the prefix behaviour and solve the issue I was seeing. However, there maybe an alternate way to solve this that doesn't involve and extra property. Open to suggestions.

Also, apologies for the additional formatting changes it seems my code formatter got carried away. I can correct this if there's approval for this PR to the merged.

@@ -6,39 +6,22 @@
import android.graphics.Typeface;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.NonNull;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import androidx.annotation.NonNull;
import androidx.annotation.NonNull;

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

Successfully merging this pull request may close these issues.

2 participants