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

Review Task 1 #10

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

Review Task 1 #10

wants to merge 1 commit into from

Conversation

fracz
Copy link
Owner

@fracz fracz commented Mar 17, 2020

Find as many defects and problems as possible!


private final String _lineOfCode;

// holds the line number

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

Comment on lines +53 to +60
lineNumberView = new TextView(getContext());
lineNumberView.setText(String.format("%d.", lineNumber););
lineNumberView.setSingleLine();
lineNumberView.setWidth(30);
addView(lineNumberView);

TextView lineContent = new TextView(getContext());
addLineContent(syntaxColor);

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;

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;

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

Comment on lines +67 to +72
/**
* Adds a text comment.
*
* @param comment
* @throws CommentNotAddedException
*/

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 {

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)

Comment on lines +97 to +98
// public void addVideoComment(File videoFile) throws CommentNotAddedException {
// }

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

Comment on lines +92 to +94
if (comments.size() > 0) {
lineNumberView.setBackgroundColor(Color.parseColor("#008000"));
}

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(){

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

Comment on lines +100 to +107
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);
}

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

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