From 341605001dfd12e0f8719c0b2c2610558ed6ca4a Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 5 Apr 2020 18:03:24 -0700 Subject: [PATCH] force display order on ConnTypes --- .../eehouse/android/xw4/ConnStatusHandler.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/ConnStatusHandler.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/ConnStatusHandler.java index 801cb9346..09d4b3b7a 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/ConnStatusHandler.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/ConnStatusHandler.java @@ -165,6 +165,17 @@ public class ConnStatusHandler { return s_downOnMe && s_rect.contains( xx, yy ); } + + private static final CommsConnType[] sDisplayOrder = { + CommsConnType.COMMS_CONN_RELAY, + CommsConnType.COMMS_CONN_BT, + CommsConnType.COMMS_CONN_IR, + CommsConnType.COMMS_CONN_IP_DIRECT, + CommsConnType.COMMS_CONN_SMS, + CommsConnType.COMMS_CONN_P2P, + CommsConnType.COMMS_CONN_NFC, + }; + public static String getStatusText( Context context, XwJNI.GamePtr gamePtr, CommsConnTypeSet connTypes, CommsAddrRec addr ) @@ -179,7 +190,10 @@ public class ConnStatusHandler { sb.append( LocUtils.getString( context, R.string.connstat_net_fmt, connTypes.toString( context, true ))); - for ( CommsConnType typ : connTypes.getTypes() ) { + for ( CommsConnType typ : sDisplayOrder ) { + if ( !connTypes.contains(typ) ) { + continue; + } SuccessRecord record = recordFor( context, typ, false ); // Don't show e.g. NFC unless it's been used