public void setData(int positiveCount, int negativeCount, int totalWords) { positive.setPercentage(calcPercentage(positiveCount, positiveCount + negativeCount)); negative.setPercentage(calcPercentage(negativeCount, positiveCount + negativeCount)); moodInfo.setText( String.format( getResources().getString(R.string.mood_blurb), positiveCount, negativeCount, totalWords)); }
public void init() { super.init(); positive = (MoodType) findViewById(R.id.positive_mood); positive.setIcon(R.drawable.ic_positive); positive.setIconTint("#00E676"); negative = (MoodType) findViewById(R.id.negative_mood); negative.setIcon(R.drawable.ic_negative); negative.setIconTint("#F44336"); moodInfo = (TextView) findViewById(R.id.mood_blurb); }