Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Commit

Permalink
UI: Fix some bug
Browse files Browse the repository at this point in the history
Signed-off-by: Fung Gwo <[email protected]>
  • Loading branch information
fython committed Feb 17, 2019
1 parent a24a01a commit dfbd462
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,15 @@ class Kuaidi100Package() : Parcelable {
}

fun getLastStatusTime(): Calendar {
if (data?.isNotEmpty() == true) {
val dates = data!!.map {
DateHelper.dateToCalendar(DEFAULT_STATUS_TIME_FORMAT.parse(it.ftime!!))
try {
if (data?.isNotEmpty() == true) {
val dates = data!!.map {
DateHelper.dateToCalendar(DEFAULT_STATUS_TIME_FORMAT.parse(it.ftime ?: it.time))
}
return dates.sorted().last()
}
return dates.sorted().last()
} catch (ignored: Exception) {

}
return Calendar.getInstance().apply { add(Calendar.YEAR, 1) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ class DetailsActivity : AbsActivity() {
}

override fun onPostExecute(items: Items) {
if (!this@DetailsActivity::data.isInitialized) {
return
}

mStatusBinder.setData(data)
mAdapter.items = items
mStatusBinder.showChiba =
Expand Down

0 comments on commit dfbd462

Please sign in to comment.