From c87ca5c3db38839d55b1c98f3a0da24365f83b98 Mon Sep 17 00:00:00 2001 From: wangyiqian Date: Sat, 10 Apr 2021 09:36:47 +0800 Subject: [PATCH] Fix bug of sample --- .../java/com/github/wangyiqian/stockchart/sample/Data.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/samples/src/main/java/com/github/wangyiqian/stockchart/sample/Data.kt b/samples/src/main/java/com/github/wangyiqian/stockchart/sample/Data.kt index a5e9c8e..53ea4e3 100644 --- a/samples/src/main/java/com/github/wangyiqian/stockchart/sample/Data.kt +++ b/samples/src/main/java/com/github/wangyiqian/stockchart/sample/Data.kt @@ -47,6 +47,7 @@ object Data { if (page > 2 || page < 0) { callback.invoke(listOf()) + return } loadData(context, "mock_data_day_page_$page.txt", callback) @@ -78,6 +79,7 @@ object Data { fun loadWeekData(context: Context, page: Int, callback: (List) -> Unit) { if (page > 1 || page < 0) { callback.invoke(listOf()) + return } loadData(context, "mock_data_week_page_$page.txt", callback) @@ -86,6 +88,7 @@ object Data { fun loadMonthData(context: Context, page: Int, callback: (List) -> Unit) { if (page > 0 || page < 0) { callback.invoke(listOf()) + return } loadData(context, "mock_data_month_page_$page.txt", callback) @@ -128,6 +131,7 @@ object Data { fun loadOneMinuteData(context: Context, page: Int, callback: (List) -> Unit) { if (page > 4 || page < 0) { callback.invoke(listOf()) + return } loadData(context, "mock_data_one_minute_page_$page.txt", callback) @@ -136,6 +140,7 @@ object Data { fun loadFiveMinutesData(context: Context, page: Int, callback: (List) -> Unit) { if (page > 3 || page < 0) { callback.invoke(listOf()) + return } loadData(context, "mock_data_five_minutes_page_$page.txt", callback) @@ -144,6 +149,7 @@ object Data { fun loadSixtyMinutesData(context: Context, page: Int, callback: (List) -> Unit) { if (page > 3 || page < 0) { callback.invoke(listOf()) + return } loadData(context, "mock_data_sixty_minutes_page_$page.txt", callback)