加圆角,Drawable,Bitmap,BitmapDrawable,字节数组之间的相互转换。
public class TimeUtil {public static String converTime(long timestamp){long currentSeconds = System.currentTimeMillis()/1000;long timeGap = currentSeconds-timestamp;//与现在时间相差秒数String timeStr = null;if(timeGap>24*60*60){//1天以上timeStr = timeGap/(24*60*60)+"天前";}else if(timeGap>60*60){//1小时-24小时timeStr = timeGap/(60*60)+"小时前";}else if(timeGap>60){//1分钟-59分钟timeStr = timeGap/60+"分钟前";}else{//1秒钟-59秒钟timeStr = "刚刚";}return timeStr;}public static String getStandardTime(long timestamp){SimpleDateFormat sdf = new SimpleDateFormat("MM月dd日 HH:mm");Date date = new Date(timestamp*1000);sdf.format(date);return sdf.format(date);}}