mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-30 08:11:17 +00:00
Display partial ID if device name is empty (fixes #419).
This commit is contained in:
parent
13870c0424
commit
41943502d4
1 changed files with 5 additions and 1 deletions
|
@ -2,6 +2,7 @@ package com.nutomic.syncthingandroid.util;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -53,7 +54,10 @@ public class DevicesAdapter extends ArrayAdapter<RestApi.Device>
|
|||
String deviceId = getItem(position).deviceID;
|
||||
RestApi.Connection conn = mConnections.get(deviceId);
|
||||
|
||||
name.setText(getItem(position).name);
|
||||
String displayName = (TextUtils.isEmpty(getItem(position).name))
|
||||
? deviceId.substring(0, 7)
|
||||
: getItem(position).name;
|
||||
name.setText(displayName);
|
||||
Resources r = getContext().getResources();
|
||||
if (conn != null && conn.connected) {
|
||||
if (conn.completion == 100) {
|
||||
|
|
Loading…
Reference in a new issue