You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.2 KiB

package com.community.pocket.ui.main.ui.info;
import android.content.Context;
import android.widget.TextView;
import androidx.annotation.LayoutRes;
import com.community.pocket.R;
import com.community.pocket.data.model.CreditScore;
import com.github.mikephil.charting.components.MarkerView;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.highlight.Highlight;
import java.util.List;
public class MyChartView extends MarkerView {
private TextView score;
private TextView notes;
private final List<CreditScore> creditScoreList;
public MyChartView(Context context, @LayoutRes int layoutResource, List<CreditScore> creditScoreList) {
super(context, layoutResource);
this.creditScoreList = creditScoreList;
score = findViewById(R.id.score);
notes = findViewById(R.id.notes);
}
@Override
public void refreshContent(Entry e, Highlight highlight) {
CreditScore creditScore = creditScoreList.get(((int) e.getX()) - 1);
score.setText(getContext().getString(R.string.change_score, creditScore.getScore()));
notes.setText(getContext().getString(R.string.score_notes, creditScore.getNotes()));
super.refreshContent(e, highlight);
}
}