-
Notifications
You must be signed in to change notification settings - Fork 15
Conversation
yev-kanivets
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.
Very well 👍 Fix the code style comments and merge it.
| import java.util.* | ||
| import javax.inject.Inject | ||
|
|
||
| /** |
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.
Remove this comment, please :)
| private lateinit var uiDecorator: AddRecordUiDecorator | ||
| private lateinit var autoCompleter: CategoryAutoCompleter | ||
|
|
||
| override fun getContentViewId(): Int { |
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.
Can be one-lined.
| super.initData() | ||
| appComponent.inject(this) | ||
|
|
||
| uiDecorator = AddRecordUiDecorator(this) |
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.
Can it be moved to initViews? It will allow to have all lateinit properties in one place.
| if (mode == Mode.MODE_EDIT) { | ||
| record?.let { record -> | ||
| etTitle.setText(record.title) | ||
| if (record.category != null) etCategory.setText(record.category?.name.orEmpty()) |
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.
Just etCategory.setText(record.category?.name.orEmpty()) may work.
| uiDecorator.decorateActionBar(supportActionBar, mode, type) | ||
| presentSpinnerAccount() | ||
|
|
||
| val categoryAutoCompleteAdapter = CategoryAutoCompleteAdapter( |
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.
This block can be extracted as initCategoryAutocomplete.
| tvTime.text = formatController.formatTime(timestamp) | ||
| } | ||
|
|
||
| enum class Mode { |
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.
One-line.
|
|
||
| @Override | ||
| public View getView(int position, View convertView, ViewGroup parent) { | ||
| public View getView(int position, View convertView, @NotNull ViewGroup parent) { |
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.
👍
| return convertView; | ||
| } | ||
|
|
||
| @Override |
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.
👍
| List<String> tempList; | ||
|
|
||
| if (constraint != null) tempList = autoCompleter.completeByPart(constraint.toString()); | ||
| if (constraint != 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.
One-line if possible.
| */ | ||
| public class CategoryAutoCompleteAdapter extends ArrayAdapter<String> implements Filterable { | ||
| private final CategoryAutoCompleter autoCompleter; | ||
| private List<String> resultList; |
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 refacto 👍
No description provided.