-
-
Notifications
You must be signed in to change notification settings - Fork 280
Add optional Word Count to Note #141
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 optional Word Count to Note #141
Conversation
- Setting included (default: deactived) - Translation for en/de refs SimpleMobileTools#40
|
nice, I will test the functionality a bit later. For now just add the new string in every strings file (even if obviously not translated), add an ID field to the new RelativeLayout at fragment_note and remove all comments, they arent necessary. Thanks |
trubitsyn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, left some comments.
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:textStyle="italic" | ||
| android:text="123" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could safely remove this unused attribute
app/src/main/res/values/strings.xml
Outdated
| <string name="place_cursor_end">Place cursor to the end of note</string> | ||
| <string name="monospaced_font">Use monospaced font</string> | ||
| <string name="show_keyboard">Show keyboard on startup</string> | ||
| <string name="show_wordcount">Show word counter</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe show_word_count would be better.
| val WIDGET_NOTE_ID = "widget_note_id" | ||
| val MONOSPACED_FONT = "monospaced_font" | ||
| val SHOW_KEYBOARD = "show_keyboard" | ||
| val SHOW_WORDCOUNT = "show_word_count" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe SHOW_WORD_COUNT would be better
| } | ||
|
|
||
| private fun setWordCounter(text: Editable) { | ||
| //Replace new lines with space |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess everyone can guess what's going on, no need to add a comment here.
|
|
||
| <RelativeLayout | ||
| android:layout_width="match_parent" | ||
| android:id="@+id/notes_relativelayout" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
notes_relative_layout would keep the code style unified
| android:layout_height="wrap_content" | ||
| android:textStyle="italic" | ||
| android:text="123" | ||
| android:text="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets make this: tools:text="123"
that way it will be shown in android studio, but wont be rendered in the app
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of setting this attribute? It is overwritten anyway. Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added tools:text, in case you missed it because I edited the file meanwhile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the purpose is just to see that view in the editor, in android studio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I get it now.
- changes string name to show_word_count - changed id of relative layout to notes_relative_layout refs SimpleMobileTools#141
|
@tibbi I think |
|
ye make it "word count" please, like the strings key name |
|
ye seems to be working nice, thanks. Ive just added a couple smaller improvements |
refs #40
What do you think? Did I miss anything?
Cheers,
Chris