pref: 优化 IP 属地显示
This commit is contained in:
parent
9af7abe934
commit
b94d638928
|
|
@ -200,13 +200,18 @@ class ThreadMainPostAdapter(
|
||||||
ImageUtil.LOAD_TYPE_AVATAR,
|
ImageUtil.LOAD_TYPE_AVATAR,
|
||||||
user.portrait
|
user.portrait
|
||||||
)
|
)
|
||||||
holder.setText(
|
var timeText =
|
||||||
R.id.thread_list_item_user_time,
|
|
||||||
context.getString(
|
context.getString(
|
||||||
R.string.tip_thread_item_thread,
|
R.string.tip_thread_item_thread,
|
||||||
DateTimeUtils.getRelativeTimeString(context, threadBean.createTime!!),
|
DateTimeUtils.getRelativeTimeString(context, threadBean.createTime!!)
|
||||||
user.ipAddress
|
|
||||||
)
|
)
|
||||||
|
if (user.ipAddress?.isNotEmpty() == true) {
|
||||||
|
timeText += " "
|
||||||
|
timeText += context.getString(R.string.text_ip_location, user.ipAddress)
|
||||||
|
}
|
||||||
|
holder.setText(
|
||||||
|
R.id.thread_list_item_user_time,
|
||||||
|
timeText
|
||||||
)
|
)
|
||||||
holder.setText(R.id.thread_list_item_content_title, title)
|
holder.setText(R.id.thread_list_item_content_title, title)
|
||||||
if (threadPostBean != null) {
|
if (threadPostBean != null) {
|
||||||
|
|
|
||||||
|
|
@ -610,14 +610,18 @@ class ThreadReplyAdapter(context: Context) :
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
initContentView(viewHolder, item)
|
initContentView(viewHolder, item)
|
||||||
|
var timeText = context.getString(
|
||||||
|
R.string.tip_thread_item,
|
||||||
|
item.floor,
|
||||||
|
getRelativeTimeString(context, item.time!!)
|
||||||
|
)
|
||||||
|
if (userInfoBean?.ipAddress?.isNotEmpty() == true) {
|
||||||
|
timeText += " "
|
||||||
|
timeText += context.getString(R.string.text_ip_location, userInfoBean.ipAddress)
|
||||||
|
}
|
||||||
viewHolder.setText(
|
viewHolder.setText(
|
||||||
R.id.thread_list_item_user_time,
|
R.id.thread_list_item_user_time,
|
||||||
context.getString(
|
timeText
|
||||||
R.string.tip_thread_item,
|
|
||||||
item.floor,
|
|
||||||
getRelativeTimeString(context, item.time!!),
|
|
||||||
userInfoBean?.ipAddress
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
initFloorView(viewHolder, item)
|
initFloorView(viewHolder, item)
|
||||||
if (isPureRead) {
|
if (isPureRead) {
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,8 @@
|
||||||
<string name="menu_save_photo">保存图片</string>
|
<string name="menu_save_photo">保存图片</string>
|
||||||
<string name="toast_play_failed">播放失败</string>
|
<string name="toast_play_failed">播放失败</string>
|
||||||
<string name="toast_cannot_view">抱歉,当前暂时无法浏览本吧</string>
|
<string name="toast_cannot_view">抱歉,当前暂时无法浏览本吧</string>
|
||||||
<string name="tip_thread_item">第 %1$s 楼 %2$s 来自%3$s</string>
|
<string name="tip_thread_item">第 %1$s 楼 %2$s</string>
|
||||||
|
<string name="text_ip_location">来自%1$s</string>
|
||||||
<string name="tip_floor_more_count">查看更多回复(%1$s)</string>
|
<string name="tip_floor_more_count">查看更多回复(%1$s)</string>
|
||||||
<string name="update_tip_title">发现新版本 %1$s(%2$s)</string>
|
<string name="update_tip_title">发现新版本 %1$s(%2$s)</string>
|
||||||
<string name="update_tip_header">更新 · %1$s</string>
|
<string name="update_tip_header">更新 · %1$s</string>
|
||||||
|
|
@ -409,7 +410,7 @@
|
||||||
<string name="text_badge_history_forum">贴吧</string>
|
<string name="text_badge_history_forum">贴吧</string>
|
||||||
<string name="title_history_thread">贴子记录</string>
|
<string name="title_history_thread">贴子记录</string>
|
||||||
<string name="title_history_forum">经过贴吧</string>
|
<string name="title_history_forum">经过贴吧</string>
|
||||||
<string name="tip_thread_item_thread">%1$s 来自%2$s</string>
|
<string name="tip_thread_item_thread">%1$s</string>
|
||||||
<string name="title_all_reply">全部</string>
|
<string name="title_all_reply">全部</string>
|
||||||
<string name="title_thread_header">回复 %1$s</string>
|
<string name="title_thread_header">回复 %1$s</string>
|
||||||
<string name="btn_agree_post">%1$s 赞</string>
|
<string name="btn_agree_post">%1$s 赞</string>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue