This repository was archived by the owner on Jul 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +25
-2
lines changed Expand file tree Collapse file tree 6 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 9
9
import android .graphics .drawable .GradientDrawable ;
10
10
import android .net .Uri ;
11
11
import android .support .annotation .ColorInt ;
12
- import android .support .annotation .Keep ;
13
12
import android .support .v4 .content .ContextCompat ;
14
13
import android .support .v4 .view .ViewCompat ;
15
14
import android .support .v7 .app .AppCompatDelegate ;
@@ -413,6 +412,14 @@ public void onClick(View view) {
413
412
messageHolder .messageTile .setBackgroundColor (privateMessageBackground );
414
413
}
415
414
415
+ // set visibility of edited tag
416
+ Boolean isEdited = message .isHasBeenEdited ();
417
+ if (isEdited != null && isEdited ) {
418
+ messageHolder .edited .setVisibility (View .VISIBLE );
419
+ } else {
420
+ messageHolder .edited .setVisibility (View .GONE );
421
+ }
422
+
416
423
setUpGravatar (message , messageHolder );
417
424
setUpTime (message , messageHolder );
418
425
break ;
Original file line number Diff line number Diff line change @@ -689,10 +689,13 @@ public void updateFromHistory(@NonNull MessageHistory history) {
689
689
editDate = history .date ;
690
690
}
691
691
692
- public boolean isHasBeenEdited () {
692
+ public Boolean isHasBeenEdited () {
693
693
return hasBeenEdited ;
694
694
}
695
695
696
+ public void setHasBeenEdited (boolean isEdited ) {
697
+ this .hasBeenEdited = isEdited ;
698
+ }
696
699
697
700
//endregion
698
701
Original file line number Diff line number Diff line change @@ -490,6 +490,7 @@ private void processUpdateMessages(List<EventsBranch> updateEvents) {
490
490
Message message = updateEvent .getMessage ();
491
491
if (message != null ) {
492
492
message .setFormattedContent (updateEvent .getFormattedContent ());
493
+ message .setHasBeenEdited (true );
493
494
494
495
// update the message in database
495
496
Dao <Message , Integer > messageDao = app .getDao (Message .class );
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ public class MessageHolder extends RecyclerView.ViewHolder implements View.OnCli
21
21
public ImageView gravatar ;
22
22
public TextView senderName ;
23
23
public TextView timestamp ;
24
+ public TextView edited ;
24
25
public TextView contentView ;
25
26
public View leftBar ;
26
27
public RelativeLayout messageTile ;
@@ -33,6 +34,7 @@ public MessageHolder(final View itemView) {
33
34
gravatar = (ImageView ) itemView .findViewById (R .id .gravatar );
34
35
senderName = (TextView ) itemView .findViewById (R .id .senderName );
35
36
timestamp = (TextView ) itemView .findViewById (R .id .timestamp );
37
+ edited = (TextView ) itemView .findViewById (R .id .message_edit_tag );
36
38
contentView = (TextView ) itemView .findViewById (R .id .contentView );
37
39
contentView .setMovementMethod (LinkMovementMethod .getInstance ());
38
40
leftBar = itemView .findViewById (R .id .leftBar );
Original file line number Diff line number Diff line change 38
38
android : textStyle =" bold"
39
39
tools : text =
" Sender < [email protected] > " />
40
40
41
+ <TextView
42
+ android : id =" @+id/message_edit_tag"
43
+ android : layout_width =" wrap_content"
44
+ android : layout_height =" wrap_content"
45
+ android : paddingRight =" 4dp"
46
+ android : text =" @string/message_edited_tag"
47
+ android : textColor =" @color/colorTextTertiary"
48
+ android : textSize =" 12sp"
49
+ android : visibility =" gone" />
41
50
<TextView
42
51
android : id =" @+id/timestamp"
43
52
android : layout_width =" wrap_content"
Original file line number Diff line number Diff line change 138
138
<string name =" maximum_time_limit_error" >Time limit exceeded</string >
139
139
<string name =" editing_message_disabled" >Editing message is disabled</string >
140
140
<string name =" default_delete_text" >(deleted)</string >
141
+ <string name =" message_edited_tag" >(EDITED)</string >
141
142
</resources >
You can’t perform that action at this time.
0 commit comments