-
Notifications
You must be signed in to change notification settings - Fork 101
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
Review Task 1 #10
base: master
Are you sure you want to change the base?
Review Task 1 #10
Conversation
|
||
private final String _lineOfCode; | ||
|
||
// holds the line number |
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.
useless komentarz, lepsza nazwa zmiennej wszystko załatwi
lineNumberView = new TextView(getContext()); | ||
lineNumberView.setText(String.format("%d.", lineNumber);); | ||
lineNumberView.setSingleLine(); | ||
lineNumberView.setWidth(30); | ||
addView(lineNumberView); | ||
|
||
TextView lineContent = new TextView(getContext()); | ||
addLineContent(syntaxColor); |
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.
żadnej logiki w konstruktorze, wydzieliłbym to do osobnych prywatnych metod
*/ | ||
@SuppressLint("ViewConstructor") | ||
public class Line extends LinearLayout implements Serializable { | ||
private static final long serialVersionUID = 3076583280108678995L; |
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.
zgodnie z konwencja const z duzych liter: SERIAL_VERSION_UID
import android.graphics.Typeface; | ||
import android.text.Html; | ||
import android.widget.LinearLayout; | ||
import android.widget.TextView; |
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.
Dodalbym spacje pomiedzy android a pl.fracz importami
/** | ||
* Adds a text comment. | ||
* | ||
* @param comment | ||
* @throws CommentNotAddedException | ||
*/ |
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.
Zbyteczny komentarz, nazwa i sygnatura metody wszystko tłumaczy
* @param recordedFile | ||
* @throws CommentNotAddedException | ||
*/ | ||
public void createVoiceComment(File recodedFile) throws CommentNotAddedException { |
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.
metoda powinna sie nazywac addVoiceComment, natomiast w jej srodku powinna sie znalezc metoda createVoiceComment(File recordedFile) (pierwsze 2 linijki)
// public void addVideoComment(File videoFile) throws CommentNotAddedException { | ||
// } |
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.
do usunięcia, nieużywane
if (comments.size() > 0) { | ||
lineNumberView.setBackgroundColor(Color.parseColor("#008000")); | ||
} |
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.
tak jak wyzej, po dodaniu komentarza size zawsze wiekszy od 0
addView(lineContent); | ||
} | ||
|
||
public List<Comment> getComments(){ |
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.
gettery i settery zebrałbym w jednym miejscu, a nie rozrzucone pomiędzy innymi metodami
private void addLineContent(boolean syntaxColor){ | ||
if (!syntaxColor || !SyntaxHighlighter.canBeHighlighted(syntaxColor)) | ||
lineContent.setText(Html.fromHtml(lineOfCode)); | ||
else | ||
lineContent.setText(SyntaxHighlighter.highlight(Html.fromHtml(lineOfCode))); | ||
lineContent.setTypeface(Typeface.MONOSPACE); | ||
addView(lineContent); | ||
} |
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.
metoda do rozdzielenia na w private metody
Find as many defects and problems as possible!