Exemplo n.º 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);
 }
Exemplo n.º 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) {
     }
   }
 }
Exemplo n.º 3
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   statsAggregator = ((MainActivity) getActivity()).getStatsAggregator();
   data = statsAggregator.getFilteredBuckets();
 }