From 13324a773ded1bbcf8927064750a8b3ba4816c8a Mon Sep 17 00:00:00 2001 From: Vin <867015538@qq.com> Date: Fri, 15 May 2020 18:34:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=8E=86=E5=8F=B2=E4=BF=A1=E7=94=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/community/pocket/ui/main/ui/info/InfoFragment.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/community/pocket/ui/main/ui/info/InfoFragment.java b/app/src/main/java/com/community/pocket/ui/main/ui/info/InfoFragment.java index b152a89..b7e9ce3 100644 --- a/app/src/main/java/com/community/pocket/ui/main/ui/info/InfoFragment.java +++ b/app/src/main/java/com/community/pocket/ui/main/ui/info/InfoFragment.java @@ -256,6 +256,8 @@ public class InfoFragment extends BaseFragment { if (myInfo.getScoreHistory() != null && myInfo.getScoreHistory().size() >= MIN_HISTORY) { loadChart(myInfo.getScoreHistory()); + }else{ + Toast.makeText(getContext(),R.string.no_score_history,Toast.LENGTH_SHORT).show(); } } @@ -629,7 +631,10 @@ public class InfoFragment extends BaseFragment { xAxis.setValueFormatter(new ValueFormatter() { @Override public String getFormattedValue(float value) { - int index = (int) (value - 1); + int index = (int) (value); + if(index==values.size()){ + return ""; + } return formatUnix(values.get(index).getTime()); } });