-
Notifications
You must be signed in to change notification settings - Fork 16
#178. Kotlinify ReportActivity. #185
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.
Fast as a 🚀Few improvements and can me shipped.
app/src/main/java/com/blogspot/e_kanivets/moneytracker/activity/ReportActivity.kt
Outdated
Show resolved
Hide resolved
|
|
||
| private lateinit var shortSummaryPresenter: ShortSummaryPresenter | ||
|
|
||
| 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 simplified to override fun getContentViewId() = R.layout.activity_report.
|
|
||
| initSpinnerCurrency() | ||
|
|
||
| shortSummaryPresenter = ShortSummaryPresenter(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.
Probably can be moved to the place, where it's declared.
| val reportMaker = ReportMaker(rateController) | ||
| val report = reportMaker.getRecordReport(currency, period, recordList) | ||
|
|
||
| var adapter: ExpandableListReportAdapter? = 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.
All code below can be moved into if statement.
| private fun initSpinnerCurrency() { | ||
| val currencyList = currencyController.readAll() | ||
|
|
||
| spinnerCurrency.adapter = ArrayAdapter(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.
Strange line-break.
| update(spinnerCurrency.selectedItem.toString()) | ||
| } | ||
|
|
||
| override fun onNothingSelected(p0: AdapterView<*>?) { |
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.
|
|
||
| <android.support.v7.widget.AppCompatSpinner | ||
| android:id="@+id/spinner_currency" | ||
| android:id="@+id/spinnerCurrency" |
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.
👍
No description provided.