コード例 #1
0
 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);
   }
 }
コード例 #2
0
 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");
   }
 }
コード例 #3
0
 private void refreshTextViewsFromService() {
   long remainingMilliseconds = this.getCountdownService().getRemainingMilliseconds();
   TimeParts timeParts = TimeParts.fromMillisRoundingUp(remainingMilliseconds);
   this.setTime(timeParts);
 }