private void hideUnusedTimeParts(TimeParts timeParts) { if (timeParts.getHours() == 0) { this.textViewHours.setVisibility(View.GONE); this.textViewColonHoursMinutes.setVisibility(View.GONE); } if (timeParts.getHours() == 0 && timeParts.getMinutes() == 0) { this.textViewMinutes.setVisibility(View.GONE); this.textViewColonMinutesSeconds.setVisibility(View.GONE); } }
private void onRefreshTick() { Log.d(TAG, "onRefreshTick()"); if (this.isServiceBound()) { long remainingMilliseconds = this.getCountdownService().getRemainingMilliseconds(); Log.v(TAG, "refresh tick - remainingMilliseconds: " + remainingMilliseconds); TimeParts timeParts = TimeParts.fromMillisRoundingUp(remainingMilliseconds); this.setTime(timeParts); if (this.showPieChart) { this.pieChart.setFraction( this.getCountdownService().getRemainingFractionRoundedUpToFullSeconds()); } } else { Log.w(TAG, "service not bound in onRefreshTick"); } }
private void refreshTextViewsFromService() { long remainingMilliseconds = this.getCountdownService().getRemainingMilliseconds(); TimeParts timeParts = TimeParts.fromMillisRoundingUp(remainingMilliseconds); this.setTime(timeParts); }