diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/ChatDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/ChatDelegate.java index 54eb045a1..1219b8d57 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/ChatDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/ChatDelegate.java @@ -38,7 +38,7 @@ import android.widget.TableRow; import android.widget.TextView; import java.text.DateFormat; -import java.util.Date; +import android.text.format.DateUtils; import junit.framework.Assert; @@ -176,10 +176,12 @@ public class ChatDelegate extends DelegateBase { m_names[playerIndx] ) ); if ( tsSeconds > 0 ) { - view = (TextView)row.findViewById( R.id.chat_row_time ); - DateFormat df = DateFormat.getDateTimeInstance( DateFormat.SHORT, - DateFormat.SHORT ); - view.setText( df.format( new Date( 1000L * tsSeconds ) ) ); + long now = 1000L * Utils.getCurSeconds(); + String str = DateUtils + .formatSameDayTime( 1000L * tsSeconds, now, DateFormat.MEDIUM, + DateFormat.MEDIUM ) + .toString(); + ((TextView)row.findViewById( R.id.chat_row_time )).setText( str ); } m_layout.addView( row ); diff --git a/xwords4/android/app/src/main/res/layout/chat_row.xml b/xwords4/android/app/src/main/res/layout/chat_row.xml index 184175123..763e624f5 100644 --- a/xwords4/android/app/src/main/res/layout/chat_row.xml +++ b/xwords4/android/app/src/main/res/layout/chat_row.xml @@ -1,22 +1,21 @@ - - + +