Integrate DynamicLanguage with DeviceListFragment

Fixes #4752
Closes #4793
This commit is contained in:
Geonu Kang
2015-12-02 16:35:07 +09:00
committed by Moxie Marlinspike
parent 03faff443c
commit 43aef3ecb0
3 changed files with 21 additions and 10 deletions

View File

@@ -34,18 +34,18 @@ public class DeviceListItem extends LinearLayout {
this.lastActive = (TextView) findViewById(R.id.active);
}
public void set(DeviceInfo deviceInfo) {
public void set(DeviceInfo deviceInfo, Locale locale) {
if (TextUtils.isEmpty(deviceInfo.getName())) this.name.setText(R.string.DeviceListItem_unnamed_device);
else this.name.setText(deviceInfo.getName());
this.created.setText(getContext().getString(R.string.DeviceListItem_linked_s,
DateUtils.getDayPrecisionTimeSpanString(getContext(),
Locale.getDefault(),
locale,
deviceInfo.getCreated())));
this.lastActive.setText(getContext().getString(R.string.DeviceListItem_last_active_s,
DateUtils.getDayPrecisionTimeSpanString(getContext(),
Locale.getDefault(),
locale,
deviceInfo.getLastSeen())));
this.deviceId = deviceInfo.getId();