Commit 238f2540 by sikang

bug fix

parent 24b73646
...@@ -166,7 +166,8 @@ public class StringFormat { ...@@ -166,7 +166,8 @@ public class StringFormat {
* 格式化时间 * 格式化时间
*/ */
public static String convertTime(String srcTime, String formatStyle) { public static String convertTime(String srcTime, String formatStyle) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String format = srcTime.contains("T") ? "yyyy-MM-dd'T'HH:mm:ss'Z'" : "yyyy-MM-dd HH:mm:ss";
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT00:00")); simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT00:00"));
SimpleDateFormat simpleDateFormatLocal = new SimpleDateFormat(formatStyle); SimpleDateFormat simpleDateFormatLocal = new SimpleDateFormat(formatStyle);
simpleDateFormatLocal.setTimeZone(TimeZone.getDefault()); simpleDateFormatLocal.setTimeZone(TimeZone.getDefault());
......
...@@ -40,8 +40,7 @@ public class QMUIHelper { ...@@ -40,8 +40,7 @@ public class QMUIHelper {
* 重新设置topbarimagebutton的图片尺寸 * 重新设置topbarimagebutton的图片尺寸
* 当没有合适尺寸的图片使用时,将图片强制缩放到适合的尺寸 * 当没有合适尺寸的图片使用时,将图片强制缩放到适合的尺寸
*/ */
public static ImageButton resizeTopbarBtn(ImageButton imageButton) { public static ImageButton resizeTopbarBtn(ImageButton imageButton,int width,int height) {
int width = StringFormat.dpToPx(imageButton.getContext(), 17f);
Bitmap bmp = BitmapUtils.drawableToBmp(imageButton.getDrawable()); Bitmap bmp = BitmapUtils.drawableToBmp(imageButton.getDrawable());
imageButton.setImageBitmap(BitmapUtils.scaleBitmap(bmp, width, width)); imageButton.setImageBitmap(BitmapUtils.scaleBitmap(bmp, width, width));
imageButton.setScaleType(ImageView.ScaleType.CENTER_INSIDE); imageButton.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
...@@ -183,7 +182,7 @@ public class QMUIHelper { ...@@ -183,7 +182,7 @@ public class QMUIHelper {
@Override @Override
public void initTopBar(TopBar topBar, Activity activity) { public void initTopBar(TopBar topBar, Activity activity) {
topBar.toolBar().addLeftBackImageButton().setOnClickListener(v -> UIHelper.doBack());
} }
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment