-
Notifications
You must be signed in to change notification settings - Fork 21
Students | Vadim Dyachkov #10
base: master
Are you sure you want to change the base?
Conversation
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.
Видно что есть опыт, это хорошо.
Общие замечания:
- Можно сохранить студента без имени и фамилии
|
||
private void init(Context context) { | ||
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); | ||
View view = inflater.inflate(R.layout.student_view, this, false); |
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.
Что бы не писать addView(view); можно третим аргументов поставить true
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.
fixed
@Override | ||
public void onClick(View v) { | ||
if (student != null) { | ||
student.setFirstName(firstNameTv.getText().toString()); |
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.
firstNameTv.getText() иногда возвращает null
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.
fixed
hideBtn.setOnClickListener(new OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
onHide.onClick(v); |
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.
Во всех лисенерах нет проверки на нул. Если не был установлен лисенер
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.
fixed
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class StudentsRepository { |
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.
Для данного задания такое решение подходит. Но в перспективе если с репозиторием будет работать не один поток будут проблемы
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<View |
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.
Зачем нужна эта полоса?
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.
"Разделитель" между списком и формой студента
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.
Ок
@otopba fixed |
@@ -60,33 +59,39 @@ private void init(Context context) { | |||
saveBtn.setOnClickListener(new OnClickListener() { | |||
@Override | |||
public void onClick(View v) { | |||
CharSequence firstName = firstNameTv.getText(); | |||
CharSequence secondName = secondNameTv.getText(); | |||
if (firstName == null || firstName.length() == 0 || secondName == null || secondName.length() == 0) { |
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.
Можно проверять с помощью TextUtils.isEmpty()
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<View |
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.
Ок
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.
Работа принята.
10 балов
No description provided.