Skip to content

Commit

Permalink
Fix bug of sample
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyiqian committed Apr 10, 2021
1 parent d758873 commit c87ca5c
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ object Data {

if (page > 2 || page < 0) {
callback.invoke(listOf())
return
}

loadData(context, "mock_data_day_page_$page.txt", callback)
Expand Down Expand Up @@ -78,6 +79,7 @@ object Data {
fun loadWeekData(context: Context, page: Int, callback: (List<IKEntity>) -> Unit) {
if (page > 1 || page < 0) {
callback.invoke(listOf())
return
}

loadData(context, "mock_data_week_page_$page.txt", callback)
Expand All @@ -86,6 +88,7 @@ object Data {
fun loadMonthData(context: Context, page: Int, callback: (List<IKEntity>) -> Unit) {
if (page > 0 || page < 0) {
callback.invoke(listOf())
return
}

loadData(context, "mock_data_month_page_$page.txt", callback)
Expand Down Expand Up @@ -128,6 +131,7 @@ object Data {
fun loadOneMinuteData(context: Context, page: Int, callback: (List<IKEntity>) -> Unit) {
if (page > 4 || page < 0) {
callback.invoke(listOf())
return
}

loadData(context, "mock_data_one_minute_page_$page.txt", callback)
Expand All @@ -136,6 +140,7 @@ object Data {
fun loadFiveMinutesData(context: Context, page: Int, callback: (List<IKEntity>) -> Unit) {
if (page > 3 || page < 0) {
callback.invoke(listOf())
return
}

loadData(context, "mock_data_five_minutes_page_$page.txt", callback)
Expand All @@ -144,6 +149,7 @@ object Data {
fun loadSixtyMinutesData(context: Context, page: Int, callback: (List<IKEntity>) -> Unit) {
if (page > 3 || page < 0) {
callback.invoke(listOf())
return
}

loadData(context, "mock_data_sixty_minutes_page_$page.txt", callback)
Expand Down

0 comments on commit c87ca5c

Please sign in to comment.