Example #1
0
 @OnClick(R.id.countUpButton)
 protected void OnCountUpClick(View view) {
   statsAggregator = ((MainActivity) getActivity()).getStatsAggregator();
   data = statsAggregator.newEvent();
   refreshPercent(votersEditText.getText().toString());
   bucketAdapter.notifyDataSetChanged();
   listView.smoothScrollToPosition(statsAggregator.getFilteredBuckets().size());
   view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
 }
Example #2
0
 private void refreshPercent(String votersText) {
   if (votersText != null && !votersText.isEmpty()) {
     try {
       float value = Integer.parseInt(votersText);
       String text = String.format("%.2f", 100 * statsAggregator.getEvents().size() / value) + "%";
       percentText.setText(text);
     } catch (Exception ignored) {
     }
   }
 }
Example #3
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   statsAggregator = ((MainActivity) getActivity()).getStatsAggregator();
   data = statsAggregator.getFilteredBuckets();
 }