scwang90 / SmartRefreshLayout

🔥下拉刷新、上拉加载、二级刷新、淘宝二楼、RefreshLayout、OverScroll,Android智能下拉刷新框架,支持越界回弹、越界拖动,具有极强的扩展性,集成了几十种炫酷的Header和 Footer。
https://segmentfault.com/a/1190000010066071
Apache License 2.0
24.92k stars 4.95k forks source link

在DialogFragment中使用时出现java.lang.IllegalArgumentException: Illegal pattern character 't' #1173

Closed hyhyhykw closed 4 years ago

hyhyhykw commented 4 years ago

详细描述 使用ClassicsHeader 必出现 定位源代码位置是ClassicsHeader 205行 DateFormat初始化的地方 mLastUpdateFormat = new SimpleDateFormat(mTextUpdate, Locale.getDefault());

使用版本

implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.2' 
implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.2' 
hyhyhykw commented 4 years ago

sorry,好像是我这里修改出错了,忘记加单引号了

bxxasn commented 4 years ago
api  'com.scwang.smart:refresh-layout-kernel:2.0.1'      //核心必须依赖
api  'com.scwang.smart:refresh-header-classics:2.0.1'    //经典刷新头
api  'com.scwang.smart:refresh-footer-classics:2.0.1'    //经典加载

也出现这个错误.Classicsheader.java中的214行.

bxxasn commented 4 years ago

mLastUpdateFormat = new SimpleDateFormat(mTextUpdate, Locale.getDefault());

mTextUpdate的结果: Last updated M-d HH:mm Locale.getDefault()的结果: en_US

MoonSawyer commented 2 years ago

implementation 'io.github.scwang90:refresh-header-classics:2.0.5'

我也碰见这个问题,自查发现,修改ClassicsHeader.REFRESH_HEADER_UPDATE的参数,正常在中文里没事,但是在英文里就会报错,感觉像是小写被改成大写,然后SimpleDateFormat转换报错了。作者改下textAllCaps试试呢?