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

readonly mode #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

readonly mode #68

wants to merge 1 commit into from

Conversation

m-thielen
Copy link

This PR adds a readonly mode to display items in its current state while preventing accidental edits.
The changes are quite a lot due to the fact that Android's EditText does not have a decent readonly state. Therefore, in readonly mode the code hides the EditText and displays a TextView instead.
Since EditText widgets are also used by DatePicker and TimePicker, I created a TextController class which all controllers using EditText inherit from. Maybe the select controllers should use it, too.

@dkharrat
Copy link
Owner

Thanks for your contribution! This feature is useful.

I was wondering why you chose to implement it this way as opposed to the other possible approaches, such as using editText.setInputType.

@m-thielen
Copy link
Author

Setting the input type (and all other approaches mentioned in this SO thread) all have at least one drawback: the underline of the EditText is still there - to me, this implies the field is editable.

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