private float drawDurationTime(Canvas paramCanvas, int paramInt) { if (this.mNode.nodeName.equalsIgnoreCase("program")) ; String str; switch (((ProgramNode) this.mNode).getCurrPlayStatus()) { default: str = ""; case 1: case 2: case 3: } while (true) { int i = drawDownloadState(paramCanvas, paramInt); this.mTimePaint.getTextBounds(str, 0, str.length(), this.textBound); paramCanvas.drawText( str, i - this.textBound.width() - this.otherInfoLayout.leftMargin, this.otherInfoLayout.topMargin + paramInt + (this.otherInfoLayout.height - this.textBound.height()) / 2, this.mTimePaint); return i - this.textBound.width() - this.otherInfoLayout.leftMargin; str = TimeUtil.msToDate3(((ProgramNode) this.mNode).getAbsoluteStartTime() * 1000L) + "-" + TimeUtil.msToDate3(((ProgramNode) this.mNode).getAbsoluteEndTime() * 1000L); continue; str = getDurationTime(((ProgramNode) this.mNode).getDuration()); } }
private void drawUpdateTime( Canvas paramCanvas, float paramFloat1, float paramFloat2, int paramInt) { String str; if (this.mNode.nodeName.equalsIgnoreCase("program")) if (((ProgramNode) this.mNode).channelType == 1) str = getUpdateTimeString((ProgramNode) this.mNode); while (true) if (str == null) { return; if (((ProgramNode) this.mNode).getCurrPlayStatus() == 3) str = TimeUtil.msToDate5(((ProgramNode) this.mNode).getAbsoluteStartTime() * 1000L); } else { str = TextUtils.ellipsize( str, this.mUpdateTimePaint, paramFloat2 - paramFloat1, TextUtils.TruncateAt.END) .toString(); this.mUpdateTimePaint.getTextBounds(str, 0, str.length(), this.textBound); paramCanvas.drawText( str, this.otherInfoLayout.leftMargin + paramFloat1, this.otherInfoLayout.topMargin + paramInt + (this.otherInfoLayout.height - this.textBound.height()), this.mUpdateTimePaint); return; str = null; } }
private String getUpdateTimeString(ProgramNode paramProgramNode) { long l = paramProgramNode.getUpdateTime(); if (this.mSameDay) { l = System.currentTimeMillis() - l; if (l <= 600000L) return "刚刚更新"; int i = (int) (l / 1000L / 3600L); if (i > 0) return String.format(Locale.CHINA, "%d小时前", new Object[] {Integer.valueOf(i)}); i = (int) (l / 1000L / 60L % 60L); if (i > 0) return String.format(Locale.CHINA, "%d分钟前", new Object[] {Integer.valueOf(i)}); return "刚刚更新"; } return TimeUtil.msToDate5(l); }