Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Silence-Android
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
268
Issues
268
List
Boards
Labels
Service Desk
Milestones
Merge Requests
11
Merge Requests
11
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Silence
Silence-Android
Commits
c1240b93
Commit
c1240b93
authored
Apr 26, 2020
by
Bastien Le Querrec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fully backport 183f8742a7d034c951eca20e854b49cee5541d31
parent
28736ce5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
src/org/smssecure/smssecure/ConversationAdapter.java
src/org/smssecure/smssecure/ConversationAdapter.java
+18
-5
src/org/smssecure/smssecure/ConversationItem.java
src/org/smssecure/smssecure/ConversationItem.java
+2
-2
No files found.
src/org/smssecure/smssecure/ConversationAdapter.java
View file @
c1240b93
...
...
@@ -80,11 +80,13 @@ public class ConversationAdapter <V extends View & BindableConversationItem>
private
final
Map
<
String
,
SoftReference
<
MessageRecord
>>
messageRecordCache
=
Collections
.
synchronizedMap
(
new
LRUCache
<
String
,
SoftReference
<
MessageRecord
>>(
MAX_CACHE_SIZE
));
private
static
final
int
MESSAGE_TYPE_OUTGOING
=
0
;
private
static
final
int
MESSAGE_TYPE_INCOMING
=
1
;
private
static
final
int
MESSAGE_TYPE_UPDATE
=
2
;
private
static
final
int
MESSAGE_TYPE_AUDIO_OUTGOING
=
3
;
private
static
final
int
MESSAGE_TYPE_AUDIO_INCOMING
=
4
;
private
static
final
int
MESSAGE_TYPE_OUTGOING
=
0
;
private
static
final
int
MESSAGE_TYPE_INCOMING
=
1
;
private
static
final
int
MESSAGE_TYPE_UPDATE
=
2
;
private
static
final
int
MESSAGE_TYPE_AUDIO_OUTGOING
=
3
;
private
static
final
int
MESSAGE_TYPE_AUDIO_INCOMING
=
4
;
private
static
final
int
MESSAGE_TYPE_THUMBNAIL_OUTGOING
=
5
;
private
static
final
int
MESSAGE_TYPE_THUMBNAIL_INCOMING
=
6
;
private
final
Set
<
MessageRecord
>
batchSelected
=
Collections
.
synchronizedSet
(
new
HashSet
<
MessageRecord
>());
...
...
@@ -219,8 +221,10 @@ public class ConversationAdapter <V extends View & BindableConversationItem>
private
@LayoutRes
int
getLayoutForViewType
(
int
viewType
)
{
switch
(
viewType
)
{
case
MESSAGE_TYPE_AUDIO_OUTGOING:
case
MESSAGE_TYPE_THUMBNAIL_OUTGOING:
case
MESSAGE_TYPE_OUTGOING:
return
R
.
layout
.
conversation_item_sent
;
case
MESSAGE_TYPE_AUDIO_INCOMING:
case
MESSAGE_TYPE_THUMBNAIL_INCOMING:
case
MESSAGE_TYPE_INCOMING:
return
R
.
layout
.
conversation_item_received
;
case
MESSAGE_TYPE_UPDATE:
return
R
.
layout
.
conversation_item_update
;
default
:
throw
new
IllegalArgumentException
(
"unsupported item view type given to ConversationAdapter"
);
...
...
@@ -236,6 +240,9 @@ public class ConversationAdapter <V extends View & BindableConversationItem>
}
else
if
(
hasAudio
(
messageRecord
))
{
if
(
messageRecord
.
isOutgoing
())
return
MESSAGE_TYPE_AUDIO_OUTGOING
;
else
return
MESSAGE_TYPE_AUDIO_INCOMING
;
}
else
if
(
hasThumbnail
(
messageRecord
))
{
if
(
messageRecord
.
isOutgoing
())
return
MESSAGE_TYPE_THUMBNAIL_OUTGOING
;
else
return
MESSAGE_TYPE_THUMBNAIL_INCOMING
;
}
else
if
(
messageRecord
.
isOutgoing
())
{
return
MESSAGE_TYPE_OUTGOING
;
}
else
{
...
...
@@ -404,4 +411,10 @@ public class ConversationAdapter <V extends View & BindableConversationItem>
}
}
private
boolean
hasThumbnail
(
MessageRecord
messageRecord
)
{
return
messageRecord
.
isMms
()
&&
!
messageRecord
.
isMmsNotification
()
&&
((
MmsMessageRecord
)
messageRecord
).
getSlideDeck
().
getThumbnailSlide
()
!=
null
;
}
}
src/org/smssecure/smssecure/ConversationItem.java
View file @
c1240b93
...
...
@@ -202,15 +202,15 @@ public class ConversationItem extends LinearLayout
this
.
recipient
.
addListener
(
this
);
this
.
conversationRecipients
.
addListener
(
this
);
setInteractionState
(
messageRecord
);
setBodyText
(
messageRecord
);
setMediaAttributes
(
messageRecord
);
setInteractionState
(
messageRecord
);
setBubbleState
(
messageRecord
,
recipient
);
setStatusIcons
(
messageRecord
);
setContactPhoto
(
recipient
);
setGroupMessageStatus
(
messageRecord
,
recipient
);
checkForAutoInitiate
(
messageRecord
);
setMinimumWidth
();
setMediaAttributes
(
messageRecord
);
setSimInfo
(
messageRecord
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment