kopia lustrzana https://github.com/ryukoposting/Signal-Android
Display reply icon if you responded 1:1 to the displayed story.
rodzic
bcd16ce296
commit
46bb64ad24
|
@ -743,8 +743,8 @@ public class MmsDatabase extends MessageDatabase {
|
|||
public boolean hasSelfReplyInStory(long parentStoryId) {
|
||||
SQLiteDatabase db = databaseHelper.getSignalReadableDatabase();
|
||||
String[] columns = new String[]{"COUNT(*)"};
|
||||
String where = PARENT_STORY_ID + " = ? AND " + RECIPIENT_ID + " = ?";
|
||||
String[] whereArgs = SqlUtil.buildArgs(parentStoryId, Recipient.self().getId());
|
||||
String where = PARENT_STORY_ID + " = ? AND (" + getOutgoingTypeClause() + ")";
|
||||
String[] whereArgs = SqlUtil.buildArgs(-parentStoryId);
|
||||
|
||||
try (Cursor cursor = db.query(TABLE_NAME, columns, where, whereArgs, null, null, null, null)) {
|
||||
return cursor != null && cursor.moveToNext() && cursor.getInt(0) > 0;
|
||||
|
|
|
@ -188,6 +188,12 @@ object StoriesLandingItem {
|
|||
}
|
||||
|
||||
icon.visible = model.data.hasReplies || model.data.hasRepliesFromSelf
|
||||
icon.setImageResource(
|
||||
when {
|
||||
model.data.hasReplies -> R.drawable.ic_messages_solid_20
|
||||
else -> R.drawable.ic_reply_24_solid_tinted
|
||||
}
|
||||
)
|
||||
|
||||
listOf(avatarView, storyPreview, storyMulti, sender, date, icon).forEach {
|
||||
it.alpha = if (model.data.isHidden) 0.5f else 1f
|
||||
|
|
|
@ -75,6 +75,7 @@
|
|||
android:layout_height="20dp"
|
||||
android:layout_marginStart="@dimen/stories_landing_item_text_horizontal_margin"
|
||||
android:importantForAccessibility="no"
|
||||
android:scaleType="centerInside"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/avatar"
|
||||
app:layout_constraintTop_toBottomOf="@id/date"
|
||||
|
|
Ładowanie…
Reference in New Issue